n8n-nodes-evolution-message-search 1.0.4 → 1.0.6

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.
@@ -5,35 +5,43 @@ class EvolutionApi {
5
5
  constructor() {
6
6
  this.name = 'evolutionApi';
7
7
  this.displayName = 'Evolution API';
8
- this.documentationUrl = 'https://docs.evolutionfoundation.com.br/evolution-api';
8
+ this.documentationUrl = 'https://doc.evolution-api.com/pt';
9
9
  this.properties = [
10
10
  {
11
- displayName: 'Base URL',
12
- name: 'baseUrl',
11
+ displayName: 'Server Url',
12
+ name: 'server-url',
13
13
  type: 'string',
14
- default: 'http://localhost:8080',
15
- description: 'Evolution API server URL (without trailing slash, e.g., http://localhost:8080 or https://wpp.dexbrasil.com)',
16
- placeholder: 'https://wpp.dexbrasil.com',
14
+ default: '',
15
+ placeholder: 'https://exemplo.com',
16
+ description: 'Digite a URL completa da sua Evolution API (ex: https://api.exemplo.com)',
17
17
  },
18
18
  {
19
- displayName: 'API Key',
20
- name: 'apiKey',
19
+ displayName: 'ApiKey',
20
+ name: 'apikey',
21
21
  type: 'string',
22
22
  default: '',
23
+ typeOptions: {
24
+ password: true,
25
+ },
26
+ description: 'Digite a ApiKey da Instancia ou Global da sua Evolution API',
23
27
  },
24
28
  ];
25
29
  this.authenticate = {
26
30
  type: 'generic',
27
31
  properties: {
28
32
  headers: {
29
- apikey: '={{$credentials.apiKey}}',
33
+ apikey: '={{$credentials.apikey}}',
30
34
  },
31
35
  },
32
36
  };
33
37
  this.test = {
34
38
  request: {
35
- url: '={{$credentials.baseUrl.replace(/\\/$/, "")}}/instance/connectionStatus',
39
+ baseURL: '={{$credentials["server-url"]}}',
40
+ url: '={{$credentials["server-url"].endsWith("/") ? "/erro" : "/instance/fetchInstances"}}',
36
41
  method: 'GET',
42
+ headers: {
43
+ apikey: '={{$credentials.apikey}}',
44
+ },
37
45
  },
38
46
  };
39
47
  }
@@ -113,8 +113,8 @@ class SearchMessages {
113
113
  const returnData = [];
114
114
  for (let i = 0; i < items.length; i++) {
115
115
  const credentials = await executeFunctions.getCredentials('evolutionApi');
116
- const baseUrl = (credentials.baseUrl || 'http://localhost:8080').replace(/\/$/, '');
117
- const apiKey = credentials.apiKey;
116
+ const serverUrl = credentials['server-url'];
117
+ const apiKey = credentials.apikey;
118
118
  const instanceName = executeFunctions.getNodeParameter('instanceName', i);
119
119
  const userConversationId = executeFunctions.getNodeParameter('conversationId', i) || '';
120
120
  const allowModelSetConversation = executeFunctions.getNodeParameter('allowModelSetConversation', i);
@@ -156,9 +156,10 @@ class SearchMessages {
156
156
  timestamp: 'desc',
157
157
  },
158
158
  };
159
- const responseData = await executeFunctions.helpers.httpRequest({
159
+ const cleanUrl = serverUrl.replace(/\/$/, '');
160
+ const responseData = await executeFunctions.helpers.request({
160
161
  method: 'POST',
161
- url: `${baseUrl}/chat/findMessages/${instanceName}`,
162
+ uri: `${cleanUrl}/chat/findMessages/${instanceName}`,
162
163
  body,
163
164
  headers: {
164
165
  'Content-Type': 'application/json',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-evolution-message-search",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Evolution API - Search Messages node for n8n. Search WhatsApp message history by keywords, dates, and conversation.",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",