Skip to content

Commit 28c517a

Browse files
committed
Merge branch 'release/1.8.2'
2 parents dfb003f + 18ebe27 commit 28c517a

18 files changed

+271
-313
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# 1.8.2 (2024-07-03 13:50)
2+
3+
### Fixed
4+
5+
* Corretion in globall rabbitmq queue name
6+
* Improvement in the use of mongodb database for credentials
7+
* Fixed base64 in webhook for documentWithCaption
8+
* Fixed Generate pairing code
9+
110
# 1.8.1 (2024-06-08 21:32)
211

312
### Feature

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "evolution-api",
3-
"version": "1.8.1",
3+
"version": "1.8.2",
44
"description": "Rest api for communication with WhatsApp",
55
"main": "./dist/src/main.js",
66
"scripts": {
@@ -49,7 +49,7 @@
4949
"amqplib": "^0.10.3",
5050
"@aws-sdk/client-sqs": "^3.569.0",
5151
"axios": "^1.6.5",
52-
"@whiskeysockets/baileys": "6.7.5",
52+
"baileys": "github:EvolutionAPI/Baileys",
5353
"class-validator": "^0.14.1",
5454
"compression": "^1.7.4",
5555
"cors": "^2.8.5",

src/api/controllers/instance.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { delay } from '@whiskeysockets/baileys';
1+
import { delay } from 'baileys';
22
import { isURL } from 'class-validator';
33
import EventEmitter2 from 'eventemitter2';
44
import { v4 } from 'uuid';

src/api/dto/chat.dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { proto, WAPresence, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '@whiskeysockets/baileys';
1+
import { proto, WAPresence, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from 'baileys';
22

33
export class OnWhatsAppDto {
44
constructor(

src/api/dto/instance.dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { WAPresence } from '@whiskeysockets/baileys';
1+
import { WAPresence } from 'baileys';
22

33
import { ProxyDto } from './proxy.dto';
44

src/api/dto/sendMessage.dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { proto, WAPresence } from '@whiskeysockets/baileys';
1+
import { proto, WAPresence } from 'baileys';
22

33
export class Quoted {
44
key: proto.IMessageKey;

src/api/integrations/chatwoot/services/chatwoot.service.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import ChatwootClient, {
88
inbox,
99
} from '@figuro/chatwoot-sdk';
1010
import { request as chatwootRequest } from '@figuro/chatwoot-sdk/dist/core/request';
11-
import { proto } from '@whiskeysockets/baileys';
1211
import axios from 'axios';
12+
import { proto } from 'baileys';
1313
import FormData from 'form-data';
1414
import { createReadStream, unlinkSync, writeFileSync } from 'fs';
1515
import Jimp from 'jimp';
@@ -444,8 +444,7 @@ export class ChatwootService {
444444
const searchableFields = this.getSearchableFields();
445445

446446
// eslint-disable-next-line prettier/prettier
447-
if(contacts.length === 2 && this.getClientCwConfig().merge_brazil_contacts && query.startsWith('+55')){
448-
447+
if (contacts.length === 2 && this.getClientCwConfig().merge_brazil_contacts && query.startsWith('+55')) {
449448
const contact = this.mergeBrazilianContacts(contacts);
450449
if (contact) {
451450
return contact;
@@ -736,7 +735,12 @@ export class ChatwootService {
736735
}
737736

738737
this.logger.verbose('find inbox by name');
739-
const findByName = inbox.payload.find((inbox) => inbox.name === this.getClientCwConfig().name_inbox);
738+
let findByName = inbox.payload.find((inbox) => inbox.name === this.getClientCwConfig().name_inbox);
739+
740+
if (!findByName) {
741+
findByName = inbox.payload.find((inbox) => inbox.name === this.getClientCwConfig().name_inbox.split('-cwId-')[0]);
742+
}
743+
740744

741745
if (!findByName) {
742746
this.logger.warn('inbox not found');

src/api/integrations/chatwoot/utils/chatwoot-import-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { inbox } from '@figuro/chatwoot-sdk';
2-
import { proto } from '@whiskeysockets/baileys';
2+
import { proto } from 'baileys';
33

44
import { InstanceDto } from '../../../../api/dto/instance.dto';
55
import { ChatwootRaw, ContactRaw, MessageRaw } from '../../../../api/models';

src/api/services/cache.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BufferJSON } from '@whiskeysockets/baileys';
1+
import { BufferJSON } from 'baileys';
22

33
import { Logger } from '../../config/logger.config';
44
import { ICache } from '../abstract/abstract.cache';

src/api/services/channel.service.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { WASocket } from '@whiskeysockets/baileys';
21
import axios from 'axios';
2+
import { WASocket } from 'baileys';
33
import { execSync } from 'child_process';
44
import { isURL } from 'class-validator';
55
import EventEmitter2 from 'eventemitter2';
@@ -721,7 +721,9 @@ export class ChannelStartupService {
721721
autoDelete: false,
722722
});
723723

724-
const queueName = `${this.instanceName}.${event}`;
724+
const eventName = event.replace(/_/g, '.').toLowerCase();
725+
726+
const queueName = `${this.instanceName}.${eventName}`;
725727

726728
await amqp.assertQueue(queueName, {
727729
durable: true,
@@ -731,7 +733,7 @@ export class ChannelStartupService {
731733
},
732734
});
733735

734-
await amqp.bindQueue(queueName, exchangeName, event);
736+
await amqp.bindQueue(queueName, exchangeName, eventName);
735737

736738
const message = {
737739
event,
@@ -786,7 +788,7 @@ export class ChannelStartupService {
786788
autoDelete: false,
787789
});
788790

789-
const queueName = transformedWe;
791+
const queueName = event;
790792

791793
await amqp.assertQueue(queueName, {
792794
durable: true,

0 commit comments

Comments
 (0)