n8n-nodes-quepasa-api-yurisilva_pro 2.1.0 → 2.2.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/README.md
CHANGED
|
@@ -107,30 +107,21 @@ n8n start
|
|
|
107
107
|
|
|
108
108
|
## ✨ Recursos
|
|
109
109
|
|
|
110
|
-
### 🔐 Autenticação
|
|
110
|
+
### 🔐 Autenticação Simples
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
Configure suas credenciais QuePasa de forma rápida e direta:
|
|
113
113
|
|
|
114
114
|
```typescript
|
|
115
115
|
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
{
|
|
119
|
-
name: "Main Account",
|
|
120
|
-
token: "your-token",
|
|
121
|
-
userId: "admin",
|
|
122
|
-
phone: "5511999999999"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
name: "Support Account",
|
|
126
|
-
token: "another-token",
|
|
127
|
-
userId: "support",
|
|
128
|
-
phone: "5511888888888"
|
|
129
|
-
}
|
|
130
|
-
]
|
|
116
|
+
baseUrl: "http://localhost:31000",
|
|
117
|
+
token: "your-api-token"
|
|
131
118
|
}
|
|
132
119
|
```
|
|
133
120
|
|
|
121
|
+
**Campos:**
|
|
122
|
+
- **Base URL:** URL do seu servidor QuePasa
|
|
123
|
+
- **Token:** Token de autenticação da API (X-QUEPASA-TOKEN)
|
|
124
|
+
|
|
134
125
|
### 📤 Envio de Mensagens
|
|
135
126
|
|
|
136
127
|
- ✅ Texto simples
|
|
@@ -288,11 +279,8 @@ Controle de presença e status
|
|
|
288
279
|
|
|
289
280
|
No n8n, crie uma nova credencial **QuePasa API**:
|
|
290
281
|
|
|
291
|
-
- **
|
|
292
|
-
- **
|
|
293
|
-
- **Token:** Seu token de API
|
|
294
|
-
- **User ID:** "admin"
|
|
295
|
-
- **Phone:** "5511999999999"
|
|
282
|
+
- **Base URL:** `http://localhost:31000` (seu servidor QuePasa)
|
|
283
|
+
- **Token:** Seu token de API (X-QUEPASA-TOKEN)
|
|
296
284
|
|
|
297
285
|
### 2. Adicione o Node QuePasa
|
|
298
286
|
|
|
@@ -8,53 +8,25 @@ class QuePasaApi {
|
|
|
8
8
|
icon = 'file:quepasa.svg';
|
|
9
9
|
properties = [
|
|
10
10
|
{
|
|
11
|
-
displayName: '
|
|
12
|
-
name: '
|
|
13
|
-
type: '
|
|
11
|
+
displayName: 'Base URL',
|
|
12
|
+
name: 'baseUrl',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: 'http://localhost:31000',
|
|
15
|
+
placeholder: 'https://your-server.com',
|
|
16
|
+
description: 'QuePasa server URL',
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
displayName: 'Token',
|
|
21
|
+
name: 'token',
|
|
22
|
+
type: 'string',
|
|
14
23
|
typeOptions: {
|
|
15
|
-
|
|
24
|
+
password: true,
|
|
16
25
|
},
|
|
17
|
-
default:
|
|
18
|
-
placeholder: '
|
|
19
|
-
description: '
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
name: 'account',
|
|
23
|
-
displayName: 'Account',
|
|
24
|
-
values: [
|
|
25
|
-
{
|
|
26
|
-
displayName: 'Account Name',
|
|
27
|
-
name: 'name',
|
|
28
|
-
type: 'string',
|
|
29
|
-
default: '',
|
|
30
|
-
placeholder: 'My WhatsApp Account',
|
|
31
|
-
description: 'Friendly name to identify this account',
|
|
32
|
-
required: true,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
displayName: 'Base URL',
|
|
36
|
-
name: 'baseUrl',
|
|
37
|
-
type: 'string',
|
|
38
|
-
default: 'http://localhost:31000',
|
|
39
|
-
placeholder: 'http://localhost:31000',
|
|
40
|
-
description: 'QuePasa server URL for this account',
|
|
41
|
-
required: true,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
displayName: 'Token',
|
|
45
|
-
name: 'token',
|
|
46
|
-
type: 'string',
|
|
47
|
-
typeOptions: {
|
|
48
|
-
password: true,
|
|
49
|
-
},
|
|
50
|
-
default: '',
|
|
51
|
-
placeholder: 'Your API Token',
|
|
52
|
-
description: 'API Token for this account',
|
|
53
|
-
required: true,
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
],
|
|
26
|
+
default: '',
|
|
27
|
+
placeholder: 'Your API Token',
|
|
28
|
+
description: 'API Token from QuePasa (X-QUEPASA-TOKEN header)',
|
|
29
|
+
required: true,
|
|
58
30
|
},
|
|
59
31
|
];
|
|
60
32
|
authenticate = {
|
|
@@ -67,10 +39,10 @@ class QuePasaApi {
|
|
|
67
39
|
};
|
|
68
40
|
test = {
|
|
69
41
|
request: {
|
|
70
|
-
baseURL: '={{$credentials.
|
|
42
|
+
baseURL: '={{$credentials.baseUrl}}',
|
|
71
43
|
url: '/info',
|
|
72
44
|
headers: {
|
|
73
|
-
'X-QUEPASA-TOKEN': '={{$credentials.
|
|
45
|
+
'X-QUEPASA-TOKEN': '={{$credentials.token}}',
|
|
74
46
|
},
|
|
75
47
|
},
|
|
76
48
|
};
|
|
@@ -11,14 +11,11 @@ const axios_1 = require("axios");
|
|
|
11
11
|
*/
|
|
12
12
|
async function quePasaApiRequest(method, endpoint, body = {}, qs = {}, option = {}) {
|
|
13
13
|
const credentials = await this.getCredentials('quePasaApi');
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
throw new Error('No QuePasa account configured. Please add at least one account in credentials.');
|
|
14
|
+
const baseUrl = credentials.baseUrl;
|
|
15
|
+
const token = credentials.token;
|
|
16
|
+
if (!baseUrl || !token) {
|
|
17
|
+
throw new Error('QuePasa credentials are incomplete. Please configure Base URL and Token.');
|
|
19
18
|
}
|
|
20
|
-
const baseUrl = account.baseUrl;
|
|
21
|
-
const token = account.token;
|
|
22
19
|
const options = {
|
|
23
20
|
method,
|
|
24
21
|
body,
|
|
@@ -28,10 +25,14 @@ async function quePasaApiRequest(method, endpoint, body = {}, qs = {}, option =
|
|
|
28
25
|
headers: {
|
|
29
26
|
'X-QUEPASA-TOKEN': token,
|
|
30
27
|
},
|
|
28
|
+
returnFullResponse: false,
|
|
31
29
|
...option,
|
|
32
30
|
};
|
|
33
31
|
try {
|
|
34
|
-
|
|
32
|
+
const response = await this.helpers.httpRequest(options);
|
|
33
|
+
// Garantir que retornamos apenas dados JSON serializáveis
|
|
34
|
+
// Converter para string e voltar para remover referências circulares
|
|
35
|
+
return JSON.parse(JSON.stringify(response));
|
|
35
36
|
}
|
|
36
37
|
catch (error) {
|
|
37
38
|
if (error instanceof axios_1.AxiosError) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-quepasa-api-yurisilva_pro",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Complete n8n integration for QuePasa WhatsApp API - 48 operations, multi-account support, 100% API v4 coverage",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|