n8n-nodes-new-evolution-api 2.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 +347 -0
- package/dist/credentials/EvolutionApiV2Api.credentials.d.ts +9 -0
- package/dist/credentials/EvolutionApiV2Api.credentials.js +50 -0
- package/dist/credentials/EvolutionApiV2Api.credentials.js.map +1 -0
- package/dist/nodes/EvolutionApi/EvolutionApiTrigger.node.d.ts +18 -0
- package/dist/nodes/EvolutionApi/EvolutionApiTrigger.node.js +835 -0
- package/dist/nodes/EvolutionApi/EvolutionApiTrigger.node.js.map +1 -0
- package/dist/nodes/EvolutionApi/EvolutionApiV2.node.d.ts +16 -0
- package/dist/nodes/EvolutionApi/EvolutionApiV2.node.js +65 -0
- package/dist/nodes/EvolutionApi/EvolutionApiV2.node.js.map +1 -0
- package/dist/nodes/EvolutionApi/EvolutionApiV2.node.json +22 -0
- package/dist/nodes/EvolutionApi/evolutionapi.svg +14 -0
- package/dist/nodes/EvolutionApi/execute/business/getCatalog.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/business/getCatalog.js +24 -0
- package/dist/nodes/EvolutionApi/execute/business/getCatalog.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/business/getCollections.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/business/getCollections.js +24 -0
- package/dist/nodes/EvolutionApi/execute/business/getCollections.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/call/offerCall.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/call/offerCall.js +24 -0
- package/dist/nodes/EvolutionApi/execute/call/offerCall.js.map +1 -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/findChatByJid.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/chat/findChatByJid.js +16 -0
- package/dist/nodes/EvolutionApi/execute/chat/findChatByJid.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/community/communityAcceptInvite.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/communityAcceptInvite.js +48 -0
- package/dist/nodes/EvolutionApi/execute/community/communityAcceptInvite.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/communityInviteCode.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/communityInviteCode.js +48 -0
- package/dist/nodes/EvolutionApi/execute/community/communityInviteCode.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/communityInviteInfo.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/communityInviteInfo.js +48 -0
- package/dist/nodes/EvolutionApi/execute/community/communityInviteInfo.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/communityJoinApprovalMode.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/communityJoinApprovalMode.js +50 -0
- package/dist/nodes/EvolutionApi/execute/community/communityJoinApprovalMode.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/communityLinkGroups.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/communityLinkGroups.js +54 -0
- package/dist/nodes/EvolutionApi/execute/community/communityLinkGroups.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/communityMemberAddMode.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/communityMemberAddMode.js +50 -0
- package/dist/nodes/EvolutionApi/execute/community/communityMemberAddMode.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/communityMetadata.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/communityMetadata.js +48 -0
- package/dist/nodes/EvolutionApi/execute/community/communityMetadata.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/communityParticipants.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/communityParticipants.js +45 -0
- package/dist/nodes/EvolutionApi/execute/community/communityParticipants.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/communityRequestParticipantsList.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/communityRequestParticipantsList.js +48 -0
- package/dist/nodes/EvolutionApi/execute/community/communityRequestParticipantsList.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/communityRequestParticipantsUpdate.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/communityRequestParticipantsUpdate.js +56 -0
- package/dist/nodes/EvolutionApi/execute/community/communityRequestParticipantsUpdate.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/communityRevokeInviteCode.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/communityRevokeInviteCode.js +48 -0
- package/dist/nodes/EvolutionApi/execute/community/communityRevokeInviteCode.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/communitySettings.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/communitySettings.js +50 -0
- package/dist/nodes/EvolutionApi/execute/community/communitySettings.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/communityToggleEphemeral.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/communityToggleEphemeral.js +50 -0
- package/dist/nodes/EvolutionApi/execute/community/communityToggleEphemeral.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/communityUnlinkGroups.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/communityUnlinkGroups.js +54 -0
- package/dist/nodes/EvolutionApi/execute/community/communityUnlinkGroups.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/createCommunity.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/createCommunity.js +53 -0
- package/dist/nodes/EvolutionApi/execute/community/createCommunity.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/fetchCommunities.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/fetchCommunities.js +44 -0
- package/dist/nodes/EvolutionApi/execute/community/fetchCommunities.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/leaveCommunity.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/leaveCommunity.js +48 -0
- package/dist/nodes/EvolutionApi/execute/community/leaveCommunity.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/updateCommunityDescription.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/updateCommunityDescription.js +50 -0
- package/dist/nodes/EvolutionApi/execute/community/updateCommunityDescription.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/updateCommunityParticipants.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/updateCommunityParticipants.js +53 -0
- package/dist/nodes/EvolutionApi/execute/community/updateCommunityParticipants.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/community/updateCommunitySubject.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/community/updateCommunitySubject.js +50 -0
- package/dist/nodes/EvolutionApi/execute/community/updateCommunitySubject.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/events/setKafka.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/events/setKafka.js +37 -0
- package/dist/nodes/EvolutionApi/execute/events/setKafka.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/events/setNats.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/events/setNats.js +33 -0
- package/dist/nodes/EvolutionApi/execute/events/setNats.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/setPusher.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/events/setPusher.js +39 -0
- package/dist/nodes/EvolutionApi/execute/events/setPusher.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/setSqs.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/events/setSqs.js +37 -0
- package/dist/nodes/EvolutionApi/execute/events/setSqs.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/events/setWebsocket.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/events/setWebsocket.js +29 -0
- package/dist/nodes/EvolutionApi/execute/events/setWebsocket.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/findGroupInfos.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/groups/findGroupInfos.js +17 -0
- package/dist/nodes/EvolutionApi/execute/groups/findGroupInfos.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/inviteInfo.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/groups/inviteInfo.js +17 -0
- package/dist/nodes/EvolutionApi/execute/groups/inviteInfo.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 +296 -0
- package/dist/nodes/EvolutionApi/execute/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/instance/connectionState.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/instance/connectionState.js +12 -0
- package/dist/nodes/EvolutionApi/execute/instance/connectionState.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/fetchProxy.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/instance/fetchProxy.js +12 -0
- package/dist/nodes/EvolutionApi/execute/instance/fetchProxy.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/setEvoai.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setEvoai.js +106 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setEvoai.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/setN8nBot.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setN8nBot.js +100 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setN8nBot.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setOpenai.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setOpenai.js +148 -0
- package/dist/nodes/EvolutionApi/execute/integrations/setOpenai.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/labels/fetchLabels.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/labels/fetchLabels.js +44 -0
- package/dist/nodes/EvolutionApi/execute/labels/fetchLabels.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/labels/handleLabel.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/labels/handleLabel.js +52 -0
- package/dist/nodes/EvolutionApi/execute/labels/handleLabel.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/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 +2 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendLocation.js +47 -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/sendPtv.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendPtv.js +41 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendPtv.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 +2 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendSticker.js +41 -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/sendTemplate.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendTemplate.js +38 -0
- package/dist/nodes/EvolutionApi/execute/messages/sendTemplate.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/newsletter/createNewsletter.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/createNewsletter.js +57 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/createNewsletter.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/deleteNewsletter.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/deleteNewsletter.js +48 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/deleteNewsletter.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/fetchNewsletterMessages.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/fetchNewsletterMessages.js +58 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/fetchNewsletterMessages.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/fetchNewsletters.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/fetchNewsletters.js +44 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/fetchNewsletters.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/followNewsletter.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/followNewsletter.js +48 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/followNewsletter.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/muteNewsletter.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/muteNewsletter.js +48 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/muteNewsletter.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/newsletterInviteInfo.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/newsletterInviteInfo.js +14 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/newsletterInviteInfo.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/newsletterMetadata.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/newsletterMetadata.js +56 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/newsletterMetadata.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/newsletterReactionMode.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/newsletterReactionMode.js +50 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/newsletterReactionMode.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/reactNewsletterMessage.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/reactNewsletterMessage.js +52 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/reactNewsletterMessage.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/removeNewsletterPicture.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/removeNewsletterPicture.js +48 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/removeNewsletterPicture.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/repostNewsletterMessage.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/repostNewsletterMessage.js +355 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/repostNewsletterMessage.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/sendNewsletterMedia.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/sendNewsletterMedia.js +68 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/sendNewsletterMedia.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/sendNewsletterPoll.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/sendNewsletterPoll.js +39 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/sendNewsletterPoll.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/sendNewsletterQuestion.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/sendNewsletterQuestion.js +22 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/sendNewsletterQuestion.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/sendNewsletterText.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/sendNewsletterText.js +20 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/sendNewsletterText.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/unfollowNewsletter.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/unfollowNewsletter.js +48 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/unfollowNewsletter.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/unmuteNewsletter.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/unmuteNewsletter.js +48 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/unmuteNewsletter.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/updateNewsletterDescription.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/updateNewsletterDescription.js +50 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/updateNewsletterDescription.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/updateNewsletterName.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/updateNewsletterName.js +50 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/updateNewsletterName.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/updateNewsletterPicture.d.ts +27 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/updateNewsletterPicture.js +50 -0
- package/dist/nodes/EvolutionApi/execute/newsletter/updateNewsletterPicture.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/execute/s3/getMedia.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/s3/getMedia.js +19 -0
- package/dist/nodes/EvolutionApi/execute/s3/getMedia.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/s3/getMediaUrl.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/s3/getMediaUrl.js +19 -0
- package/dist/nodes/EvolutionApi/execute/s3/getMediaUrl.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/templates/createTemplate.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/templates/createTemplate.js +23 -0
- package/dist/nodes/EvolutionApi/execute/templates/createTemplate.js.map +1 -0
- package/dist/nodes/EvolutionApi/execute/templates/fetchTemplates.d.ts +2 -0
- package/dist/nodes/EvolutionApi/execute/templates/fetchTemplates.js +12 -0
- package/dist/nodes/EvolutionApi/execute/templates/fetchTemplates.js.map +1 -0
- package/dist/nodes/EvolutionApi/loadOptions.d.ts +7 -0
- package/dist/nodes/EvolutionApi/loadOptions.js +264 -0
- package/dist/nodes/EvolutionApi/loadOptions.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/ai-integrations.fields.d.ts +4 -0
- package/dist/nodes/EvolutionApi/properties/ai-integrations.fields.js +608 -0
- package/dist/nodes/EvolutionApi/properties/ai-integrations.fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/business.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/business.fields.js +126 -0
- package/dist/nodes/EvolutionApi/properties/business.fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/business.operations.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/business.operations.js +30 -0
- package/dist/nodes/EvolutionApi/properties/business.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/call.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/call.fields.js +63 -0
- package/dist/nodes/EvolutionApi/properties/call.fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/call.operations.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/call.operations.js +24 -0
- package/dist/nodes/EvolutionApi/properties/call.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/chat.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/chat.fields.js +622 -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 +108 -0
- package/dist/nodes/EvolutionApi/properties/chat.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/community.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/community.fields.js +475 -0
- package/dist/nodes/EvolutionApi/properties/community.fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/community.operations.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/community.operations.js +138 -0
- package/dist/nodes/EvolutionApi/properties/community.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/events.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/events.fields.js +938 -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 +60 -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 +798 -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 +114 -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 +132 -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 +982 -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 +84 -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 +1782 -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 +66 -0
- package/dist/nodes/EvolutionApi/properties/integrations.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/labels.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/labels.fields.js +55 -0
- package/dist/nodes/EvolutionApi/properties/labels.fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/labels.operations.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/labels.operations.js +30 -0
- package/dist/nodes/EvolutionApi/properties/labels.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/messages.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/messages.fields.js +2199 -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 +114 -0
- package/dist/nodes/EvolutionApi/properties/messages.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/newsletter.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/newsletter.fields.js +1050 -0
- package/dist/nodes/EvolutionApi/properties/newsletter.fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/newsletter.operations.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/newsletter.operations.js +144 -0
- package/dist/nodes/EvolutionApi/properties/newsletter.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/profile.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/profile.fields.js +257 -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/EvolutionApi/properties/s3.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/s3.fields.js +64 -0
- package/dist/nodes/EvolutionApi/properties/s3.fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/s3.operations.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/s3.operations.js +30 -0
- package/dist/nodes/EvolutionApi/properties/s3.operations.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/templates.fields.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/templates.fields.js +95 -0
- package/dist/nodes/EvolutionApi/properties/templates.fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/properties/templates.operations.d.ts +2 -0
- package/dist/nodes/EvolutionApi/properties/templates.operations.js +30 -0
- package/dist/nodes/EvolutionApi/properties/templates.operations.js.map +1 -0
- package/dist/package.json +69 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/index.js +0 -0
- package/package.json +69 -0
|
@@ -0,0 +1,835 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EvolutionApiTrigger = void 0;
|
|
4
|
+
const loadOptions_1 = require("./loadOptions");
|
|
5
|
+
const messageDedupeCache = new Map();
|
|
6
|
+
const DEDUPE_TTL_MS = 30000;
|
|
7
|
+
function cleanDedupeCache() {
|
|
8
|
+
const now = Date.now();
|
|
9
|
+
for (const [key, timestamp] of messageDedupeCache.entries()) {
|
|
10
|
+
if (now - timestamp > DEDUPE_TTL_MS) {
|
|
11
|
+
messageDedupeCache.delete(key);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
setInterval(cleanDedupeCache, 60000);
|
|
16
|
+
class EvolutionApiTrigger {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.description = {
|
|
19
|
+
displayName: 'New Evolution API Trigger',
|
|
20
|
+
name: 'evolutionApiV2Trigger',
|
|
21
|
+
icon: 'file:evolutionapi.svg',
|
|
22
|
+
group: ['trigger'],
|
|
23
|
+
version: 1,
|
|
24
|
+
subtitle: '={{$parameter["events"].join(", ")}}',
|
|
25
|
+
description: 'Recebe eventos em tempo real da Evolution API (WhatsApp)',
|
|
26
|
+
defaults: {
|
|
27
|
+
name: 'New Evolution API Trigger',
|
|
28
|
+
},
|
|
29
|
+
inputs: [],
|
|
30
|
+
outputs: ["main"],
|
|
31
|
+
credentials: [
|
|
32
|
+
{
|
|
33
|
+
name: 'evolutionApiV2Api',
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
webhooks: [
|
|
38
|
+
{
|
|
39
|
+
name: 'default',
|
|
40
|
+
httpMethod: 'POST',
|
|
41
|
+
responseMode: 'onReceived',
|
|
42
|
+
path: '={{$parameter["path"]}}',
|
|
43
|
+
isFullPath: true,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
properties: [
|
|
47
|
+
{
|
|
48
|
+
displayName: 'Path',
|
|
49
|
+
name: 'path',
|
|
50
|
+
type: 'string',
|
|
51
|
+
default: 'webhook-evolution',
|
|
52
|
+
placeholder: 'webhook-evolution',
|
|
53
|
+
required: true,
|
|
54
|
+
description: 'Caminho do webhook (ex: webhook-evolution). A URL completa será exibida após salvar.',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
displayName: 'Instance Name or ID',
|
|
58
|
+
name: 'instanceName',
|
|
59
|
+
type: 'options',
|
|
60
|
+
typeOptions: {
|
|
61
|
+
loadOptionsMethod: 'getInstances',
|
|
62
|
+
},
|
|
63
|
+
default: '',
|
|
64
|
+
required: true,
|
|
65
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
displayName: 'Events',
|
|
69
|
+
name: 'events',
|
|
70
|
+
type: 'multiOptions',
|
|
71
|
+
default: ['MESSAGES_UPSERT'],
|
|
72
|
+
required: true,
|
|
73
|
+
description: 'Eventos para escutar',
|
|
74
|
+
options: [
|
|
75
|
+
{
|
|
76
|
+
name: 'Call (Chamada)',
|
|
77
|
+
value: 'CALL',
|
|
78
|
+
description: 'Chamadas recebidas',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'Chats Delete',
|
|
82
|
+
value: 'CHATS_DELETE',
|
|
83
|
+
description: 'Chat deletado',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'Chats Set',
|
|
87
|
+
value: 'CHATS_SET',
|
|
88
|
+
description: 'Chats sincronizados',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'Chats Update',
|
|
92
|
+
value: 'CHATS_UPDATE',
|
|
93
|
+
description: 'Chat atualizado',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'Chats Upsert',
|
|
97
|
+
value: 'CHATS_UPSERT',
|
|
98
|
+
description: 'Chat criado ou atualizado',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'Connection Update',
|
|
102
|
+
value: 'CONNECTION_UPDATE',
|
|
103
|
+
description: 'Status da conexão alterado',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'Contacts Set',
|
|
107
|
+
value: 'CONTACTS_SET',
|
|
108
|
+
description: 'Contatos sincronizados',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'Contacts Update',
|
|
112
|
+
value: 'CONTACTS_UPDATE',
|
|
113
|
+
description: 'Contato atualizado',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'Contacts Upsert',
|
|
117
|
+
value: 'CONTACTS_UPSERT',
|
|
118
|
+
description: 'Contato criado ou atualizado',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'Groups Update',
|
|
122
|
+
value: 'GROUPS_UPDATE',
|
|
123
|
+
description: 'Grupo atualizado',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'Groups Upsert',
|
|
127
|
+
value: 'GROUPS_UPSERT',
|
|
128
|
+
description: 'Grupo criado ou atualizado',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: 'Labels Association',
|
|
132
|
+
value: 'LABELS_ASSOCIATION',
|
|
133
|
+
description: 'Etiqueta associada',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: 'Labels Edit',
|
|
137
|
+
value: 'LABELS_EDIT',
|
|
138
|
+
description: 'Etiqueta editada',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: 'Messages Delete',
|
|
142
|
+
value: 'MESSAGES_DELETE',
|
|
143
|
+
description: 'Mensagem deletada',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: 'Messages Set',
|
|
147
|
+
value: 'MESSAGES_SET',
|
|
148
|
+
description: 'Mensagens sincronizadas',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: 'Messages Update',
|
|
152
|
+
value: 'MESSAGES_UPDATE',
|
|
153
|
+
description: 'Mensagem atualizada (status de leitura, etc)',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: 'Messages Upsert',
|
|
157
|
+
value: 'MESSAGES_UPSERT',
|
|
158
|
+
description: 'Nova mensagem recebida ou enviada',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: 'Newsletter Message',
|
|
162
|
+
value: 'NEWSLETTER_MESSAGE',
|
|
163
|
+
description: 'Mensagem de canal/newsletter recebida (novo!)',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'Presence Update',
|
|
167
|
+
value: 'PRESENCE_UPDATE',
|
|
168
|
+
description: 'Status de presença (online, digitando)',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: 'QR Code Updated',
|
|
172
|
+
value: 'QRCODE_UPDATED',
|
|
173
|
+
description: 'QR Code atualizado',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: 'Send Message',
|
|
177
|
+
value: 'SEND_MESSAGE',
|
|
178
|
+
description: 'Mensagem enviada pela API',
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: 'Typebot Change Status',
|
|
182
|
+
value: 'TYPEBOT_CHANGE_STATUS',
|
|
183
|
+
description: 'Status do Typebot alterado',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: 'Typebot Start',
|
|
187
|
+
value: 'TYPEBOT_START',
|
|
188
|
+
description: 'Typebot iniciado',
|
|
189
|
+
},
|
|
190
|
+
],
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
displayName: 'Options',
|
|
194
|
+
name: 'options',
|
|
195
|
+
type: 'collection',
|
|
196
|
+
placeholder: 'Add Option',
|
|
197
|
+
default: {},
|
|
198
|
+
options: [
|
|
199
|
+
{
|
|
200
|
+
displayName: 'Ignore From Me',
|
|
201
|
+
name: 'ignoreFromMe',
|
|
202
|
+
type: 'boolean',
|
|
203
|
+
default: false,
|
|
204
|
+
description: 'Whether to ignore messages sent by yourself (fromMe: true). Useful to prevent loops when reposting.',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
displayName: 'Ignore Newsletters I Own',
|
|
208
|
+
name: 'ignoreOwnNewsletters',
|
|
209
|
+
type: 'boolean',
|
|
210
|
+
default: true,
|
|
211
|
+
description: 'Whether to ignore messages from newsletters where you are the owner/admin. Prevents loops when reposting.',
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
displayName: 'Optimized Payload',
|
|
215
|
+
name: 'optimizedPayload',
|
|
216
|
+
type: 'boolean',
|
|
217
|
+
default: true,
|
|
218
|
+
description: 'Whether to remove raw data to reduce payload size (recommended). Keeps only processed fields.',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
displayName: 'Webhook Base64',
|
|
222
|
+
name: 'webhookBase64',
|
|
223
|
+
type: 'boolean',
|
|
224
|
+
default: false,
|
|
225
|
+
description: 'Whether to include media as base64 in the webhook payload',
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
displayName: 'Webhook by Events',
|
|
229
|
+
name: 'webhookByEvents',
|
|
230
|
+
type: 'boolean',
|
|
231
|
+
default: false,
|
|
232
|
+
description: 'Whether to send each event to a separate webhook URL',
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
};
|
|
238
|
+
this.methods = {
|
|
239
|
+
loadOptions: {
|
|
240
|
+
getInstances: loadOptions_1.getInstances,
|
|
241
|
+
},
|
|
242
|
+
};
|
|
243
|
+
this.webhookMethods = {
|
|
244
|
+
default: {
|
|
245
|
+
async checkExists() {
|
|
246
|
+
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
247
|
+
const instanceName = this.getNodeParameter('instanceName');
|
|
248
|
+
const credentials = await this.getCredentials('evolutionApiV2Api');
|
|
249
|
+
try {
|
|
250
|
+
const response = await this.helpers.httpRequest({
|
|
251
|
+
method: 'GET',
|
|
252
|
+
url: `${credentials.serverUrl}/webhook/find/${instanceName}`,
|
|
253
|
+
headers: {
|
|
254
|
+
apikey: credentials.apiKey,
|
|
255
|
+
},
|
|
256
|
+
json: true,
|
|
257
|
+
});
|
|
258
|
+
if (response && response.webhook && response.webhook.url === webhookUrl) {
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
catch (error) {
|
|
263
|
+
}
|
|
264
|
+
return false;
|
|
265
|
+
},
|
|
266
|
+
async create() {
|
|
267
|
+
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
268
|
+
const instanceName = this.getNodeParameter('instanceName');
|
|
269
|
+
const events = this.getNodeParameter('events');
|
|
270
|
+
const options = this.getNodeParameter('options');
|
|
271
|
+
const credentials = await this.getCredentials('evolutionApiV2Api');
|
|
272
|
+
const body = {
|
|
273
|
+
webhook: {
|
|
274
|
+
enabled: true,
|
|
275
|
+
url: webhookUrl,
|
|
276
|
+
webhookByEvents: options.webhookByEvents || false,
|
|
277
|
+
webhookBase64: options.webhookBase64 || false,
|
|
278
|
+
events,
|
|
279
|
+
},
|
|
280
|
+
};
|
|
281
|
+
try {
|
|
282
|
+
await this.helpers.httpRequest({
|
|
283
|
+
method: 'POST',
|
|
284
|
+
url: `${credentials.serverUrl}/webhook/set/${instanceName}`,
|
|
285
|
+
headers: {
|
|
286
|
+
apikey: credentials.apiKey,
|
|
287
|
+
'Content-Type': 'application/json',
|
|
288
|
+
},
|
|
289
|
+
body,
|
|
290
|
+
json: true,
|
|
291
|
+
});
|
|
292
|
+
return true;
|
|
293
|
+
}
|
|
294
|
+
catch (error) {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
async delete() {
|
|
299
|
+
const instanceName = this.getNodeParameter('instanceName');
|
|
300
|
+
const credentials = await this.getCredentials('evolutionApiV2Api');
|
|
301
|
+
try {
|
|
302
|
+
await this.helpers.httpRequest({
|
|
303
|
+
method: 'POST',
|
|
304
|
+
url: `${credentials.serverUrl}/webhook/set/${instanceName}`,
|
|
305
|
+
headers: {
|
|
306
|
+
apikey: credentials.apiKey,
|
|
307
|
+
'Content-Type': 'application/json',
|
|
308
|
+
},
|
|
309
|
+
body: {
|
|
310
|
+
webhook: {
|
|
311
|
+
enabled: false,
|
|
312
|
+
url: '',
|
|
313
|
+
events: [],
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
json: true,
|
|
317
|
+
});
|
|
318
|
+
return true;
|
|
319
|
+
}
|
|
320
|
+
catch (error) {
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
async webhook() {
|
|
328
|
+
const req = this.getRequestObject();
|
|
329
|
+
const res = this.getResponseObject();
|
|
330
|
+
const body = req.body;
|
|
331
|
+
const options = this.getNodeParameter('options', {});
|
|
332
|
+
const optimizedPayload = options.optimizedPayload !== false;
|
|
333
|
+
const ignoreFromMe = options.ignoreFromMe === true;
|
|
334
|
+
const ignoreOwnNewsletters = options.ignoreOwnNewsletters !== false;
|
|
335
|
+
const event = body.event;
|
|
336
|
+
const instance = body.instance;
|
|
337
|
+
const data = body.data;
|
|
338
|
+
if (data) {
|
|
339
|
+
const key = data.key;
|
|
340
|
+
if (key && key.id) {
|
|
341
|
+
const dedupeKey = `${instance}_${key.id}`;
|
|
342
|
+
if (messageDedupeCache.has(dedupeKey)) {
|
|
343
|
+
res.status(200).json({ ignored: true, reason: 'duplicate message' });
|
|
344
|
+
return { noWebhookResponse: true };
|
|
345
|
+
}
|
|
346
|
+
messageDedupeCache.set(dedupeKey, Date.now());
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
if (data) {
|
|
350
|
+
const key = data.key;
|
|
351
|
+
if (key) {
|
|
352
|
+
const isFromMe = key.fromMe === true || key.fromMe === 'true' || key.fromMe === 1;
|
|
353
|
+
const jid = key.remoteJid || '';
|
|
354
|
+
if (ignoreFromMe && isFromMe) {
|
|
355
|
+
res.status(200).json({ ignored: true, reason: 'fromMe filter' });
|
|
356
|
+
return { noWebhookResponse: true };
|
|
357
|
+
}
|
|
358
|
+
if (ignoreOwnNewsletters && jid.includes('@newsletter') && isFromMe) {
|
|
359
|
+
res.status(200).json({ ignored: true, reason: 'ownNewsletter filter' });
|
|
360
|
+
return { noWebhookResponse: true };
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
const processedData = processMessageData(data, event);
|
|
365
|
+
const returnData = {
|
|
366
|
+
event,
|
|
367
|
+
instance,
|
|
368
|
+
...(optimizedPayload ? {} : { data }),
|
|
369
|
+
...processedData,
|
|
370
|
+
receivedAt: new Date().toISOString(),
|
|
371
|
+
...(body.sender && { sender: body.sender }),
|
|
372
|
+
...(body.server_url && { serverUrl: body.server_url }),
|
|
373
|
+
...(body.date_time && { dateTime: body.date_time }),
|
|
374
|
+
...(body.apikey && { apikey: body.apikey }),
|
|
375
|
+
};
|
|
376
|
+
return {
|
|
377
|
+
workflowData: [this.helpers.returnJsonArray([returnData])],
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
exports.EvolutionApiTrigger = EvolutionApiTrigger;
|
|
382
|
+
function processMessageData(data, event) {
|
|
383
|
+
const processed = {};
|
|
384
|
+
if (!data)
|
|
385
|
+
return processed;
|
|
386
|
+
const key = data.key;
|
|
387
|
+
const message = data.message;
|
|
388
|
+
if (key) {
|
|
389
|
+
processed.messageId = key.id;
|
|
390
|
+
processed.remoteJid = key.remoteJid;
|
|
391
|
+
processed.fromMe = key.fromMe;
|
|
392
|
+
processed.participant = key.participant;
|
|
393
|
+
const jid = key.remoteJid;
|
|
394
|
+
if (jid) {
|
|
395
|
+
if (jid.includes('@g.us')) {
|
|
396
|
+
processed.chatType = 'group';
|
|
397
|
+
}
|
|
398
|
+
else if (jid.includes('@newsletter')) {
|
|
399
|
+
processed.chatType = 'newsletter';
|
|
400
|
+
}
|
|
401
|
+
else if (jid.includes('@s.whatsapp.net')) {
|
|
402
|
+
processed.chatType = 'private';
|
|
403
|
+
}
|
|
404
|
+
else {
|
|
405
|
+
processed.chatType = 'unknown';
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
if (data.pushName) {
|
|
410
|
+
processed.senderName = data.pushName;
|
|
411
|
+
}
|
|
412
|
+
if (data.messageTimestamp) {
|
|
413
|
+
processed.timestamp = data.messageTimestamp;
|
|
414
|
+
processed.dateTime = new Date(Number(data.messageTimestamp) * 1000).toISOString();
|
|
415
|
+
}
|
|
416
|
+
if (data.messageType) {
|
|
417
|
+
processed.messageType = data.messageType;
|
|
418
|
+
}
|
|
419
|
+
if (!message)
|
|
420
|
+
return processed;
|
|
421
|
+
if (message.conversation) {
|
|
422
|
+
processed.text = message.conversation;
|
|
423
|
+
processed.hasText = true;
|
|
424
|
+
}
|
|
425
|
+
if (message.extendedTextMessage) {
|
|
426
|
+
const extMsg = message.extendedTextMessage;
|
|
427
|
+
processed.text = extMsg.text;
|
|
428
|
+
processed.hasText = true;
|
|
429
|
+
if (extMsg.matchedText || extMsg.canonicalUrl || extMsg.title) {
|
|
430
|
+
processed.hasLinkPreview = true;
|
|
431
|
+
processed.linkPreviewUrl = extMsg.matchedText || extMsg.canonicalUrl;
|
|
432
|
+
processed.linkPreviewTitle = extMsg.title;
|
|
433
|
+
processed.linkPreviewDescription = extMsg.description;
|
|
434
|
+
if (extMsg.jpegThumbnail) {
|
|
435
|
+
processed.linkPreviewThumbnail = convertThumbnailToBase64(extMsg.jpegThumbnail);
|
|
436
|
+
}
|
|
437
|
+
if (extMsg.thumbnailDirectPath) {
|
|
438
|
+
processed.linkPreviewThumbnailDirectPath = extMsg.thumbnailDirectPath;
|
|
439
|
+
}
|
|
440
|
+
if (extMsg.mediaKey) {
|
|
441
|
+
processed.linkPreviewMediaKey = convertThumbnailToBase64(extMsg.mediaKey);
|
|
442
|
+
}
|
|
443
|
+
if (extMsg.thumbnailWidth) {
|
|
444
|
+
processed.linkPreviewThumbnailWidth = extMsg.thumbnailWidth;
|
|
445
|
+
}
|
|
446
|
+
if (extMsg.thumbnailHeight) {
|
|
447
|
+
processed.linkPreviewThumbnailHeight = extMsg.thumbnailHeight;
|
|
448
|
+
}
|
|
449
|
+
if (extMsg.thumbnailSha256) {
|
|
450
|
+
processed.linkPreviewThumbnailSha256 = convertThumbnailToBase64(extMsg.thumbnailSha256);
|
|
451
|
+
}
|
|
452
|
+
if (extMsg.thumbnailEncSha256) {
|
|
453
|
+
processed.linkPreviewThumbnailEncSha256 = convertThumbnailToBase64(extMsg.thumbnailEncSha256);
|
|
454
|
+
}
|
|
455
|
+
if (extMsg.mediaKeyTimestamp) {
|
|
456
|
+
processed.linkPreviewMediaKeyTimestamp = extMsg.mediaKeyTimestamp;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
if (extMsg.contextInfo) {
|
|
460
|
+
const ctx = extMsg.contextInfo;
|
|
461
|
+
if (ctx.quotedMessage) {
|
|
462
|
+
processed.quotedMessage = ctx.quotedMessage;
|
|
463
|
+
processed.quotedMessageId = ctx.stanzaId;
|
|
464
|
+
processed.hasQuotedMessage = true;
|
|
465
|
+
}
|
|
466
|
+
if (ctx.mentionedJid) {
|
|
467
|
+
processed.mentionedJids = ctx.mentionedJid;
|
|
468
|
+
processed.hasMentions = true;
|
|
469
|
+
}
|
|
470
|
+
if (!processed.linkPreviewMediaKey && ctx.mediaKey) {
|
|
471
|
+
processed.linkPreviewMediaKey = convertThumbnailToBase64(ctx.mediaKey);
|
|
472
|
+
}
|
|
473
|
+
if (!processed.linkPreviewThumbnailDirectPath && ctx.thumbnailDirectPath) {
|
|
474
|
+
processed.linkPreviewThumbnailDirectPath = ctx.thumbnailDirectPath;
|
|
475
|
+
}
|
|
476
|
+
if (!processed.linkPreviewThumbnailWidth && ctx.thumbnailWidth) {
|
|
477
|
+
processed.linkPreviewThumbnailWidth = ctx.thumbnailWidth;
|
|
478
|
+
}
|
|
479
|
+
if (!processed.linkPreviewThumbnailHeight && ctx.thumbnailHeight) {
|
|
480
|
+
processed.linkPreviewThumbnailHeight = ctx.thumbnailHeight;
|
|
481
|
+
}
|
|
482
|
+
if (!processed.linkPreviewThumbnailSha256 && ctx.thumbnailSha256) {
|
|
483
|
+
processed.linkPreviewThumbnailSha256 = convertThumbnailToBase64(ctx.thumbnailSha256);
|
|
484
|
+
}
|
|
485
|
+
if (!processed.linkPreviewThumbnailEncSha256 && ctx.thumbnailEncSha256) {
|
|
486
|
+
processed.linkPreviewThumbnailEncSha256 = convertThumbnailToBase64(ctx.thumbnailEncSha256);
|
|
487
|
+
}
|
|
488
|
+
if (!processed.linkPreviewMediaKeyTimestamp && ctx.mediaKeyTimestamp) {
|
|
489
|
+
processed.linkPreviewMediaKeyTimestamp = ctx.mediaKeyTimestamp;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
if (message.linkPreview) {
|
|
494
|
+
const linkPreview = message.linkPreview;
|
|
495
|
+
processed.hasLinkPreview = true;
|
|
496
|
+
processed.linkPreviewUrl = linkPreview.url;
|
|
497
|
+
processed.linkPreviewTitle = linkPreview.title;
|
|
498
|
+
processed.linkPreviewDescription = linkPreview.description;
|
|
499
|
+
if (linkPreview.thumbnail) {
|
|
500
|
+
const thumb = linkPreview.thumbnail;
|
|
501
|
+
processed.linkPreviewThumbnail = thumb.startsWith('data:') ? thumb : `data:image/jpeg;base64,${thumb}`;
|
|
502
|
+
}
|
|
503
|
+
if (linkPreview.thumbnailDirectPath) {
|
|
504
|
+
processed.linkPreviewThumbnailDirectPath = linkPreview.thumbnailDirectPath;
|
|
505
|
+
}
|
|
506
|
+
if (linkPreview.mediaKey) {
|
|
507
|
+
processed.linkPreviewMediaKey = linkPreview.mediaKey;
|
|
508
|
+
}
|
|
509
|
+
if (linkPreview.thumbnailWidth) {
|
|
510
|
+
processed.linkPreviewThumbnailWidth = linkPreview.thumbnailWidth;
|
|
511
|
+
}
|
|
512
|
+
if (linkPreview.thumbnailHeight) {
|
|
513
|
+
processed.linkPreviewThumbnailHeight = linkPreview.thumbnailHeight;
|
|
514
|
+
}
|
|
515
|
+
if (linkPreview.thumbnailSha256) {
|
|
516
|
+
processed.linkPreviewThumbnailSha256 = linkPreview.thumbnailSha256;
|
|
517
|
+
}
|
|
518
|
+
if (linkPreview.thumbnailEncSha256) {
|
|
519
|
+
processed.linkPreviewThumbnailEncSha256 = linkPreview.thumbnailEncSha256;
|
|
520
|
+
}
|
|
521
|
+
if (linkPreview.mediaKeyTimestamp) {
|
|
522
|
+
processed.linkPreviewMediaKeyTimestamp = linkPreview.mediaKeyTimestamp;
|
|
523
|
+
}
|
|
524
|
+
if (linkPreview.imageS3Url) {
|
|
525
|
+
processed.linkPreviewImageS3Url = linkPreview.imageS3Url;
|
|
526
|
+
}
|
|
527
|
+
if (linkPreview.imageS3Key) {
|
|
528
|
+
processed.linkPreviewImageS3Key = linkPreview.imageS3Key;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
if (message.imageMessage) {
|
|
532
|
+
const img = message.imageMessage;
|
|
533
|
+
processed.hasMedia = true;
|
|
534
|
+
processed.mediaType = 'image';
|
|
535
|
+
processed.caption = img.caption || '';
|
|
536
|
+
processed.mimetype = img.mimetype;
|
|
537
|
+
processed.mediaUrl = img.url;
|
|
538
|
+
processed.mediaWidth = img.width;
|
|
539
|
+
processed.mediaHeight = img.height;
|
|
540
|
+
if (img.fileLength) {
|
|
541
|
+
processed.mediaFileLength = typeof img.fileLength === 'object'
|
|
542
|
+
? img.fileLength.low
|
|
543
|
+
: img.fileLength;
|
|
544
|
+
}
|
|
545
|
+
if (img.jpegThumbnail) {
|
|
546
|
+
processed.thumbnail = convertThumbnailToBase64(img.jpegThumbnail);
|
|
547
|
+
processed.hasThumbnail = true;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
if (message.videoMessage) {
|
|
551
|
+
const vid = message.videoMessage;
|
|
552
|
+
processed.hasMedia = true;
|
|
553
|
+
processed.mediaType = 'video';
|
|
554
|
+
processed.caption = vid.caption || '';
|
|
555
|
+
processed.mimetype = vid.mimetype;
|
|
556
|
+
processed.mediaUrl = vid.url;
|
|
557
|
+
processed.mediaWidth = vid.width;
|
|
558
|
+
processed.mediaHeight = vid.height;
|
|
559
|
+
processed.mediaDuration = vid.seconds;
|
|
560
|
+
processed.isGif = vid.gifPlayback || false;
|
|
561
|
+
if (vid.fileLength) {
|
|
562
|
+
processed.mediaFileLength = typeof vid.fileLength === 'object'
|
|
563
|
+
? vid.fileLength.low
|
|
564
|
+
: vid.fileLength;
|
|
565
|
+
}
|
|
566
|
+
if (vid.jpegThumbnail) {
|
|
567
|
+
processed.thumbnail = convertThumbnailToBase64(vid.jpegThumbnail);
|
|
568
|
+
processed.hasThumbnail = true;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
if (message.audioMessage) {
|
|
572
|
+
const aud = message.audioMessage;
|
|
573
|
+
processed.hasMedia = true;
|
|
574
|
+
processed.mediaType = 'audio';
|
|
575
|
+
processed.mimetype = aud.mimetype;
|
|
576
|
+
processed.mediaUrl = aud.url;
|
|
577
|
+
processed.mediaDuration = aud.seconds;
|
|
578
|
+
processed.isVoiceNote = aud.ptt || false;
|
|
579
|
+
if (aud.fileLength) {
|
|
580
|
+
processed.mediaFileLength = typeof aud.fileLength === 'object'
|
|
581
|
+
? aud.fileLength.low
|
|
582
|
+
: aud.fileLength;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
if (message.documentMessage) {
|
|
586
|
+
const doc = message.documentMessage;
|
|
587
|
+
processed.hasMedia = true;
|
|
588
|
+
processed.mediaType = 'document';
|
|
589
|
+
processed.caption = doc.caption || '';
|
|
590
|
+
processed.fileName = doc.fileName;
|
|
591
|
+
processed.mimetype = doc.mimetype;
|
|
592
|
+
processed.mediaUrl = doc.url;
|
|
593
|
+
processed.pageCount = doc.pageCount;
|
|
594
|
+
if (doc.fileLength) {
|
|
595
|
+
processed.mediaFileLength = typeof doc.fileLength === 'object'
|
|
596
|
+
? doc.fileLength.low
|
|
597
|
+
: doc.fileLength;
|
|
598
|
+
}
|
|
599
|
+
if (doc.jpegThumbnail) {
|
|
600
|
+
processed.thumbnail = convertThumbnailToBase64(doc.jpegThumbnail);
|
|
601
|
+
processed.hasThumbnail = true;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
if (message.stickerMessage) {
|
|
605
|
+
const stk = message.stickerMessage;
|
|
606
|
+
processed.hasMedia = true;
|
|
607
|
+
processed.mediaType = 'sticker';
|
|
608
|
+
processed.mimetype = stk.mimetype;
|
|
609
|
+
processed.mediaUrl = stk.url;
|
|
610
|
+
processed.mediaWidth = stk.width;
|
|
611
|
+
processed.mediaHeight = stk.height;
|
|
612
|
+
processed.isAnimated = stk.isAnimated || false;
|
|
613
|
+
if (stk.fileLength) {
|
|
614
|
+
processed.mediaFileLength = typeof stk.fileLength === 'object'
|
|
615
|
+
? stk.fileLength.low
|
|
616
|
+
: stk.fileLength;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
if (message.locationMessage) {
|
|
620
|
+
const loc = message.locationMessage;
|
|
621
|
+
processed.hasLocation = true;
|
|
622
|
+
processed.latitude = loc.degreesLatitude;
|
|
623
|
+
processed.longitude = loc.degreesLongitude;
|
|
624
|
+
processed.locationName = loc.name;
|
|
625
|
+
processed.locationAddress = loc.address;
|
|
626
|
+
processed.locationUrl = loc.url;
|
|
627
|
+
if (loc.jpegThumbnail) {
|
|
628
|
+
processed.thumbnail = convertThumbnailToBase64(loc.jpegThumbnail);
|
|
629
|
+
processed.hasThumbnail = true;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
if (message.liveLocationMessage) {
|
|
633
|
+
const loc = message.liveLocationMessage;
|
|
634
|
+
processed.hasLocation = true;
|
|
635
|
+
processed.isLiveLocation = true;
|
|
636
|
+
processed.latitude = loc.degreesLatitude;
|
|
637
|
+
processed.longitude = loc.degreesLongitude;
|
|
638
|
+
processed.locationAccuracy = loc.accuracyInMeters;
|
|
639
|
+
processed.locationSpeed = loc.speedInMps;
|
|
640
|
+
processed.locationSequenceNumber = loc.sequenceNumber;
|
|
641
|
+
}
|
|
642
|
+
if (message.contactMessage) {
|
|
643
|
+
const contact = message.contactMessage;
|
|
644
|
+
processed.hasContact = true;
|
|
645
|
+
processed.contactName = contact.displayName;
|
|
646
|
+
processed.contactVcard = contact.vcard;
|
|
647
|
+
const vcard = contact.vcard;
|
|
648
|
+
if (vcard) {
|
|
649
|
+
const telMatch = vcard.match(/TEL[^:]*:([^\n]+)/);
|
|
650
|
+
if (telMatch) {
|
|
651
|
+
processed.contactPhone = telMatch[1].replace(/\D/g, '');
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
if (message.contactsArrayMessage) {
|
|
656
|
+
const contacts = message.contactsArrayMessage;
|
|
657
|
+
processed.hasContacts = true;
|
|
658
|
+
processed.contactsDisplayName = contacts.displayName;
|
|
659
|
+
processed.contacts = contacts.contacts;
|
|
660
|
+
}
|
|
661
|
+
const pollMsg = message.pollCreationMessage || message.pollCreationMessageV2 || message.pollCreationMessageV3 || message.pollCreationMessageV4 || message.pollCreationMessageV5;
|
|
662
|
+
if (pollMsg) {
|
|
663
|
+
const poll = pollMsg;
|
|
664
|
+
processed.hasPoll = true;
|
|
665
|
+
processed.pollQuestion = poll.name;
|
|
666
|
+
processed.pollOptions = poll.options;
|
|
667
|
+
processed.pollSelectableCount = poll.selectableOptionsCount;
|
|
668
|
+
if (Array.isArray(poll.options)) {
|
|
669
|
+
processed.pollOptionsText = poll.options.map(opt => opt.optionName || opt.name || opt.text).filter(Boolean);
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
if (message.questionMessage) {
|
|
673
|
+
const question = message.questionMessage;
|
|
674
|
+
if (Array.isArray(question.options) && question.options.length > 0) {
|
|
675
|
+
processed.hasPoll = true;
|
|
676
|
+
processed.isQuestion = true;
|
|
677
|
+
processed.pollQuestion = question.question || question.name;
|
|
678
|
+
processed.pollOptions = question.options;
|
|
679
|
+
processed.pollSelectableCount = question.selectableOptionsCount || 1;
|
|
680
|
+
processed.pollOptionsText = question.options.map(opt => opt.optionName || opt.name || opt.text).filter(Boolean);
|
|
681
|
+
}
|
|
682
|
+
else if (question.message) {
|
|
683
|
+
const innerMsg = question.message;
|
|
684
|
+
const extendedText = innerMsg.extendedTextMessage;
|
|
685
|
+
if (extendedText) {
|
|
686
|
+
processed.isQuestion = true;
|
|
687
|
+
processed.questionText = extendedText.text;
|
|
688
|
+
if (!processed.text) {
|
|
689
|
+
processed.text = extendedText.text;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
if (message.pollUpdateMessage) {
|
|
695
|
+
const pollUpdate = message.pollUpdateMessage;
|
|
696
|
+
processed.isPollUpdate = true;
|
|
697
|
+
processed.pollUpdateVote = pollUpdate.vote;
|
|
698
|
+
processed.pollUpdateMessageKey = pollUpdate.pollCreationMessageKey;
|
|
699
|
+
}
|
|
700
|
+
if (message.buttonsMessage) {
|
|
701
|
+
const btns = message.buttonsMessage;
|
|
702
|
+
processed.hasButtons = true;
|
|
703
|
+
processed.buttonsText = btns.contentText;
|
|
704
|
+
processed.buttonsFooter = btns.footerText;
|
|
705
|
+
processed.buttons = btns.buttons;
|
|
706
|
+
}
|
|
707
|
+
if (message.buttonsResponseMessage) {
|
|
708
|
+
const resp = message.buttonsResponseMessage;
|
|
709
|
+
processed.isButtonResponse = true;
|
|
710
|
+
processed.buttonSelectedId = resp.selectedButtonId;
|
|
711
|
+
processed.buttonSelectedText = resp.selectedDisplayText;
|
|
712
|
+
}
|
|
713
|
+
if (message.listMessage) {
|
|
714
|
+
const list = message.listMessage;
|
|
715
|
+
processed.hasList = true;
|
|
716
|
+
processed.listTitle = list.title;
|
|
717
|
+
processed.listDescription = list.description;
|
|
718
|
+
processed.listButtonText = list.buttonText;
|
|
719
|
+
processed.listFooter = list.footerText;
|
|
720
|
+
processed.listSections = list.sections;
|
|
721
|
+
}
|
|
722
|
+
if (message.listResponseMessage) {
|
|
723
|
+
const resp = message.listResponseMessage;
|
|
724
|
+
processed.isListResponse = true;
|
|
725
|
+
processed.listSelectedTitle = resp.title;
|
|
726
|
+
processed.listSelectedDescription = resp.description;
|
|
727
|
+
processed.listSelectedRowId = resp.singleSelectReply
|
|
728
|
+
? resp.singleSelectReply.selectedRowId
|
|
729
|
+
: resp.selectedRowId;
|
|
730
|
+
}
|
|
731
|
+
if (message.templateButtonReplyMessage) {
|
|
732
|
+
const tmpl = message.templateButtonReplyMessage;
|
|
733
|
+
processed.isTemplateResponse = true;
|
|
734
|
+
processed.templateSelectedId = tmpl.selectedId;
|
|
735
|
+
processed.templateSelectedText = tmpl.selectedDisplayText;
|
|
736
|
+
processed.templateSelectedIndex = tmpl.selectedIndex;
|
|
737
|
+
}
|
|
738
|
+
if (message.reactionMessage) {
|
|
739
|
+
const react = message.reactionMessage;
|
|
740
|
+
processed.isReaction = true;
|
|
741
|
+
processed.reactionEmoji = react.text;
|
|
742
|
+
processed.reactionTargetKey = react.key;
|
|
743
|
+
processed.reactionTimestamp = react.senderTimestampMs;
|
|
744
|
+
}
|
|
745
|
+
if (message.editedMessage || message.protocolMessage) {
|
|
746
|
+
const proto = message.protocolMessage;
|
|
747
|
+
if (proto && proto.type === 14) {
|
|
748
|
+
processed.isEdited = true;
|
|
749
|
+
processed.editedMessageId = proto.key ? proto.key.id : undefined;
|
|
750
|
+
if (proto.editedMessage) {
|
|
751
|
+
const edited = proto.editedMessage;
|
|
752
|
+
if (edited.conversation) {
|
|
753
|
+
processed.text = edited.conversation;
|
|
754
|
+
processed.hasText = true;
|
|
755
|
+
}
|
|
756
|
+
else if (edited.extendedTextMessage) {
|
|
757
|
+
processed.text = edited.extendedTextMessage.text;
|
|
758
|
+
processed.hasText = true;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
if (message.protocolMessage) {
|
|
764
|
+
const proto = message.protocolMessage;
|
|
765
|
+
if (proto.type === 0) {
|
|
766
|
+
processed.isDeleted = true;
|
|
767
|
+
processed.deletedMessageId = proto.key ? proto.key.id : undefined;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
if (event === 'newsletter.message' || event === 'NEWSLETTER_MESSAGE') {
|
|
771
|
+
processed.isNewsletter = true;
|
|
772
|
+
const jid = key === null || key === void 0 ? void 0 : key.remoteJid;
|
|
773
|
+
if (jid && jid.includes('@newsletter')) {
|
|
774
|
+
processed.newsletterId = jid.replace('@newsletter', '');
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
if (data.participant) {
|
|
778
|
+
processed.isGroup = true;
|
|
779
|
+
processed.participantJid = data.participant;
|
|
780
|
+
}
|
|
781
|
+
const messageObj = data.message;
|
|
782
|
+
if (messageObj === null || messageObj === void 0 ? void 0 : messageObj.mediaS3Url) {
|
|
783
|
+
processed.mediaS3Url = messageObj.mediaS3Url;
|
|
784
|
+
processed.mediaS3Key = messageObj.mediaS3Key;
|
|
785
|
+
processed.hasS3Media = true;
|
|
786
|
+
}
|
|
787
|
+
if (!processed.mediaUrl && (messageObj === null || messageObj === void 0 ? void 0 : messageObj.mediaUrl)) {
|
|
788
|
+
processed.mediaUrl = messageObj.mediaUrl;
|
|
789
|
+
}
|
|
790
|
+
if (messageObj === null || messageObj === void 0 ? void 0 : messageObj.base64) {
|
|
791
|
+
processed.mediaBase64 = messageObj.base64;
|
|
792
|
+
processed.hasBase64 = true;
|
|
793
|
+
}
|
|
794
|
+
else if (data.base64) {
|
|
795
|
+
processed.mediaBase64 = data.base64;
|
|
796
|
+
processed.hasBase64 = true;
|
|
797
|
+
}
|
|
798
|
+
return processed;
|
|
799
|
+
}
|
|
800
|
+
function convertThumbnailToBase64(thumbnail) {
|
|
801
|
+
if (!thumbnail)
|
|
802
|
+
return '';
|
|
803
|
+
if (typeof thumbnail === 'string') {
|
|
804
|
+
if (!thumbnail.startsWith('data:')) {
|
|
805
|
+
return `data:image/jpeg;base64,${thumbnail}`;
|
|
806
|
+
}
|
|
807
|
+
return thumbnail;
|
|
808
|
+
}
|
|
809
|
+
if (typeof thumbnail === 'object' && thumbnail !== null) {
|
|
810
|
+
try {
|
|
811
|
+
const obj = thumbnail;
|
|
812
|
+
if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
|
|
813
|
+
const buffer = Buffer.from(obj.data);
|
|
814
|
+
return `data:image/jpeg;base64,${buffer.toString('base64')}`;
|
|
815
|
+
}
|
|
816
|
+
const numericObj = obj;
|
|
817
|
+
const keys = Object.keys(numericObj).filter((k) => !isNaN(Number(k))).sort((a, b) => Number(a) - Number(b));
|
|
818
|
+
const bytes = [];
|
|
819
|
+
for (const key of keys) {
|
|
820
|
+
const val = numericObj[key];
|
|
821
|
+
if (typeof val === 'number') {
|
|
822
|
+
bytes.push(val);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
if (bytes.length > 0) {
|
|
826
|
+
const buffer = Buffer.from(bytes);
|
|
827
|
+
return `data:image/jpeg;base64,${buffer.toString('base64')}`;
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
catch {
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
return '';
|
|
834
|
+
}
|
|
835
|
+
//# sourceMappingURL=EvolutionApiTrigger.node.js.map
|