@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.
- package/LICENSE +21 -0
- package/README.md +330 -0
- package/dist/credentials/EvolutionApi.credentials.d.ts +10 -0
- package/dist/credentials/EvolutionApi.credentials.js +84 -0
- package/dist/credentials/EvolutionApi.credentials.js.map +1 -0
- package/dist/nodes/EvolutionApi/EvolutionApi.node.d.ts +19 -0
- package/dist/nodes/EvolutionApi/EvolutionApi.node.js +180 -0
- package/dist/nodes/EvolutionApi/EvolutionApi.node.js.map +1 -0
- package/dist/nodes/EvolutionApi/EvolutionApi.node.json +22 -0
- package/dist/nodes/EvolutionApi/EvolutionApiTrigger.node.d.ts +18 -0
- package/dist/nodes/EvolutionApi/EvolutionApiTrigger.node.js +615 -0
- package/dist/nodes/EvolutionApi/EvolutionApiTrigger.node.js.map +1 -0
- package/dist/nodes/EvolutionApi/EvolutionApiTrigger.node.json +19 -0
- package/dist/nodes/EvolutionApi/GenericFunctions.d.ts +114 -0
- package/dist/nodes/EvolutionApi/GenericFunctions.js +681 -0
- package/dist/nodes/EvolutionApi/GenericFunctions.js.map +1 -0
- package/dist/nodes/EvolutionApi/constants.d.ts +7 -0
- package/dist/nodes/EvolutionApi/constants.js +77 -0
- package/dist/nodes/EvolutionApi/constants.js.map +1 -0
- package/dist/nodes/EvolutionApi/evolution.svg +11 -0
- package/dist/nodes/EvolutionApi/resources/call/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/call/index.js +62 -0
- package/dist/nodes/EvolutionApi/resources/call/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/call/offer.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/call/offer.operation.js +56 -0
- package/dist/nodes/EvolutionApi/resources/call/offer.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/archive.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/archive.operation.js +44 -0
- package/dist/nodes/EvolutionApi/resources/chat/archive.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/checkNumbers.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/checkNumbers.operation.js +28 -0
- package/dist/nodes/EvolutionApi/resources/chat/checkNumbers.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/deleteMessage.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/deleteMessage.operation.js +68 -0
- package/dist/nodes/EvolutionApi/resources/chat/deleteMessage.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/downloadMedia.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/chat/downloadMedia.operation.js +143 -0
- package/dist/nodes/EvolutionApi/resources/chat/downloadMedia.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/editMessage.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/editMessage.operation.js +49 -0
- package/dist/nodes/EvolutionApi/resources/chat/editMessage.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/get.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/get.operation.js +28 -0
- package/dist/nodes/EvolutionApi/resources/chat/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/getChannels.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/getChannels.operation.js +23 -0
- package/dist/nodes/EvolutionApi/resources/chat/getChannels.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/getContacts.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/getContacts.operation.js +55 -0
- package/dist/nodes/EvolutionApi/resources/chat/getContacts.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/getMany.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/chat/getMany.operation.js +74 -0
- package/dist/nodes/EvolutionApi/resources/chat/getMany.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/getMessages.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/getMessages.operation.js +124 -0
- package/dist/nodes/EvolutionApi/resources/chat/getMessages.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/getPollVotes.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/getPollVotes.operation.js +36 -0
- package/dist/nodes/EvolutionApi/resources/chat/getPollVotes.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/getStatusUpdates.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/getStatusUpdates.operation.js +57 -0
- package/dist/nodes/EvolutionApi/resources/chat/getStatusUpdates.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/helpers.d.ts +25 -0
- package/dist/nodes/EvolutionApi/resources/chat/helpers.js +219 -0
- package/dist/nodes/EvolutionApi/resources/chat/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/chat/index.js +209 -0
- package/dist/nodes/EvolutionApi/resources/chat/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/markAsPlayed.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/markAsPlayed.operation.js +49 -0
- package/dist/nodes/EvolutionApi/resources/chat/markAsPlayed.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/markAsRead.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/markAsRead.operation.js +48 -0
- package/dist/nodes/EvolutionApi/resources/chat/markAsRead.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/markUnread.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/markUnread.operation.js +35 -0
- package/dist/nodes/EvolutionApi/resources/chat/markUnread.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/sendPresence.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/sendPresence.operation.js +53 -0
- package/dist/nodes/EvolutionApi/resources/chat/sendPresence.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/updateBlockStatus.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/updateBlockStatus.operation.js +44 -0
- package/dist/nodes/EvolutionApi/resources/chat/updateBlockStatus.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/changeStatus.operation.d.ts +31 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/changeStatus.operation.js +73 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/changeStatus.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/create.operation.d.ts +38 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/create.operation.js +251 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/create.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/createCredential.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/createCredential.operation.js +44 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/createCredential.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/delete.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/delete.operation.js +19 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/delete.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/deleteCredential.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/deleteCredential.operation.js +30 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/deleteCredential.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/fields.d.ts +10 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/fields.js +229 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/get.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/get.operation.js +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getCredentials.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getCredentials.operation.js +17 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getCredentials.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getMany.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getMany.operation.js +18 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getMany.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getModels.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getModels.operation.js +39 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getModels.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getSessions.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getSessions.operation.js +69 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getSessions.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getSettings.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getSettings.operation.js +17 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getSettings.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/helpers.d.ts +24 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/helpers.js +273 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/ignoreJid.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/ignoreJid.operation.js +35 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/ignoreJid.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/index.d.ts +6 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/index.js +210 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/methods.d.ts +2 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/methods.js +58 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/methods.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/setSettings.operation.d.ts +33 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/setSettings.operation.js +133 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/setSettings.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/start.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/start.operation.js +112 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/start.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/update.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/update.operation.js +191 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/update.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/get.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/get.operation.js +25 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/helpers.d.ts +4 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/helpers.js +26 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/index.js +70 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/set.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/set.operation.js +252 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/set.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/acceptInvite.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/acceptInvite.operation.js +25 -0
- package/dist/nodes/EvolutionApi/resources/group/acceptInvite.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/create.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/create.operation.js +68 -0
- package/dist/nodes/EvolutionApi/resources/group/create.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/get.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/get.operation.js +15 -0
- package/dist/nodes/EvolutionApi/resources/group/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/getInviteCode.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/getInviteCode.operation.js +15 -0
- package/dist/nodes/EvolutionApi/resources/group/getInviteCode.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/getInviteInfo.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/getInviteInfo.operation.js +25 -0
- package/dist/nodes/EvolutionApi/resources/group/getInviteInfo.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/getMany.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/getMany.operation.js +72 -0
- package/dist/nodes/EvolutionApi/resources/group/getMany.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/getParticipants.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/getParticipants.operation.js +21 -0
- package/dist/nodes/EvolutionApi/resources/group/getParticipants.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/helpers.d.ts +8 -0
- package/dist/nodes/EvolutionApi/resources/group/helpers.js +139 -0
- package/dist/nodes/EvolutionApi/resources/group/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/index.d.ts +7 -0
- package/dist/nodes/EvolutionApi/resources/group/index.js +216 -0
- package/dist/nodes/EvolutionApi/resources/group/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/leave.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/leave.operation.js +15 -0
- package/dist/nodes/EvolutionApi/resources/group/leave.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/revokeInviteCode.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/revokeInviteCode.operation.js +20 -0
- package/dist/nodes/EvolutionApi/resources/group/revokeInviteCode.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/sendInvite.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/sendInvite.operation.js +48 -0
- package/dist/nodes/EvolutionApi/resources/group/sendInvite.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/toggleEphemeral.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/toggleEphemeral.operation.js +43 -0
- package/dist/nodes/EvolutionApi/resources/group/toggleEphemeral.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/updateDescription.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/updateDescription.operation.js +34 -0
- package/dist/nodes/EvolutionApi/resources/group/updateDescription.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/updateMemberAddMode.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/updateMemberAddMode.operation.js +47 -0
- package/dist/nodes/EvolutionApi/resources/group/updateMemberAddMode.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/updateParticipants.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/updateParticipants.operation.js +67 -0
- package/dist/nodes/EvolutionApi/resources/group/updateParticipants.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/updatePicture.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/updatePicture.operation.js +99 -0
- package/dist/nodes/EvolutionApi/resources/group/updatePicture.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/updateSetting.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/updateSetting.operation.js +57 -0
- package/dist/nodes/EvolutionApi/resources/group/updateSetting.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/updateSubject.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/updateSubject.operation.js +31 -0
- package/dist/nodes/EvolutionApi/resources/group/updateSubject.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/index.d.ts +6 -0
- package/dist/nodes/EvolutionApi/resources/index.js +144 -0
- package/dist/nodes/EvolutionApi/resources/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/connect.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/instance/connect.operation.js +40 -0
- package/dist/nodes/EvolutionApi/resources/instance/connect.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/create.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/instance/create.operation.js +519 -0
- package/dist/nodes/EvolutionApi/resources/instance/create.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/delete.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/instance/delete.operation.js +11 -0
- package/dist/nodes/EvolutionApi/resources/instance/delete.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/getConnectionState.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/instance/getConnectionState.operation.js +11 -0
- package/dist/nodes/EvolutionApi/resources/instance/getConnectionState.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/getMany.operation.d.ts +31 -0
- package/dist/nodes/EvolutionApi/resources/instance/getMany.operation.js +149 -0
- package/dist/nodes/EvolutionApi/resources/instance/getMany.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/helpers.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/instance/helpers.js +60 -0
- package/dist/nodes/EvolutionApi/resources/instance/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/index.d.ts +6 -0
- package/dist/nodes/EvolutionApi/resources/instance/index.js +128 -0
- package/dist/nodes/EvolutionApi/resources/instance/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/logout.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/instance/logout.operation.js +11 -0
- package/dist/nodes/EvolutionApi/resources/instance/logout.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/restart.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/instance/restart.operation.js +13 -0
- package/dist/nodes/EvolutionApi/resources/instance/restart.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/setPresence.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/instance/setPresence.operation.js +24 -0
- package/dist/nodes/EvolutionApi/resources/instance/setPresence.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/label/addToChat.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/label/addToChat.operation.js +11 -0
- package/dist/nodes/EvolutionApi/resources/label/addToChat.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/label/getMany.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/label/getMany.operation.js +12 -0
- package/dist/nodes/EvolutionApi/resources/label/getMany.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/label/helpers.d.ts +4 -0
- package/dist/nodes/EvolutionApi/resources/label/helpers.js +69 -0
- package/dist/nodes/EvolutionApi/resources/label/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/label/index.d.ts +6 -0
- package/dist/nodes/EvolutionApi/resources/label/index.js +88 -0
- package/dist/nodes/EvolutionApi/resources/label/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/label/removeFromChat.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/label/removeFromChat.operation.js +11 -0
- package/dist/nodes/EvolutionApi/resources/label/removeFromChat.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/generateMessageId.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/generateMessageId.operation.js +21 -0
- package/dist/nodes/EvolutionApi/resources/message/generateMessageId.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/helpers.d.ts +39 -0
- package/dist/nodes/EvolutionApi/resources/message/helpers.js +566 -0
- package/dist/nodes/EvolutionApi/resources/message/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/index.d.ts +6 -0
- package/dist/nodes/EvolutionApi/resources/message/index.js +192 -0
- package/dist/nodes/EvolutionApi/resources/message/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendAudio.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendAudio.operation.js +36 -0
- package/dist/nodes/EvolutionApi/resources/message/sendAudio.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendButtons.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendButtons.operation.js +114 -0
- package/dist/nodes/EvolutionApi/resources/message/sendButtons.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendCarousel.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/message/sendCarousel.operation.js +162 -0
- package/dist/nodes/EvolutionApi/resources/message/sendCarousel.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendContact.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendContact.operation.js +105 -0
- package/dist/nodes/EvolutionApi/resources/message/sendContact.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendList.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/message/sendList.operation.js +197 -0
- package/dist/nodes/EvolutionApi/resources/message/sendList.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendLocation.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendLocation.operation.js +70 -0
- package/dist/nodes/EvolutionApi/resources/message/sendLocation.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendMedia.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendMedia.operation.js +142 -0
- package/dist/nodes/EvolutionApi/resources/message/sendMedia.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendPoll.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendPoll.operation.js +67 -0
- package/dist/nodes/EvolutionApi/resources/message/sendPoll.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendPtv.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendPtv.operation.js +22 -0
- package/dist/nodes/EvolutionApi/resources/message/sendPtv.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendReaction.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendReaction.operation.js +81 -0
- package/dist/nodes/EvolutionApi/resources/message/sendReaction.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendStatus.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendStatus.operation.js +147 -0
- package/dist/nodes/EvolutionApi/resources/message/sendStatus.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendSticker.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendSticker.operation.js +41 -0
- package/dist/nodes/EvolutionApi/resources/message/sendSticker.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendTemplate.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendTemplate.operation.js +92 -0
- package/dist/nodes/EvolutionApi/resources/message/sendTemplate.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendText.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendText.operation.js +38 -0
- package/dist/nodes/EvolutionApi/resources/message/sendText.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/get.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/profile/get.operation.js +27 -0
- package/dist/nodes/EvolutionApi/resources/profile/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/getBusinessProfile.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/profile/getBusinessProfile.operation.js +24 -0
- package/dist/nodes/EvolutionApi/resources/profile/getBusinessProfile.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/getPicture.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/profile/getPicture.operation.js +27 -0
- package/dist/nodes/EvolutionApi/resources/profile/getPicture.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/getPrivacySettings.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/profile/getPrivacySettings.operation.js +11 -0
- package/dist/nodes/EvolutionApi/resources/profile/getPrivacySettings.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/profile/index.js +136 -0
- package/dist/nodes/EvolutionApi/resources/profile/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/removePicture.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/profile/removePicture.operation.js +11 -0
- package/dist/nodes/EvolutionApi/resources/profile/removePicture.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/updateName.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/profile/updateName.operation.js +27 -0
- package/dist/nodes/EvolutionApi/resources/profile/updateName.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/updatePicture.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/profile/updatePicture.operation.js +86 -0
- package/dist/nodes/EvolutionApi/resources/profile/updatePicture.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/updatePrivacySettings.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/profile/updatePrivacySettings.operation.js +133 -0
- package/dist/nodes/EvolutionApi/resources/profile/updatePrivacySettings.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/updateStatus.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/profile/updateStatus.operation.js +28 -0
- package/dist/nodes/EvolutionApi/resources/profile/updateStatus.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/proxy/get.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/proxy/get.operation.js +25 -0
- package/dist/nodes/EvolutionApi/resources/proxy/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/proxy/helpers.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/proxy/helpers.js +28 -0
- package/dist/nodes/EvolutionApi/resources/proxy/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/proxy/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/proxy/index.js +70 -0
- package/dist/nodes/EvolutionApi/resources/proxy/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/proxy/set.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/proxy/set.operation.js +137 -0
- package/dist/nodes/EvolutionApi/resources/proxy/set.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/settings/get.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/settings/get.operation.js +25 -0
- package/dist/nodes/EvolutionApi/resources/settings/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/settings/helpers.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/settings/helpers.js +37 -0
- package/dist/nodes/EvolutionApi/resources/settings/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/settings/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/settings/index.js +70 -0
- package/dist/nodes/EvolutionApi/resources/settings/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/settings/set.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/settings/set.operation.js +128 -0
- package/dist/nodes/EvolutionApi/resources/settings/set.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/create.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/template/create.operation.js +97 -0
- package/dist/nodes/EvolutionApi/resources/template/create.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/delete.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/template/delete.operation.js +50 -0
- package/dist/nodes/EvolutionApi/resources/template/delete.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/getCatalog.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/template/getCatalog.operation.js +48 -0
- package/dist/nodes/EvolutionApi/resources/template/getCatalog.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/getCollections.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/template/getCollections.operation.js +41 -0
- package/dist/nodes/EvolutionApi/resources/template/getCollections.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/getMany.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/template/getMany.operation.js +109 -0
- package/dist/nodes/EvolutionApi/resources/template/getMany.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/helpers.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/template/helpers.js +32 -0
- package/dist/nodes/EvolutionApi/resources/template/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/template/index.js +109 -0
- package/dist/nodes/EvolutionApi/resources/template/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/update.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/template/update.operation.js +89 -0
- package/dist/nodes/EvolutionApi/resources/template/update.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/webhook/get.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/webhook/get.operation.js +25 -0
- package/dist/nodes/EvolutionApi/resources/webhook/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/webhook/getTransport.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/webhook/getTransport.operation.js +49 -0
- package/dist/nodes/EvolutionApi/resources/webhook/getTransport.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/webhook/helpers.d.ts +17 -0
- package/dist/nodes/EvolutionApi/resources/webhook/helpers.js +144 -0
- package/dist/nodes/EvolutionApi/resources/webhook/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/webhook/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/webhook/index.js +91 -0
- package/dist/nodes/EvolutionApi/resources/webhook/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/webhook/set.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/webhook/set.operation.js +174 -0
- package/dist/nodes/EvolutionApi/resources/webhook/set.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/webhook/setTransport.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/webhook/setTransport.operation.js +159 -0
- package/dist/nodes/EvolutionApi/resources/webhook/setTransport.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/trigger/auth.d.ts +26 -0
- package/dist/nodes/EvolutionApi/trigger/auth.js +96 -0
- package/dist/nodes/EvolutionApi/trigger/auth.js.map +1 -0
- package/dist/nodes/EvolutionApi/trigger/constants.d.ts +10 -0
- package/dist/nodes/EvolutionApi/trigger/constants.js +154 -0
- package/dist/nodes/EvolutionApi/trigger/constants.js.map +1 -0
- package/dist/nodes/EvolutionApi/trigger/dedupe.d.ts +5 -0
- package/dist/nodes/EvolutionApi/trigger/dedupe.js +87 -0
- package/dist/nodes/EvolutionApi/trigger/dedupe.js.map +1 -0
- package/dist/nodes/EvolutionApi/trigger/payload.d.ts +48 -0
- package/dist/nodes/EvolutionApi/trigger/payload.js +265 -0
- package/dist/nodes/EvolutionApi/trigger/payload.js.map +1 -0
- package/dist/nodes/EvolutionApi/trigger/registration.d.ts +36 -0
- package/dist/nodes/EvolutionApi/trigger/registration.js +156 -0
- package/dist/nodes/EvolutionApi/trigger/registration.js.map +1 -0
- package/dist/nodes/EvolutionApi/types.d.ts +44 -0
- package/dist/nodes/EvolutionApi/types.js +3 -0
- package/dist/nodes/EvolutionApi/types.js.map +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
8
|
+
const helpers_1 = require("./helpers");
|
|
9
|
+
const properties = [
|
|
10
|
+
helpers_1.numberProperty,
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Media Type',
|
|
13
|
+
name: 'mediatype',
|
|
14
|
+
type: 'options',
|
|
15
|
+
options: [
|
|
16
|
+
{
|
|
17
|
+
name: 'Audio File',
|
|
18
|
+
value: 'audio',
|
|
19
|
+
description: 'Regular audio file. Use "Send Audio" for a voice note.',
|
|
20
|
+
},
|
|
21
|
+
{ name: 'Document', value: 'document', description: 'Any file (PDF, spreadsheet, ZIP…)' },
|
|
22
|
+
{ name: 'Image', value: 'image', description: 'Converted to JPEG by Evolution' },
|
|
23
|
+
{ name: 'Video', value: 'video', description: 'MP4 video' },
|
|
24
|
+
],
|
|
25
|
+
default: 'image',
|
|
26
|
+
description: 'Kind of media to send',
|
|
27
|
+
},
|
|
28
|
+
...(0, helpers_1.mediaSourceProperties)('file'),
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Caption',
|
|
31
|
+
name: 'caption',
|
|
32
|
+
type: 'string',
|
|
33
|
+
default: '',
|
|
34
|
+
typeOptions: { rows: 2 },
|
|
35
|
+
description: 'Text shown under the media',
|
|
36
|
+
displayOptions: { show: { mediatype: ['image', 'video', 'document'] } },
|
|
37
|
+
},
|
|
38
|
+
(0, helpers_1.sendOptionsProperty)([
|
|
39
|
+
(0, helpers_1.delayOption)(),
|
|
40
|
+
{
|
|
41
|
+
displayName: 'File Name',
|
|
42
|
+
name: 'fileName',
|
|
43
|
+
type: 'string',
|
|
44
|
+
default: '',
|
|
45
|
+
placeholder: 'invoice.pdf',
|
|
46
|
+
description: 'File name shown to the recipient, including the extension (Evolution derives the MIME type from it). Defaults to the name of the binary file, or for documents to the last part of the URL; required for documents sent as base64 or from a URL without a file extension.',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
displayName: 'GIF Attribution',
|
|
50
|
+
name: 'gifAttribution',
|
|
51
|
+
type: 'options',
|
|
52
|
+
options: [
|
|
53
|
+
{ name: 'None', value: 0 },
|
|
54
|
+
{ name: 'GIPHY', value: 1 },
|
|
55
|
+
{ name: 'Tenor', value: 2 },
|
|
56
|
+
],
|
|
57
|
+
default: 0,
|
|
58
|
+
description: `Source badge shown on a GIF (video sent with GIF Playback). ${constants_1.REQUIRES_24}`,
|
|
59
|
+
displayOptions: { show: { '/mediatype': ['video'] } },
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
displayName: 'GIF Playback',
|
|
63
|
+
name: 'gifPlayback',
|
|
64
|
+
type: 'boolean',
|
|
65
|
+
default: false,
|
|
66
|
+
description: `Whether to play the video as a looping GIF without sound. ${constants_1.REQUIRES_24}`,
|
|
67
|
+
displayOptions: { show: { '/mediatype': ['video'] } },
|
|
68
|
+
},
|
|
69
|
+
...helpers_1.mentionOptions,
|
|
70
|
+
helpers_1.messageIdOption,
|
|
71
|
+
{
|
|
72
|
+
displayName: 'MIME Type',
|
|
73
|
+
name: 'mimetype',
|
|
74
|
+
type: 'string',
|
|
75
|
+
default: '',
|
|
76
|
+
placeholder: 'audio/mpeg',
|
|
77
|
+
description: 'MIME type of the file, e.g. application/pdf. Evolution derives the MIME type from the file name extension whenever there is a file name, so this value mainly adds a missing extension to the file name; it is sent as-is only when there is no file name.',
|
|
78
|
+
},
|
|
79
|
+
...(0, helpers_1.quotedOptions)(),
|
|
80
|
+
]),
|
|
81
|
+
];
|
|
82
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)({ show: { resource: ['message'], operation: ['sendMedia'] } }, properties);
|
|
83
|
+
const FALLBACK_EXTENSION = { image: '.jpg', video: '.mp4' };
|
|
84
|
+
async function execute(itemIndex) {
|
|
85
|
+
var _a, _b, _c;
|
|
86
|
+
const node = this.getNode();
|
|
87
|
+
const number = helpers_1.getRecipient.call(this, itemIndex);
|
|
88
|
+
const mediatype = helpers_1.getString.call(this, 'mediatype', itemIndex) || 'image';
|
|
89
|
+
const options = this.getNodeParameter('options', itemIndex, {});
|
|
90
|
+
const media = await helpers_1.resolveMediaInput.call(this, itemIndex, {
|
|
91
|
+
fileName: String((_a = options.fileName) !== null && _a !== void 0 ? _a : '').trim(),
|
|
92
|
+
mimeType: String((_b = options.mimetype) !== null && _b !== void 0 ? _b : '').trim(),
|
|
93
|
+
});
|
|
94
|
+
let fileName = (0, helpers_1.ensureFileExtension)((_c = media.fileName) !== null && _c !== void 0 ? _c : '', media.mimeType);
|
|
95
|
+
const urlFileName = media.type === 'url' ? (0, helpers_1.fileNameFromUrl)(media.value) : '';
|
|
96
|
+
if (fileName && !(0, helpers_1.hasFileExtension)(fileName) && urlFileName) {
|
|
97
|
+
fileName += urlFileName.substring(urlFileName.lastIndexOf('.'));
|
|
98
|
+
}
|
|
99
|
+
if (fileName && !(0, helpers_1.hasFileExtension)(fileName) && FALLBACK_EXTENSION[mediatype]) {
|
|
100
|
+
fileName += FALLBACK_EXTENSION[mediatype];
|
|
101
|
+
}
|
|
102
|
+
if (mediatype === 'document' && !fileName) {
|
|
103
|
+
if (media.type === 'url') {
|
|
104
|
+
fileName = urlFileName || (0, helpers_1.ensureFileExtension)('document', media.mimeType);
|
|
105
|
+
if (!(0, helpers_1.hasFileExtension)(fileName)) {
|
|
106
|
+
throw (0, helpers_1.operationError)(node, itemIndex, 'A file name is required to send a document from a URL without a file extension', 'Set Options > File Name, including the extension (e.g. invoice.pdf).');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
throw (0, helpers_1.operationError)(node, itemIndex, 'A file name is required to send a document from base64 or binary data', 'Set Options > File Name, including the extension (e.g. invoice.pdf).');
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const fields = (0, GenericFunctions_1.compactObject)({
|
|
114
|
+
number,
|
|
115
|
+
mediatype,
|
|
116
|
+
caption: mediatype === 'audio' ? '' : helpers_1.getString.call(this, 'caption', itemIndex),
|
|
117
|
+
fileName,
|
|
118
|
+
mimetype: media.mimeType,
|
|
119
|
+
});
|
|
120
|
+
if (mediatype === 'video') {
|
|
121
|
+
if (options.gifPlayback !== undefined)
|
|
122
|
+
fields.gifPlayback = options.gifPlayback === true;
|
|
123
|
+
const gifAttribution = Number(options.gifAttribution);
|
|
124
|
+
if (options.gifAttribution !== undefined &&
|
|
125
|
+
options.gifAttribution !== '' &&
|
|
126
|
+
[0, 1, 2].includes(gifAttribution)) {
|
|
127
|
+
fields.gifAttribution = gifAttribution;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
(0, helpers_1.applySendOptions)(node, itemIndex, options, fields);
|
|
131
|
+
const multipartFields = { ...fields };
|
|
132
|
+
if (fields.gifPlayback !== undefined)
|
|
133
|
+
multipartFields.gifPlayback = String(fields.gifPlayback);
|
|
134
|
+
if (fields.gifAttribution !== undefined) {
|
|
135
|
+
multipartFields.gifAttribution = String(fields.gifAttribution);
|
|
136
|
+
}
|
|
137
|
+
const body = media.type === 'binary' && (0, GenericFunctions_1.isMultipartSafe)(multipartFields)
|
|
138
|
+
? (0, GenericFunctions_1.buildMediaRequestBody)(media, multipartFields, { mediaField: 'media', allowMultipart: true })
|
|
139
|
+
: (0, GenericFunctions_1.buildMediaRequestBody)(media, fields, { mediaField: 'media' });
|
|
140
|
+
return await helpers_1.postMessage.call(this, itemIndex, 'sendMedia', body);
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=sendMedia.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendMedia.operation.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/resources/message/sendMedia.operation.ts"],"names":[],"mappings":";;;AAqHA,0BA6EC;AAjMD,+CAAoD;AAEpD,+CAA8C;AAC9C,6DAA+F;AAC/F,uCAiBmB;AAEnB,MAAM,UAAU,GAAsB;IACpC,wBAAc;IACd;QACE,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,wDAAwD;aACtE;YACD,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,mCAAmC,EAAE;YACzF,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,gCAAgC,EAAE;YAChF,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE;SAC5D;QACD,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,uBAAuB;KACrC;IACD,GAAG,IAAA,+BAAqB,EAAC,MAAM,CAAC;IAChC;QACE,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;QACxB,WAAW,EAAE,4BAA4B;QACzC,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,EAAE;KACxE;IACD,IAAA,6BAAmB,EAAC;QAClB,I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OAAO,CAAC,cAAc,KAAK,EAAE;YAC7B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,EAClC,CAAC;YACD,MAAM,CAAC,cAAc,GAAG,cAAc,CAAC;QACzC,CAAC;IACH,CAAC;IACD,IAAA,0BAAgB,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAGnD,MAAM,eAAe,GAAgB,EAAE,GAAG,MAAM,EAAE,CAAC;IACnD,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS;QAAE,eAAe,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC/F,IAAI,MAAM,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;QACxC,eAAe,CAAC,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACjE,CAAC;IACD,MAAM,IAAI,GACR,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAA,kCAAe,EAAC,eAAe,CAAC;QACzD,CAAC,CAAC,IAAA,wCAAqB,EAAC,KAAK,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;QAC9F,CAAC,CAAC,IAAA,wCAAqB,EAAC,KAAK,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;IACpE,OAAO,MAAM,qBAAW,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
builderHint?: import("n8n-workflow").IParameterBuilderHint;
|
|
12
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
13
|
+
options?: Array<import("n8n-workflow").INodePropertyOptions | INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
isNodeSetting?: boolean;
|
|
16
|
+
noDataExpression?: boolean;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
19
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
20
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
21
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
22
|
+
requiresDataPath?: "single" | "multiple";
|
|
23
|
+
doNotInherit?: boolean;
|
|
24
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
25
|
+
ignoreValidationDuringExecution?: boolean;
|
|
26
|
+
allowArbitraryValues?: boolean;
|
|
27
|
+
resolvableField?: boolean;
|
|
28
|
+
}[];
|
|
29
|
+
export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<IDataObject>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const helpers_1 = require("./helpers");
|
|
7
|
+
const properties = [
|
|
8
|
+
helpers_1.numberProperty,
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Question',
|
|
11
|
+
name: 'pollQuestion',
|
|
12
|
+
type: 'string',
|
|
13
|
+
required: true,
|
|
14
|
+
default: '',
|
|
15
|
+
placeholder: 'Which day works best?',
|
|
16
|
+
description: 'Title of the poll',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
displayName: 'Poll Options',
|
|
20
|
+
name: 'pollOptions',
|
|
21
|
+
type: 'string',
|
|
22
|
+
required: true,
|
|
23
|
+
default: '',
|
|
24
|
+
typeOptions: { rows: 4 },
|
|
25
|
+
placeholder: 'Monday\nTuesday\nWednesday',
|
|
26
|
+
description: 'Answers to choose from, one per line (2 to 10, all different)',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
displayName: 'Selectable Count',
|
|
30
|
+
name: 'selectableCount',
|
|
31
|
+
type: 'number',
|
|
32
|
+
default: 1,
|
|
33
|
+
typeOptions: { minValue: 0, maxValue: 10 },
|
|
34
|
+
description: 'How many options each person can select: 1 for a single choice, 0 for any number of options',
|
|
35
|
+
},
|
|
36
|
+
(0, helpers_1.sendOptionsProperty)([(0, helpers_1.delayOption)(), ...helpers_1.mentionOptions, helpers_1.messageIdOption, ...(0, helpers_1.quotedOptions)()]),
|
|
37
|
+
];
|
|
38
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)({ show: { resource: ['message'], operation: ['sendPoll'] } }, properties);
|
|
39
|
+
async function execute(itemIndex) {
|
|
40
|
+
const node = this.getNode();
|
|
41
|
+
const number = helpers_1.getRecipient.call(this, itemIndex);
|
|
42
|
+
const name = helpers_1.getString.call(this, 'pollQuestion', itemIndex);
|
|
43
|
+
if (!name)
|
|
44
|
+
throw (0, helpers_1.operationError)(node, itemIndex, 'Question is required');
|
|
45
|
+
const values = (0, helpers_1.splitLines)(this.getNodeParameter('pollOptions', itemIndex, ''));
|
|
46
|
+
if (values.length < 2 || values.length > 10) {
|
|
47
|
+
throw (0, helpers_1.operationError)(node, itemIndex, `A poll needs between 2 and 10 options (got ${values.length})`, 'Write one option per line in Poll Options.');
|
|
48
|
+
}
|
|
49
|
+
const duplicate = values.find((value, index) => values.indexOf(value) !== index);
|
|
50
|
+
if (duplicate !== undefined) {
|
|
51
|
+
throw (0, helpers_1.operationError)(node, itemIndex, `Poll options must be different ("${duplicate}" is repeated)`);
|
|
52
|
+
}
|
|
53
|
+
const rawCount = Number(this.getNodeParameter('selectableCount', itemIndex, 1));
|
|
54
|
+
const selectableCount = Number.isFinite(rawCount) ? Math.round(rawCount) : 1;
|
|
55
|
+
if (selectableCount < 0 || selectableCount > values.length) {
|
|
56
|
+
throw (0, helpers_1.operationError)(node, itemIndex, `Selectable Count must be between 0 and the number of options (${values.length})`);
|
|
57
|
+
}
|
|
58
|
+
const options = this.getNodeParameter('options', itemIndex, {});
|
|
59
|
+
const body = (0, helpers_1.applySendOptions)(node, itemIndex, options, {
|
|
60
|
+
number,
|
|
61
|
+
name,
|
|
62
|
+
selectableCount,
|
|
63
|
+
values,
|
|
64
|
+
});
|
|
65
|
+
return await helpers_1.postMessage.call(this, itemIndex, 'sendPoll', body);
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=sendPoll.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendPoll.operation.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/resources/message/sendPoll.operation.ts"],"names":[],"mappings":";;;AA8DA,0BA0CC;AAvGD,+CAAoD;AAEpD,uCAamB;AAEnB,MAAM,UAAU,GAAsB;IACpC,wBAAc;IACd;QACE,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,uBAAuB;QACpC,WAAW,EAAE,mBAAmB;KACjC;IACD;QACE,WAAW,EAAE,cAAc;QAC3B,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;QACxB,WA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
2
|
+
export declare const description: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
builderHint?: import("n8n-workflow").IParameterBuilderHint;
|
|
12
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
13
|
+
options?: Array<import("n8n-workflow").INodePropertyOptions | INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
isNodeSetting?: boolean;
|
|
16
|
+
noDataExpression?: boolean;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
19
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
20
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
21
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
22
|
+
requiresDataPath?: "single" | "multiple";
|
|
23
|
+
doNotInherit?: boolean;
|
|
24
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
25
|
+
ignoreValidationDuringExecution?: boolean;
|
|
26
|
+
allowArbitraryValues?: boolean;
|
|
27
|
+
resolvableField?: boolean;
|
|
28
|
+
}[];
|
|
29
|
+
export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<IDataObject>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
7
|
+
const helpers_1 = require("./helpers");
|
|
8
|
+
const properties = [
|
|
9
|
+
helpers_1.numberProperty,
|
|
10
|
+
...(0, helpers_1.mediaSourceProperties)('MP4 video'),
|
|
11
|
+
(0, helpers_1.sendOptionsProperty)([(0, helpers_1.delayOption)(), ...helpers_1.mentionOptions, helpers_1.messageIdOption, ...(0, helpers_1.quotedOptions)()]),
|
|
12
|
+
];
|
|
13
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)({ show: { resource: ['message'], operation: ['sendPtv'] } }, properties);
|
|
14
|
+
async function execute(itemIndex) {
|
|
15
|
+
const number = helpers_1.getRecipient.call(this, itemIndex);
|
|
16
|
+
const options = this.getNodeParameter('options', itemIndex, {});
|
|
17
|
+
const media = await helpers_1.resolveMediaInput.call(this, itemIndex);
|
|
18
|
+
const fields = (0, helpers_1.applySendOptions)(this.getNode(), itemIndex, options, { number });
|
|
19
|
+
const body = (0, GenericFunctions_1.buildMediaRequestBody)(media, fields, { mediaField: 'video', allowMultipart: true });
|
|
20
|
+
return await helpers_1.postMessage.call(this, itemIndex, 'sendPtv', body);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=sendPtv.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendPtv.operation.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/resources/message/sendPtv.operation.ts"],"names":[],"mappings":";;;AAmCA,0BAQC;AA1CD,+CAAoD;AAEpD,6DAA+D;AAC/D,uCAYmB;AAEnB,MAAM,UAAU,GAAsB;IACpC,wBAAc;IACd,GAAG,IAAA,+BAAqB,EAAC,WAAW,CAAC;IACrC,IAAA,6BAAmB,EAAC,CAAC,IAAA,qBAAW,GAAE,EAAE,GAAG,wBAAc,EAAE,yBAAe,EAAE,GAAG,IAAA,uBAAa,GAAE,CAAC,CAAC;CAC7F,CAAC;AAEW,QAAA,WAAW,GAAG,IAAA,mCAAoB,EAC7C,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,EAC3D,UAAU,CACX,CAAC;AAQK,KAAK,UAAU,OAAO,CAA0B,SAAiB;IACtE,MAAM,MAAM,GAAG,sBAAY,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAAgB,CAAC;IAC/E,MAAM,KAAK,GAAG,MAAM,2BAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAE5D,MAAM,MAAM,GAAG,IAAA,0BAAgB,EAAC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAChF,MAAM,IAAI,GAAG,IAAA,wCAAqB,EAAC,KAAK,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;IACjG,OAAO,MAAM,qBAAW,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
builderHint?: import("n8n-workflow").IParameterBuilderHint;
|
|
12
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
13
|
+
options?: Array<import("n8n-workflow").INodePropertyOptions | INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
isNodeSetting?: boolean;
|
|
16
|
+
noDataExpression?: boolean;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
19
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
20
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
21
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
22
|
+
requiresDataPath?: "single" | "multiple";
|
|
23
|
+
doNotInherit?: boolean;
|
|
24
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
25
|
+
ignoreValidationDuringExecution?: boolean;
|
|
26
|
+
allowArbitraryValues?: boolean;
|
|
27
|
+
resolvableField?: boolean;
|
|
28
|
+
}[];
|
|
29
|
+
export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<IDataObject>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const helpers_1 = require("../chat/helpers");
|
|
7
|
+
const helpers_2 = require("./helpers");
|
|
8
|
+
const properties = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Chat JID',
|
|
11
|
+
name: 'remoteJid',
|
|
12
|
+
type: 'string',
|
|
13
|
+
required: true,
|
|
14
|
+
default: '',
|
|
15
|
+
placeholder: '5215512345678@s.whatsapp.net',
|
|
16
|
+
description: 'Chat of the message to react to (key.remoteJid of the webhook or send response): …@s.whatsapp.net, …@g.us or …@lid. Plain numbers use Evolution’s Mexico, Argentina and Brazil digit rules; full JIDs are kept unchanged.',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
displayName: 'Message ID',
|
|
20
|
+
name: 'messageId',
|
|
21
|
+
type: 'string',
|
|
22
|
+
required: true,
|
|
23
|
+
default: '',
|
|
24
|
+
placeholder: '3EB0C767D26A1D8E5F2A',
|
|
25
|
+
description: 'ID (key.id) of the message to react to',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
displayName: 'From Me',
|
|
29
|
+
name: 'fromMe',
|
|
30
|
+
type: 'boolean',
|
|
31
|
+
default: false,
|
|
32
|
+
description: 'Whether the message was sent by this instance (key.fromMe)',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Reaction',
|
|
36
|
+
name: 'reaction',
|
|
37
|
+
type: 'string',
|
|
38
|
+
default: '👍',
|
|
39
|
+
description: 'Exactly one emoji. Leave empty to remove a previous reaction.',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
displayName: 'Options',
|
|
43
|
+
name: 'options',
|
|
44
|
+
type: 'collection',
|
|
45
|
+
placeholder: 'Add Option',
|
|
46
|
+
default: {},
|
|
47
|
+
options: [
|
|
48
|
+
{
|
|
49
|
+
displayName: 'Participant',
|
|
50
|
+
name: 'participant',
|
|
51
|
+
type: 'string',
|
|
52
|
+
default: '',
|
|
53
|
+
placeholder: '5215512345678@s.whatsapp.net',
|
|
54
|
+
description: 'Groups only: JID of the member who sent the message (key.participant). Needed to react to messages of other members. Plain numbers use Evolution’s Mexico, Argentina and Brazil digit rules; full JIDs are kept unchanged.',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)({ show: { resource: ['message'], operation: ['sendReaction'] } }, properties);
|
|
60
|
+
async function execute(itemIndex) {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
const node = this.getNode();
|
|
63
|
+
const remoteJid = (0, helpers_1.evolutionJid)(this.getNodeParameter('remoteJid', itemIndex, ''));
|
|
64
|
+
const id = helpers_2.getString.call(this, 'messageId', itemIndex);
|
|
65
|
+
if (!remoteJid)
|
|
66
|
+
throw (0, helpers_2.operationError)(node, itemIndex, 'Chat JID is required');
|
|
67
|
+
if (!id)
|
|
68
|
+
throw (0, helpers_2.operationError)(node, itemIndex, 'Message ID is required');
|
|
69
|
+
const options = this.getNodeParameter('options', itemIndex, {});
|
|
70
|
+
const key = {
|
|
71
|
+
id,
|
|
72
|
+
remoteJid,
|
|
73
|
+
fromMe: this.getNodeParameter('fromMe', itemIndex, false) === true,
|
|
74
|
+
};
|
|
75
|
+
const participant = String((_a = options.participant) !== null && _a !== void 0 ? _a : '').trim();
|
|
76
|
+
if (participant)
|
|
77
|
+
key.participant = (0, helpers_1.evolutionJid)(participant);
|
|
78
|
+
const reaction = String((_b = this.getNodeParameter('reaction', itemIndex, '')) !== null && _b !== void 0 ? _b : '').trim();
|
|
79
|
+
return await helpers_2.postMessage.call(this, itemIndex, 'sendReaction', { key, reaction });
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=sendReaction.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendReaction.operation.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/resources/message/sendReaction.operation.ts"],"names":[],"mappings":";;;AAsEA,0BAkBC;AAvFD,+CAAoD;AAEpD,6CAA+C;AAC/C,uCAAmE;AAEnE,MAAM,UAAU,GAAsB;IACpC;QACE,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,8BAA8B;QAC3C,WAAW,EACT,2NAA2N;KAC9N;IACD;QACE,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,sBAAsB;QACnC,WAA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,wBAAc,EAAC,IAAI,EAAE,SAAS,EAAE,wBAAwB,CAAC,CAAC;IAEzE,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAAgB,CAAC;IAC/E,MAAM,GAAG,GAAgB;QACvB,EAAE;QACF,SAAS;QACT,MAAM,EAAE,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,KAAK,IAAI;KACnE,CAAC;IACF,MAAM,WAAW,GAAG,MAAM,CAAC,MAAA,OAAO,CAAC,WAAW,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC7D,IAAI,WAAW;QAAE,GAAG,CAAC,WAAW,GAAG,IAAA,sBAAY,EAAC,WAAW,CAAC,CAAC;IAE7D,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAA,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE,CAAC,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACvF,OAAO,MAAM,qBAAW,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
builderHint?: import("n8n-workflow").IParameterBuilderHint;
|
|
12
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
13
|
+
options?: Array<import("n8n-workflow").INodePropertyOptions | INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
isNodeSetting?: boolean;
|
|
16
|
+
noDataExpression?: boolean;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
19
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
20
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
21
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
22
|
+
requiresDataPath?: "single" | "multiple";
|
|
23
|
+
doNotInherit?: boolean;
|
|
24
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
25
|
+
ignoreValidationDuringExecution?: boolean;
|
|
26
|
+
allowArbitraryValues?: boolean;
|
|
27
|
+
resolvableField?: boolean;
|
|
28
|
+
}[];
|
|
29
|
+
export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<IDataObject>;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
7
|
+
const helpers_1 = require("../chat/helpers");
|
|
8
|
+
const helpers_2 = require("./helpers");
|
|
9
|
+
const properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Status Type',
|
|
12
|
+
name: 'statusType',
|
|
13
|
+
type: 'options',
|
|
14
|
+
options: [
|
|
15
|
+
{
|
|
16
|
+
name: 'Audio',
|
|
17
|
+
value: 'audio',
|
|
18
|
+
description: 'Voice status from a URL, base64 or binary file (converted by Evolution)',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Image',
|
|
22
|
+
value: 'image',
|
|
23
|
+
description: 'Image from a URL, base64 or binary file',
|
|
24
|
+
},
|
|
25
|
+
{ name: 'Text', value: 'text', description: 'Text on a colored background' },
|
|
26
|
+
{
|
|
27
|
+
name: 'Video',
|
|
28
|
+
value: 'video',
|
|
29
|
+
description: 'Video from a URL, base64 or binary file',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
default: 'text',
|
|
33
|
+
description: 'Kind of status (story) to post',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
displayName: 'Text',
|
|
37
|
+
name: 'text',
|
|
38
|
+
type: 'string',
|
|
39
|
+
required: true,
|
|
40
|
+
default: '',
|
|
41
|
+
typeOptions: { rows: 3 },
|
|
42
|
+
description: 'Text of the status',
|
|
43
|
+
displayOptions: { show: { statusType: ['text'] } },
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
displayName: 'Background Color',
|
|
47
|
+
name: 'statusBackgroundColor',
|
|
48
|
+
type: 'color',
|
|
49
|
+
default: '#008000',
|
|
50
|
+
description: 'Background color of a text status (hex, e.g. #008000)',
|
|
51
|
+
displayOptions: { show: { statusType: ['text'] } },
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
displayName: 'Font',
|
|
55
|
+
name: 'statusFont',
|
|
56
|
+
type: 'number',
|
|
57
|
+
default: 1,
|
|
58
|
+
typeOptions: { minValue: 1, maxValue: 5 },
|
|
59
|
+
description: 'Font style of a text status, from 1 to 5',
|
|
60
|
+
displayOptions: { show: { statusType: ['text'] } },
|
|
61
|
+
},
|
|
62
|
+
...(0, helpers_2.mediaSourceProperties)('image, video or audio', { statusType: ['image', 'video', 'audio'] }),
|
|
63
|
+
{
|
|
64
|
+
displayName: 'Caption',
|
|
65
|
+
name: 'caption',
|
|
66
|
+
type: 'string',
|
|
67
|
+
default: '',
|
|
68
|
+
description: 'Text shown with the image or video',
|
|
69
|
+
displayOptions: { show: { statusType: ['image', 'video'] } },
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
displayName: 'All Contacts',
|
|
73
|
+
name: 'statusAllContacts',
|
|
74
|
+
type: 'boolean',
|
|
75
|
+
default: false,
|
|
76
|
+
description: "Whether to show the status to every contact stored in Evolution's database that has a name",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
displayName: 'Recipients',
|
|
80
|
+
name: 'statusRecipients',
|
|
81
|
+
type: 'string',
|
|
82
|
+
required: true,
|
|
83
|
+
default: '',
|
|
84
|
+
placeholder: '5215512345678, 5511999999999@s.whatsapp.net',
|
|
85
|
+
description: 'Numbers or JIDs that can see the status, separated by commas. The node converts plain numbers using Evolution’s Mexico, Argentina and Brazil digit rules. Full JIDs, including …@lid, are kept unchanged; prefer the JID from a webhook or from Chat > Check Numbers.',
|
|
86
|
+
displayOptions: { show: { statusAllContacts: [false] } },
|
|
87
|
+
},
|
|
88
|
+
];
|
|
89
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)({ show: { resource: ['message'], operation: ['sendStatus'] } }, properties);
|
|
90
|
+
const DEFAULT_MIME_TYPE = { image: 'image/jpeg', video: 'video/mp4' };
|
|
91
|
+
async function execute(itemIndex) {
|
|
92
|
+
var _a;
|
|
93
|
+
const node = this.getNode();
|
|
94
|
+
const type = helpers_2.getString.call(this, 'statusType', itemIndex) || 'text';
|
|
95
|
+
const fields = { type };
|
|
96
|
+
const allContacts = this.getNodeParameter('statusAllContacts', itemIndex, false) === true;
|
|
97
|
+
if (allContacts) {
|
|
98
|
+
fields.allContacts = true;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
const recipients = (0, GenericFunctions_1.normalizeNumberList)(this.getNodeParameter('statusRecipients', itemIndex, ''))
|
|
102
|
+
.map((recipient) => (0, helpers_1.evolutionJid)(recipient))
|
|
103
|
+
.filter((recipient, index, list) => list.indexOf(recipient) === index);
|
|
104
|
+
if (recipients.length === 0) {
|
|
105
|
+
throw (0, helpers_2.operationError)(node, itemIndex, 'Add at least one recipient or enable All Contacts', 'WhatsApp only shows a status to the listed contacts.');
|
|
106
|
+
}
|
|
107
|
+
fields.statusJidList = recipients;
|
|
108
|
+
}
|
|
109
|
+
if (type === 'text') {
|
|
110
|
+
const text = String((_a = this.getNodeParameter('text', itemIndex, '')) !== null && _a !== void 0 ? _a : '');
|
|
111
|
+
if (!text.trim())
|
|
112
|
+
throw (0, helpers_2.operationError)(node, itemIndex, 'Text is required');
|
|
113
|
+
const backgroundColor = helpers_2.getString.call(this, 'statusBackgroundColor', itemIndex);
|
|
114
|
+
if (!backgroundColor)
|
|
115
|
+
throw (0, helpers_2.operationError)(node, itemIndex, 'Background Color is required');
|
|
116
|
+
const font = Math.round(Number(this.getNodeParameter('statusFont', itemIndex, 1)));
|
|
117
|
+
if (!Number.isFinite(font) || font < 1 || font > 5) {
|
|
118
|
+
throw (0, helpers_2.operationError)(node, itemIndex, 'Font must be a number from 1 to 5');
|
|
119
|
+
}
|
|
120
|
+
return await helpers_2.postMessage.call(this, itemIndex, 'sendStatus', {
|
|
121
|
+
...fields,
|
|
122
|
+
content: text,
|
|
123
|
+
backgroundColor,
|
|
124
|
+
font,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (type !== 'image' && type !== 'video' && type !== 'audio') {
|
|
128
|
+
throw (0, helpers_2.operationError)(node, itemIndex, `Unsupported status type "${type}"`);
|
|
129
|
+
}
|
|
130
|
+
const media = await helpers_2.resolveMediaInput.call(this, itemIndex);
|
|
131
|
+
if (type === 'audio') {
|
|
132
|
+
const body = (0, GenericFunctions_1.buildMediaRequestBody)(media, fields, {
|
|
133
|
+
mediaField: 'content',
|
|
134
|
+
allowMultipart: true,
|
|
135
|
+
});
|
|
136
|
+
return await helpers_2.postMessage.call(this, itemIndex, 'sendStatus', body);
|
|
137
|
+
}
|
|
138
|
+
fields.content =
|
|
139
|
+
media.type === 'url'
|
|
140
|
+
? media.value
|
|
141
|
+
: `data:${media.mimeType || DEFAULT_MIME_TYPE[type]};base64,${media.value}`;
|
|
142
|
+
const caption = helpers_2.getString.call(this, 'caption', itemIndex);
|
|
143
|
+
if (caption)
|
|
144
|
+
fields.caption = caption;
|
|
145
|
+
return await helpers_2.postMessage.call(this, itemIndex, 'sendStatus', fields);
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=sendStatus.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendStatus.operation.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/resources/message/sendStatus.operation.ts"],"names":[],"mappings":";;;AAqHA,0BA4DC;AAhLD,+CAAoD;AAEpD,6DAAoF;AACpF,6CAA+C;AAC/C,uCAMmB;AAEnB,MAAM,UAAU,GAAsB;IACpC;QACE,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,yEAAyE;aACvF;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,yCAAyC;aACvD;YACD,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,8BAA8B,EAAE;YAC5E;gBACE,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,yCAAyC;aACvD;SACF;QACD,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,gCAAgC;KAC9C;IACD;QACE,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;QACxB,WAAW,EAAE,oBAAoB;QACjC,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE;KACnD;IACD;QACE,WAAW,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