n8n-nodes-evolution-message-search 1.0.3 → 1.0.5
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.
|
@@ -12,7 +12,8 @@ class EvolutionApi {
|
|
|
12
12
|
name: 'baseUrl',
|
|
13
13
|
type: 'string',
|
|
14
14
|
default: 'http://localhost:8080',
|
|
15
|
-
description: 'Evolution API server URL (
|
|
15
|
+
description: 'Evolution API server URL (without trailing slash)',
|
|
16
|
+
placeholder: 'http://localhost:8080',
|
|
16
17
|
},
|
|
17
18
|
{
|
|
18
19
|
displayName: 'API Key',
|
|
@@ -31,7 +32,7 @@ class EvolutionApi {
|
|
|
31
32
|
};
|
|
32
33
|
this.test = {
|
|
33
34
|
request: {
|
|
34
|
-
url: '
|
|
35
|
+
url: '={{$credentials.baseUrl.replace(/\\/$/, "")}}/instance/connectionStatus',
|
|
35
36
|
method: 'GET',
|
|
36
37
|
},
|
|
37
38
|
};
|
|
@@ -24,13 +24,6 @@ class SearchMessages {
|
|
|
24
24
|
required: true,
|
|
25
25
|
},
|
|
26
26
|
],
|
|
27
|
-
requestDefaults: {
|
|
28
|
-
baseURL: '={{$credentials.baseUrl || "http://localhost:8080"}}',
|
|
29
|
-
headers: {
|
|
30
|
-
'Accept': 'application/json',
|
|
31
|
-
'Content-Type': 'application/json',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
27
|
properties: [
|
|
35
28
|
{
|
|
36
29
|
displayName: 'Instance Name',
|
|
@@ -119,6 +112,9 @@ class SearchMessages {
|
|
|
119
112
|
const items = executeFunctions.getInputData();
|
|
120
113
|
const returnData = [];
|
|
121
114
|
for (let i = 0; i < items.length; i++) {
|
|
115
|
+
const credentials = await executeFunctions.getCredentials('evolutionApi');
|
|
116
|
+
const baseUrl = (credentials.baseUrl || 'http://localhost:8080').replace(/\/$/, '');
|
|
117
|
+
const apiKey = credentials.apiKey;
|
|
122
118
|
const instanceName = executeFunctions.getNodeParameter('instanceName', i);
|
|
123
119
|
const userConversationId = executeFunctions.getNodeParameter('conversationId', i) || '';
|
|
124
120
|
const allowModelSetConversation = executeFunctions.getNodeParameter('allowModelSetConversation', i);
|
|
@@ -162,8 +158,13 @@ class SearchMessages {
|
|
|
162
158
|
};
|
|
163
159
|
const responseData = await executeFunctions.helpers.httpRequest({
|
|
164
160
|
method: 'POST',
|
|
165
|
-
url:
|
|
161
|
+
url: `${baseUrl}/chat/findMessages/${instanceName}`,
|
|
166
162
|
body,
|
|
163
|
+
headers: {
|
|
164
|
+
'Content-Type': 'application/json',
|
|
165
|
+
'Accept': 'application/json',
|
|
166
|
+
'apikey': apiKey,
|
|
167
|
+
},
|
|
167
168
|
});
|
|
168
169
|
const messages = responseData.messages || responseData;
|
|
169
170
|
const total = messages.total || messages.length || 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-evolution-message-search",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
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",
|