n8n-nodes-stevomanager 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +19 -0
- package/README.md +254 -0
- package/dist/credentials/StevoManager.credentials.d.ts +9 -0
- package/dist/credentials/StevoManager.credentials.js +50 -0
- package/dist/credentials/StevoManager.credentials.js.map +1 -0
- package/dist/credentials/StevoManagerApi.credentials.d.ts +9 -0
- package/dist/credentials/StevoManagerApi.credentials.js +50 -0
- package/dist/credentials/StevoManagerApi.credentials.js.map +1 -0
- package/dist/nodes/StevoManager/StevoManager.node.d.ts +5 -0
- package/dist/nodes/StevoManager/StevoManager.node.js +54 -0
- package/dist/nodes/StevoManager/StevoManager.node.js.map +1 -0
- package/dist/nodes/StevoManager/StevoManager.node.json +21 -0
- package/dist/nodes/StevoManager/execute/chat/blockContact.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/chat/blockContact.js +51 -0
- package/dist/nodes/StevoManager/execute/chat/blockContact.js.map +1 -0
- package/dist/nodes/StevoManager/execute/chat/checkNumber.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/chat/checkNumber.js +50 -0
- package/dist/nodes/StevoManager/execute/chat/checkNumber.js.map +1 -0
- package/dist/nodes/StevoManager/execute/chat/deleteMessage.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/chat/deleteMessage.js +62 -0
- package/dist/nodes/StevoManager/execute/chat/deleteMessage.js.map +1 -0
- package/dist/nodes/StevoManager/execute/chat/fetchProfilePicture.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/chat/fetchProfilePicture.js +49 -0
- package/dist/nodes/StevoManager/execute/chat/fetchProfilePicture.js.map +1 -0
- package/dist/nodes/StevoManager/execute/chat/findChats.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/chat/findChats.js +57 -0
- package/dist/nodes/StevoManager/execute/chat/findChats.js.map +1 -0
- package/dist/nodes/StevoManager/execute/chat/findContacts.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/chat/findContacts.js +55 -0
- package/dist/nodes/StevoManager/execute/chat/findContacts.js.map +1 -0
- package/dist/nodes/StevoManager/execute/chat/findMessages.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/chat/findMessages.js +57 -0
- package/dist/nodes/StevoManager/execute/chat/findMessages.js.map +1 -0
- package/dist/nodes/StevoManager/execute/chat/findStatusMessages.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/chat/findStatusMessages.js +58 -0
- package/dist/nodes/StevoManager/execute/chat/findStatusMessages.js.map +1 -0
- package/dist/nodes/StevoManager/execute/chat/getMediaBase64.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/chat/getMediaBase64.js +55 -0
- package/dist/nodes/StevoManager/execute/chat/getMediaBase64.js.map +1 -0
- package/dist/nodes/StevoManager/execute/chat/manageArchive.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/chat/manageArchive.js +60 -0
- package/dist/nodes/StevoManager/execute/chat/manageArchive.js.map +1 -0
- package/dist/nodes/StevoManager/execute/chat/markChatUnread.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/chat/markChatUnread.js +58 -0
- package/dist/nodes/StevoManager/execute/chat/markChatUnread.js.map +1 -0
- package/dist/nodes/StevoManager/execute/chat/readMessages.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/chat/readMessages.js +57 -0
- package/dist/nodes/StevoManager/execute/chat/readMessages.js.map +1 -0
- package/dist/nodes/StevoManager/execute/chat/sendPresence.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/chat/sendPresence.js +53 -0
- package/dist/nodes/StevoManager/execute/chat/sendPresence.js.map +1 -0
- package/dist/nodes/StevoManager/execute/chat/updateMessage.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/chat/updateMessage.js +57 -0
- package/dist/nodes/StevoManager/execute/chat/updateMessage.js.map +1 -0
- package/dist/nodes/StevoManager/execute/events/setProxy.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/events/setProxy.js +63 -0
- package/dist/nodes/StevoManager/execute/events/setProxy.js.map +1 -0
- package/dist/nodes/StevoManager/execute/events/setRabbitMQ.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/events/setRabbitMQ.js +83 -0
- package/dist/nodes/StevoManager/execute/events/setRabbitMQ.js.map +1 -0
- package/dist/nodes/StevoManager/execute/events/setWebhook.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/events/setWebhook.js +89 -0
- package/dist/nodes/StevoManager/execute/events/setWebhook.js.map +1 -0
- package/dist/nodes/StevoManager/execute/evolutionRequest.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/evolutionRequest.js +18 -0
- package/dist/nodes/StevoManager/execute/evolutionRequest.js.map +1 -0
- package/dist/nodes/StevoManager/execute/groups/createGroup.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/groups/createGroup.js +54 -0
- package/dist/nodes/StevoManager/execute/groups/createGroup.js.map +1 -0
- package/dist/nodes/StevoManager/execute/groups/fetchGroups.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/groups/fetchGroups.js +69 -0
- package/dist/nodes/StevoManager/execute/groups/fetchGroups.js.map +1 -0
- package/dist/nodes/StevoManager/execute/groups/fetchInviteCode.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/groups/fetchInviteCode.js +45 -0
- package/dist/nodes/StevoManager/execute/groups/fetchInviteCode.js.map +1 -0
- package/dist/nodes/StevoManager/execute/groups/findParticipants.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/groups/findParticipants.js +45 -0
- package/dist/nodes/StevoManager/execute/groups/findParticipants.js.map +1 -0
- package/dist/nodes/StevoManager/execute/groups/joinGroup.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/groups/joinGroup.js +45 -0
- package/dist/nodes/StevoManager/execute/groups/joinGroup.js.map +1 -0
- package/dist/nodes/StevoManager/execute/groups/leaveGroup.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/groups/leaveGroup.js +45 -0
- package/dist/nodes/StevoManager/execute/groups/leaveGroup.js.map +1 -0
- package/dist/nodes/StevoManager/execute/groups/revokeInviteCode.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/groups/revokeInviteCode.js +45 -0
- package/dist/nodes/StevoManager/execute/groups/revokeInviteCode.js.map +1 -0
- package/dist/nodes/StevoManager/execute/groups/sendInviteLink.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/groups/sendInviteLink.js +54 -0
- package/dist/nodes/StevoManager/execute/groups/sendInviteLink.js.map +1 -0
- package/dist/nodes/StevoManager/execute/groups/toggleEphemeral.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/groups/toggleEphemeral.js +50 -0
- package/dist/nodes/StevoManager/execute/groups/toggleEphemeral.js.map +1 -0
- package/dist/nodes/StevoManager/execute/groups/updateGroupDescription.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/groups/updateGroupDescription.js +50 -0
- package/dist/nodes/StevoManager/execute/groups/updateGroupDescription.js.map +1 -0
- package/dist/nodes/StevoManager/execute/groups/updateGroupName.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/groups/updateGroupName.js +50 -0
- package/dist/nodes/StevoManager/execute/groups/updateGroupName.js.map +1 -0
- package/dist/nodes/StevoManager/execute/groups/updateGroupPicture.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/groups/updateGroupPicture.js +50 -0
- package/dist/nodes/StevoManager/execute/groups/updateGroupPicture.js.map +1 -0
- package/dist/nodes/StevoManager/execute/groups/updateParticipants.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/groups/updateParticipants.js +53 -0
- package/dist/nodes/StevoManager/execute/groups/updateParticipants.js.map +1 -0
- package/dist/nodes/StevoManager/execute/groups/updateSettings.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/groups/updateSettings.js +50 -0
- package/dist/nodes/StevoManager/execute/groups/updateSettings.js.map +1 -0
- package/dist/nodes/StevoManager/execute/index.d.ts +8 -0
- package/dist/nodes/StevoManager/execute/index.js +148 -0
- package/dist/nodes/StevoManager/execute/index.js.map +1 -0
- package/dist/nodes/StevoManager/execute/instance/createInstanceBasic.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/instance/createInstanceBasic.js +104 -0
- package/dist/nodes/StevoManager/execute/instance/createInstanceBasic.js.map +1 -0
- package/dist/nodes/StevoManager/execute/instance/deleteInstance.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/instance/deleteInstance.js +48 -0
- package/dist/nodes/StevoManager/execute/instance/deleteInstance.js.map +1 -0
- package/dist/nodes/StevoManager/execute/instance/fetchInstances.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/instance/fetchInstances.js +52 -0
- package/dist/nodes/StevoManager/execute/instance/fetchInstances.js.map +1 -0
- package/dist/nodes/StevoManager/execute/instance/instanceConnect.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/instance/instanceConnect.js +56 -0
- package/dist/nodes/StevoManager/execute/instance/instanceConnect.js.map +1 -0
- package/dist/nodes/StevoManager/execute/instance/instanceSettings.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/instance/instanceSettings.js +71 -0
- package/dist/nodes/StevoManager/execute/instance/instanceSettings.js.map +1 -0
- package/dist/nodes/StevoManager/execute/instance/logoutInstance.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/instance/logoutInstance.js +52 -0
- package/dist/nodes/StevoManager/execute/instance/logoutInstance.js.map +1 -0
- package/dist/nodes/StevoManager/execute/instance/restartInstance.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/instance/restartInstance.js +48 -0
- package/dist/nodes/StevoManager/execute/instance/restartInstance.js.map +1 -0
- package/dist/nodes/StevoManager/execute/instance/setPresence.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/instance/setPresence.js +55 -0
- package/dist/nodes/StevoManager/execute/instance/setPresence.js.map +1 -0
- package/dist/nodes/StevoManager/execute/instance/setProxy.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/instance/setProxy.js +89 -0
- package/dist/nodes/StevoManager/execute/instance/setProxy.js.map +1 -0
- package/dist/nodes/StevoManager/execute/integrations/setChatwoot.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/integrations/setChatwoot.js +108 -0
- package/dist/nodes/StevoManager/execute/integrations/setChatwoot.js.map +1 -0
- package/dist/nodes/StevoManager/execute/integrations/setDifyBot.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/integrations/setDifyBot.js +169 -0
- package/dist/nodes/StevoManager/execute/integrations/setDifyBot.js.map +1 -0
- package/dist/nodes/StevoManager/execute/integrations/setEvolutionBot.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/integrations/setEvolutionBot.js +178 -0
- package/dist/nodes/StevoManager/execute/integrations/setEvolutionBot.js.map +1 -0
- package/dist/nodes/StevoManager/execute/integrations/setFlowiseBot.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/integrations/setFlowiseBot.js +178 -0
- package/dist/nodes/StevoManager/execute/integrations/setFlowiseBot.js.map +1 -0
- package/dist/nodes/StevoManager/execute/integrations/setTypebot.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/integrations/setTypebot.js +194 -0
- package/dist/nodes/StevoManager/execute/integrations/setTypebot.js.map +1 -0
- package/dist/nodes/StevoManager/execute/messages/sendAudio.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/messages/sendAudio.js +82 -0
- package/dist/nodes/StevoManager/execute/messages/sendAudio.js.map +1 -0
- package/dist/nodes/StevoManager/execute/messages/sendButtons.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/messages/sendButtons.js +35 -0
- package/dist/nodes/StevoManager/execute/messages/sendButtons.js.map +1 -0
- package/dist/nodes/StevoManager/execute/messages/sendContact.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/messages/sendContact.js +83 -0
- package/dist/nodes/StevoManager/execute/messages/sendContact.js.map +1 -0
- package/dist/nodes/StevoManager/execute/messages/sendDocument.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/messages/sendDocument.js +95 -0
- package/dist/nodes/StevoManager/execute/messages/sendDocument.js.map +1 -0
- package/dist/nodes/StevoManager/execute/messages/sendImage.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/messages/sendImage.js +95 -0
- package/dist/nodes/StevoManager/execute/messages/sendImage.js.map +1 -0
- package/dist/nodes/StevoManager/execute/messages/sendList.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/messages/sendList.js +35 -0
- package/dist/nodes/StevoManager/execute/messages/sendList.js.map +1 -0
- package/dist/nodes/StevoManager/execute/messages/sendPix.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/messages/sendPix.js +35 -0
- package/dist/nodes/StevoManager/execute/messages/sendPix.js.map +1 -0
- package/dist/nodes/StevoManager/execute/messages/sendPoll.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/messages/sendPoll.js +89 -0
- package/dist/nodes/StevoManager/execute/messages/sendPoll.js.map +1 -0
- package/dist/nodes/StevoManager/execute/messages/sendReaction.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/messages/sendReaction.js +74 -0
- package/dist/nodes/StevoManager/execute/messages/sendReaction.js.map +1 -0
- package/dist/nodes/StevoManager/execute/messages/sendStories.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/messages/sendStories.js +35 -0
- package/dist/nodes/StevoManager/execute/messages/sendStories.js.map +1 -0
- package/dist/nodes/StevoManager/execute/messages/sendText.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/messages/sendText.js +88 -0
- package/dist/nodes/StevoManager/execute/messages/sendText.js.map +1 -0
- package/dist/nodes/StevoManager/execute/messages/sendVideo.d.ts +2 -0
- package/dist/nodes/StevoManager/execute/messages/sendVideo.js +95 -0
- package/dist/nodes/StevoManager/execute/messages/sendVideo.js.map +1 -0
- package/dist/nodes/StevoManager/execute/profile/fetchBusinessProfile.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/profile/fetchBusinessProfile.js +49 -0
- package/dist/nodes/StevoManager/execute/profile/fetchBusinessProfile.js.map +1 -0
- package/dist/nodes/StevoManager/execute/profile/fetchPrivacySettings.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/profile/fetchPrivacySettings.js +44 -0
- package/dist/nodes/StevoManager/execute/profile/fetchPrivacySettings.js.map +1 -0
- package/dist/nodes/StevoManager/execute/profile/fetchProfile.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/profile/fetchProfile.js +49 -0
- package/dist/nodes/StevoManager/execute/profile/fetchProfile.js.map +1 -0
- package/dist/nodes/StevoManager/execute/profile/removeProfilePicture.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/profile/removeProfilePicture.js +44 -0
- package/dist/nodes/StevoManager/execute/profile/removeProfilePicture.js.map +1 -0
- package/dist/nodes/StevoManager/execute/profile/updatePrivacySettings.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/profile/updatePrivacySettings.js +59 -0
- package/dist/nodes/StevoManager/execute/profile/updatePrivacySettings.js.map +1 -0
- package/dist/nodes/StevoManager/execute/profile/updateProfileName.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/profile/updateProfileName.js +49 -0
- package/dist/nodes/StevoManager/execute/profile/updateProfileName.js.map +1 -0
- package/dist/nodes/StevoManager/execute/profile/updateProfilePicture.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/profile/updateProfilePicture.js +49 -0
- package/dist/nodes/StevoManager/execute/profile/updateProfilePicture.js.map +1 -0
- package/dist/nodes/StevoManager/execute/profile/updateProfileStatus.d.ts +27 -0
- package/dist/nodes/StevoManager/execute/profile/updateProfileStatus.js +49 -0
- package/dist/nodes/StevoManager/execute/profile/updateProfileStatus.js.map +1 -0
- package/dist/nodes/StevoManager/properties/chat.fields.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/chat.fields.js +575 -0
- package/dist/nodes/StevoManager/properties/chat.fields.js.map +1 -0
- package/dist/nodes/StevoManager/properties/chat.operations.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/chat.operations.js +102 -0
- package/dist/nodes/StevoManager/properties/chat.operations.js.map +1 -0
- package/dist/nodes/StevoManager/properties/events.fields.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/events.fields.js +336 -0
- package/dist/nodes/StevoManager/properties/events.fields.js.map +1 -0
- package/dist/nodes/StevoManager/properties/events.operations.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/events.operations.js +30 -0
- package/dist/nodes/StevoManager/properties/events.operations.js.map +1 -0
- package/dist/nodes/StevoManager/properties/groups.fields.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/groups.fields.js +481 -0
- package/dist/nodes/StevoManager/properties/groups.fields.js.map +1 -0
- package/dist/nodes/StevoManager/properties/groups.operations.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/groups.operations.js +102 -0
- package/dist/nodes/StevoManager/properties/groups.operations.js.map +1 -0
- package/dist/nodes/StevoManager/properties/index.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/index.js +72 -0
- package/dist/nodes/StevoManager/properties/index.js.map +1 -0
- package/dist/nodes/StevoManager/properties/instances.fields.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/instances.fields.js +798 -0
- package/dist/nodes/StevoManager/properties/instances.fields.js.map +1 -0
- package/dist/nodes/StevoManager/properties/instances.operations.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/instances.operations.js +72 -0
- package/dist/nodes/StevoManager/properties/instances.operations.js.map +1 -0
- package/dist/nodes/StevoManager/properties/integrations.fields.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/integrations.fields.js +1697 -0
- package/dist/nodes/StevoManager/properties/integrations.fields.js.map +1 -0
- package/dist/nodes/StevoManager/properties/integrations.operations.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/integrations.operations.js +48 -0
- package/dist/nodes/StevoManager/properties/integrations.operations.js.map +1 -0
- package/dist/nodes/StevoManager/properties/messages.fields.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/messages.fields.js +1628 -0
- package/dist/nodes/StevoManager/properties/messages.fields.js.map +1 -0
- package/dist/nodes/StevoManager/properties/messages.operations.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/messages.operations.js +90 -0
- package/dist/nodes/StevoManager/properties/messages.operations.js.map +1 -0
- package/dist/nodes/StevoManager/properties/profile.fields.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/profile.fields.js +241 -0
- package/dist/nodes/StevoManager/properties/profile.fields.js.map +1 -0
- package/dist/nodes/StevoManager/properties/profile.operations.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/profile.operations.js +66 -0
- package/dist/nodes/StevoManager/properties/profile.operations.js.map +1 -0
- package/dist/nodes/StevoManager/properties/resources.d.ts +2 -0
- package/dist/nodes/StevoManager/properties/resources.js +41 -0
- package/dist/nodes/StevoManager/properties/resources.js.map +1 -0
- package/dist/nodes/StevoManager/stevomanager.png +0 -0
- package/dist/package.json +69 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/index.js +0 -0
- package/package.json +69 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendList = sendList;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
async function sendList(ef) {
|
|
6
|
+
const items = ef.getInputData();
|
|
7
|
+
const returnData = [];
|
|
8
|
+
for (let i = 0; i < items.length; i++) {
|
|
9
|
+
const errorMessage = 'Funcionalidade não disponível';
|
|
10
|
+
const errorDetails = 'O envio de listas não é suportado pela API StevoManager';
|
|
11
|
+
if (!ef.continueOnFail()) {
|
|
12
|
+
throw new n8n_workflow_1.NodeOperationError(ef.getNode(), errorMessage, {
|
|
13
|
+
message: errorMessage,
|
|
14
|
+
description: errorDetails,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
returnData.push({
|
|
18
|
+
json: {
|
|
19
|
+
success: false,
|
|
20
|
+
error: {
|
|
21
|
+
message: errorMessage,
|
|
22
|
+
details: errorDetails,
|
|
23
|
+
code: 'NOT_SUPPORTED',
|
|
24
|
+
timestamp: new Date().toISOString(),
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
error: new n8n_workflow_1.NodeOperationError(ef.getNode(), errorMessage, {
|
|
28
|
+
message: errorMessage,
|
|
29
|
+
description: errorDetails,
|
|
30
|
+
}),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return returnData;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=sendList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendList.js","sourceRoot":"","sources":["../../../../../nodes/StevoManager/execute/messages/sendList.ts"],"names":[],"mappings":";;AAQA,4BAiCC;AAzCD,+CAIsB;AAIf,KAAK,UAAU,QAAQ,CAAC,EAAqB;IACnD,MAAM,KAAK,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC;IAChC,MAAM,UAAU,GAAyB,EAAE,CAAC;IAE5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,MAAM,YAAY,GAAG,+BAA+B,CAAC;QACrD,MAAM,YAAY,GAAG,yDAAyD,CAAC;QAE/E,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC;YAC1B,MAAM,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE;gBACxD,OAAO,EAAE,YAAY;gBACrB,WAAW,EAAE,YAAY;aACzB,CAAC,CAAC;QACJ,CAAC;QAED,UAAU,CAAC,IAAI,CAAC;YACf,IAAI,EAAE;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACN,OAAO,EAAE,YAAY;oBACrB,OAAO,EAAE,YAAY;oBACrB,IAAI,EAAE,eAAe;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;iBACnC;aACD;YACD,KAAK,EAAE,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE;gBACzD,OAAO,EAAE,YAAY;gBACrB,WAAW,EAAE,YAAY;aACzB,CAAC;SACF,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendPix = sendPix;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
async function sendPix(ef) {
|
|
6
|
+
const items = ef.getInputData();
|
|
7
|
+
const returnData = [];
|
|
8
|
+
for (let i = 0; i < items.length; i++) {
|
|
9
|
+
const errorMessage = 'Funcionalidade não disponível';
|
|
10
|
+
const errorDetails = 'O envio de PIX não é suportado pela API StevoManager';
|
|
11
|
+
if (!ef.continueOnFail()) {
|
|
12
|
+
throw new n8n_workflow_1.NodeOperationError(ef.getNode(), errorMessage, {
|
|
13
|
+
message: errorMessage,
|
|
14
|
+
description: errorDetails,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
returnData.push({
|
|
18
|
+
json: {
|
|
19
|
+
success: false,
|
|
20
|
+
error: {
|
|
21
|
+
message: errorMessage,
|
|
22
|
+
details: errorDetails,
|
|
23
|
+
code: 'NOT_SUPPORTED',
|
|
24
|
+
timestamp: new Date().toISOString(),
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
error: new n8n_workflow_1.NodeOperationError(ef.getNode(), errorMessage, {
|
|
28
|
+
message: errorMessage,
|
|
29
|
+
description: errorDetails,
|
|
30
|
+
}),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return returnData;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=sendPix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendPix.js","sourceRoot":"","sources":["../../../../../nodes/StevoManager/execute/messages/sendPix.ts"],"names":[],"mappings":";;AAQA,0BAiCC;AAzCD,+CAIsB;AAIf,KAAK,UAAU,OAAO,CAAC,EAAqB;IAClD,MAAM,KAAK,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC;IAChC,MAAM,UAAU,GAAyB,EAAE,CAAC;IAE5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,MAAM,YAAY,GAAG,+BAA+B,CAAC;QACrD,MAAM,YAAY,GAAG,sDAAsD,CAAC;QAE5E,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC;YAC1B,MAAM,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE;gBACxD,OAAO,EAAE,YAAY;gBACrB,WAAW,EAAE,YAAY;aACzB,CAAC,CAAC;QACJ,CAAC;QAED,UAAU,CAAC,IAAI,CAAC;YACf,IAAI,EAAE;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACN,OAAO,EAAE,YAAY;oBACrB,OAAO,EAAE,YAAY;oBACrB,IAAI,EAAE,eAAe;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;iBACnC;aACD;YACD,KAAK,EAAE,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE;gBACzD,OAAO,EAAE,YAAY;gBACrB,WAAW,EAAE,YAAY;aACzB,CAAC;SACF,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendPoll = sendPoll;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const evolutionRequest_1 = require("../evolutionRequest");
|
|
6
|
+
async function sendPoll(ef) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const items = ef.getInputData();
|
|
9
|
+
const returnData = [];
|
|
10
|
+
for (let i = 0; i < items.length; i++) {
|
|
11
|
+
try {
|
|
12
|
+
const remoteJid = ef.getNodeParameter('remoteJid', i);
|
|
13
|
+
const pollTitle = ef.getNodeParameter('caption', i);
|
|
14
|
+
const options = ef.getNodeParameter('options_display.metadataValues', i);
|
|
15
|
+
const options_message = ef.getNodeParameter('options_message', i, {});
|
|
16
|
+
const pollOptions = Array.isArray(options) ? options.map((option) => option.optionValue) : [];
|
|
17
|
+
if (pollOptions.length === 0) {
|
|
18
|
+
throw new n8n_workflow_1.NodeOperationError(ef.getNode(), 'Opções da enquete inválidas', {
|
|
19
|
+
message: 'Opções da enquete inválidas',
|
|
20
|
+
description: 'A enquete precisa ter pelo menos uma opção',
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const body = {
|
|
24
|
+
number: remoteJid,
|
|
25
|
+
name: pollTitle,
|
|
26
|
+
selectableCount: 1,
|
|
27
|
+
values: pollOptions,
|
|
28
|
+
};
|
|
29
|
+
if (options_message.delay) {
|
|
30
|
+
body.delay = options_message.delay;
|
|
31
|
+
}
|
|
32
|
+
if ((_b = (_a = options_message.quoted) === null || _a === void 0 ? void 0 : _a.messageQuoted) === null || _b === void 0 ? void 0 : _b.messageId) {
|
|
33
|
+
body.quoted = {
|
|
34
|
+
messageId: options_message.quoted.messageQuoted.messageId,
|
|
35
|
+
};
|
|
36
|
+
if (options_message.quoted.messageQuoted.participant) {
|
|
37
|
+
body.quoted.participant = options_message.quoted.messageQuoted.participant;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const requestOptions = {
|
|
41
|
+
method: 'POST',
|
|
42
|
+
headers: {
|
|
43
|
+
'Content-Type': 'application/json',
|
|
44
|
+
},
|
|
45
|
+
uri: '/send/poll',
|
|
46
|
+
body,
|
|
47
|
+
json: true,
|
|
48
|
+
};
|
|
49
|
+
const response = await (0, evolutionRequest_1.evolutionRequest)(ef, requestOptions);
|
|
50
|
+
returnData.push({
|
|
51
|
+
json: {
|
|
52
|
+
success: true,
|
|
53
|
+
data: response,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
const errorMessage = error.message.includes('Could not get parameter')
|
|
59
|
+
? 'Parâmetros inválidos ou ausentes'
|
|
60
|
+
: 'Erro ao enviar enquete';
|
|
61
|
+
const errorDetails = error.message.includes('Could not get parameter')
|
|
62
|
+
? 'Verifique se todos os campos obrigatórios foram preenchidos corretamente'
|
|
63
|
+
: error.message;
|
|
64
|
+
if (!ef.continueOnFail()) {
|
|
65
|
+
throw new n8n_workflow_1.NodeOperationError(ef.getNode(), errorMessage, {
|
|
66
|
+
message: errorMessage,
|
|
67
|
+
description: errorDetails,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
returnData.push({
|
|
71
|
+
json: {
|
|
72
|
+
success: false,
|
|
73
|
+
error: {
|
|
74
|
+
message: errorMessage,
|
|
75
|
+
details: errorDetails,
|
|
76
|
+
code: error.code || 'UNKNOWN_ERROR',
|
|
77
|
+
timestamp: new Date().toISOString(),
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
error: new n8n_workflow_1.NodeOperationError(ef.getNode(), errorMessage, {
|
|
81
|
+
message: errorMessage,
|
|
82
|
+
description: errorDetails,
|
|
83
|
+
}),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return returnData;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=sendPoll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendPoll.js","sourceRoot":"","sources":["../../../../../nodes/StevoManager/execute/messages/sendPoll.ts"],"names":[],"mappings":";;AASA,4BA2GC;AApHD,+CAMsB;AACtB,0DAAuD;AAEhD,KAAK,UAAU,QAAQ,CAAC,EAAqB;;IACnD,MAAM,KAAK,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC;IAChC,MAAM,UAAU,GAAyB,EAAE,CAAC;IAE5C,KAAK,IAAI,CAAC,GAAG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EAAE;wBACN,OAAO,EAAE,YAAY;wBACrB,OAAO,EAAE,YAAY;wBACrB,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,eAAe;wBACnC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;qBACnC;iBACD;gBACD,KAAK,EAAE,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE;oBACzD,OAAO,EAAE,YAAY;oBACrB,WAAW,EAAE,YAAY;iBACzB,CAAC;aACF,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendReaction = sendReaction;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const evolutionRequest_1 = require("../evolutionRequest");
|
|
6
|
+
async function sendReaction(ef) {
|
|
7
|
+
const items = ef.getInputData();
|
|
8
|
+
const returnData = [];
|
|
9
|
+
for (let i = 0; i < items.length; i++) {
|
|
10
|
+
try {
|
|
11
|
+
const remoteJid = ef.getNodeParameter('remoteJid', i);
|
|
12
|
+
const messageId = ef.getNodeParameter('messageId', i);
|
|
13
|
+
const reaction = ef.getNodeParameter('reaction', i);
|
|
14
|
+
if (!reaction) {
|
|
15
|
+
throw new n8n_workflow_1.NodeOperationError(ef.getNode(), 'Reação inválida', {
|
|
16
|
+
message: 'Reação inválida',
|
|
17
|
+
description: 'É necessário fornecer um emoji para a reação',
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
const body = {
|
|
21
|
+
chat: remoteJid,
|
|
22
|
+
messageId: messageId,
|
|
23
|
+
emoji: reaction,
|
|
24
|
+
};
|
|
25
|
+
const requestOptions = {
|
|
26
|
+
method: 'POST',
|
|
27
|
+
headers: {
|
|
28
|
+
'Content-Type': 'application/json',
|
|
29
|
+
},
|
|
30
|
+
uri: '/message/react',
|
|
31
|
+
body,
|
|
32
|
+
json: true,
|
|
33
|
+
};
|
|
34
|
+
const response = await (0, evolutionRequest_1.evolutionRequest)(ef, requestOptions);
|
|
35
|
+
returnData.push({
|
|
36
|
+
json: {
|
|
37
|
+
success: true,
|
|
38
|
+
data: response,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
const errorMessage = error.message.includes('Could not get parameter')
|
|
44
|
+
? 'Parâmetros inválidos ou ausentes'
|
|
45
|
+
: 'Erro ao enviar reação';
|
|
46
|
+
const errorDetails = error.message.includes('Could not get parameter')
|
|
47
|
+
? 'Verifique se todos os campos obrigatórios foram preenchidos corretamente'
|
|
48
|
+
: error.message;
|
|
49
|
+
if (!ef.continueOnFail()) {
|
|
50
|
+
throw new n8n_workflow_1.NodeOperationError(ef.getNode(), errorMessage, {
|
|
51
|
+
message: errorMessage,
|
|
52
|
+
description: errorDetails,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
returnData.push({
|
|
56
|
+
json: {
|
|
57
|
+
success: false,
|
|
58
|
+
error: {
|
|
59
|
+
message: errorMessage,
|
|
60
|
+
details: errorDetails,
|
|
61
|
+
code: error.code || 'UNKNOWN_ERROR',
|
|
62
|
+
timestamp: new Date().toISOString(),
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
error: new n8n_workflow_1.NodeOperationError(ef.getNode(), errorMessage, {
|
|
66
|
+
message: errorMessage,
|
|
67
|
+
description: errorDetails,
|
|
68
|
+
}),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return returnData;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=sendReaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendReaction.js","sourceRoot":"","sources":["../../../../../nodes/StevoManager/execute/messages/sendReaction.ts"],"names":[],"mappings":";;AASA,oCA4EC;AArFD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AAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAC;gBACrE,CAAC,CAAC,kCAAkC;gBACpC,CAAC,CAAC,uBAAuB,CAAC;YAE3B,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAC;gBACrE,CAAC,CAAC,0EAA0E;gBAC5E,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;YAEjB,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC1B,MAAM,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE;oBACxD,OAAO,EAAE,YAAY;oBACrB,WAAW,EAAE,YAAY;iBACzB,CAAC,CAAC;YACJ,CAAC;YAED,UAAU,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE;oBACL,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE;wBACN,OAAO,EAAE,YAAY;wBACrB,OAAO,EAAE,YAAY;wBACrB,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,eAAe;wBACnC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;qBACnC;iBACD;gBACD,KAAK,EAAE,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE;oBACzD,OAAO,EAAE,YAAY;oBACrB,WAAW,EAAE,YAAY;iBACzB,CAAC;aACF,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendStories = sendStories;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
async function sendStories(ef) {
|
|
6
|
+
const items = ef.getInputData();
|
|
7
|
+
const returnData = [];
|
|
8
|
+
for (let i = 0; i < items.length; i++) {
|
|
9
|
+
const errorMessage = 'Funcionalidade não disponível';
|
|
10
|
+
const errorDetails = 'O envio de stories/status não é suportado pela API StevoManager';
|
|
11
|
+
if (!ef.continueOnFail()) {
|
|
12
|
+
throw new n8n_workflow_1.NodeOperationError(ef.getNode(), errorMessage, {
|
|
13
|
+
message: errorMessage,
|
|
14
|
+
description: errorDetails,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
returnData.push({
|
|
18
|
+
json: {
|
|
19
|
+
success: false,
|
|
20
|
+
error: {
|
|
21
|
+
message: errorMessage,
|
|
22
|
+
details: errorDetails,
|
|
23
|
+
code: 'NOT_SUPPORTED',
|
|
24
|
+
timestamp: new Date().toISOString(),
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
error: new n8n_workflow_1.NodeOperationError(ef.getNode(), errorMessage, {
|
|
28
|
+
message: errorMessage,
|
|
29
|
+
description: errorDetails,
|
|
30
|
+
}),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return returnData;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=sendStories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendStories.js","sourceRoot":"","sources":["../../../../../nodes/StevoManager/execute/messages/sendStories.ts"],"names":[],"mappings":";;AAQA,kCAiCC;AAzCD,+CAIsB;AAIf,KAAK,UAAU,WAAW,CAAC,EAAqB;IACtD,MAAM,KAAK,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC;IAChC,MAAM,UAAU,GAAyB,EAAE,CAAC;IAE5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,MAAM,YAAY,GAAG,+BAA+B,CAAC;QACrD,MAAM,YAAY,GAAG,iEAAiE,CAAC;QAEvF,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC;YAC1B,MAAM,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE;gBACxD,OAAO,EAAE,YAAY;gBACrB,WAAW,EAAE,YAAY;aACzB,CAAC,CAAC;QACJ,CAAC;QAED,UAAU,CAAC,IAAI,CAAC;YACf,IAAI,EAAE;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACN,OAAO,EAAE,YAAY;oBACrB,OAAO,EAAE,YAAY;oBACrB,IAAI,EAAE,eAAe;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;iBACnC;aACD;YACD,KAAK,EAAE,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE;gBACzD,OAAO,EAAE,YAAY;gBACrB,WAAW,EAAE,YAAY;aACzB,CAAC;SACF,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendText = sendText;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const evolutionRequest_1 = require("../evolutionRequest");
|
|
6
|
+
async function sendText(ef) {
|
|
7
|
+
var _a, _b, _c;
|
|
8
|
+
const items = ef.getInputData();
|
|
9
|
+
const returnData = [];
|
|
10
|
+
for (let i = 0; i < items.length; i++) {
|
|
11
|
+
try {
|
|
12
|
+
const remoteJid = ef.getNodeParameter('remoteJid', i);
|
|
13
|
+
const messageText = ef.getNodeParameter('messageText', i);
|
|
14
|
+
const options = ef.getNodeParameter('options_message', i, {});
|
|
15
|
+
const body = {
|
|
16
|
+
number: remoteJid,
|
|
17
|
+
text: messageText,
|
|
18
|
+
};
|
|
19
|
+
if (options.delay) {
|
|
20
|
+
body.delay = options.delay;
|
|
21
|
+
}
|
|
22
|
+
if ((_b = (_a = options.quoted) === null || _a === void 0 ? void 0 : _a.messageQuoted) === null || _b === void 0 ? void 0 : _b.messageId) {
|
|
23
|
+
body.quoted = {
|
|
24
|
+
messageId: options.quoted.messageQuoted.messageId,
|
|
25
|
+
};
|
|
26
|
+
if (options.quoted.messageQuoted.participant) {
|
|
27
|
+
body.quoted.participant = options.quoted.messageQuoted.participant;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if ((_c = options.mentions) === null || _c === void 0 ? void 0 : _c.mentionsSettings) {
|
|
31
|
+
const { mentionsEveryOne, mentioned } = options.mentions.mentionsSettings;
|
|
32
|
+
if (mentionsEveryOne) {
|
|
33
|
+
body.mentionAll = true;
|
|
34
|
+
}
|
|
35
|
+
else if (mentioned) {
|
|
36
|
+
body.mentionedJid = mentioned;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const requestOptions = {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
headers: {
|
|
42
|
+
'Content-Type': 'application/json',
|
|
43
|
+
},
|
|
44
|
+
uri: '/send/text',
|
|
45
|
+
body,
|
|
46
|
+
json: true,
|
|
47
|
+
};
|
|
48
|
+
const response = await (0, evolutionRequest_1.evolutionRequest)(ef, requestOptions);
|
|
49
|
+
returnData.push({
|
|
50
|
+
json: {
|
|
51
|
+
success: true,
|
|
52
|
+
data: response,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
const errorMessage = error.message.includes('Could not get parameter')
|
|
58
|
+
? 'Parâmetros inválidos ou ausentes'
|
|
59
|
+
: 'Erro ao enviar mensagem de texto';
|
|
60
|
+
const errorDetails = error.message.includes('Could not get parameter')
|
|
61
|
+
? 'Verifique se todos os campos obrigatórios foram preenchidos corretamente'
|
|
62
|
+
: error.message;
|
|
63
|
+
if (!ef.continueOnFail()) {
|
|
64
|
+
throw new n8n_workflow_1.NodeOperationError(ef.getNode(), errorMessage, {
|
|
65
|
+
message: errorMessage,
|
|
66
|
+
description: errorDetails,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
returnData.push({
|
|
70
|
+
json: {
|
|
71
|
+
success: false,
|
|
72
|
+
error: {
|
|
73
|
+
message: errorMessage,
|
|
74
|
+
details: errorDetails,
|
|
75
|
+
code: error.code || 'UNKNOWN_ERROR',
|
|
76
|
+
timestamp: new Date().toISOString(),
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
error: new n8n_workflow_1.NodeOperationError(ef.getNode(), errorMessage, {
|
|
80
|
+
message: errorMessage,
|
|
81
|
+
description: errorDetails,
|
|
82
|
+
}),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return returnData;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=sendText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendText.js","sourceRoot":"","sources":["../../../../../nodes/StevoManager/execute/messages/sendText.ts"],"names":[],"mappings":";;AASA,4BA2GC;AApHD,+CAMsB;AACtB,0DAAuD;AAEhD,KAAK,UAAU,QAAQ,CAAC,EAAqB;;IACnD,MAAM,KAAK,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC;IAChC,MAAM,UAAU,GAAyB,EAAE,CAAC;IAE5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,IAAI,CAAC;YACJ,MAAM,SAAS,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAW,CAAC;YAChE,MAAM,WAAW,GAAG,EAAE,CAAC,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAW,CAAC;YACpE,MAAM,OAAO,GAAG,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,EAAE,EAAE,CAe3D,CAAC;YAEF,MAAM,IAAI,GAAQ;gBACjB,MAAM,EAAE,SAAS;gBACjB,IAAI,EAAE,WAA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C;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAC;gBACrE,CAAC,CAAC,kCAAkC;gBACpC,CAAC,CAAC,kCAAkC,CAAC;YAEtC,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAC;gBACrE,CAAC,CAAC,0EAA0E;gBAC5E,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;YAEjB,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC1B,MAAM,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE;oBACxD,OAAO,EAAE,YAAY;oBACrB,WAAW,EAAE,YAAY;iBACzB,CAAC,CAAC;YACJ,CAAC;YAED,UAAU,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE;oBACL,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE;wBACN,OAAO,EAAE,YAAY;wBACrB,OAAO,EAAE,YAAY;wBACrB,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,eAAe;wBACnC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;qBACnC;iBACD;gBACD,KAAK,EAAE,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE;oBACzD,OAAO,EAAE,YAAY;oBACrB,WAAW,EAAE,YAAY;iBACzB,CAAC;aACF,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendVideo = sendVideo;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const evolutionRequest_1 = require("../evolutionRequest");
|
|
6
|
+
async function sendVideo(ef) {
|
|
7
|
+
var _a, _b, _c;
|
|
8
|
+
const items = ef.getInputData();
|
|
9
|
+
const returnData = [];
|
|
10
|
+
for (let i = 0; i < items.length; i++) {
|
|
11
|
+
try {
|
|
12
|
+
const remoteJid = ef.getNodeParameter('remoteJid', i);
|
|
13
|
+
const media = ef.getNodeParameter('media', i);
|
|
14
|
+
const caption = ef.getNodeParameter('caption', i, '');
|
|
15
|
+
const fileName = ef.getNodeParameter('fileName', i, 'video.mp4') || 'video.mp4';
|
|
16
|
+
const options = ef.getNodeParameter('options_message', i, {});
|
|
17
|
+
const body = {
|
|
18
|
+
number: remoteJid,
|
|
19
|
+
type: 'video',
|
|
20
|
+
url: media,
|
|
21
|
+
filename: fileName,
|
|
22
|
+
};
|
|
23
|
+
if (caption) {
|
|
24
|
+
body.caption = caption;
|
|
25
|
+
}
|
|
26
|
+
if (options.delay) {
|
|
27
|
+
body.delay = options.delay;
|
|
28
|
+
}
|
|
29
|
+
if ((_b = (_a = options.quoted) === null || _a === void 0 ? void 0 : _a.messageQuoted) === null || _b === void 0 ? void 0 : _b.messageId) {
|
|
30
|
+
body.quoted = {
|
|
31
|
+
messageId: options.quoted.messageQuoted.messageId,
|
|
32
|
+
};
|
|
33
|
+
if (options.quoted.messageQuoted.participant) {
|
|
34
|
+
body.quoted.participant = options.quoted.messageQuoted.participant;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if ((_c = options.mentions) === null || _c === void 0 ? void 0 : _c.mentionsSettings) {
|
|
38
|
+
const { mentionsEveryOne, mentioned } = options.mentions.mentionsSettings;
|
|
39
|
+
if (mentionsEveryOne) {
|
|
40
|
+
body.mentionAll = true;
|
|
41
|
+
}
|
|
42
|
+
else if (mentioned) {
|
|
43
|
+
body.mentionedJid = mentioned;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const requestOptions = {
|
|
47
|
+
method: 'POST',
|
|
48
|
+
headers: {
|
|
49
|
+
'Content-Type': 'application/json',
|
|
50
|
+
},
|
|
51
|
+
uri: '/send/media',
|
|
52
|
+
body,
|
|
53
|
+
json: true,
|
|
54
|
+
};
|
|
55
|
+
const response = await (0, evolutionRequest_1.evolutionRequest)(ef, requestOptions);
|
|
56
|
+
returnData.push({
|
|
57
|
+
json: {
|
|
58
|
+
success: true,
|
|
59
|
+
data: response,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
const errorMessage = error.message.includes('Could not get parameter')
|
|
65
|
+
? 'Parâmetros inválidos ou ausentes'
|
|
66
|
+
: 'Erro ao enviar vídeo';
|
|
67
|
+
const errorDetails = error.message.includes('Could not get parameter')
|
|
68
|
+
? 'Verifique se todos os campos obrigatórios foram preenchidos corretamente'
|
|
69
|
+
: error.message;
|
|
70
|
+
if (!ef.continueOnFail()) {
|
|
71
|
+
throw new n8n_workflow_1.NodeOperationError(ef.getNode(), errorMessage, {
|
|
72
|
+
message: errorMessage,
|
|
73
|
+
description: errorDetails,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
returnData.push({
|
|
77
|
+
json: {
|
|
78
|
+
success: false,
|
|
79
|
+
error: {
|
|
80
|
+
message: errorMessage,
|
|
81
|
+
details: errorDetails,
|
|
82
|
+
code: error.code || 'UNKNOWN_ERROR',
|
|
83
|
+
timestamp: new Date().toISOString(),
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
error: new n8n_workflow_1.NodeOperationError(ef.getNode(), errorMessage, {
|
|
87
|
+
message: errorMessage,
|
|
88
|
+
description: errorDetails,
|
|
89
|
+
}),
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return returnData;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=sendVideo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendVideo.js","sourceRoot":"","sources":["../../../../../nodes/StevoManager/execute/messages/sendVideo.ts"],"names":[],"mappings":";;AASA,8BAiH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AC,CAAC,KAAK,CAAC,OAAO,CAAC;YAEjB,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC1B,MAAM,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE;oBACxD,OAAO,EAAE,YAAY;oBACrB,WAAW,EAAE,YAAY;iBACzB,CAAC,CAAC;YACJ,CAAC;YAED,UAAU,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE;oBACL,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE;wBACN,OAAO,EAAE,YAAY;wBACrB,OAAO,EAAE,YAAY;wBACrB,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,eAAe;wBACnC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;qBACnC;iBACD;gBACD,KAAK,EAAE,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE;oBACzD,OAAO,EAAE,YAAY;oBACrB,WAAW,EAAE,YAAY;iBACzB,CAAC;aACF,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare function fetchBusinessProfile(ef: IExecuteFunctions): Promise<{
|
|
3
|
+
json: {
|
|
4
|
+
success: boolean;
|
|
5
|
+
data: any;
|
|
6
|
+
};
|
|
7
|
+
error?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
json: {
|
|
10
|
+
success: boolean;
|
|
11
|
+
error: {
|
|
12
|
+
message: any;
|
|
13
|
+
details: string;
|
|
14
|
+
code: any;
|
|
15
|
+
timestamp: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
error: {
|
|
19
|
+
success: boolean;
|
|
20
|
+
error: {
|
|
21
|
+
message: any;
|
|
22
|
+
details: string;
|
|
23
|
+
code: any;
|
|
24
|
+
timestamp: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchBusinessProfile = fetchBusinessProfile;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const evolutionRequest_1 = require("../evolutionRequest");
|
|
6
|
+
async function fetchBusinessProfile(ef) {
|
|
7
|
+
try {
|
|
8
|
+
const instanceName = ef.getNodeParameter('instanceName', 0);
|
|
9
|
+
const remoteJid = ef.getNodeParameter('remoteJid', 0);
|
|
10
|
+
const body = {
|
|
11
|
+
number: remoteJid.includes('@') ? remoteJid : `${remoteJid}@s.whatsapp.net`,
|
|
12
|
+
};
|
|
13
|
+
const requestOptions = {
|
|
14
|
+
method: 'POST',
|
|
15
|
+
uri: `/chat/fetchBusinessProfile/${instanceName}`,
|
|
16
|
+
body,
|
|
17
|
+
json: true,
|
|
18
|
+
};
|
|
19
|
+
const response = await (0, evolutionRequest_1.evolutionRequest)(ef, requestOptions);
|
|
20
|
+
return {
|
|
21
|
+
json: {
|
|
22
|
+
success: true,
|
|
23
|
+
data: response,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
const errorData = {
|
|
29
|
+
success: false,
|
|
30
|
+
error: {
|
|
31
|
+
message: error.message,
|
|
32
|
+
details: 'Erro ao buscar perfil de negócio',
|
|
33
|
+
code: error.code || 'UNKNOWN_ERROR',
|
|
34
|
+
timestamp: new Date().toISOString(),
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
if (!ef.continueOnFail()) {
|
|
38
|
+
throw new n8n_workflow_1.NodeOperationError(ef.getNode(), error.message, {
|
|
39
|
+
message: errorData.error.message,
|
|
40
|
+
description: errorData.error.details,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
json: errorData,
|
|
45
|
+
error: errorData,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=fetchBusinessProfile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchBusinessProfile.js","sourceRoot":"","sources":["../../../../../nodes/StevoManager/execute/profile/fetchBusinessProfile.ts"],"names":[],"mappings":";;AAQA,oDA8CC;AAtDD,+CAKsB;AACtB,0DAAuD;AAEhD,KAAK,UAAU,oBAAoB,CAAC,EAAqB;IAC5D,IAAI,CAAC;QACD,MAAM,YAAY,GAAG,EAAE,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAW,CAAC;QACtE,MAAM,SAAS,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAW,CAAC;QAEhE,MAAM,IAAI,GAAG;YACT,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,iBAAiB;SAC9E,CAAC;QAEF,MAAM,cAAc,GAAoB;YACpC,MAAM,EAAE,MAA6B;YACrC,GAAG,EAAE,8BAA8B,YAAY,EAAE;YACjD,IAAI;YACJ,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,mCAAgB,EAAC,EAAE,EAAE,cAAc,CAAC,CAAC;QAC5D,OAAO;YACH,IAAI,EAAE;gBACF,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,QAAQ;aACjB;SACJ,CAAC;IACN,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,SAAS,GAAG;YACd,OAAO,EAAE,KAAK;YACd,KAAK,EAAE;gBACH,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,OAAO,EAAE,kCAAkC;gBAC3C,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,eAAe;gBACnC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACtC;SACJ,CAAC;QAEF,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC;YACvB,MAAM,IAAI,iCAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE;gBACtD,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,OAAO;gBAChC,WAAW,EAAE,SAAS,CAAC,KAAK,CAAC,OAAO;aACvC,CAAC,CAAC;QACP,CAAC;QAED,OAAO;YACH,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,SAAS;SACnB,CAAC;IACN,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare function fetchPrivacySettings(ef: IExecuteFunctions): Promise<{
|
|
3
|
+
json: {
|
|
4
|
+
success: boolean;
|
|
5
|
+
data: any;
|
|
6
|
+
};
|
|
7
|
+
error?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
json: {
|
|
10
|
+
success: boolean;
|
|
11
|
+
error: {
|
|
12
|
+
message: any;
|
|
13
|
+
details: string;
|
|
14
|
+
code: any;
|
|
15
|
+
timestamp: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
error: {
|
|
19
|
+
success: boolean;
|
|
20
|
+
error: {
|
|
21
|
+
message: any;
|
|
22
|
+
details: string;
|
|
23
|
+
code: any;
|
|
24
|
+
timestamp: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}>;
|