@renatoascencio/n8n-nodes-evolution-api 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +330 -0
- package/dist/credentials/EvolutionApi.credentials.d.ts +10 -0
- package/dist/credentials/EvolutionApi.credentials.js +84 -0
- package/dist/credentials/EvolutionApi.credentials.js.map +1 -0
- package/dist/nodes/EvolutionApi/EvolutionApi.node.d.ts +19 -0
- package/dist/nodes/EvolutionApi/EvolutionApi.node.js +180 -0
- package/dist/nodes/EvolutionApi/EvolutionApi.node.js.map +1 -0
- package/dist/nodes/EvolutionApi/EvolutionApi.node.json +22 -0
- package/dist/nodes/EvolutionApi/EvolutionApiTrigger.node.d.ts +18 -0
- package/dist/nodes/EvolutionApi/EvolutionApiTrigger.node.js +615 -0
- package/dist/nodes/EvolutionApi/EvolutionApiTrigger.node.js.map +1 -0
- package/dist/nodes/EvolutionApi/EvolutionApiTrigger.node.json +19 -0
- package/dist/nodes/EvolutionApi/GenericFunctions.d.ts +114 -0
- package/dist/nodes/EvolutionApi/GenericFunctions.js +681 -0
- package/dist/nodes/EvolutionApi/GenericFunctions.js.map +1 -0
- package/dist/nodes/EvolutionApi/constants.d.ts +7 -0
- package/dist/nodes/EvolutionApi/constants.js +77 -0
- package/dist/nodes/EvolutionApi/constants.js.map +1 -0
- package/dist/nodes/EvolutionApi/evolution.svg +11 -0
- package/dist/nodes/EvolutionApi/resources/call/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/call/index.js +62 -0
- package/dist/nodes/EvolutionApi/resources/call/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/call/offer.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/call/offer.operation.js +56 -0
- package/dist/nodes/EvolutionApi/resources/call/offer.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/archive.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/archive.operation.js +44 -0
- package/dist/nodes/EvolutionApi/resources/chat/archive.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/checkNumbers.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/checkNumbers.operation.js +28 -0
- package/dist/nodes/EvolutionApi/resources/chat/checkNumbers.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/deleteMessage.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/deleteMessage.operation.js +68 -0
- package/dist/nodes/EvolutionApi/resources/chat/deleteMessage.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/downloadMedia.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/chat/downloadMedia.operation.js +143 -0
- package/dist/nodes/EvolutionApi/resources/chat/downloadMedia.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/editMessage.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/editMessage.operation.js +49 -0
- package/dist/nodes/EvolutionApi/resources/chat/editMessage.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/get.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/get.operation.js +28 -0
- package/dist/nodes/EvolutionApi/resources/chat/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/getChannels.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/getChannels.operation.js +23 -0
- package/dist/nodes/EvolutionApi/resources/chat/getChannels.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/getContacts.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/getContacts.operation.js +55 -0
- package/dist/nodes/EvolutionApi/resources/chat/getContacts.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/getMany.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/chat/getMany.operation.js +74 -0
- package/dist/nodes/EvolutionApi/resources/chat/getMany.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/getMessages.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/getMessages.operation.js +124 -0
- package/dist/nodes/EvolutionApi/resources/chat/getMessages.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/getPollVotes.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/getPollVotes.operation.js +36 -0
- package/dist/nodes/EvolutionApi/resources/chat/getPollVotes.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/getStatusUpdates.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/getStatusUpdates.operation.js +57 -0
- package/dist/nodes/EvolutionApi/resources/chat/getStatusUpdates.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/helpers.d.ts +25 -0
- package/dist/nodes/EvolutionApi/resources/chat/helpers.js +219 -0
- package/dist/nodes/EvolutionApi/resources/chat/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/chat/index.js +209 -0
- package/dist/nodes/EvolutionApi/resources/chat/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/markAsPlayed.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/markAsPlayed.operation.js +49 -0
- package/dist/nodes/EvolutionApi/resources/chat/markAsPlayed.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/markAsRead.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/markAsRead.operation.js +48 -0
- package/dist/nodes/EvolutionApi/resources/chat/markAsRead.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/markUnread.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/markUnread.operation.js +35 -0
- package/dist/nodes/EvolutionApi/resources/chat/markUnread.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/sendPresence.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/sendPresence.operation.js +53 -0
- package/dist/nodes/EvolutionApi/resources/chat/sendPresence.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chat/updateBlockStatus.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chat/updateBlockStatus.operation.js +44 -0
- package/dist/nodes/EvolutionApi/resources/chat/updateBlockStatus.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/changeStatus.operation.d.ts +31 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/changeStatus.operation.js +73 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/changeStatus.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/create.operation.d.ts +38 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/create.operation.js +251 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/create.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/createCredential.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/createCredential.operation.js +44 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/createCredential.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/delete.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/delete.operation.js +19 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/delete.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/deleteCredential.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/deleteCredential.operation.js +30 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/deleteCredential.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/fields.d.ts +10 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/fields.js +229 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/fields.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/get.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/get.operation.js +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getCredentials.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getCredentials.operation.js +17 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getCredentials.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getMany.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getMany.operation.js +18 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getMany.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getModels.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getModels.operation.js +39 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getModels.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getSessions.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getSessions.operation.js +69 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getSessions.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getSettings.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getSettings.operation.js +17 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/getSettings.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/helpers.d.ts +24 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/helpers.js +273 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/ignoreJid.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/ignoreJid.operation.js +35 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/ignoreJid.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/index.d.ts +6 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/index.js +210 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/methods.d.ts +2 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/methods.js +58 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/methods.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/setSettings.operation.d.ts +33 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/setSettings.operation.js +133 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/setSettings.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/start.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/start.operation.js +112 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/start.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/update.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/update.operation.js +191 -0
- package/dist/nodes/EvolutionApi/resources/chatbot/update.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/get.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/get.operation.js +25 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/helpers.d.ts +4 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/helpers.js +26 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/index.js +70 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/set.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/set.operation.js +252 -0
- package/dist/nodes/EvolutionApi/resources/chatwoot/set.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/acceptInvite.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/acceptInvite.operation.js +25 -0
- package/dist/nodes/EvolutionApi/resources/group/acceptInvite.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/create.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/create.operation.js +68 -0
- package/dist/nodes/EvolutionApi/resources/group/create.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/get.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/get.operation.js +15 -0
- package/dist/nodes/EvolutionApi/resources/group/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/getInviteCode.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/getInviteCode.operation.js +15 -0
- package/dist/nodes/EvolutionApi/resources/group/getInviteCode.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/getInviteInfo.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/getInviteInfo.operation.js +25 -0
- package/dist/nodes/EvolutionApi/resources/group/getInviteInfo.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/getMany.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/getMany.operation.js +72 -0
- package/dist/nodes/EvolutionApi/resources/group/getMany.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/getParticipants.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/getParticipants.operation.js +21 -0
- package/dist/nodes/EvolutionApi/resources/group/getParticipants.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/helpers.d.ts +8 -0
- package/dist/nodes/EvolutionApi/resources/group/helpers.js +139 -0
- package/dist/nodes/EvolutionApi/resources/group/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/index.d.ts +7 -0
- package/dist/nodes/EvolutionApi/resources/group/index.js +216 -0
- package/dist/nodes/EvolutionApi/resources/group/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/leave.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/leave.operation.js +15 -0
- package/dist/nodes/EvolutionApi/resources/group/leave.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/revokeInviteCode.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/revokeInviteCode.operation.js +20 -0
- package/dist/nodes/EvolutionApi/resources/group/revokeInviteCode.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/sendInvite.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/sendInvite.operation.js +48 -0
- package/dist/nodes/EvolutionApi/resources/group/sendInvite.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/toggleEphemeral.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/toggleEphemeral.operation.js +43 -0
- package/dist/nodes/EvolutionApi/resources/group/toggleEphemeral.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/updateDescription.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/updateDescription.operation.js +34 -0
- package/dist/nodes/EvolutionApi/resources/group/updateDescription.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/updateMemberAddMode.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/updateMemberAddMode.operation.js +47 -0
- package/dist/nodes/EvolutionApi/resources/group/updateMemberAddMode.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/updateParticipants.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/updateParticipants.operation.js +67 -0
- package/dist/nodes/EvolutionApi/resources/group/updateParticipants.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/updatePicture.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/updatePicture.operation.js +99 -0
- package/dist/nodes/EvolutionApi/resources/group/updatePicture.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/updateSetting.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/updateSetting.operation.js +57 -0
- package/dist/nodes/EvolutionApi/resources/group/updateSetting.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/group/updateSubject.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/group/updateSubject.operation.js +31 -0
- package/dist/nodes/EvolutionApi/resources/group/updateSubject.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/index.d.ts +6 -0
- package/dist/nodes/EvolutionApi/resources/index.js +144 -0
- package/dist/nodes/EvolutionApi/resources/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/connect.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/instance/connect.operation.js +40 -0
- package/dist/nodes/EvolutionApi/resources/instance/connect.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/create.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/instance/create.operation.js +519 -0
- package/dist/nodes/EvolutionApi/resources/instance/create.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/delete.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/instance/delete.operation.js +11 -0
- package/dist/nodes/EvolutionApi/resources/instance/delete.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/getConnectionState.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/instance/getConnectionState.operation.js +11 -0
- package/dist/nodes/EvolutionApi/resources/instance/getConnectionState.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/getMany.operation.d.ts +31 -0
- package/dist/nodes/EvolutionApi/resources/instance/getMany.operation.js +149 -0
- package/dist/nodes/EvolutionApi/resources/instance/getMany.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/helpers.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/instance/helpers.js +60 -0
- package/dist/nodes/EvolutionApi/resources/instance/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/index.d.ts +6 -0
- package/dist/nodes/EvolutionApi/resources/instance/index.js +128 -0
- package/dist/nodes/EvolutionApi/resources/instance/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/logout.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/instance/logout.operation.js +11 -0
- package/dist/nodes/EvolutionApi/resources/instance/logout.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/restart.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/instance/restart.operation.js +13 -0
- package/dist/nodes/EvolutionApi/resources/instance/restart.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/instance/setPresence.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/instance/setPresence.operation.js +24 -0
- package/dist/nodes/EvolutionApi/resources/instance/setPresence.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/label/addToChat.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/label/addToChat.operation.js +11 -0
- package/dist/nodes/EvolutionApi/resources/label/addToChat.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/label/getMany.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/label/getMany.operation.js +12 -0
- package/dist/nodes/EvolutionApi/resources/label/getMany.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/label/helpers.d.ts +4 -0
- package/dist/nodes/EvolutionApi/resources/label/helpers.js +69 -0
- package/dist/nodes/EvolutionApi/resources/label/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/label/index.d.ts +6 -0
- package/dist/nodes/EvolutionApi/resources/label/index.js +88 -0
- package/dist/nodes/EvolutionApi/resources/label/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/label/removeFromChat.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/label/removeFromChat.operation.js +11 -0
- package/dist/nodes/EvolutionApi/resources/label/removeFromChat.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/generateMessageId.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/generateMessageId.operation.js +21 -0
- package/dist/nodes/EvolutionApi/resources/message/generateMessageId.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/helpers.d.ts +39 -0
- package/dist/nodes/EvolutionApi/resources/message/helpers.js +566 -0
- package/dist/nodes/EvolutionApi/resources/message/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/index.d.ts +6 -0
- package/dist/nodes/EvolutionApi/resources/message/index.js +192 -0
- package/dist/nodes/EvolutionApi/resources/message/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendAudio.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendAudio.operation.js +36 -0
- package/dist/nodes/EvolutionApi/resources/message/sendAudio.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendButtons.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendButtons.operation.js +114 -0
- package/dist/nodes/EvolutionApi/resources/message/sendButtons.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendCarousel.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/message/sendCarousel.operation.js +162 -0
- package/dist/nodes/EvolutionApi/resources/message/sendCarousel.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendContact.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendContact.operation.js +105 -0
- package/dist/nodes/EvolutionApi/resources/message/sendContact.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendList.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/message/sendList.operation.js +197 -0
- package/dist/nodes/EvolutionApi/resources/message/sendList.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendLocation.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendLocation.operation.js +70 -0
- package/dist/nodes/EvolutionApi/resources/message/sendLocation.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendMedia.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendMedia.operation.js +142 -0
- package/dist/nodes/EvolutionApi/resources/message/sendMedia.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendPoll.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendPoll.operation.js +67 -0
- package/dist/nodes/EvolutionApi/resources/message/sendPoll.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendPtv.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendPtv.operation.js +22 -0
- package/dist/nodes/EvolutionApi/resources/message/sendPtv.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendReaction.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendReaction.operation.js +81 -0
- package/dist/nodes/EvolutionApi/resources/message/sendReaction.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendStatus.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendStatus.operation.js +147 -0
- package/dist/nodes/EvolutionApi/resources/message/sendStatus.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendSticker.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendSticker.operation.js +41 -0
- package/dist/nodes/EvolutionApi/resources/message/sendSticker.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendTemplate.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendTemplate.operation.js +92 -0
- package/dist/nodes/EvolutionApi/resources/message/sendTemplate.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/message/sendText.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/message/sendText.operation.js +38 -0
- package/dist/nodes/EvolutionApi/resources/message/sendText.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/get.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/profile/get.operation.js +27 -0
- package/dist/nodes/EvolutionApi/resources/profile/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/getBusinessProfile.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/profile/getBusinessProfile.operation.js +24 -0
- package/dist/nodes/EvolutionApi/resources/profile/getBusinessProfile.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/getPicture.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/profile/getPicture.operation.js +27 -0
- package/dist/nodes/EvolutionApi/resources/profile/getPicture.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/getPrivacySettings.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/profile/getPrivacySettings.operation.js +11 -0
- package/dist/nodes/EvolutionApi/resources/profile/getPrivacySettings.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/profile/index.js +136 -0
- package/dist/nodes/EvolutionApi/resources/profile/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/removePicture.operation.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/profile/removePicture.operation.js +11 -0
- package/dist/nodes/EvolutionApi/resources/profile/removePicture.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/updateName.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/profile/updateName.operation.js +27 -0
- package/dist/nodes/EvolutionApi/resources/profile/updateName.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/updatePicture.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/profile/updatePicture.operation.js +86 -0
- package/dist/nodes/EvolutionApi/resources/profile/updatePicture.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/updatePrivacySettings.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/profile/updatePrivacySettings.operation.js +133 -0
- package/dist/nodes/EvolutionApi/resources/profile/updatePrivacySettings.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/profile/updateStatus.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/profile/updateStatus.operation.js +28 -0
- package/dist/nodes/EvolutionApi/resources/profile/updateStatus.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/proxy/get.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/proxy/get.operation.js +25 -0
- package/dist/nodes/EvolutionApi/resources/proxy/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/proxy/helpers.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/proxy/helpers.js +28 -0
- package/dist/nodes/EvolutionApi/resources/proxy/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/proxy/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/proxy/index.js +70 -0
- package/dist/nodes/EvolutionApi/resources/proxy/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/proxy/set.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/proxy/set.operation.js +137 -0
- package/dist/nodes/EvolutionApi/resources/proxy/set.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/settings/get.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/settings/get.operation.js +25 -0
- package/dist/nodes/EvolutionApi/resources/settings/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/settings/helpers.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/settings/helpers.js +37 -0
- package/dist/nodes/EvolutionApi/resources/settings/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/settings/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/settings/index.js +70 -0
- package/dist/nodes/EvolutionApi/resources/settings/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/settings/set.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/settings/set.operation.js +128 -0
- package/dist/nodes/EvolutionApi/resources/settings/set.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/create.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/template/create.operation.js +97 -0
- package/dist/nodes/EvolutionApi/resources/template/create.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/delete.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/template/delete.operation.js +50 -0
- package/dist/nodes/EvolutionApi/resources/template/delete.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/getCatalog.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/template/getCatalog.operation.js +48 -0
- package/dist/nodes/EvolutionApi/resources/template/getCatalog.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/getCollections.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/template/getCollections.operation.js +41 -0
- package/dist/nodes/EvolutionApi/resources/template/getCollections.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/getMany.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/template/getMany.operation.js +109 -0
- package/dist/nodes/EvolutionApi/resources/template/getMany.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/helpers.d.ts +3 -0
- package/dist/nodes/EvolutionApi/resources/template/helpers.js +32 -0
- package/dist/nodes/EvolutionApi/resources/template/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/template/index.js +109 -0
- package/dist/nodes/EvolutionApi/resources/template/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/template/update.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/template/update.operation.js +89 -0
- package/dist/nodes/EvolutionApi/resources/template/update.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/webhook/get.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/webhook/get.operation.js +25 -0
- package/dist/nodes/EvolutionApi/resources/webhook/get.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/webhook/getTransport.operation.d.ts +30 -0
- package/dist/nodes/EvolutionApi/resources/webhook/getTransport.operation.js +49 -0
- package/dist/nodes/EvolutionApi/resources/webhook/getTransport.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/webhook/helpers.d.ts +17 -0
- package/dist/nodes/EvolutionApi/resources/webhook/helpers.js +144 -0
- package/dist/nodes/EvolutionApi/resources/webhook/helpers.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/webhook/index.d.ts +5 -0
- package/dist/nodes/EvolutionApi/resources/webhook/index.js +91 -0
- package/dist/nodes/EvolutionApi/resources/webhook/index.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/webhook/set.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/webhook/set.operation.js +174 -0
- package/dist/nodes/EvolutionApi/resources/webhook/set.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/resources/webhook/setTransport.operation.d.ts +29 -0
- package/dist/nodes/EvolutionApi/resources/webhook/setTransport.operation.js +159 -0
- package/dist/nodes/EvolutionApi/resources/webhook/setTransport.operation.js.map +1 -0
- package/dist/nodes/EvolutionApi/trigger/auth.d.ts +26 -0
- package/dist/nodes/EvolutionApi/trigger/auth.js +96 -0
- package/dist/nodes/EvolutionApi/trigger/auth.js.map +1 -0
- package/dist/nodes/EvolutionApi/trigger/constants.d.ts +10 -0
- package/dist/nodes/EvolutionApi/trigger/constants.js +154 -0
- package/dist/nodes/EvolutionApi/trigger/constants.js.map +1 -0
- package/dist/nodes/EvolutionApi/trigger/dedupe.d.ts +5 -0
- package/dist/nodes/EvolutionApi/trigger/dedupe.js +87 -0
- package/dist/nodes/EvolutionApi/trigger/dedupe.js.map +1 -0
- package/dist/nodes/EvolutionApi/trigger/payload.d.ts +48 -0
- package/dist/nodes/EvolutionApi/trigger/payload.js +265 -0
- package/dist/nodes/EvolutionApi/trigger/payload.js.map +1 -0
- package/dist/nodes/EvolutionApi/trigger/registration.d.ts +36 -0
- package/dist/nodes/EvolutionApi/trigger/registration.js +156 -0
- package/dist/nodes/EvolutionApi/trigger/registration.js.map +1 -0
- package/dist/nodes/EvolutionApi/types.d.ts +44 -0
- package/dist/nodes/EvolutionApi/types.js +3 -0
- package/dist/nodes/EvolutionApi/types.js.map +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
7
|
+
const helpers_1 = require("./helpers");
|
|
8
|
+
const properties = [helpers_1.secretsOptionsProperty];
|
|
9
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)({ show: { resource: ['chatbot'], operation: ['getSettings'] } }, properties);
|
|
10
|
+
async function execute(itemIndex) {
|
|
11
|
+
const instance = await GenericFunctions_1.resolveInstanceName.call(this, itemIndex);
|
|
12
|
+
const botType = (0, helpers_1.parseBotType)(this.getNode(), this.getNodeParameter('botType', itemIndex), itemIndex);
|
|
13
|
+
const options = this.getNodeParameter('options', itemIndex, {});
|
|
14
|
+
const settings = (await GenericFunctions_1.evolutionApiRequest.call(this, 'GET', `/${botType.value}/fetchSettings/${instance}`, {}, {}, { itemIndex }));
|
|
15
|
+
return options.includeSecrets === true ? settings : (0, helpers_1.redactBotSecrets)(settings);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=getSettings.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSettings.operation.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/resources/chatbot/getSettings.operation.ts"],"names":[],"mappings":";;;AAmBA,0BAiBC;AAnCD,+CAAoD;AAEpD,6DAAkF;AAClF,uCAAmF;AAEnF,MAAM,UAAU,GAAsB,CAAC,gCAAsB,CAAC,CAAC;AAElD,QAAA,WAAW,GAAG,IAAA,mCAAoB,EAC7C,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,EAC/D,UAAU,CACX,CAAC;AAQK,KAAK,UAAU,OAAO,CAA0B,SAAiB;IACtE,MAAM,QAAQ,GAAG,MAAM,sCAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,IAAA,sBAAY,EAC1B,IAAI,CAAC,OAAO,EAAE,EACd,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,EAC3C,SAAS,CACV,CAAC;IACF,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAAgB,CAAC;IAC/E,MAAM,QAAQ,GAAG,CAAC,MAAM,sCAAmB,CAAC,IAAI,CAC9C,IAAI,EACJ,KAAK,EACL,IAAI,OAAO,CAAC,KAAK,kBAAkB,QAAQ,EAAE,EAC7C,EAAE,EACF,EAAE,EACF,EAAE,SAAS,EAAE,CACd,CAAgB,CAAC;IAClB,OAAO,OAAO,CAAC,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAA,0BAAgB,EAAC,QAAQ,CAAC,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IDataObject, INode, INodeProperties, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
export type BotType = 'dify' | 'evoai' | 'evolutionBot' | 'flowise' | 'n8n' | 'openai' | 'typebot';
|
|
3
|
+
export interface BotTypeInfo {
|
|
4
|
+
label: string;
|
|
5
|
+
env?: string;
|
|
6
|
+
specificKeys: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare const BOT_TYPES: Record<BotType, BotTypeInfo>;
|
|
9
|
+
export declare const CHATBOT_TYPE_OPTIONS: INodePropertyOptions[];
|
|
10
|
+
export declare function parseBotType(node: INode, value: unknown, itemIndex?: number): {
|
|
11
|
+
value: BotType;
|
|
12
|
+
info: BotTypeInfo;
|
|
13
|
+
};
|
|
14
|
+
export declare const COMMON_BOT_KEYS: string[];
|
|
15
|
+
export declare function parseJidList(value: unknown): string[];
|
|
16
|
+
export declare function parseMessageList(value: unknown, label: string): string[];
|
|
17
|
+
export declare function collectBotFields(values: IDataObject, botType: BotType): IDataObject;
|
|
18
|
+
export declare function pickBotBody(bot: IDataObject, botType: BotType): IDataObject;
|
|
19
|
+
export declare function validateBotBody(node: INode, body: IDataObject, botType: BotType, itemIndex: number): void;
|
|
20
|
+
export declare const SETTINGS_DEFAULTS: IDataObject;
|
|
21
|
+
export declare function redactBotSecrets<T>(value: T): T;
|
|
22
|
+
export declare const includeSecretsOption: INodeProperties;
|
|
23
|
+
export declare const secretsOptionsProperty: INodeProperties;
|
|
24
|
+
export declare function withChatbotHint(error: unknown, hint: string): unknown;
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.secretsOptionsProperty = exports.includeSecretsOption = exports.SETTINGS_DEFAULTS = exports.COMMON_BOT_KEYS = exports.CHATBOT_TYPE_OPTIONS = exports.BOT_TYPES = void 0;
|
|
4
|
+
exports.parseBotType = parseBotType;
|
|
5
|
+
exports.parseJidList = parseJidList;
|
|
6
|
+
exports.parseMessageList = parseMessageList;
|
|
7
|
+
exports.collectBotFields = collectBotFields;
|
|
8
|
+
exports.pickBotBody = pickBotBody;
|
|
9
|
+
exports.validateBotBody = validateBotBody;
|
|
10
|
+
exports.redactBotSecrets = redactBotSecrets;
|
|
11
|
+
exports.withChatbotHint = withChatbotHint;
|
|
12
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
13
|
+
const constants_1 = require("../../constants");
|
|
14
|
+
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
15
|
+
exports.BOT_TYPES = {
|
|
16
|
+
dify: { label: 'Dify', env: 'DIFY_ENABLED', specificKeys: ['botType', 'apiUrl', 'apiKey'] },
|
|
17
|
+
evoai: { label: 'EvoAI', env: 'EVOAI_ENABLED', specificKeys: ['agentUrl', 'apiKey'] },
|
|
18
|
+
evolutionBot: { label: 'Evolution Bot', specificKeys: ['apiUrl', 'apiKey'] },
|
|
19
|
+
flowise: { label: 'Flowise', env: 'FLOWISE_ENABLED', specificKeys: ['apiUrl', 'apiKey'] },
|
|
20
|
+
n8n: {
|
|
21
|
+
label: 'n8n',
|
|
22
|
+
env: 'N8N_ENABLED',
|
|
23
|
+
specificKeys: ['webhookUrl', 'basicAuthUser', 'basicAuthPass'],
|
|
24
|
+
},
|
|
25
|
+
openai: {
|
|
26
|
+
label: 'OpenAI',
|
|
27
|
+
env: 'OPENAI_ENABLED',
|
|
28
|
+
specificKeys: [
|
|
29
|
+
'openaiCredsId',
|
|
30
|
+
'botType',
|
|
31
|
+
'assistantId',
|
|
32
|
+
'functionUrl',
|
|
33
|
+
'model',
|
|
34
|
+
'systemMessages',
|
|
35
|
+
'assistantMessages',
|
|
36
|
+
'userMessages',
|
|
37
|
+
'maxTokens',
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
typebot: { label: 'Typebot', env: 'TYPEBOT_ENABLED', specificKeys: ['url', 'typebot'] },
|
|
41
|
+
};
|
|
42
|
+
const BOT_TYPE_DESCRIPTIONS = {
|
|
43
|
+
dify: 'Dify apps: chat bot, text generator, agent or workflow (DIFY_ENABLED=true)',
|
|
44
|
+
evoai: 'EvoAI agents (EVOAI_ENABLED=true)',
|
|
45
|
+
evolutionBot: 'Your own HTTP endpoint: Evolution posts each message to its API URL and sends the reply back (always available)',
|
|
46
|
+
flowise: 'Flowise chatflows (FLOWISE_ENABLED=true)',
|
|
47
|
+
n8n: "Evolution's native n8n integration: each message is posted to an n8n webhook, whose output is sent back (N8N_ENABLED=true)",
|
|
48
|
+
openai: 'OpenAI assistants or chat completions, using OpenAI credentials stored in Evolution (OPENAI_ENABLED=true)',
|
|
49
|
+
typebot: 'Typebot flows (TYPEBOT_ENABLED=true)',
|
|
50
|
+
};
|
|
51
|
+
exports.CHATBOT_TYPE_OPTIONS = constants_1.BOT_TYPE_OPTIONS.map((option) => {
|
|
52
|
+
var _a;
|
|
53
|
+
return ({
|
|
54
|
+
...option,
|
|
55
|
+
description: (_a = BOT_TYPE_DESCRIPTIONS[option.value]) !== null && _a !== void 0 ? _a : option.description,
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
function parseBotType(node, value, itemIndex) {
|
|
59
|
+
const name = String(value !== null && value !== void 0 ? value : '').trim();
|
|
60
|
+
if (!Object.prototype.hasOwnProperty.call(exports.BOT_TYPES, name)) {
|
|
61
|
+
throw new n8n_workflow_1.NodeOperationError(node, `Unknown bot type "${name}"`, {
|
|
62
|
+
itemIndex,
|
|
63
|
+
description: `Use one of: ${Object.keys(exports.BOT_TYPES).join(', ')}.`,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return { value: name, info: exports.BOT_TYPES[name] };
|
|
67
|
+
}
|
|
68
|
+
exports.COMMON_BOT_KEYS = [
|
|
69
|
+
'enabled',
|
|
70
|
+
'description',
|
|
71
|
+
'triggerType',
|
|
72
|
+
'triggerOperator',
|
|
73
|
+
'triggerValue',
|
|
74
|
+
'expire',
|
|
75
|
+
'keywordFinish',
|
|
76
|
+
'delayMessage',
|
|
77
|
+
'unknownMessage',
|
|
78
|
+
'listeningFromMe',
|
|
79
|
+
'stopBotFromMe',
|
|
80
|
+
'keepOpen',
|
|
81
|
+
'debounceTime',
|
|
82
|
+
'ignoreJids',
|
|
83
|
+
'splitMessages',
|
|
84
|
+
'timePerChar',
|
|
85
|
+
];
|
|
86
|
+
const FIELD_SPECS = {
|
|
87
|
+
enabled: { key: 'enabled', kind: 'boolean' },
|
|
88
|
+
description: { key: 'description', kind: 'string' },
|
|
89
|
+
triggerType: { key: 'triggerType', kind: 'string' },
|
|
90
|
+
triggerOperator: { key: 'triggerOperator', kind: 'string' },
|
|
91
|
+
triggerValue: { key: 'triggerValue', kind: 'string' },
|
|
92
|
+
expire: { key: 'expire', kind: 'integer' },
|
|
93
|
+
keywordFinish: { key: 'keywordFinish', kind: 'string' },
|
|
94
|
+
delayMessage: { key: 'delayMessage', kind: 'integer' },
|
|
95
|
+
unknownMessage: { key: 'unknownMessage', kind: 'string' },
|
|
96
|
+
listeningFromMe: { key: 'listeningFromMe', kind: 'boolean' },
|
|
97
|
+
stopBotFromMe: { key: 'stopBotFromMe', kind: 'boolean' },
|
|
98
|
+
keepOpen: { key: 'keepOpen', kind: 'boolean' },
|
|
99
|
+
debounceTime: { key: 'debounceTime', kind: 'integer' },
|
|
100
|
+
ignoreJids: { key: 'ignoreJids', kind: 'jidList' },
|
|
101
|
+
splitMessages: { key: 'splitMessages', kind: 'boolean' },
|
|
102
|
+
timePerChar: { key: 'timePerChar', kind: 'integer' },
|
|
103
|
+
typebotUrl: { key: 'url', kind: 'string', botTypes: ['typebot'] },
|
|
104
|
+
typebotPublicId: { key: 'typebot', kind: 'string', botTypes: ['typebot'] },
|
|
105
|
+
openaiCredsId: { key: 'openaiCredsId', kind: 'string', botTypes: ['openai'] },
|
|
106
|
+
openaiBotType: { key: 'botType', kind: 'string', botTypes: ['openai'] },
|
|
107
|
+
assistantId: { key: 'assistantId', kind: 'string', botTypes: ['openai'] },
|
|
108
|
+
model: { key: 'model', kind: 'string', botTypes: ['openai'] },
|
|
109
|
+
maxTokens: { key: 'maxTokens', kind: 'integer', botTypes: ['openai'] },
|
|
110
|
+
functionUrl: { key: 'functionUrl', kind: 'string', botTypes: ['openai'] },
|
|
111
|
+
systemMessages: { key: 'systemMessages', kind: 'messageList', botTypes: ['openai'] },
|
|
112
|
+
assistantMessages: { key: 'assistantMessages', kind: 'messageList', botTypes: ['openai'] },
|
|
113
|
+
userMessages: { key: 'userMessages', kind: 'messageList', botTypes: ['openai'] },
|
|
114
|
+
speechToText: { key: 'speechToText', kind: 'boolean', botTypes: ['openai'] },
|
|
115
|
+
difyBotType: { key: 'botType', kind: 'string', botTypes: ['dify'] },
|
|
116
|
+
apiUrl: { key: 'apiUrl', kind: 'string', botTypes: ['dify', 'flowise', 'evolutionBot'] },
|
|
117
|
+
apiKey: { key: 'apiKey', kind: 'string', botTypes: ['dify', 'flowise', 'evolutionBot', 'evoai'] },
|
|
118
|
+
agentUrl: { key: 'agentUrl', kind: 'string', botTypes: ['evoai'] },
|
|
119
|
+
webhookUrl: { key: 'webhookUrl', kind: 'string', botTypes: ['n8n'] },
|
|
120
|
+
basicAuthUser: { key: 'basicAuthUser', kind: 'string', botTypes: ['n8n'] },
|
|
121
|
+
basicAuthPass: { key: 'basicAuthPass', kind: 'string', botTypes: ['n8n'] },
|
|
122
|
+
};
|
|
123
|
+
function parseJidList(value) {
|
|
124
|
+
const entries = Array.isArray(value) ? value : String(value !== null && value !== void 0 ? value : '').split(/[,\n;]/);
|
|
125
|
+
const jids = entries.map((entry) => (0, GenericFunctions_1.toJid)(String(entry !== null && entry !== void 0 ? entry : ''))).filter((entry) => entry);
|
|
126
|
+
return [...new Set(jids)];
|
|
127
|
+
}
|
|
128
|
+
function parseMessageList(value, label) {
|
|
129
|
+
if (Array.isArray(value))
|
|
130
|
+
return value.map((entry) => String(entry));
|
|
131
|
+
const text = String(value !== null && value !== void 0 ? value : '').trim();
|
|
132
|
+
if (!text)
|
|
133
|
+
return [];
|
|
134
|
+
if (text.startsWith('[')) {
|
|
135
|
+
const parsed = (0, GenericFunctions_1.parseJsonParameter)(text, label);
|
|
136
|
+
if (!Array.isArray(parsed))
|
|
137
|
+
throw new Error(`${label} must be a JSON array of strings`);
|
|
138
|
+
return parsed.map((entry) => String(entry));
|
|
139
|
+
}
|
|
140
|
+
return [text];
|
|
141
|
+
}
|
|
142
|
+
function toInteger(value, label) {
|
|
143
|
+
const number = Number(value);
|
|
144
|
+
if (value === '' || value === null || !Number.isFinite(number)) {
|
|
145
|
+
throw new Error(`${label} must be a number`);
|
|
146
|
+
}
|
|
147
|
+
return Math.round(number);
|
|
148
|
+
}
|
|
149
|
+
function collectBotFields(values, botType) {
|
|
150
|
+
const body = {};
|
|
151
|
+
for (const [name, value] of Object.entries(values)) {
|
|
152
|
+
const spec = FIELD_SPECS[name];
|
|
153
|
+
if (!spec || (spec.botTypes && !spec.botTypes.includes(botType)))
|
|
154
|
+
continue;
|
|
155
|
+
switch (spec.kind) {
|
|
156
|
+
case 'boolean':
|
|
157
|
+
body[spec.key] = value === true;
|
|
158
|
+
break;
|
|
159
|
+
case 'integer':
|
|
160
|
+
body[spec.key] = toInteger(value, name);
|
|
161
|
+
break;
|
|
162
|
+
case 'jidList':
|
|
163
|
+
body[spec.key] = parseJidList(value);
|
|
164
|
+
break;
|
|
165
|
+
case 'messageList':
|
|
166
|
+
body[spec.key] = parseMessageList(value, name);
|
|
167
|
+
break;
|
|
168
|
+
default:
|
|
169
|
+
body[spec.key] = typeof value === 'string' ? value.trim() : String(value !== null && value !== void 0 ? value : '');
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return body;
|
|
173
|
+
}
|
|
174
|
+
function pickBotBody(bot, botType) {
|
|
175
|
+
const body = {};
|
|
176
|
+
for (const key of [...exports.COMMON_BOT_KEYS, ...exports.BOT_TYPES[botType].specificKeys]) {
|
|
177
|
+
const value = bot[key];
|
|
178
|
+
if (value !== undefined && value !== null)
|
|
179
|
+
body[key] = value;
|
|
180
|
+
}
|
|
181
|
+
return body;
|
|
182
|
+
}
|
|
183
|
+
function validateBotBody(node, body, botType, itemIndex) {
|
|
184
|
+
var _a;
|
|
185
|
+
const missing = [];
|
|
186
|
+
if (body.triggerType === 'keyword') {
|
|
187
|
+
if (!body.triggerOperator)
|
|
188
|
+
missing.push('Trigger Operator');
|
|
189
|
+
if (!body.triggerValue)
|
|
190
|
+
missing.push('Trigger Value');
|
|
191
|
+
}
|
|
192
|
+
if (body.triggerType === 'advanced' && !body.triggerValue)
|
|
193
|
+
missing.push('Trigger Value');
|
|
194
|
+
if (botType === 'openai') {
|
|
195
|
+
if (!body.openaiCredsId)
|
|
196
|
+
missing.push('OpenAI Credential');
|
|
197
|
+
if (body.botType === 'assistant' && !body.assistantId)
|
|
198
|
+
missing.push('Assistant ID');
|
|
199
|
+
if (body.botType === 'chatCompletion') {
|
|
200
|
+
if (!body.model)
|
|
201
|
+
missing.push('Model');
|
|
202
|
+
if (!body.maxTokens)
|
|
203
|
+
missing.push('Max Tokens');
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const required = {
|
|
207
|
+
typebot: [
|
|
208
|
+
['url', 'Typebot URL'],
|
|
209
|
+
['typebot', 'Typebot Public ID'],
|
|
210
|
+
],
|
|
211
|
+
dify: [['apiUrl', 'API URL']],
|
|
212
|
+
flowise: [['apiUrl', 'API URL']],
|
|
213
|
+
evolutionBot: [['apiUrl', 'API URL']],
|
|
214
|
+
evoai: [['agentUrl', 'Agent URL']],
|
|
215
|
+
n8n: [['webhookUrl', 'Webhook URL']],
|
|
216
|
+
};
|
|
217
|
+
for (const [key, label] of (_a = required[botType]) !== null && _a !== void 0 ? _a : []) {
|
|
218
|
+
if (!body[key])
|
|
219
|
+
missing.push(label);
|
|
220
|
+
}
|
|
221
|
+
if (missing.length > 0) {
|
|
222
|
+
throw new n8n_workflow_1.NodeOperationError(node, `Missing bot fields: ${missing.join(', ')}`, { itemIndex });
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
exports.SETTINGS_DEFAULTS = {
|
|
226
|
+
expire: 300,
|
|
227
|
+
keywordFinish: 'bye',
|
|
228
|
+
delayMessage: 1000,
|
|
229
|
+
unknownMessage: 'Sorry, I dont understand',
|
|
230
|
+
listeningFromMe: true,
|
|
231
|
+
stopBotFromMe: true,
|
|
232
|
+
keepOpen: false,
|
|
233
|
+
debounceTime: 1,
|
|
234
|
+
ignoreJids: [],
|
|
235
|
+
splitMessages: false,
|
|
236
|
+
timePerChar: 0,
|
|
237
|
+
};
|
|
238
|
+
const SECRET_KEYS = new Set(['apiKey', 'basicAuthPass']);
|
|
239
|
+
function redactBotSecrets(value) {
|
|
240
|
+
if (Array.isArray(value))
|
|
241
|
+
return value.map((entry) => redactBotSecrets(entry));
|
|
242
|
+
if (!(0, GenericFunctions_1.isPlainObject)(value))
|
|
243
|
+
return value;
|
|
244
|
+
const copy = {};
|
|
245
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
246
|
+
if (!SECRET_KEYS.has(key))
|
|
247
|
+
copy[key] = redactBotSecrets(entry);
|
|
248
|
+
}
|
|
249
|
+
return copy;
|
|
250
|
+
}
|
|
251
|
+
exports.includeSecretsOption = {
|
|
252
|
+
displayName: 'Include Secrets',
|
|
253
|
+
name: 'includeSecrets',
|
|
254
|
+
type: 'boolean',
|
|
255
|
+
default: false,
|
|
256
|
+
description: 'Whether to keep API keys and n8n Basic Auth passwords in the output. Off by default so they are not stored in execution logs.',
|
|
257
|
+
};
|
|
258
|
+
exports.secretsOptionsProperty = {
|
|
259
|
+
displayName: 'Options',
|
|
260
|
+
name: 'options',
|
|
261
|
+
type: 'collection',
|
|
262
|
+
placeholder: 'Add Option',
|
|
263
|
+
default: {},
|
|
264
|
+
options: [exports.includeSecretsOption],
|
|
265
|
+
};
|
|
266
|
+
function withChatbotHint(error, hint) {
|
|
267
|
+
var _a;
|
|
268
|
+
if (error instanceof n8n_workflow_1.NodeApiError && error.httpCode === '500') {
|
|
269
|
+
error.description = `${hint} ${(_a = error.description) !== null && _a !== void 0 ? _a : ''}`.trim();
|
|
270
|
+
}
|
|
271
|
+
return error;
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/resources/chatbot/helpers.ts"],"names":[],"mappings":";;;AAwEA,oCAaC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C,WAAW,GAAG,GAAG,IAAI,IAAI,MAAA,KAAK,CAAC,WAAW,mCAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;IAClE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
builderHint?: import("n8n-workflow").IParameterBuilderHint;
|
|
12
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
13
|
+
options?: Array<import("n8n-workflow").INodePropertyOptions | INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
isNodeSetting?: boolean;
|
|
16
|
+
noDataExpression?: boolean;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
19
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
20
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
21
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
22
|
+
requiresDataPath?: "single" | "multiple";
|
|
23
|
+
doNotInherit?: boolean;
|
|
24
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
25
|
+
ignoreValidationDuringExecution?: boolean;
|
|
26
|
+
allowArbitraryValues?: boolean;
|
|
27
|
+
resolvableField?: boolean;
|
|
28
|
+
}[];
|
|
29
|
+
export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<IDataObject>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
7
|
+
const changeStatus_operation_1 = require("./changeStatus.operation");
|
|
8
|
+
const helpers_1 = require("./helpers");
|
|
9
|
+
const properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Action',
|
|
12
|
+
name: 'ignoreJidAction',
|
|
13
|
+
type: 'options',
|
|
14
|
+
options: [
|
|
15
|
+
{ name: 'Add', value: 'add', description: 'Bots of this type stop answering the chat' },
|
|
16
|
+
{ name: 'Remove', value: 'remove', description: 'Bots of this type answer the chat again' },
|
|
17
|
+
],
|
|
18
|
+
default: 'add',
|
|
19
|
+
},
|
|
20
|
+
(0, changeStatus_operation_1.remoteJidProperty)('Chat to ignore or stop ignoring: the exact JID of the chat (…@s.whatsapp.net, …@g.us, …@lid, as in data.key.remoteJid), "@g.us" for every group or "@s.whatsapp.net" for every 1:1 chat. A phone number is turned into …@s.whatsapp.net as typed.'),
|
|
21
|
+
];
|
|
22
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)({ show: { resource: ['chatbot'], operation: ['ignoreJid'] } }, properties);
|
|
23
|
+
async function execute(itemIndex) {
|
|
24
|
+
const instance = await GenericFunctions_1.resolveInstanceName.call(this, itemIndex);
|
|
25
|
+
const botType = (0, helpers_1.parseBotType)(this.getNode(), this.getNodeParameter('botType', itemIndex), itemIndex);
|
|
26
|
+
const remoteJid = changeStatus_operation_1.getRemoteJid.call(this, itemIndex);
|
|
27
|
+
const action = this.getNodeParameter('ignoreJidAction', itemIndex, 'add');
|
|
28
|
+
try {
|
|
29
|
+
return (await GenericFunctions_1.evolutionApiRequest.call(this, 'POST', `/${botType.value}/ignoreJid/${instance}`, { remoteJid, action }, {}, { itemIndex }));
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
throw (0, helpers_1.withChatbotHint)(error, `The ignore list lives in the default ${botType.info.label} settings: save them first with Set Settings.`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=ignoreJid.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignoreJid.operation.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/resources/chatbot/ignoreJid.operation.ts"],"names":[],"mappings":";;;AAiCA,0BAwBC;AAxDD,+CAAoD;AAEpD,6DAAkF;AAClF,qEAA2E;AAC3E,uCAA0D;AAE1D,MAAM,UAAU,GAAsB;IACpC;QACE,WAAW,EAAE,QAAQ;QACrB,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,2CAA2C,EAAE;YACvF,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,yCAAyC,EAAE;SAC5F;QACD,OAAO,EAAE,KAAK;KACf;IACD,IAAA,0CAAiB,EACf,mPAAmP,CACpP;CACF,CAAC;AAEW,QAAA,WAAW,GAAG,IAAA,mCAAoB,EAC7C,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,EAC7D,UAAU,CACX,CAAC;AAOK,KAAK,UAAU,OAAO,CAA0B,SAAiB;IACtE,MAAM,QAAQ,GAAG,MAAM,sCAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,IAAA,sBAAY,EAC1B,IAAI,CAAC,OAAO,EAAE,EACd,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,EAC3C,SAAS,CACV,CAAC;IACF,MAAM,SAAS,GAAG,qCAAY,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,SAAS,EAAE,KAAK,CAAW,CAAC;IACpF,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,sCAAmB,CAAC,IAAI,CACpC,IAAI,EACJ,MAAM,EACN,IAAI,OAAO,CAAC,KAAK,cAAc,QAAQ,EAAE,EACzC,EAAE,SAAS,EAAE,MAAM,EAAE,EACrB,EAAE,EACF,EAAE,SAAS,EAAE,CACd,CAAgB,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAA,yBAAe,EACnB,KAAK,EACL,wCAAwC,OAAO,CAAC,IAAI,CAAC,KAAK,+CAA+C,CAC1G,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import type { OperationHandler } from '../../types';
|
|
3
|
+
export { methods } from './methods';
|
|
4
|
+
export declare const operations: INodeProperties;
|
|
5
|
+
export declare const fields: INodeProperties[];
|
|
6
|
+
export declare const execute: Record<string, OperationHandler>;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.execute = exports.fields = exports.operations = exports.methods = void 0;
|
|
37
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
38
|
+
const changeStatus = __importStar(require("./changeStatus.operation"));
|
|
39
|
+
const create = __importStar(require("./create.operation"));
|
|
40
|
+
const createCredential = __importStar(require("./createCredential.operation"));
|
|
41
|
+
const deleteBot = __importStar(require("./delete.operation"));
|
|
42
|
+
const deleteCredential = __importStar(require("./deleteCredential.operation"));
|
|
43
|
+
const fields_1 = require("./fields");
|
|
44
|
+
const get = __importStar(require("./get.operation"));
|
|
45
|
+
const getCredentials = __importStar(require("./getCredentials.operation"));
|
|
46
|
+
const getMany = __importStar(require("./getMany.operation"));
|
|
47
|
+
const getModels = __importStar(require("./getModels.operation"));
|
|
48
|
+
const getSessions = __importStar(require("./getSessions.operation"));
|
|
49
|
+
const getSettings = __importStar(require("./getSettings.operation"));
|
|
50
|
+
const ignoreJid = __importStar(require("./ignoreJid.operation"));
|
|
51
|
+
const setSettings = __importStar(require("./setSettings.operation"));
|
|
52
|
+
const start = __importStar(require("./start.operation"));
|
|
53
|
+
const update = __importStar(require("./update.operation"));
|
|
54
|
+
var methods_1 = require("./methods");
|
|
55
|
+
Object.defineProperty(exports, "methods", { enumerable: true, get: function () { return methods_1.methods; } });
|
|
56
|
+
exports.operations = {
|
|
57
|
+
displayName: 'Operation',
|
|
58
|
+
name: 'operation',
|
|
59
|
+
type: 'options',
|
|
60
|
+
noDataExpression: true,
|
|
61
|
+
displayOptions: {
|
|
62
|
+
show: {
|
|
63
|
+
resource: ['chatbot'],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
options: [
|
|
67
|
+
{
|
|
68
|
+
name: 'Change Session Status',
|
|
69
|
+
value: 'changeStatus',
|
|
70
|
+
description: "Pause, resume, close or delete a contact's bot session. Pause hands the chat to a human; Close and Delete affect that contact's sessions on every instance of the server.",
|
|
71
|
+
action: 'Change the status of a bot session',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'Create',
|
|
75
|
+
value: 'create',
|
|
76
|
+
description: 'Create a bot with its trigger and behavior settings',
|
|
77
|
+
action: 'Create a bot',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'Create OpenAI Credential',
|
|
81
|
+
value: 'createCredential',
|
|
82
|
+
description: 'Store an OpenAI API key in Evolution for the OpenAI bots of an instance',
|
|
83
|
+
action: 'Create an OpenAI credential',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'Delete',
|
|
87
|
+
value: 'delete',
|
|
88
|
+
description: 'Delete a bot and all its sessions',
|
|
89
|
+
action: 'Delete a bot',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'Delete OpenAI Credential',
|
|
93
|
+
value: 'deleteCredential',
|
|
94
|
+
description: 'Delete an OpenAI API key stored in Evolution',
|
|
95
|
+
action: 'Delete an OpenAI credential',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: 'Get',
|
|
99
|
+
value: 'get',
|
|
100
|
+
description: 'Get a bot by ID',
|
|
101
|
+
action: 'Get a bot',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'Get Many',
|
|
105
|
+
value: 'getMany',
|
|
106
|
+
description: 'Get the bots of a chatbot integration',
|
|
107
|
+
action: 'Get many bots',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'Get OpenAI Credentials',
|
|
111
|
+
value: 'getCredentials',
|
|
112
|
+
description: 'Get the OpenAI credentials stored for an instance and the bots that use them',
|
|
113
|
+
action: 'Get OpenAI credentials',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'Get OpenAI Models',
|
|
117
|
+
value: 'getModels',
|
|
118
|
+
description: 'List the OpenAI models available to a stored OpenAI credential',
|
|
119
|
+
action: 'Get OpenAI models',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'Get Sessions',
|
|
123
|
+
value: 'getSessions',
|
|
124
|
+
description: 'Get the sessions of a bot (contact, status opened/paused/closed, whether it awaits the user)',
|
|
125
|
+
action: 'Get bot sessions',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'Get Settings',
|
|
129
|
+
value: 'getSettings',
|
|
130
|
+
description: 'Get the default settings of a chatbot integration (timeouts, finish keyword, ignored JIDs, fallback bot)',
|
|
131
|
+
action: 'Get default bot settings',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'Ignore JID',
|
|
135
|
+
value: 'ignoreJid',
|
|
136
|
+
description: 'Add a chat to, or remove it from, the list of chats the bots of a type ignore',
|
|
137
|
+
action: 'Add or remove an ignored JID',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'Set Settings',
|
|
141
|
+
value: 'setSettings',
|
|
142
|
+
description: 'Change some default settings of a chatbot integration; the settings you do not add keep their current value',
|
|
143
|
+
action: 'Set default bot settings',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: 'Start Typebot',
|
|
147
|
+
value: 'start',
|
|
148
|
+
description: 'Start a Typebot flow for a contact, optionally with prefilled variables',
|
|
149
|
+
action: 'Start a Typebot flow',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'Update',
|
|
153
|
+
value: 'update',
|
|
154
|
+
description: 'Change some fields of a bot; the fields you do not add keep their current value',
|
|
155
|
+
action: 'Update a bot',
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
default: 'getMany',
|
|
159
|
+
};
|
|
160
|
+
const BOT_TYPE_OPERATIONS = [
|
|
161
|
+
'changeStatus',
|
|
162
|
+
'create',
|
|
163
|
+
'delete',
|
|
164
|
+
'get',
|
|
165
|
+
'getMany',
|
|
166
|
+
'getSessions',
|
|
167
|
+
'getSettings',
|
|
168
|
+
'ignoreJid',
|
|
169
|
+
'setSettings',
|
|
170
|
+
'update',
|
|
171
|
+
];
|
|
172
|
+
exports.fields = [
|
|
173
|
+
...(0, n8n_workflow_1.updateDisplayOptions)({ show: { resource: ['chatbot'], operation: BOT_TYPE_OPERATIONS } }, [
|
|
174
|
+
fields_1.botTypeProperty,
|
|
175
|
+
]),
|
|
176
|
+
...(0, n8n_workflow_1.updateDisplayOptions)({ show: { resource: ['chatbot'], operation: ['delete', 'get', 'getSessions', 'update'] } }, [fields_1.botIdProperty]),
|
|
177
|
+
...changeStatus.description,
|
|
178
|
+
...create.description,
|
|
179
|
+
...createCredential.description,
|
|
180
|
+
...deleteBot.description,
|
|
181
|
+
...deleteCredential.description,
|
|
182
|
+
...get.description,
|
|
183
|
+
...getCredentials.description,
|
|
184
|
+
...getMany.description,
|
|
185
|
+
...getModels.description,
|
|
186
|
+
...getSessions.description,
|
|
187
|
+
...getSettings.description,
|
|
188
|
+
...ignoreJid.description,
|
|
189
|
+
...setSettings.description,
|
|
190
|
+
...start.description,
|
|
191
|
+
...update.description,
|
|
192
|
+
];
|
|
193
|
+
exports.execute = {
|
|
194
|
+
changeStatus: changeStatus.execute,
|
|
195
|
+
create: create.execute,
|
|
196
|
+
createCredential: createCredential.execute,
|
|
197
|
+
delete: deleteBot.execute,
|
|
198
|
+
deleteCredential: deleteCredential.execute,
|
|
199
|
+
get: get.execute,
|
|
200
|
+
getCredentials: getCredentials.execute,
|
|
201
|
+
getMany: getMany.execute,
|
|
202
|
+
getModels: getModels.execute,
|
|
203
|
+
getSessions: getSessions.execute,
|
|
204
|
+
getSettings: getSettings.execute,
|
|
205
|
+
ignoreJid: ignoreJid.execute,
|
|
206
|
+
setSettings: setSettings.execute,
|
|
207
|
+
start: start.execute,
|
|
208
|
+
update: update.execute,
|
|
209
|
+
};
|
|
210
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/resources/chatbot/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAoD;AAGpD,uEAAyD;AACzD,2DAA6C;AAC7C,+EAAiE;AACjE,8DAAgD;AAChD,+EAAiE;AACjE,qCAA0D;AAC1D,qDAAuC;AACvC,2EAA6D;AAC7D,6DAA+C;AAC/C,iEAAmD;AACnD,qEAAuD;AACvD,qEAAuD;AACvD,iEAAmD;AACnD,qEAAuD;AACvD,yDAA2C;AAC3C,2DAA6C;AAE7C,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAUH,QAAA,UAAU,GAAoB;IACzC,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,SAAS;IACf,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE;QACd,IAAI,EAAE;YACJ,QAAQ,EAAE,CAAC,SAAS,CAAC;SACtB;KACF;IACD,O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