Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 82 additions & 82 deletions README.md

Large diffs are not rendered by default.

164 changes: 82 additions & 82 deletions README_TEMPLATE.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions credentials/EvolutionApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import {
export class EvolutionApi implements ICredentialType {
name = 'evolutionApi';
displayName = 'Evolution API';
documentationUrl = 'https://doc.evolution-api.com/pt';
documentationUrl = 'https://doc.evolution-api.com/';
properties: INodeProperties[] = [
{
displayName: 'Server Url',
name: 'server-url',
type: 'string',
default: '',
placeholder: 'https://exemplo.com',
description: 'Digite a URL completa da sua Evolution API (ex: https://api.exemplo.com)',
placeholder: 'https://example.com',
description: 'Enter the full URL of your Evolution API (e.g., https://api.example.com)',
},
{
displayName: 'ApiKey',
Expand All @@ -26,7 +26,7 @@ export class EvolutionApi implements ICredentialType {
typeOptions: {
password: true,
},
description: 'Digite a ApiKey da Instancia ou Global da sua Evolution API',
description: 'Enter the instance or Global ApiKey of your Evolution API',
},
];

Expand Down
20 changes: 10 additions & 10 deletions nodes/EvolutionApi/EvolutionApi.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,32 @@ export class EvolutionApi implements INodeType {
'Content-Type': 'application/json',
},
},
// A estrutura de propriedades do nó:
// • Resources: Recursos disponíveis (Instancia, Mensagens, Eventos, Integrações)
// • Operations: Operações de cada recurso (Ex: Criar instancia, Enviar mensagem, Definir Webhook)
// • Fields: Campos de cada operação
// The node's property structure:
// • Resources: Available resources (Instance, Messages, Events, Integrations)
// • Operations: Operations for each resource (e.g., Create instance, Send message, Set Webhook)
// • Fields: Fields for each operation
properties: evolutionNodeProperties,
};

async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const resource = this.getNodeParameter('resource', 0) as string;
const operation = this.getNodeParameter('operation', 0) as string;

// Busca a função para o recurso e operação selecionados
// Search for the function for the selected resource and operation
const fn = resourceOperationsFunctions[resource][operation];

// Se não encontrar a função, retorna um erro
// If the function is not found, return an error
if (!fn) {
throw new NodeApiError(this.getNode(), {
message: 'Operação não suportada.',
description: `A função "${operation}" para o recurso "${resource}" não é suportada!`,
message: 'Unsupported operation.',
description: `The function "${operation}" for the resource "${resource}" is not supported!`,
});
}

// Executa a função
// Execute the function
const responseData = await fn(this);

// Retornar apenas o JSON
// Return only the JSON
return [this.helpers.returnJsonArray(responseData)];
}
}
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/chat/blockContact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function blockContact(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao gerenciar bloqueio do contato',
details: 'Error managing contact block',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/chat/checkNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function checkNumber(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao verificar números no WhatsApp',
details: 'Error checking numbers on WhatsApp',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/chat/deleteMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export async function deleteMessage(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao deletar mensagem',
details: 'Error deleting message',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/chat/fetchProfilePicture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function fetchProfilePicture(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao buscar foto do perfil',
details: 'Error fetching profile picture',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/chat/findChats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export async function findChats(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao buscar chats',
details: 'Error fetching chats',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/chat/findContacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function findContacts(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao buscar contatos',
details: 'Error fetching contacts',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/chat/findMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export async function findMessages(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao buscar mensagens',
details: 'Error fetching messages',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/chat/findStatusMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export async function findStatusMessages(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao buscar status das mensagens',
details: 'Error fetching message status',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/chat/getMediaBase64.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function getMediaBase64(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao obter mídia em Base64',
details: 'Error getting media in Base64',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/chat/manageArchive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function manageArchive(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao gerenciar arquivo da conversa',
details: 'Error managing chat archive',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/chat/markChatUnread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export async function markChatUnread(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao marcar conversa como não lida',
details: 'Error marking chat as unread',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/chat/readMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export async function readMessages(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao marcar mensagens como lidas',
details: 'Error marking messages as read',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/chat/sendPresence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function sendPresence(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao enviar presença',
details: 'Error sending presence',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/chat/updateMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export async function updateMessage(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao editar mensagem',
details: 'Error editing message',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
6 changes: 3 additions & 3 deletions nodes/EvolutionApi/execute/events/setProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ export async function setProxy(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message.includes('Could not get parameter')
? 'Parâmetros inválidos ou ausentes'
: 'Erro ao configurar proxy',
? 'Invalid or missing parameters'
: 'Error configuring proxy',
details: error.message.includes('Could not get parameter')
? 'Verifique se todos os campos obrigatórios foram preenchidos corretamente'
? 'Check if all required fields have been filled correctly'
: error.message,
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
Expand Down
10 changes: 5 additions & 5 deletions nodes/EvolutionApi/execute/events/setRabbitMQ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export async function setRabbitMQ(ef: IExecuteFunctions) {
const errorData = {
success: false,
error: {
message: 'Operação de RabbitMQ não reconhecida',
details: 'A operação solicitada não é válida para o recurso de RabbitMQ',
message: 'Unrecognized RabbitMQ operation',
details: 'The requested operation is not valid for the RabbitMQ resource',
code: 'INVALID_OPERATION',
timestamp: new Date().toISOString(),
},
Expand All @@ -64,10 +64,10 @@ export async function setRabbitMQ(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message.includes('Could not get parameter')
? 'Parâmetros inválidos ou ausentes'
: 'Erro ao configurar RabbitMQ',
? 'Invalid or missing parameters'
: 'Error configuring RabbitMQ',
details: error.message.includes('Could not get parameter')
? 'Verifique se todos os campos obrigatórios foram preenchidos corretamente'
? 'Check if all required fields have been filled correctly'
: error.message,
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
Expand Down
12 changes: 6 additions & 6 deletions nodes/EvolutionApi/execute/events/setWebhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function setWebhook(ef: IExecuteFunctions) {

if (resourceForWebhook === 'setWebhook') {
const enabled = ef.getNodeParameter('enabled', 0);
const webhookUrl = ef.getNodeParameter('webhookUrl', 0) || 'vazio';
const webhookUrl = ef.getNodeParameter('webhookUrl', 0) || '';
const webhookByEvents = ef.getNodeParameter('webhookByEvents', 0);
const webhookBase64 = ef.getNodeParameter('webhookBase64', 0);
const webhookEvents = ef.getNodeParameter('webhookEvents', 0) || [];
Expand Down Expand Up @@ -46,8 +46,8 @@ export async function setWebhook(ef: IExecuteFunctions) {
const errorData = {
success: false,
error: {
message: 'Operação de webhook não reconhecida',
details: 'A operação solicitada não é válida para o recurso de webhook',
message: 'Unrecognized webhook operation',
details: 'The requested operation is not valid for the webhook resource',
code: 'INVALID_OPERATION',
timestamp: new Date().toISOString(),
},
Expand All @@ -70,10 +70,10 @@ export async function setWebhook(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message.includes('Could not get parameter')
? 'Parâmetros inválidos ou ausentes'
: 'Erro ao configurar webhook',
? 'Invalid or missing parameters'
: 'Error configuring webhook',
details: error.message.includes('Could not get parameter')
? 'Verifique se todos os campos obrigatórios foram preenchidos corretamente'
? 'Check if all required fields have been filled correctly'
: error.message,
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/groups/createGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function createGroup(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao criar grupo',
details: 'Error creating group',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
4 changes: 2 additions & 2 deletions nodes/EvolutionApi/execute/groups/fetchGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function fetchGroups(ef: IExecuteFunctions) {
break;

default:
throw new Error('Método de busca inválido');
throw new Error('Invalid search method');
}

const response = await evolutionRequest(ef, requestOptions);
Expand All @@ -56,7 +56,7 @@ export async function fetchGroups(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao buscar informações do(s) grupo(s)',
details: 'Error fetching group(s) information',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/groups/fetchInviteCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function fetchInviteCode(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao buscar código de convite do grupo',
details: 'Error fetching group invite code',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/groups/findParticipants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function findParticipants(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao buscar participantes do grupo',
details: 'Error fetching group participants',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/groups/joinGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function joinGroup(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao entrar no grupo',
details: 'Error joining group',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/groups/leaveGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function leaveGroup(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao sair do grupo',
details: 'Error leaving group',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/groups/revokeInviteCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function revokeInviteCode(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao revogar código de convite do grupo',
details: 'Error revoking group invite code',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/groups/sendInviteLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function sendInviteLink(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao enviar link de convite do grupo',
details: 'Error sending group invite link',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/groups/toggleEphemeral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function toggleEphemeral(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao configurar mensagens temporárias',
details: 'Error configuring temporary messages',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function updateGroupDescription(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao atualizar descrição do grupo',
details: 'Error updating group description',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/groups/updateGroupName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function updateGroupName(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao atualizar nome do grupo',
details: 'Error updating group name',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/groups/updateGroupPicture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function updateGroupPicture(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao atualizar imagem do grupo',
details: 'Error updating group image',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
2 changes: 1 addition & 1 deletion nodes/EvolutionApi/execute/groups/updateParticipants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function updateParticipants(ef: IExecuteFunctions) {
success: false,
error: {
message: error.message,
details: 'Erro ao atualizar membros do grupo',
details: 'Error updating group members',
code: error.code || 'UNKNOWN_ERROR',
timestamp: new Date().toISOString(),
},
Expand Down
Loading