n8n-nodes-quepasa-api-yurisilva_pro 2.2.0 → 2.2.1

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.
@@ -154,7 +154,7 @@ class QuePasa {
154
154
  if (additionalOptions.trackId) {
155
155
  body.trackId = additionalOptions.trackId;
156
156
  }
157
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', '/v4/messages/send', body);
157
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', '/send', body);
158
158
  }
159
159
  else if (operation === 'sendMedia') {
160
160
  const chatId = this.getNodeParameter('chatId', i);
@@ -171,7 +171,7 @@ class QuePasa {
171
171
  if (caption) {
172
172
  body.caption = caption;
173
173
  }
174
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', '/v4/messages/send', body);
174
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', '/send', body);
175
175
  }
176
176
  else if (operation === 'sendFromUrl') {
177
177
  const chatId = this.getNodeParameter('chatId', i);
@@ -188,11 +188,11 @@ class QuePasa {
188
188
  if (filename) {
189
189
  body.filename = filename;
190
190
  }
191
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', '/v4/messages/send', body);
191
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', '/send', body);
192
192
  }
193
193
  else if (operation === 'revokeMessage') {
194
194
  const messageId = this.getNodeParameter('messageId', i);
195
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'DELETE', `/v4/messages/${messageId}`);
195
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'DELETE', `/messages/${messageId}`);
196
196
  }
197
197
  else if (operation === 'reactToMessage') {
198
198
  const messageId = this.getNodeParameter('messageId', i);
@@ -200,7 +200,7 @@ class QuePasa {
200
200
  const body = {
201
201
  emoji,
202
202
  };
203
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/v4/messages/${messageId}/react`, body);
203
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/messages/${messageId}/react`, body);
204
204
  }
205
205
  else if (operation === 'forwardMessage') {
206
206
  const messageId = this.getNodeParameter('messageId', i);
@@ -208,12 +208,12 @@ class QuePasa {
208
208
  const body = {
209
209
  to: (0, GenericFunctions_1.formatPhoneNumber)(toChatId),
210
210
  };
211
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/v4/messages/${messageId}/forward`, body);
211
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/messages/${messageId}/forward`, body);
212
212
  }
213
213
  else if (operation === 'getHistory') {
214
214
  const chatId = this.getNodeParameter('chatId', i);
215
215
  const limit = this.getNodeParameter('limit', i, 50);
216
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'GET', `/v4/chats/${(0, GenericFunctions_1.formatPhoneNumber)(chatId)}/messages`, {}, { limit: Math.min(limit, 100) });
216
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'GET', `/chats/${(0, GenericFunctions_1.formatPhoneNumber)(chatId)}/messages`, {}, { limit: Math.min(limit, 100) });
217
217
  }
218
218
  }
219
219
  // ============================================
@@ -333,12 +333,12 @@ class QuePasa {
333
333
  .split(',')
334
334
  .map(p => p.trim().replace(/\D/g, ''))
335
335
  .filter(p => p);
336
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', '/v4/contacts/check', { phones });
336
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', '/contacts/check', { phones });
337
337
  }
338
338
  else if (operation === 'getPicture') {
339
339
  const contactId = this.getNodeParameter('contactId', i);
340
340
  const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i, 'data');
341
- const response = await GenericFunctions_1.quePasaApiRequest.call(this, 'GET', `/v4/contacts/${contactId}/picture`, {}, {}, { returnFullResponse: true, encoding: null });
341
+ const response = await GenericFunctions_1.quePasaApiRequest.call(this, 'GET', `/contacts/${contactId}/picture`, {}, {}, { returnFullResponse: true, encoding: null });
342
342
  const executionData = {
343
343
  json: { contactId, success: true },
344
344
  binary: {
@@ -350,11 +350,11 @@ class QuePasa {
350
350
  }
351
351
  else if (operation === 'blockContact') {
352
352
  const contactId = this.getNodeParameter('contactId', i);
353
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/v4/contacts/${contactId}/block`);
353
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/contacts/${contactId}/block`);
354
354
  }
355
355
  else if (operation === 'unblockContact') {
356
356
  const contactId = this.getNodeParameter('contactId', i);
357
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/v4/contacts/${contactId}/unblock`);
357
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/contacts/${contactId}/unblock`);
358
358
  }
359
359
  }
360
360
  // ============================================
@@ -364,7 +364,7 @@ class QuePasa {
364
364
  if (operation === 'downloadMedia') {
365
365
  const messageId = this.getNodeParameter('messageId', i);
366
366
  const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i, 'data');
367
- const response = await GenericFunctions_1.quePasaApiRequest.call(this, 'GET', `/v4/messages/${messageId}/download`, {}, {}, { returnFullResponse: true, encoding: null });
367
+ const response = await GenericFunctions_1.quePasaApiRequest.call(this, 'GET', `/messages/${messageId}/download`, {}, {}, { returnFullResponse: true, encoding: null });
368
368
  const executionData = {
369
369
  json: { messageId, success: true },
370
370
  binary: {
@@ -376,7 +376,7 @@ class QuePasa {
376
376
  }
377
377
  else if (operation === 'downloadAsBase64') {
378
378
  const messageId = this.getNodeParameter('messageId', i);
379
- const response = await GenericFunctions_1.quePasaApiRequest.call(this, 'GET', `/v4/messages/${messageId}/download`, {}, {}, { returnFullResponse: true, encoding: null });
379
+ const response = await GenericFunctions_1.quePasaApiRequest.call(this, 'GET', `/messages/${messageId}/download`, {}, {}, { returnFullResponse: true, encoding: null });
380
380
  const base64Data = response.body.toString('base64');
381
381
  const mimeType = response.headers['content-type'];
382
382
  responseData = {
@@ -427,23 +427,23 @@ class QuePasa {
427
427
  else if (resource === 'chat') {
428
428
  if (operation === 'markAsRead') {
429
429
  const chatId = this.getNodeParameter('chatId', i);
430
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/v4/chats/${chatId}/markasread`);
430
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/chats/${chatId}/markasread`);
431
431
  }
432
432
  else if (operation === 'archiveChat') {
433
433
  const chatId = this.getNodeParameter('chatId', i);
434
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/v4/chats/${chatId}/archive`);
434
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/chats/${chatId}/archive`);
435
435
  }
436
436
  else if (operation === 'unarchiveChat') {
437
437
  const chatId = this.getNodeParameter('chatId', i);
438
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/v4/chats/${chatId}/unarchive`);
438
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/chats/${chatId}/unarchive`);
439
439
  }
440
440
  else if (operation === 'pinChat') {
441
441
  const chatId = this.getNodeParameter('chatId', i);
442
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/v4/chats/${chatId}/pin`);
442
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/chats/${chatId}/pin`);
443
443
  }
444
444
  else if (operation === 'unpinChat') {
445
445
  const chatId = this.getNodeParameter('chatId', i);
446
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/v4/chats/${chatId}/unpin`);
446
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/chats/${chatId}/unpin`);
447
447
  }
448
448
  else if (operation === 'muteChat') {
449
449
  const chatId = this.getNodeParameter('chatId', i);
@@ -451,11 +451,11 @@ class QuePasa {
451
451
  const body = {
452
452
  duration,
453
453
  };
454
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/v4/chats/${chatId}/mute`, body);
454
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/chats/${chatId}/mute`, body);
455
455
  }
456
456
  else if (operation === 'unmuteChat') {
457
457
  const chatId = this.getNodeParameter('chatId', i);
458
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/v4/chats/${chatId}/unmute`);
458
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', `/chats/${chatId}/unmute`);
459
459
  }
460
460
  }
461
461
  // ============================================
@@ -464,18 +464,18 @@ class QuePasa {
464
464
  else if (resource === 'status') {
465
465
  if (operation === 'updatePresence') {
466
466
  const presence = this.getNodeParameter('presence', i);
467
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', '/v4/presence', { presence });
467
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', '/presence', { presence });
468
468
  }
469
469
  else if (operation === 'updateStatus') {
470
470
  const statusText = this.getNodeParameter('statusText', i);
471
471
  const body = {
472
472
  status: statusText,
473
473
  };
474
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', '/v4/status', body);
474
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'POST', '/status', body);
475
475
  }
476
476
  else if (operation === 'getContactStatus') {
477
477
  const contactId = this.getNodeParameter('contactId', i);
478
- responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'GET', `/v4/contacts/${contactId}/status`);
478
+ responseData = await GenericFunctions_1.quePasaApiRequest.call(this, 'GET', `/contacts/${contactId}/status`);
479
479
  }
480
480
  }
481
481
  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-quepasa-api-yurisilva_pro",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
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",