n8n-nodes-evolution-go-nk 1.0.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.md +19 -0
- package/README.md +197 -0
- package/dist/credentials/EvolutionApi.credentials.d.ts +9 -0
- package/dist/credentials/EvolutionApi.credentials.js +50 -0
- package/dist/credentials/EvolutionApi.credentials.js.map +1 -0
- package/dist/credentials/EvolutionApiNk.credentials.d.ts +9 -0
- package/dist/credentials/EvolutionApiNk.credentials.js +50 -0
- package/dist/credentials/EvolutionApiNk.credentials.js.map +1 -0
- package/dist/credentials/EvolutionApiNkApi.credentials.d.ts +9 -0
- package/dist/credentials/EvolutionApiNkApi.credentials.js +50 -0
- package/dist/credentials/EvolutionApiNkApi.credentials.js.map +1 -0
- package/dist/credentials/EvolutionGoApi.credentials.d.ts +9 -0
- package/dist/credentials/EvolutionGoApi.credentials.js +57 -0
- package/dist/credentials/EvolutionGoApi.credentials.js.map +1 -0
- package/dist/nodes/EvolutionApi/EvolutionApiNk.node.d.ts +5 -0
- package/dist/nodes/EvolutionApi/EvolutionApiNk.node.js +54 -0
- package/dist/nodes/EvolutionApi/EvolutionApiNk.node.js.map +1 -0
- package/dist/nodes/EvolutionApi/EvolutionApiNk.node.json +21 -0
- package/dist/nodes/EvolutionApi/evolutionapi.svg +14 -0
- package/dist/nodes/EvolutionApi/execute/chat/blockContact.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/chat/blockContact.js +51 -0
- package/dist/nodes/EvolutionApi/execute/chat/blockContact.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/chat/checkNumber.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/chat/checkNumber.js +50 -0
- package/dist/nodes/EvolutionApi/execute/chat/checkNumber.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/chat/deleteMessage.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/chat/deleteMessage.js +62 -0
- package/dist/nodes/EvolutionApi/execute/chat/deleteMessage.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/chat/fetchProfilePicture.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/chat/fetchProfilePicture.js +49 -0
- package/dist/nodes/EvolutionApi/execute/chat/fetchProfilePicture.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/chat/findChats.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/chat/findChats.js +57 -0
- package/dist/nodes/EvolutionApi/execute/chat/findChats.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/chat/findContacts.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/chat/findContacts.js +55 -0
- package/dist/nodes/EvolutionApi/execute/chat/findContacts.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/chat/findMessages.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/chat/findMessages.js +57 -0
- package/dist/nodes/EvolutionApi/execute/chat/findMessages.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/chat/findStatusMessages.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/chat/findStatusMessages.js +58 -0
- package/dist/nodes/EvolutionApi/execute/chat/findStatusMessages.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/chat/getMediaBase64.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/chat/getMediaBase64.js +55 -0
- package/dist/nodes/EvolutionApi/execute/chat/getMediaBase64.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/chat/manageArchive.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/chat/manageArchive.js +60 -0
- package/dist/nodes/EvolutionApi/execute/chat/manageArchive.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/chat/markChatUnread.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/chat/markChatUnread.js +58 -0
- package/dist/nodes/EvolutionApi/execute/chat/markChatUnread.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/chat/readMessages.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/chat/readMessages.js +57 -0
- package/dist/nodes/EvolutionApi/execute/chat/readMessages.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/chat/sendPresence.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/chat/sendPresence.js +53 -0
- package/dist/nodes/EvolutionApi/execute/chat/sendPresence.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/chat/updateMessage.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/chat/updateMessage.js +57 -0
- package/dist/nodes/EvolutionApi/execute/chat/updateMessage.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/events/setProxy.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/events/setProxy.js +63 -0
- package/dist/nodes/EvolutionApi/execute/events/setProxy.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/events/setRabbitMQ.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/events/setRabbitMQ.js +83 -0
- package/dist/nodes/EvolutionApi/execute/events/setRabbitMQ.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/events/setWebhook.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/events/setWebhook.js +89 -0
- package/dist/nodes/EvolutionApi/execute/events/setWebhook.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/evolutionRequest.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/evolutionRequest.js +18 -0
- package/dist/nodes/EvolutionApi/execute/evolutionRequest.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/groups/createGroup.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/groups/createGroup.js +54 -0
- package/dist/nodes/EvolutionApi/execute/groups/createGroup.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/groups/fetchGroups.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/groups/fetchGroups.js +69 -0
- package/dist/nodes/EvolutionApi/execute/groups/fetchGroups.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/groups/fetchInviteCode.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/groups/fetchInviteCode.js +45 -0
- package/dist/nodes/EvolutionApi/execute/groups/fetchInviteCode.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/groups/findParticipants.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/groups/findParticipants.js +45 -0
- package/dist/nodes/EvolutionApi/execute/groups/findParticipants.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/groups/joinGroup.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/groups/joinGroup.js +45 -0
- package/dist/nodes/EvolutionApi/execute/groups/joinGroup.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/groups/leaveGroup.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/groups/leaveGroup.js +45 -0
- package/dist/nodes/EvolutionApi/execute/groups/leaveGroup.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/groups/revokeInviteCode.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/groups/revokeInviteCode.js +45 -0
- package/dist/nodes/EvolutionApi/execute/groups/revokeInviteCode.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/groups/sendInviteLink.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/groups/sendInviteLink.js +54 -0
- package/dist/nodes/EvolutionApi/execute/groups/sendInviteLink.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/groups/toggleEphemeral.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/groups/toggleEphemeral.js +50 -0
- package/dist/nodes/EvolutionApi/execute/groups/toggleEphemeral.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/groups/updateGroupDescription.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/groups/updateGroupDescription.js +50 -0
- package/dist/nodes/EvolutionApi/execute/groups/updateGroupDescription.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/groups/updateGroupName.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/groups/updateGroupName.js +50 -0
- package/dist/nodes/EvolutionApi/execute/groups/updateGroupName.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/groups/updateGroupPicture.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/groups/updateGroupPicture.js +50 -0
- package/dist/nodes/EvolutionApi/execute/groups/updateGroupPicture.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/groups/updateParticipants.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/groups/updateParticipants.js +53 -0
- package/dist/nodes/EvolutionApi/execute/groups/updateParticipants.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/groups/updateSettings.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/groups/updateSettings.js +50 -0
- package/dist/nodes/EvolutionApi/execute/groups/updateSettings.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/index.d.ts +8 -0
- package/dist/nodes/EvolutionApi/execute/index.js +154 -0
- package/dist/nodes/EvolutionApi/execute/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/instance/createInstanceBasic.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/instance/createInstanceBasic.js +104 -0
- package/dist/nodes/EvolutionApi/execute/instance/createInstanceBasic.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/instance/deleteInstance.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/instance/deleteInstance.js +48 -0
- package/dist/nodes/EvolutionApi/execute/instance/deleteInstance.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/instance/fetchInstances.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/instance/fetchInstances.js +48 -0
- package/dist/nodes/EvolutionApi/execute/instance/fetchInstances.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/instance/instanceConnect.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/instance/instanceConnect.js +48 -0
- package/dist/nodes/EvolutionApi/execute/instance/instanceConnect.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/instance/instanceSettings.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/instance/instanceSettings.js +71 -0
- package/dist/nodes/EvolutionApi/execute/instance/instanceSettings.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/instance/logoutInstance.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/instance/logoutInstance.js +48 -0
- package/dist/nodes/EvolutionApi/execute/instance/logoutInstance.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/instance/restartInstance.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/instance/restartInstance.js +48 -0
- package/dist/nodes/EvolutionApi/execute/instance/restartInstance.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/instance/setPresence.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/instance/setPresence.js +55 -0
- package/dist/nodes/EvolutionApi/execute/instance/setPresence.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/instance/setProxy.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/instance/setProxy.js +89 -0
- package/dist/nodes/EvolutionApi/execute/instance/setProxy.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setChatwoot.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setChatwoot.js +108 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setChatwoot.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setDifyBot.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setDifyBot.js +169 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setDifyBot.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setEvolutionBot.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setEvolutionBot.js +178 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setEvolutionBot.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setFlowiseBot.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setFlowiseBot.js +178 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setFlowiseBot.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setTypebot.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setTypebot.js +194 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setTypebot.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendAudio.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendAudio.js +86 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendAudio.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendButtons.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendButtons.js +121 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendButtons.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendCarousel.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendCarousel.js +136 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendCarousel.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendContact.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendContact.js +80 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendContact.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendDocument.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendDocument.js +97 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendDocument.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendImage.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendImage.js +98 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendImage.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendList.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendList.js +111 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendList.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendLocation.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendLocation.js +105 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendLocation.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendPix.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendPix.js +84 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendPix.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendPoll.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendPoll.js +89 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendPoll.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendReaction.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendReaction.js +79 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendReaction.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendSticker.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendSticker.js +84 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendSticker.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendStories.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendStories.js +94 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendStories.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendText.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendText.js +94 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendText.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendVideo.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendVideo.js +89 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendVideo.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/profile/fetchBusinessProfile.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/profile/fetchBusinessProfile.js +49 -0
- package/dist/nodes/EvolutionApi/execute/profile/fetchBusinessProfile.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/profile/fetchPrivacySettings.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/profile/fetchPrivacySettings.js +44 -0
- package/dist/nodes/EvolutionApi/execute/profile/fetchPrivacySettings.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/profile/fetchProfile.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/profile/fetchProfile.js +49 -0
- package/dist/nodes/EvolutionApi/execute/profile/fetchProfile.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/profile/removeProfilePicture.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/profile/removeProfilePicture.js +44 -0
- package/dist/nodes/EvolutionApi/execute/profile/removeProfilePicture.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/profile/updatePrivacySettings.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/profile/updatePrivacySettings.js +59 -0
- package/dist/nodes/EvolutionApi/execute/profile/updatePrivacySettings.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/profile/updateProfileName.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/profile/updateProfileName.js +49 -0
- package/dist/nodes/EvolutionApi/execute/profile/updateProfileName.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/profile/updateProfilePicture.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/profile/updateProfilePicture.js +49 -0
- package/dist/nodes/EvolutionApi/execute/profile/updateProfilePicture.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/profile/updateProfileStatus.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/profile/updateProfileStatus.js +49 -0
- package/dist/nodes/EvolutionApi/execute/profile/updateProfileStatus.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/chat.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/chat.fields.js +588 -0
- package/dist/nodes/EvolutionApi/properties/chat.fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/chat.operations.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/chat.operations.js +102 -0
- package/dist/nodes/EvolutionApi/properties/chat.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/events.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/events.fields.js +364 -0
- package/dist/nodes/EvolutionApi/properties/events.fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/events.operations.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/events.operations.js +30 -0
- package/dist/nodes/EvolutionApi/properties/events.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/groups.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/groups.fields.js +691 -0
- package/dist/nodes/EvolutionApi/properties/groups.fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/groups.operations.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/groups.operations.js +102 -0
- package/dist/nodes/EvolutionApi/properties/groups.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/index.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/index.js +72 -0
- package/dist/nodes/EvolutionApi/properties/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/instances.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/instances.fields.js +923 -0
- package/dist/nodes/EvolutionApi/properties/instances.fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/instances.operations.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/instances.operations.js +72 -0
- package/dist/nodes/EvolutionApi/properties/instances.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/integrations.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/integrations.fields.js +1767 -0
- package/dist/nodes/EvolutionApi/properties/integrations.fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/integrations.operations.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/integrations.operations.js +48 -0
- package/dist/nodes/EvolutionApi/properties/integrations.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/messages.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/messages.fields.js +2234 -0
- package/dist/nodes/EvolutionApi/properties/messages.fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/messages.operations.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/messages.operations.js +108 -0
- package/dist/nodes/EvolutionApi/properties/messages.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/profile.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/profile.fields.js +254 -0
- package/dist/nodes/EvolutionApi/properties/profile.fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/profile.operations.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/profile.operations.js +66 -0
- package/dist/nodes/EvolutionApi/properties/profile.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/resources.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/resources.js +41 -0
- package/dist/nodes/EvolutionApi/properties/resources.js.map +1 -0
- package/dist/nodes/EvolutionGo/EvolutionGo.node.d.ts +5 -0
- package/dist/nodes/EvolutionGo/EvolutionGo.node.js +55 -0
- package/dist/nodes/EvolutionGo/EvolutionGo.node.js.map +1 -0
- package/dist/nodes/EvolutionGo/evolutiongo.svg +10 -0
- package/dist/nodes/EvolutionGo/execute/chat/index.d.ts +8 -0
- package/dist/nodes/EvolutionGo/execute/chat/index.js +96 -0
- package/dist/nodes/EvolutionGo/execute/chat/index.js.map +1 -0
- package/dist/nodes/EvolutionGo/execute/evolutionGoRequest.d.ts +2 -0
- package/dist/nodes/EvolutionGo/execute/evolutionGoRequest.js +19 -0
- package/dist/nodes/EvolutionGo/execute/evolutionGoRequest.js.map +1 -0
- package/dist/nodes/EvolutionGo/execute/group/index.d.ts +10 -0
- package/dist/nodes/EvolutionGo/execute/group/index.js +130 -0
- package/dist/nodes/EvolutionGo/execute/group/index.js.map +1 -0
- package/dist/nodes/EvolutionGo/execute/index.d.ts +8 -0
- package/dist/nodes/EvolutionGo/execute/index.js +73 -0
- package/dist/nodes/EvolutionGo/execute/index.js.map +1 -0
- package/dist/nodes/EvolutionGo/execute/instance/index.d.ts +12 -0
- package/dist/nodes/EvolutionGo/execute/instance/index.js +127 -0
- package/dist/nodes/EvolutionGo/execute/instance/index.js.map +1 -0
- package/dist/nodes/EvolutionGo/execute/message/index.d.ts +6 -0
- package/dist/nodes/EvolutionGo/execute/message/index.js +74 -0
- package/dist/nodes/EvolutionGo/execute/message/index.js.map +1 -0
- package/dist/nodes/EvolutionGo/execute/send/index.d.ts +10 -0
- package/dist/nodes/EvolutionGo/execute/send/index.js +196 -0
- package/dist/nodes/EvolutionGo/execute/send/index.js.map +1 -0
- package/dist/nodes/EvolutionGo/execute/user/index.d.ts +9 -0
- package/dist/nodes/EvolutionGo/execute/user/index.js +106 -0
- package/dist/nodes/EvolutionGo/execute/user/index.js.map +1 -0
- package/dist/nodes/EvolutionGo/properties/chat.properties.d.ts +3 -0
- package/dist/nodes/EvolutionGo/properties/chat.properties.js +106 -0
- package/dist/nodes/EvolutionGo/properties/chat.properties.js.map +1 -0
- package/dist/nodes/EvolutionGo/properties/group.properties.d.ts +3 -0
- package/dist/nodes/EvolutionGo/properties/group.properties.js +178 -0
- package/dist/nodes/EvolutionGo/properties/group.properties.js.map +1 -0
- package/dist/nodes/EvolutionGo/properties/index.d.ts +2 -0
- package/dist/nodes/EvolutionGo/properties/index.js +58 -0
- package/dist/nodes/EvolutionGo/properties/index.js.map +1 -0
- package/dist/nodes/EvolutionGo/properties/instance.properties.d.ts +3 -0
- package/dist/nodes/EvolutionGo/properties/instance.properties.js +127 -0
- package/dist/nodes/EvolutionGo/properties/instance.properties.js.map +1 -0
- package/dist/nodes/EvolutionGo/properties/message.properties.d.ts +3 -0
- package/dist/nodes/EvolutionGo/properties/message.properties.js +118 -0
- package/dist/nodes/EvolutionGo/properties/message.properties.js.map +1 -0
- package/dist/nodes/EvolutionGo/properties/send.properties.d.ts +3 -0
- package/dist/nodes/EvolutionGo/properties/send.properties.js +434 -0
- package/dist/nodes/EvolutionGo/properties/send.properties.js.map +1 -0
- package/dist/nodes/EvolutionGo/properties/user.properties.d.ts +3 -0
- package/dist/nodes/EvolutionGo/properties/user.properties.js +123 -0
- package/dist/nodes/EvolutionGo/properties/user.properties.js.map +1 -0
- package/dist/package.json +67 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/index.js +8 -0
- package/package.json +67 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendPix = sendPix;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const evolutionRequest_1 = require("../evolutionRequest");
|
|
6
|
+
async function sendPix(ef) {
|
|
7
|
+
try {
|
|
8
|
+
const instanceName = ef.getNodeParameter('instanceName', 0);
|
|
9
|
+
const remoteJid = ef.getNodeParameter('remoteJid', 0);
|
|
10
|
+
const name = ef.getNodeParameter('name', 0);
|
|
11
|
+
const keyType = ef.getNodeParameter('keyType', 0);
|
|
12
|
+
const key = ef.getNodeParameter('key', 0);
|
|
13
|
+
const validKeyTypes = ['cpf', 'cnpj', 'email', 'phone', 'random'];
|
|
14
|
+
if (!validKeyTypes.includes(keyType)) {
|
|
15
|
+
const errorData = {
|
|
16
|
+
success: false,
|
|
17
|
+
error: {
|
|
18
|
+
message: 'Tipo de chave PIX inválida',
|
|
19
|
+
details: 'O tipo de chave PIX deve ser: cpf, cnpj, email, phone ou random',
|
|
20
|
+
code: 'INVALID_PIX_KEY_TYPE',
|
|
21
|
+
timestamp: new Date().toISOString(),
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
json: errorData,
|
|
26
|
+
error: errorData,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const body = {
|
|
30
|
+
number: remoteJid,
|
|
31
|
+
buttons: [
|
|
32
|
+
{
|
|
33
|
+
type: 'pix',
|
|
34
|
+
currency: 'BRL',
|
|
35
|
+
name,
|
|
36
|
+
keyType,
|
|
37
|
+
key,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
const requestOptions = {
|
|
42
|
+
method: 'POST',
|
|
43
|
+
headers: {
|
|
44
|
+
'Content-Type': 'application/json',
|
|
45
|
+
},
|
|
46
|
+
uri: `/message/sendButtons/${instanceName}`,
|
|
47
|
+
body,
|
|
48
|
+
json: true,
|
|
49
|
+
};
|
|
50
|
+
const response = await (0, evolutionRequest_1.evolutionRequest)(ef, requestOptions);
|
|
51
|
+
return {
|
|
52
|
+
json: {
|
|
53
|
+
success: true,
|
|
54
|
+
data: response,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
const errorData = {
|
|
60
|
+
success: false,
|
|
61
|
+
error: {
|
|
62
|
+
message: error.message.includes('Could not get parameter')
|
|
63
|
+
? 'Parâmetros inválidos ou ausentes'
|
|
64
|
+
: 'Erro ao enviar botão PIX',
|
|
65
|
+
details: error.message.includes('Could not get parameter')
|
|
66
|
+
? 'Verifique se todos os campos obrigatórios foram preenchidos corretamente'
|
|
67
|
+
: error.message,
|
|
68
|
+
code: error.code || 'UNKNOWN_ERROR',
|
|
69
|
+
timestamp: new Date().toISOString(),
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
if (!ef.continueOnFail()) {
|
|
73
|
+
throw new n8n_workflow_1.NodeOperationError(ef.getNode(), error.message, {
|
|
74
|
+
message: errorData.error.message,
|
|
75
|
+
description: errorData.error.details,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
json: errorData,
|
|
80
|
+
error: errorData,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=sendPix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendPix.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/execute/messages/sendPix.ts"],"names":[],"mappings":";;AAQA,0BAoFC;AA5FD,+CAKsB;AACtB,0DAAuD;AAEhD,K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
+
success: boolean;
|
|
5
|
+
data: any;
|
|
6
|
+
};
|
|
7
|
+
error?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
json: {
|
|
10
|
+
success: boolean;
|
|
11
|
+
error: {
|
|
12
|
+
message: string;
|
|
13
|
+
details: any;
|
|
14
|
+
code: any;
|
|
15
|
+
timestamp: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
error: {
|
|
19
|
+
success: boolean;
|
|
20
|
+
error: {
|
|
21
|
+
message: string;
|
|
22
|
+
details: any;
|
|
23
|
+
code: any;
|
|
24
|
+
timestamp: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendPoll = sendPoll;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const evolutionRequest_1 = require("../evolutionRequest");
|
|
6
|
+
async function sendPoll(ef) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
try {
|
|
9
|
+
const instanceName = ef.getNodeParameter('instanceName', 0);
|
|
10
|
+
const remoteJid = ef.getNodeParameter('remoteJid', 0);
|
|
11
|
+
const pollTitle = ef.getNodeParameter('caption', 0);
|
|
12
|
+
const options = ef.getNodeParameter('options_display.metadataValues', 0);
|
|
13
|
+
const options_message = ef.getNodeParameter('options_message', 0, {});
|
|
14
|
+
const pollOptions = Array.isArray(options) ? options.map((option) => option.optionValue) : [];
|
|
15
|
+
if (pollOptions.length === 0) {
|
|
16
|
+
const errorData = {
|
|
17
|
+
success: false,
|
|
18
|
+
error: {
|
|
19
|
+
message: 'Opções da enquete inválidas',
|
|
20
|
+
details: 'A enquete precisa ter pelo menos uma opção',
|
|
21
|
+
code: 'INVALID_POLL_OPTIONS',
|
|
22
|
+
timestamp: new Date().toISOString(),
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
json: errorData,
|
|
27
|
+
error: errorData,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const body = {
|
|
31
|
+
number: remoteJid,
|
|
32
|
+
name: pollTitle,
|
|
33
|
+
selectableCount: 1,
|
|
34
|
+
values: pollOptions,
|
|
35
|
+
};
|
|
36
|
+
if (options_message.delay) {
|
|
37
|
+
body.delay = options_message.delay;
|
|
38
|
+
}
|
|
39
|
+
if ((_b = (_a = options_message.quoted) === null || _a === void 0 ? void 0 : _a.messageQuoted) === null || _b === void 0 ? void 0 : _b.messageId) {
|
|
40
|
+
body.quoted = {
|
|
41
|
+
key: {
|
|
42
|
+
id: options_message.quoted.messageQuoted.messageId,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const requestOptions = {
|
|
47
|
+
method: 'POST',
|
|
48
|
+
headers: {
|
|
49
|
+
'Content-Type': 'application/json',
|
|
50
|
+
},
|
|
51
|
+
uri: `/message/sendPoll/${instanceName}`,
|
|
52
|
+
body,
|
|
53
|
+
json: true,
|
|
54
|
+
};
|
|
55
|
+
const response = await (0, evolutionRequest_1.evolutionRequest)(ef, requestOptions);
|
|
56
|
+
return {
|
|
57
|
+
json: {
|
|
58
|
+
success: true,
|
|
59
|
+
data: response,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
const errorData = {
|
|
65
|
+
success: false,
|
|
66
|
+
error: {
|
|
67
|
+
message: error.message.includes('Could not get parameter')
|
|
68
|
+
? 'Parâmetros inválidos ou ausentes'
|
|
69
|
+
: 'Erro ao enviar enquete',
|
|
70
|
+
details: error.message.includes('Could not get parameter')
|
|
71
|
+
? 'Verifique se todos os campos obrigatórios foram preenchidos corretamente'
|
|
72
|
+
: error.message,
|
|
73
|
+
code: error.code || 'UNKNOWN_ERROR',
|
|
74
|
+
timestamp: new Date().toISOString(),
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
if (!ef.continueOnFail()) {
|
|
78
|
+
throw new n8n_workflow_1.NodeOperationError(ef.getNode(), error.message, {
|
|
79
|
+
message: errorData.error.message,
|
|
80
|
+
description: errorData.error.details,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
json: errorData,
|
|
85
|
+
error: errorData,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=sendPoll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendPoll.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/execute/messages/sendPoll.ts"],"names":[],"mappings":";;AAQA,4BAwGC;AAhHD,+CAKsB;AACtB,0DAAuD;AAEhD,KAAK,UAAU,QAAQ,CAAC,EAAqB;;IACnD,IAAI,CAAC;QAEJ,MAAM,YAAY,GAAG,EAAE,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAC5D,MAAM,SAAS,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QACtD,MAAM,SAAS,GAAG,EAAE,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QACpD,MAAM,OAAO,GAAG,EAAE,CAAC,gBAAgB,CAAC,gCAAgC,EAAE,CAAC,CAEpE,CAAC;QAGJ,MAAM,eAAe,GAAG,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,EAAE,EAAE,CAOnE,CAAC;QAGF,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAE9F,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,MAAM,SAAS,GAAG;gBACjB,OAAO,EAAE,KA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Q,CAAC,yBAAyB,CAAC;oBACzD,CAAC,CAAC,kCAAkC;oBACpC,CAAC,CAAC,wBAAwB;gBAC3B,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAC;oBACzD,CAAC,CAAC,0EAA0E;oBAC5E,CAAC,CAAC,KAAK,CAAC,OAAO;gBAChB,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,eAAe;gBACnC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACnC;SACD,CAAC;QAEF,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC;YAC1B,MAAM,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE;gBACzD,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,OAAO;gBAChC,WAAW,EAAE,SAAS,CAAC,KAAK,CAAC,OAAO;aACpC,CAAC,CAAC;QACJ,CAAC;QAED,OAAO;YACN,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,SAAS;SAChB,CAAC;IACH,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare function sendReaction(ef: IExecuteFunctions): Promise<{
|
|
3
|
+
json: {
|
|
4
|
+
success: boolean;
|
|
5
|
+
data: any;
|
|
6
|
+
};
|
|
7
|
+
error?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
json: {
|
|
10
|
+
success: boolean;
|
|
11
|
+
error: {
|
|
12
|
+
message: string;
|
|
13
|
+
details: any;
|
|
14
|
+
code: any;
|
|
15
|
+
timestamp: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
error: {
|
|
19
|
+
success: boolean;
|
|
20
|
+
error: {
|
|
21
|
+
message: string;
|
|
22
|
+
details: any;
|
|
23
|
+
code: any;
|
|
24
|
+
timestamp: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendReaction = sendReaction;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const evolutionRequest_1 = require("../evolutionRequest");
|
|
6
|
+
async function sendReaction(ef) {
|
|
7
|
+
try {
|
|
8
|
+
const instanceName = ef.getNodeParameter('instanceName', 0);
|
|
9
|
+
const remoteJid = ef.getNodeParameter('remoteJid', 0);
|
|
10
|
+
const messageId = ef.getNodeParameter('messageId', 0);
|
|
11
|
+
const fromMe = ef.getNodeParameter('fromMe', 0);
|
|
12
|
+
const reaction = ef.getNodeParameter('reaction', 0);
|
|
13
|
+
if (!reaction) {
|
|
14
|
+
const errorData = {
|
|
15
|
+
success: false,
|
|
16
|
+
error: {
|
|
17
|
+
message: 'Reação inválida',
|
|
18
|
+
details: 'É necessário fornecer um emoji para a reação',
|
|
19
|
+
code: 'INVALID_REACTION',
|
|
20
|
+
timestamp: new Date().toISOString(),
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
json: errorData,
|
|
25
|
+
error: errorData,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const body = {
|
|
29
|
+
key: {
|
|
30
|
+
remoteJid,
|
|
31
|
+
fromMe,
|
|
32
|
+
id: messageId,
|
|
33
|
+
},
|
|
34
|
+
reaction,
|
|
35
|
+
};
|
|
36
|
+
const requestOptions = {
|
|
37
|
+
method: 'POST',
|
|
38
|
+
headers: {
|
|
39
|
+
'Content-Type': 'application/json',
|
|
40
|
+
},
|
|
41
|
+
uri: `/message/sendReaction/${instanceName}`,
|
|
42
|
+
body,
|
|
43
|
+
json: true,
|
|
44
|
+
};
|
|
45
|
+
const response = await (0, evolutionRequest_1.evolutionRequest)(ef, requestOptions);
|
|
46
|
+
return {
|
|
47
|
+
json: {
|
|
48
|
+
success: true,
|
|
49
|
+
data: response,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
const errorData = {
|
|
55
|
+
success: false,
|
|
56
|
+
error: {
|
|
57
|
+
message: error.message.includes('Could not get parameter')
|
|
58
|
+
? 'Parâmetros inválidos ou ausentes'
|
|
59
|
+
: 'Erro ao enviar reação',
|
|
60
|
+
details: error.message.includes('Could not get parameter')
|
|
61
|
+
? 'Verifique se todos os campos obrigatórios foram preenchidos corretamente'
|
|
62
|
+
: error.message,
|
|
63
|
+
code: error.code || 'UNKNOWN_ERROR',
|
|
64
|
+
timestamp: new Date().toISOString(),
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
if (!ef.continueOnFail()) {
|
|
68
|
+
throw new n8n_workflow_1.NodeOperationError(ef.getNode(), error.message, {
|
|
69
|
+
message: errorData.error.message,
|
|
70
|
+
description: errorData.error.details,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
json: errorData,
|
|
75
|
+
error: errorData,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=sendReaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendReaction.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/execute/messages/sendReaction.ts"],"names":[],"mappings":";;AAQA,oCA+EC;AAvFD,+CAKsB;AACtB,0DAAuD;AAEhD,KAAK,UAAU,YAAY,CAAC,EAAqB;IACvD,IAAI,CAAC;QAEJ,MAAM,YAAY,GAAG,EAAE,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAW,CAAC;QACtE,MAAM,SAAS,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAW,CAAC;QAChE,MAAM,SAAS,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAW,CAAC;QAChE,M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E,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAC;oBACzD,CAAC,CAAC,0EAA0E;oBAC5E,CAAC,CAAC,KAAK,CAAC,OAAO;gBAChB,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,eAAe;gBACnC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACnC;SACD,CAAC;QAEF,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC;YAC1B,MAAM,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE;gBACzD,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,OAAO;gBAChC,WAAW,EAAE,SAAS,CAAC,KAAK,CAAC,OAAO;aACpC,CAAC,CAAC;QACJ,CAAC;QAED,OAAO;YACN,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,SAAS;SAChB,CAAC;IACH,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare function sendSticker(ef: IExecuteFunctions): Promise<{
|
|
3
|
+
json: {
|
|
4
|
+
success: boolean;
|
|
5
|
+
data: any;
|
|
6
|
+
};
|
|
7
|
+
error?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
json: {
|
|
10
|
+
success: boolean;
|
|
11
|
+
error: {
|
|
12
|
+
message: string;
|
|
13
|
+
details: any;
|
|
14
|
+
code: any;
|
|
15
|
+
timestamp: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
error: {
|
|
19
|
+
success: boolean;
|
|
20
|
+
error: {
|
|
21
|
+
message: string;
|
|
22
|
+
details: any;
|
|
23
|
+
code: any;
|
|
24
|
+
timestamp: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendSticker = sendSticker;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const evolutionRequest_1 = require("../evolutionRequest");
|
|
6
|
+
async function sendSticker(ef) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
try {
|
|
9
|
+
const instanceName = ef.getNodeParameter('instanceName', 0);
|
|
10
|
+
const remoteJid = ef.getNodeParameter('remoteJid', 0);
|
|
11
|
+
const sticker = ef.getNodeParameter('stickerUrl', 0);
|
|
12
|
+
if (!sticker) {
|
|
13
|
+
const errorData = {
|
|
14
|
+
success: false,
|
|
15
|
+
error: {
|
|
16
|
+
message: 'URL do sticker é obrigatória',
|
|
17
|
+
details: 'Forneça uma URL válida ou base64 do sticker',
|
|
18
|
+
code: 'MISSING_STICKER',
|
|
19
|
+
timestamp: new Date().toISOString(),
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
json: errorData,
|
|
24
|
+
error: errorData,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const options = ef.getNodeParameter('options_message', 0, {});
|
|
28
|
+
const body = {
|
|
29
|
+
number: remoteJid,
|
|
30
|
+
sticker,
|
|
31
|
+
};
|
|
32
|
+
if (options.delay)
|
|
33
|
+
body.delay = options.delay;
|
|
34
|
+
if ((_b = (_a = options.quoted) === null || _a === void 0 ? void 0 : _a.messageQuoted) === null || _b === void 0 ? void 0 : _b.messageId) {
|
|
35
|
+
body.quoted = {
|
|
36
|
+
key: {
|
|
37
|
+
id: options.quoted.messageQuoted.messageId,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const requestOptions = {
|
|
42
|
+
method: 'POST',
|
|
43
|
+
headers: {
|
|
44
|
+
'Content-Type': 'application/json',
|
|
45
|
+
},
|
|
46
|
+
uri: `/message/sendSticker/${instanceName}`,
|
|
47
|
+
body,
|
|
48
|
+
json: true,
|
|
49
|
+
};
|
|
50
|
+
const response = await (0, evolutionRequest_1.evolutionRequest)(ef, requestOptions);
|
|
51
|
+
return {
|
|
52
|
+
json: {
|
|
53
|
+
success: true,
|
|
54
|
+
data: response,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
const errorData = {
|
|
60
|
+
success: false,
|
|
61
|
+
error: {
|
|
62
|
+
message: error.message.includes('Could not get parameter')
|
|
63
|
+
? 'Parâmetros inválidos ou ausentes'
|
|
64
|
+
: 'Erro ao enviar sticker',
|
|
65
|
+
details: error.message.includes('Could not get parameter')
|
|
66
|
+
? 'Verifique se todos os campos obrigatórios foram preenchidos corretamente'
|
|
67
|
+
: error.message,
|
|
68
|
+
code: error.code || 'UNKNOWN_ERROR',
|
|
69
|
+
timestamp: new Date().toISOString(),
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
if (!ef.continueOnFail()) {
|
|
73
|
+
throw new n8n_workflow_1.NodeOperationError(ef.getNode(), error.message, {
|
|
74
|
+
message: errorData.error.message,
|
|
75
|
+
description: errorData.error.details,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
json: errorData,
|
|
80
|
+
error: errorData,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=sendSticker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendSticker.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/execute/messages/sendSticker.ts"],"names":[],"mappings":";;AAQA,kCA6FC;AArGD,+CAKsB;AACtB,0DAAuD;AAEhD,KAAK,UAAU,WAAW,CAAC,EAAqB;;IACnD,IAAI,CAAC;QAED,MAAM,YAAY,GAAG,EAAE,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAW,CAAC;QACtE,MAAM,SAAS,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAW,CAAC;QA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QAAQ;aACjB;SACJ,CAAC;IACN,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,SAAS,GAAG;YACd,OAAO,EAAE,KAAK;YACd,KAAK,EAAE;gBACH,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAC;oBACtD,CAAC,CAAC,kCAAkC;oBACpC,CAAC,CAAC,wBAAwB;gBAC9B,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAC;oBACtD,CAAC,CAAC,0EAA0E;oBAC5E,CAAC,CAAC,KAAK,CAAC,OAAO;gBACnB,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,eAAe;gBACnC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACtC;SACJ,CAAC;QAEF,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC;YACvB,MAAM,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE;gBACtD,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,OAAO;gBAChC,WAAW,EAAE,SAAS,CAAC,KAAK,CAAC,OAAO;aACvC,CAAC,CAAC;QACP,CAAC;QAED,OAAO;YACH,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,SAAS;SACnB,CAAC;IACN,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare function sendStories(ef: IExecuteFunctions): Promise<{
|
|
3
|
+
json: {
|
|
4
|
+
success: boolean;
|
|
5
|
+
data: any;
|
|
6
|
+
};
|
|
7
|
+
error?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
json: {
|
|
10
|
+
success: boolean;
|
|
11
|
+
error: {
|
|
12
|
+
message: string;
|
|
13
|
+
details: any;
|
|
14
|
+
code: any;
|
|
15
|
+
timestamp: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
error: {
|
|
19
|
+
success: boolean;
|
|
20
|
+
error: {
|
|
21
|
+
message: string;
|
|
22
|
+
details: any;
|
|
23
|
+
code: any;
|
|
24
|
+
timestamp: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendStories = sendStories;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const evolutionRequest_1 = require("../evolutionRequest");
|
|
6
|
+
async function sendStories(ef) {
|
|
7
|
+
try {
|
|
8
|
+
const instanceName = ef.getNodeParameter('instanceName', 0);
|
|
9
|
+
const content = ef.getNodeParameter('content', 0);
|
|
10
|
+
const type = ef.getNodeParameter('type', 0);
|
|
11
|
+
const caption = ef.getNodeParameter('caption', 0, '');
|
|
12
|
+
const allContacts = ef.getNodeParameter('allContacts', 0, false);
|
|
13
|
+
const backgroundColor = ef.getNodeParameter('backgroundColor', 0, '#000000');
|
|
14
|
+
const font = ef.getNodeParameter('font', 0, 1);
|
|
15
|
+
if (type !== 'text' && !content.startsWith('http') && !content.startsWith('data:')) {
|
|
16
|
+
const errorData = {
|
|
17
|
+
success: false,
|
|
18
|
+
error: {
|
|
19
|
+
message: 'Formato de conteúdo inválido',
|
|
20
|
+
details: 'O conteúdo deve ser uma URL válida ou um base64',
|
|
21
|
+
code: 'INVALID_CONTENT_FORMAT',
|
|
22
|
+
timestamp: new Date().toISOString(),
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
json: errorData,
|
|
27
|
+
error: errorData,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const body = {
|
|
31
|
+
type,
|
|
32
|
+
content,
|
|
33
|
+
backgroundColor,
|
|
34
|
+
font,
|
|
35
|
+
allContacts
|
|
36
|
+
};
|
|
37
|
+
if ((type === 'image' || type === 'video') && caption) {
|
|
38
|
+
body.caption = caption;
|
|
39
|
+
}
|
|
40
|
+
if (!allContacts) {
|
|
41
|
+
const statusJidList = ef.getNodeParameter('statusJidList', 0, '');
|
|
42
|
+
if (statusJidList) {
|
|
43
|
+
body.statusJidList = statusJidList.split(',')
|
|
44
|
+
.map(num => num.trim())
|
|
45
|
+
.map(num => num.includes('@s.whatsapp.net') ? num : `${num}@s.whatsapp.net`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const requestOptions = {
|
|
49
|
+
method: 'POST',
|
|
50
|
+
headers: {
|
|
51
|
+
'Content-Type': 'application/json',
|
|
52
|
+
},
|
|
53
|
+
uri: `/message/sendStatus/${instanceName}`,
|
|
54
|
+
body,
|
|
55
|
+
json: true,
|
|
56
|
+
};
|
|
57
|
+
const response = await (0, evolutionRequest_1.evolutionRequest)(ef, requestOptions);
|
|
58
|
+
if (!response) {
|
|
59
|
+
throw new Error('Resposta vazia do servidor');
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
json: {
|
|
63
|
+
success: true,
|
|
64
|
+
data: response,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
const errorData = {
|
|
70
|
+
success: false,
|
|
71
|
+
error: {
|
|
72
|
+
message: error.message.includes('Could not get parameter')
|
|
73
|
+
? 'Parâmetros inválidos ou ausentes'
|
|
74
|
+
: 'Erro ao enviar status',
|
|
75
|
+
details: error.message.includes('Could not get parameter')
|
|
76
|
+
? 'Verifique se todos os campos obrigatórios foram preenchidos corretamente'
|
|
77
|
+
: error.message,
|
|
78
|
+
code: error.code || 'UNKNOWN_ERROR',
|
|
79
|
+
timestamp: new Date().toISOString(),
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
if (!ef.continueOnFail()) {
|
|
83
|
+
throw new n8n_workflow_1.NodeOperationError(ef.getNode(), error.message, {
|
|
84
|
+
message: errorData.error.message,
|
|
85
|
+
description: errorData.error.details,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
json: errorData,
|
|
90
|
+
error: errorData,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=sendStories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendStories.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/execute/messages/sendStories.ts"],"names":[],"mappings":";;AAQA,kCAoGC;AA5GD,+CAKsB;AACtB,0DAAuD;AAEhD,KAAK,UAAU,WAAW,CAAC,EAAqB;IACtD,IAAI,CAAC;QAEJ,MAAM,YAAY,GAAG,EAAE,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAW,CAAC;QACtE,MAAM,OAAO,GAAG,EAAE,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAW,CAAC;QAC5D,MAAM,IAAI,GAAG,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAyC,CAAC;QACpF,MAAM,OAAO,GAAG,EAAE,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAW,CAAC;QAChE,MAAM,WAAW,GAAG,EAAE,CAAC,gBAAgB,CAAC,aAAa,EAAE,CAAC,EAAE,KAAK,CAAY,CAAC;QAC5E,MAAM,eAAe,GAAG,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,EAAE,SAAS,CAAW,CAAC;QACvF,MAAM,IAAI,GAAG,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAW,CAAC;QAGzD,IAAI,IAAI,KAAK,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACpF,MAAM,SAAS,GAAG;gBACjB,OAAO,EAAE,KAAK;gBACd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