@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,31 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare function remoteJidProperty(description: string): INodeProperties;
|
|
3
|
+
export declare function getRemoteJid(this: IExecuteFunctions, itemIndex: number): string;
|
|
4
|
+
export declare const description: {
|
|
5
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
6
|
+
displayName: string;
|
|
7
|
+
name: string;
|
|
8
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
9
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
10
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
11
|
+
description?: string;
|
|
12
|
+
hint?: string;
|
|
13
|
+
builderHint?: import("n8n-workflow").IParameterBuilderHint;
|
|
14
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
15
|
+
options?: Array<import("n8n-workflow").INodePropertyOptions | INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
isNodeSetting?: boolean;
|
|
18
|
+
noDataExpression?: boolean;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
21
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
22
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
23
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
24
|
+
requiresDataPath?: "single" | "multiple";
|
|
25
|
+
doNotInherit?: boolean;
|
|
26
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
27
|
+
ignoreValidationDuringExecution?: boolean;
|
|
28
|
+
allowArbitraryValues?: boolean;
|
|
29
|
+
resolvableField?: boolean;
|
|
30
|
+
}[];
|
|
31
|
+
export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<IDataObject>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.remoteJidProperty = remoteJidProperty;
|
|
5
|
+
exports.getRemoteJid = getRemoteJid;
|
|
6
|
+
exports.execute = execute;
|
|
7
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
+
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
9
|
+
const helpers_1 = require("./helpers");
|
|
10
|
+
function remoteJidProperty(description) {
|
|
11
|
+
return {
|
|
12
|
+
displayName: 'Remote JID',
|
|
13
|
+
name: 'remoteJid',
|
|
14
|
+
type: 'string',
|
|
15
|
+
required: true,
|
|
16
|
+
default: '',
|
|
17
|
+
placeholder: '5215512345678@s.whatsapp.net',
|
|
18
|
+
description,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function getRemoteJid(itemIndex) {
|
|
22
|
+
const remoteJid = (0, GenericFunctions_1.toJid)(this.getNodeParameter('remoteJid', itemIndex, ''));
|
|
23
|
+
if (!remoteJid) {
|
|
24
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Remote JID is required', { itemIndex });
|
|
25
|
+
}
|
|
26
|
+
return remoteJid;
|
|
27
|
+
}
|
|
28
|
+
const properties = [
|
|
29
|
+
remoteJidProperty('Contact or group of the session. Best: the exact JID from the incoming message (data.key.remoteJid, e.g. …@s.whatsapp.net, …@g.us, …@lid). A phone number is turned into …@s.whatsapp.net as typed, but this route does not apply WhatsApp number rules, so e.g. a Mexican 521… number will not match a session stored as 52….'),
|
|
30
|
+
{
|
|
31
|
+
displayName: 'Status',
|
|
32
|
+
name: 'sessionStatus',
|
|
33
|
+
type: 'options',
|
|
34
|
+
options: [
|
|
35
|
+
{
|
|
36
|
+
name: 'Close',
|
|
37
|
+
value: 'closed',
|
|
38
|
+
description: 'End the session. With "Keep Open" in the settings it is kept as closed: on 2.3.x the bot then stays silent for the contact, while Evolution API v2.4 and later start the bot again on the next message. Otherwise it is deleted. Applies to the bot sessions of this contact of every bot type on every instance of the server.',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Delete',
|
|
42
|
+
value: 'delete',
|
|
43
|
+
description: 'Delete the bot sessions of this contact of every bot type on every instance of the server; the next message can start a bot again',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'Open',
|
|
47
|
+
value: 'opened',
|
|
48
|
+
description: 'Resume a paused session (bot sessions of this contact of every bot type on this instance)',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'Pause',
|
|
52
|
+
value: 'paused',
|
|
53
|
+
description: 'The bot ignores the contact until the session is opened again. Use it to hand the chat over to a human (bot sessions of this contact of every bot type on this instance).',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
default: 'paused',
|
|
57
|
+
description: 'New session status. Use Pause for a human handoff: Close does not keep the bot silent on Evolution API v2.4 and later.',
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)({ show: { resource: ['chatbot'], operation: ['changeStatus'] } }, properties);
|
|
61
|
+
async function execute(itemIndex) {
|
|
62
|
+
const instance = await GenericFunctions_1.resolveInstanceName.call(this, itemIndex);
|
|
63
|
+
const botType = (0, helpers_1.parseBotType)(this.getNode(), this.getNodeParameter('botType', itemIndex), itemIndex);
|
|
64
|
+
const remoteJid = getRemoteJid.call(this, itemIndex);
|
|
65
|
+
const status = this.getNodeParameter('sessionStatus', itemIndex, 'paused');
|
|
66
|
+
try {
|
|
67
|
+
return (await GenericFunctions_1.evolutionApiRequest.call(this, 'POST', `/${botType.value}/changeStatus/${instance}`, { remoteJid, status }, {}, { itemIndex }));
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
throw (0, helpers_1.withChatbotHint)(error, 'Check the Remote JID and that the integration is enabled.');
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=changeStatus.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changeStatus.operation.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/resources/chatbot/changeStatus.operation.ts"],"names":[],"mappings":";;;AAOA,8CAUC;AAGD,oCAMC;AAwDD,0BAqBC;AAtGD,+CAAwE;AAExE,6DAAyF;AACzF,uCAA0D;AAG1D,SAAgB,iBAAiB,CAAC,WAAmB;IACnD,OAAO;QACL,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,8BAA8B;QAC3C,WAAW;KACZ,CAAC;AACJ,CAAC;AAGD,SAAgB,YAAY,CAA0B,SAAiB;IACrE,MAAM,SAAS,GAAG,IAAA,wBAAK,EAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3E,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,wBAAwB,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IACxF,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,GAAsB;IACpC,iBAAiB,CACf,gUAAgU,CACjU;IACD;QACE,WAAW,EAAE,QAAQ;QACrB,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,OAAO;gBAC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pB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAA,yBAAe,EAAC,KAAK,EAAE,2DAA2D,CAAC,CAAC;IAC5F,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const OPENAI_BOT_TYPE_OPTIONS: {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string;
|
|
5
|
+
description: string;
|
|
6
|
+
}[];
|
|
7
|
+
export declare const DIFY_BOT_TYPE_OPTIONS: {
|
|
8
|
+
name: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}[];
|
|
11
|
+
export declare const description: {
|
|
12
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
13
|
+
displayName: string;
|
|
14
|
+
name: string;
|
|
15
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
16
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
17
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
18
|
+
description?: string;
|
|
19
|
+
hint?: string;
|
|
20
|
+
builderHint?: import("n8n-workflow").IParameterBuilderHint;
|
|
21
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
22
|
+
options?: Array<import("n8n-workflow").INodePropertyOptions | INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
isNodeSetting?: boolean;
|
|
25
|
+
noDataExpression?: boolean;
|
|
26
|
+
required?: boolean;
|
|
27
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
28
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
29
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
30
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
31
|
+
requiresDataPath?: "single" | "multiple";
|
|
32
|
+
doNotInherit?: boolean;
|
|
33
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
34
|
+
ignoreValidationDuringExecution?: boolean;
|
|
35
|
+
allowArbitraryValues?: boolean;
|
|
36
|
+
resolvableField?: boolean;
|
|
37
|
+
}[];
|
|
38
|
+
export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<IDataObject>;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = exports.DIFY_BOT_TYPE_OPTIONS = exports.OPENAI_BOT_TYPE_OPTIONS = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
7
|
+
const fields_1 = require("./fields");
|
|
8
|
+
const helpers_1 = require("./helpers");
|
|
9
|
+
exports.OPENAI_BOT_TYPE_OPTIONS = [
|
|
10
|
+
{
|
|
11
|
+
name: 'Assistant',
|
|
12
|
+
value: 'assistant',
|
|
13
|
+
description: 'An OpenAI Assistant (Assistants API) identified by its ID',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'Chat Completion',
|
|
17
|
+
value: 'chatCompletion',
|
|
18
|
+
description: 'Chat completions with a model, max tokens and seed messages',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
exports.DIFY_BOT_TYPE_OPTIONS = [
|
|
22
|
+
{ name: 'Agent', value: 'agent' },
|
|
23
|
+
{ name: 'Chat Bot', value: 'chatBot' },
|
|
24
|
+
{ name: 'Text Generator', value: 'textGenerator' },
|
|
25
|
+
{ name: 'Workflow', value: 'workflow' },
|
|
26
|
+
];
|
|
27
|
+
const properties = [
|
|
28
|
+
{
|
|
29
|
+
displayName: 'Enabled',
|
|
30
|
+
name: 'botEnabled',
|
|
31
|
+
type: 'boolean',
|
|
32
|
+
default: true,
|
|
33
|
+
description: 'Whether the bot answers messages right away',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
displayName: 'Trigger Type',
|
|
37
|
+
name: 'triggerType',
|
|
38
|
+
type: 'options',
|
|
39
|
+
options: fields_1.TRIGGER_TYPE_OPTIONS,
|
|
40
|
+
default: 'keyword',
|
|
41
|
+
description: 'Which messages start a session with this bot',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Trigger Operator',
|
|
45
|
+
name: 'triggerOperator',
|
|
46
|
+
type: 'options',
|
|
47
|
+
options: fields_1.TRIGGER_OPERATOR_OPTIONS,
|
|
48
|
+
default: 'contains',
|
|
49
|
+
displayOptions: { show: { triggerType: ['keyword'] } },
|
|
50
|
+
description: 'How the message is compared with Trigger Value (case-sensitive)',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
displayName: 'Trigger Value',
|
|
54
|
+
name: 'triggerValue',
|
|
55
|
+
type: 'string',
|
|
56
|
+
required: true,
|
|
57
|
+
default: '',
|
|
58
|
+
displayOptions: { show: { triggerType: ['keyword', 'advanced'] } },
|
|
59
|
+
description: 'Keyword or filter that starts the bot. The Trigger Operator + Trigger Value pair must be unique per instance.',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Typebot URL',
|
|
63
|
+
name: 'typebotUrl',
|
|
64
|
+
type: 'string',
|
|
65
|
+
required: true,
|
|
66
|
+
default: '',
|
|
67
|
+
placeholder: 'https://typebot.example.com',
|
|
68
|
+
displayOptions: { show: { botType: ['typebot'] } },
|
|
69
|
+
description: 'Base URL of the Typebot viewer (the server that serves the published bot)',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
displayName: 'Typebot Public ID',
|
|
73
|
+
name: 'typebotPublicId',
|
|
74
|
+
type: 'string',
|
|
75
|
+
required: true,
|
|
76
|
+
default: '',
|
|
77
|
+
placeholder: 'my-typebot-abc123',
|
|
78
|
+
displayOptions: { show: { botType: ['typebot'] } },
|
|
79
|
+
description: 'Public ID of the published Typebot (Share > the last part of the link)',
|
|
80
|
+
},
|
|
81
|
+
{ ...fields_1.openaiCredentialProperty, displayOptions: { show: { botType: ['openai'] } } },
|
|
82
|
+
{
|
|
83
|
+
displayName: 'OpenAI Bot Type',
|
|
84
|
+
name: 'openaiBotType',
|
|
85
|
+
type: 'options',
|
|
86
|
+
options: exports.OPENAI_BOT_TYPE_OPTIONS,
|
|
87
|
+
default: 'chatCompletion',
|
|
88
|
+
displayOptions: { show: { botType: ['openai'] } },
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
displayName: 'Assistant ID',
|
|
92
|
+
name: 'openaiAssistantId',
|
|
93
|
+
type: 'string',
|
|
94
|
+
required: true,
|
|
95
|
+
default: '',
|
|
96
|
+
placeholder: 'asst_abc123',
|
|
97
|
+
displayOptions: { show: { botType: ['openai'], openaiBotType: ['assistant'] } },
|
|
98
|
+
description: 'ID of the OpenAI Assistant',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
displayName: 'Model',
|
|
102
|
+
name: 'openaiModel',
|
|
103
|
+
type: 'string',
|
|
104
|
+
required: true,
|
|
105
|
+
default: '',
|
|
106
|
+
placeholder: 'gpt-4o-mini',
|
|
107
|
+
displayOptions: { show: { botType: ['openai'], openaiBotType: ['chatCompletion'] } },
|
|
108
|
+
description: 'OpenAI model ID (see Get OpenAI Models)',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
displayName: 'Max Tokens',
|
|
112
|
+
name: 'openaiMaxTokens',
|
|
113
|
+
type: 'number',
|
|
114
|
+
required: true,
|
|
115
|
+
typeOptions: { minValue: 1 },
|
|
116
|
+
default: 500,
|
|
117
|
+
displayOptions: { show: { botType: ['openai'], openaiBotType: ['chatCompletion'] } },
|
|
118
|
+
description: 'Maximum number of tokens of each reply',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
displayName: 'Dify Bot Type',
|
|
122
|
+
name: 'difyBotType',
|
|
123
|
+
type: 'options',
|
|
124
|
+
options: exports.DIFY_BOT_TYPE_OPTIONS,
|
|
125
|
+
default: 'chatBot',
|
|
126
|
+
displayOptions: { show: { botType: ['dify'] } },
|
|
127
|
+
description: 'Type of the Dify app',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
displayName: 'API URL',
|
|
131
|
+
name: 'botApiUrl',
|
|
132
|
+
type: 'string',
|
|
133
|
+
required: true,
|
|
134
|
+
default: '',
|
|
135
|
+
displayOptions: { show: { botType: ['dify', 'flowise', 'evolutionBot'] } },
|
|
136
|
+
description: 'Dify: API base URL (e.g. https://api.dify.ai/v1). Flowise: prediction URL of the chatflow (…/api/v1/prediction/<ID>). Evolution Bot: URL that receives each message.',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
displayName: 'Agent URL',
|
|
140
|
+
name: 'evoaiAgentUrl',
|
|
141
|
+
type: 'string',
|
|
142
|
+
required: true,
|
|
143
|
+
default: '',
|
|
144
|
+
displayOptions: { show: { botType: ['evoai'] } },
|
|
145
|
+
description: 'URL of the EvoAI agent',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
displayName: 'Webhook URL',
|
|
149
|
+
name: 'n8nWebhookUrl',
|
|
150
|
+
type: 'string',
|
|
151
|
+
required: true,
|
|
152
|
+
default: '',
|
|
153
|
+
placeholder: 'https://n8n.example.com/webhook/whatsapp-bot',
|
|
154
|
+
displayOptions: { show: { botType: ['n8n'] } },
|
|
155
|
+
description: 'Production URL of an n8n Webhook node (POST). Evolution sends { chatInput, sessionId, remoteJid, pushName, keyId, fromMe, quotedMessage, instanceName, serverUrl, apiKey } and replies with the "output" (or "answer") field of the response. apiKey is the instance token: add Basic Auth User and Password (Additional Fields), check them in the Webhook node and avoid saving those executions.',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
displayName: 'API Key',
|
|
159
|
+
name: 'botApiKey',
|
|
160
|
+
type: 'string',
|
|
161
|
+
typeOptions: { password: true },
|
|
162
|
+
default: '',
|
|
163
|
+
displayOptions: { show: { botType: ['dify', 'flowise', 'evolutionBot', 'evoai'] } },
|
|
164
|
+
description: 'API key of the bot service (required by Dify; optional for the others)',
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
displayName: 'Additional Fields',
|
|
168
|
+
name: 'additionalFields',
|
|
169
|
+
type: 'collection',
|
|
170
|
+
placeholder: 'Add Field',
|
|
171
|
+
default: {},
|
|
172
|
+
description: 'Behavior fields not added here use the default settings of this bot type (Get Settings)',
|
|
173
|
+
options: (0, fields_1.sortOptions)([
|
|
174
|
+
{
|
|
175
|
+
displayName: 'Description',
|
|
176
|
+
name: 'description',
|
|
177
|
+
type: 'string',
|
|
178
|
+
default: '',
|
|
179
|
+
description: 'Name shown for the bot in the Evolution manager and in bot lists',
|
|
180
|
+
},
|
|
181
|
+
...fields_1.BEHAVIOR_OPTIONS,
|
|
182
|
+
...fields_1.N8N_AUTH_OPTIONS,
|
|
183
|
+
...fields_1.OPENAI_MESSAGE_OPTIONS,
|
|
184
|
+
]),
|
|
185
|
+
},
|
|
186
|
+
helpers_1.secretsOptionsProperty,
|
|
187
|
+
];
|
|
188
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)({ show: { resource: ['chatbot'], operation: ['create'] } }, properties);
|
|
189
|
+
async function execute(itemIndex) {
|
|
190
|
+
const node = this.getNode();
|
|
191
|
+
const instance = await GenericFunctions_1.resolveInstanceName.call(this, itemIndex);
|
|
192
|
+
const botType = (0, helpers_1.parseBotType)(node, this.getNodeParameter('botType', itemIndex), itemIndex);
|
|
193
|
+
const param = (name, fallback = '') => this.getNodeParameter(name, itemIndex, fallback);
|
|
194
|
+
const text = (name) => { var _a; return String((_a = param(name)) !== null && _a !== void 0 ? _a : '').trim(); };
|
|
195
|
+
const triggerType = text('triggerType') || 'keyword';
|
|
196
|
+
const body = { enabled: param('botEnabled', true) === true, triggerType };
|
|
197
|
+
if (triggerType === 'keyword')
|
|
198
|
+
body.triggerOperator = text('triggerOperator') || 'contains';
|
|
199
|
+
if (triggerType === 'keyword' || triggerType === 'advanced') {
|
|
200
|
+
body.triggerValue = text('triggerValue');
|
|
201
|
+
}
|
|
202
|
+
switch (botType.value) {
|
|
203
|
+
case 'typebot':
|
|
204
|
+
body.url = text('typebotUrl');
|
|
205
|
+
body.typebot = text('typebotPublicId');
|
|
206
|
+
break;
|
|
207
|
+
case 'openai':
|
|
208
|
+
body.openaiCredsId = text('openaiCredsId');
|
|
209
|
+
body.botType = text('openaiBotType') || 'chatCompletion';
|
|
210
|
+
if (body.botType === 'assistant') {
|
|
211
|
+
body.assistantId = text('openaiAssistantId');
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
body.model = text('openaiModel');
|
|
215
|
+
body.maxTokens = Math.round(Number(param('openaiMaxTokens', 0)));
|
|
216
|
+
}
|
|
217
|
+
break;
|
|
218
|
+
case 'dify':
|
|
219
|
+
body.botType = text('difyBotType') || 'chatBot';
|
|
220
|
+
body.apiUrl = text('botApiUrl');
|
|
221
|
+
break;
|
|
222
|
+
case 'flowise':
|
|
223
|
+
case 'evolutionBot':
|
|
224
|
+
body.apiUrl = text('botApiUrl');
|
|
225
|
+
break;
|
|
226
|
+
case 'evoai':
|
|
227
|
+
body.agentUrl = text('evoaiAgentUrl');
|
|
228
|
+
break;
|
|
229
|
+
case 'n8n':
|
|
230
|
+
body.webhookUrl = text('n8nWebhookUrl');
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
if (['dify', 'flowise', 'evolutionBot', 'evoai'].includes(botType.value)) {
|
|
234
|
+
const apiKey = text('botApiKey');
|
|
235
|
+
if (apiKey)
|
|
236
|
+
body.apiKey = apiKey;
|
|
237
|
+
}
|
|
238
|
+
const fields = this.getNodeParameter('additionalFields', itemIndex, {});
|
|
239
|
+
Object.assign(body, (0, helpers_1.collectBotFields)(fields, botType.value));
|
|
240
|
+
(0, helpers_1.validateBotBody)(node, body, botType.value, itemIndex);
|
|
241
|
+
const options = this.getNodeParameter('options', itemIndex, {});
|
|
242
|
+
let bot;
|
|
243
|
+
try {
|
|
244
|
+
bot = (await GenericFunctions_1.evolutionApiRequest.call(this, 'POST', `/${botType.value}/create/${instance}`, body, {}, { itemIndex }));
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
throw (0, helpers_1.withChatbotHint)(error, `Evolution rejects a second enabled "All" ${botType.info.label} bot, a trigger that already exists and a duplicate bot (same URL and key).`);
|
|
248
|
+
}
|
|
249
|
+
return options.includeSecrets === true ? bot : (0, helpers_1.redactBotSecrets)(bot);
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=create.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.operation.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/resources/chatbot/create.operation.ts"],"names":[],"mappings":";;;AA6NA,0BAwEC;AApSD,+CAAoD;AAEpD,6DAAkF;AAClF,qCAQkB;AAClB,uCAOmB;AAGN,QAAA,uBAAuB,GAAG;IACrC;QACE,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,2DAA2D;KACzE;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,6DAA6D;KAC3E;CACF,CAAC;AAGW,QAAA,qBAAqB,GAAG;IACnC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IACjC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE;IACtC,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,eAAe,EAAE;IAClD,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;CACxC,CAAC;AAEF,MAAM,UAAU,GAAsB;IACpC;QACE,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,6CAA6C;KAC3D;IACD;QACE,W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,WAAW,QAAQ,EAAE,EACtC,IAAI,EACJ,EAAE,EACF,EAAE,SAAS,EAAE,CACd,CAAgB,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAA,yBAAe,EACnB,KAAK,EACL,4CAA4C,OAAO,CAAC,IAAI,CAAC,KAAK,6EAA6E,CAC5I,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAA,0BAAgB,EAAC,GAAG,CAAC,CAAC;AACvE,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,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
7
|
+
const helpers_1 = require("./helpers");
|
|
8
|
+
const properties = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Name',
|
|
11
|
+
name: 'openaiCredentialName',
|
|
12
|
+
type: 'string',
|
|
13
|
+
required: true,
|
|
14
|
+
default: '',
|
|
15
|
+
placeholder: 'main-openai-key',
|
|
16
|
+
description: 'Unique name of the credential on this instance',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
displayName: 'OpenAI API Key',
|
|
20
|
+
name: 'openaiApiKey',
|
|
21
|
+
type: 'string',
|
|
22
|
+
typeOptions: { password: true },
|
|
23
|
+
required: true,
|
|
24
|
+
default: '',
|
|
25
|
+
placeholder: 'sk-…',
|
|
26
|
+
description: 'OpenAI API key. The same key cannot be stored twice on the server.',
|
|
27
|
+
},
|
|
28
|
+
helpers_1.secretsOptionsProperty,
|
|
29
|
+
];
|
|
30
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)({ show: { resource: ['chatbot'], operation: ['createCredential'] } }, properties);
|
|
31
|
+
async function execute(itemIndex) {
|
|
32
|
+
const instance = await GenericFunctions_1.resolveInstanceName.call(this, itemIndex);
|
|
33
|
+
const name = String(this.getNodeParameter('openaiCredentialName', itemIndex, '')).trim();
|
|
34
|
+
const apiKey = String(this.getNodeParameter('openaiApiKey', itemIndex, '')).trim();
|
|
35
|
+
if (!name || !apiKey) {
|
|
36
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Name and OpenAI API Key are required', {
|
|
37
|
+
itemIndex,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const options = this.getNodeParameter('options', itemIndex, {});
|
|
41
|
+
const response = (await GenericFunctions_1.evolutionApiRequest.call(this, 'POST', `/openai/creds/${instance}`, { name, apiKey }, {}, { itemIndex }));
|
|
42
|
+
return options.includeSecrets === true ? response : (0, helpers_1.redactBotSecrets)(response);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=createCredential.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCredential.operation.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/resources/chatbot/createCredential.operation.ts"],"names":[],"mappings":";;;AAwCA,0BAmBC;AA1DD,+CAAwE;AAExE,6DAAkF;AAClF,uCAAqE;AAErE,MAAM,UAAU,GAAsB;IACpC;QACE,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,sBAAsB;QAC5B,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,gDAAgD;KAC9D;IACD;QACE,WAAW,EAAE,gBAAgB;QAC7B,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/B,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,MAAM;QACnB,WAAW,EAAE,oEAAoE;KAClF;IACD,gCAAsB;CACvB,CAAC;AAEW,QAAA,WAAW,GAAG,IAAA,mCAAoB,EAC7C,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,kBAAkB,CAAC,EAAE,EAAE,EACpE,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,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,sBAAsB,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACzF,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACnF,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QACrB,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,sCAAsC,EAAE;YACnF,SAAS;SACV,CAAC,CAAC;IACL,CAAC;IACD,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,MAAM,EACN,iBAAiB,QAAQ,EAAE,EAC3B,EAAE,IAAI,EAAE,MAAM,EAAE,EAChB,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,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
6
|
+
const helpers_1 = require("./helpers");
|
|
7
|
+
exports.description = [];
|
|
8
|
+
async function execute(itemIndex) {
|
|
9
|
+
const instance = await GenericFunctions_1.resolveInstanceName.call(this, itemIndex);
|
|
10
|
+
const botType = (0, helpers_1.parseBotType)(this.getNode(), this.getNodeParameter('botType', itemIndex), itemIndex);
|
|
11
|
+
const botId = String(this.getNodeParameter('botId', itemIndex, '', { extractValue: true })).trim();
|
|
12
|
+
try {
|
|
13
|
+
return (await GenericFunctions_1.evolutionApiRequest.call(this, 'DELETE', `/${botType.value}/delete/${(0, GenericFunctions_1.encodePathSegment)(botId, 'Bot ID')}/${instance}`, {}, {}, { itemIndex }));
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
throw (0, helpers_1.withChatbotHint)(error, `Check that the ${botType.info.label} bot "${botId}" exists on this instance (Get Many).`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=delete.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.operation.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/resources/chatbot/delete.operation.ts"],"names":[],"mappings":";;;AAiBA,0BAyBC;AAxCD,6DAIgC;AAChC,uCAA0D;AAG7C,QAAA,WAAW,GAAsB,EAAE,CAAC;AAO1C,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,KAAK,GAAG,MAAM,CAClB,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CACtE,CAAC,IAAI,EAAE,CAAC;IACT,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,sCAAmB,CAAC,IAAI,CACpC,IAAI,EACJ,QAAQ,EACR,IAAI,OAAO,CAAC,KAAK,WAAW,IAAA,oCAAiB,EAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,QAAQ,EAAE,EAC5E,EAAE,EACF,EAAE,EACF,EAAE,SAAS,EAAE,CACd,CAAgB,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAA,yBAAe,EACnB,KAAK,EACL,kBAAkB,OAAO,CAAC,IAAI,CAAC,KAAK,SAAS,KAAK,uCAAuC,CAC1F,CAAC;IACJ,CAAC;AACH,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,30 @@
|
|
|
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 fields_1 = require("./fields");
|
|
8
|
+
const helpers_1 = require("./helpers");
|
|
9
|
+
const properties = [
|
|
10
|
+
{
|
|
11
|
+
...fields_1.openaiCredentialProperty,
|
|
12
|
+
description: 'OpenAI credential to delete. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)({ show: { resource: ['chatbot'], operation: ['deleteCredential'] } }, properties);
|
|
16
|
+
async function execute(itemIndex) {
|
|
17
|
+
const instance = await GenericFunctions_1.resolveInstanceName.call(this, itemIndex);
|
|
18
|
+
const credsId = String(this.getNodeParameter('openaiCredsId', itemIndex, '')).trim();
|
|
19
|
+
if (!credsId) {
|
|
20
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'OpenAI Credential ID is required', { itemIndex });
|
|
21
|
+
}
|
|
22
|
+
const path = `/openai/creds/${(0, GenericFunctions_1.encodePathSegment)(credsId, 'OpenAI Credential ID')}/${instance}`;
|
|
23
|
+
try {
|
|
24
|
+
return (await GenericFunctions_1.evolutionApiRequest.call(this, 'DELETE', path, {}, {}, { itemIndex }));
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
throw (0, helpers_1.withChatbotHint)(error, 'Check that the credential exists on this instance (Get OpenAI Credentials) and that no OpenAI bot still uses it.');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=deleteCredential.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteCredential.operation.js","sourceRoot":"","sources":["../../../../../nodes/EvolutionApi/resources/chatbot/deleteCredential.operation.ts"],"names":[],"mappings":";;;AA4BA,0BAsBC;AAjDD,+CAAwE;AAExE,6DAIgC;AAChC,qCAAoD;AACpD,uCAA4C;AAE5C,MAAM,UAAU,GAAsB;IACpC;QACE,GAAG,iCAAwB;QAC3B,WAAW,EACT,8IAA8I;KACjJ;CACF,CAAC;AAEW,QAAA,WAAW,GAAG,IAAA,mCAAoB,EAC7C,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,kBAAkB,CAAC,EAAE,EAAE,EACpE,UAAU,CACX,CAAC;AAMK,KAAK,UAAU,OAAO,CAA0B,SAAiB;IACtE,MAAM,QAAQ,GAAG,MAAM,sCAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,eAAe,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACrF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,kCAAkC,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IAClG,CAAC;IACD,MAAM,IAAI,GAAG,iBAAiB,IAAA,oCAAiB,EAAC,OAAO,EAAE,sBAAsB,CAAC,IAAI,QAAQ,EAAE,CAAC;IAC/F,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,sCAAmB,CAAC,IAAI,CACpC,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,EAAE,EACF,EAAE,EACF,EAAE,SAAS,EAAE,CACd,CAAgB,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAA,yBAAe,EACnB,KAAK,EACL,kHAAkH,CACnH,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { INodeProperties, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
export declare const botTypeProperty: INodeProperties;
|
|
3
|
+
export declare const botIdProperty: INodeProperties;
|
|
4
|
+
export declare const openaiCredentialProperty: INodeProperties;
|
|
5
|
+
export declare const TRIGGER_TYPE_OPTIONS: INodePropertyOptions[];
|
|
6
|
+
export declare const TRIGGER_OPERATOR_OPTIONS: INodePropertyOptions[];
|
|
7
|
+
export declare const BEHAVIOR_OPTIONS: INodeProperties[];
|
|
8
|
+
export declare const OPENAI_MESSAGE_OPTIONS: INodeProperties[];
|
|
9
|
+
export declare const N8N_AUTH_OPTIONS: INodeProperties[];
|
|
10
|
+
export declare function sortOptions(options: INodeProperties[]): INodeProperties[];
|