Skip to content

Commit 14c210c

Browse files
committed
fix: new version baileys
1 parent 00e7fcc commit 14c210c

17 files changed

+39
-51
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
# 1.8.0 (develop)
1+
# 1.7.4 (develop)
22

33
### Fixed
44
* Adjusts in proxy on fetchAgent
55
* Recovering messages lost with redis cache
66
* Log when init redis cache service
77
* Recovering messages lost with redis cache
88
* Chatwoot inbox name
9+
* Update Baileys version
910

1011
# 1.7.3 (2024-04-18 12:07)
1112

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@
4646
"@figuro/chatwoot-sdk": "^1.1.16",
4747
"@hapi/boom": "^10.0.1",
4848
"@sentry/node": "^7.59.2",
49-
"@whiskeysockets/baileys": "github:WhiskeySockets/Baileys#fix/missing-messages",
5049
"amqplib": "^0.10.3",
5150
"aws-sdk": "^2.1499.0",
5251
"axios": "^1.6.5",
52+
"baileys": "^6.7.0",
5353
"class-validator": "^0.14.1",
5454
"compression": "^1.7.4",
5555
"cors": "^2.8.5",

src/api/controllers/instance.controller.ts

Lines changed: 3 additions & 3 deletions
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';
@@ -15,12 +15,12 @@ import { WebsocketService } from '../integrations/websocket/services/websocket.s
1515
import { RepositoryBroker } from '../repository/repository.manager';
1616
import { AuthService, OldToken } from '../services/auth.service';
1717
import { CacheService } from '../services/cache.service';
18+
import { BaileysStartupService } from '../services/channels/whatsapp.baileys.service';
19+
import { BusinessStartupService } from '../services/channels/whatsapp.business.service';
1820
import { IntegrationService } from '../services/integration.service';
1921
import { WAMonitoringService } from '../services/monitor.service';
2022
import { SettingsService } from '../services/settings.service';
2123
import { WebhookService } from '../services/webhook.service';
22-
import { BaileysStartupService } from '../services/whatsapp/whatsapp.baileys.service';
23-
import { BusinessStartupService } from '../services/whatsapp/whatsapp.business.service';
2424
import { Events, Integration, wa } from '../types/wa.types';
2525
import { ProxyController } from './proxy.controller';
2626

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: 1 addition & 1 deletion
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';

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';
Lines changed: 13 additions & 13 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';
@@ -38,17 +38,17 @@ import { waMonitor } from '../server.module';
3838
import { Events, wa } from '../types/wa.types';
3939
import { CacheService } from './cache.service';
4040

41-
export class WAStartupService {
41+
export class ChannelStartupService {
4242
constructor(
4343
public readonly configService: ConfigService,
4444
public readonly eventEmitter: EventEmitter2,
4545
public readonly repository: RepositoryBroker,
4646
public readonly chatwootCache: CacheService,
4747
) {
48-
this.logger.verbose('WAStartupService initialized');
48+
this.logger.verbose('ChannelStartupService initialized');
4949
}
5050

51-
public readonly logger = new Logger(WAStartupService.name);
51+
public readonly logger = new Logger(ChannelStartupService.name);
5252

5353
public client: WASocket;
5454
public readonly instance: wa.Instance = {};
@@ -742,7 +742,7 @@ export class WAStartupService {
742742

743743
if (this.configService.get<Log>('LOG').LEVEL.includes('WEBHOOKS')) {
744744
const logData = {
745-
local: WAStartupService.name + '.sendData-RabbitMQ',
745+
local: ChannelStartupService.name + '.sendData-RabbitMQ',
746746
event,
747747
instance: this.instance.name,
748748
data,
@@ -798,7 +798,7 @@ export class WAStartupService {
798798
sqs.sendMessage(params, (err, data) => {
799799
if (err) {
800800
this.logger.error({
801-
local: WAStartupService.name + '.sendData-SQS',
801+
local: ChannelStartupService.name + '.sendData-SQS',
802802
message: err?.message,
803803
hostName: err?.hostname,
804804
code: err?.code,
@@ -810,7 +810,7 @@ export class WAStartupService {
810810
} else {
811811
if (this.configService.get<Log>('LOG').LEVEL.includes('WEBHOOKS')) {
812812
const logData = {
813-
local: WAStartupService.name + '.sendData-SQS',
813+
local: ChannelStartupService.name + '.sendData-SQS',
814814
event,
815815
instance: this.instance.name,
816816
data,
@@ -854,7 +854,7 @@ export class WAStartupService {
854854

855855
if (this.configService.get<Log>('LOG').LEVEL.includes('WEBHOOKS')) {
856856
const logData = {
857-
local: WAStartupService.name + '.sendData-WebsocketGlobal',
857+
local: ChannelStartupService.name + '.sendData-WebsocketGlobal',
858858
event,
859859
instance: this.instance.name,
860860
data,
@@ -884,7 +884,7 @@ export class WAStartupService {
884884

885885
if (this.configService.get<Log>('LOG').LEVEL.includes('WEBHOOKS')) {
886886
const logData = {
887-
local: WAStartupService.name + '.sendData-Websocket',
887+
local: ChannelStartupService.name + '.sendData-Websocket',
888888
event,
889889
instance: this.instance.name,
890890
data,
@@ -918,7 +918,7 @@ export class WAStartupService {
918918

919919
if (this.configService.get<Log>('LOG').LEVEL.includes('WEBHOOKS')) {
920920
const logData = {
921-
local: WAStartupService.name + '.sendDataWebhook-local',
921+
local: ChannelStartupService.name + '.sendDataWebhook-local',
922922
url: baseURL,
923923
event,
924924
instance: this.instance.name,
@@ -958,7 +958,7 @@ export class WAStartupService {
958958
}
959959
} catch (error) {
960960
this.logger.error({
961-
local: WAStartupService.name + '.sendDataWebhook-local',
961+
local: ChannelStartupService.name + '.sendDataWebhook-local',
962962
message: error?.message,
963963
hostName: error?.hostname,
964964
syscall: error?.syscall,
@@ -990,7 +990,7 @@ export class WAStartupService {
990990

991991
if (this.configService.get<Log>('LOG').LEVEL.includes('WEBHOOKS')) {
992992
const logData = {
993-
local: WAStartupService.name + '.sendDataWebhook-global',
993+
local: ChannelStartupService.name + '.sendDataWebhook-global',
994994
url: globalURL,
995995
event,
996996
instance: this.instance.name,
@@ -1029,7 +1029,7 @@ export class WAStartupService {
10291029
}
10301030
} catch (error) {
10311031
this.logger.error({
1032-
local: WAStartupService.name + '.sendDataWebhook-global',
1032+
local: ChannelStartupService.name + '.sendDataWebhook-global',
10331033
message: error?.message,
10341034
hostName: error?.hostname,
10351035
syscall: error?.syscall,

0 commit comments

Comments
 (0)