Skip to content

Commit

Permalink
downgrade baileys version
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidsonGomes committed May 20, 2024
1 parent 8cc1b8d commit 283b497
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:

- name: set docker tag
run: |
echo "DOCKER_TAG=ghcr.io/stack-app-br/evolution-api:$GIT_REF" >> $GITHUB_ENV
echo "DOCKER_TAG=ghcr.io/atendai/evolution-api:$GIT_REF" >> $GITHUB_ENV
- name: replace docker tag if main
if: github.ref_name == 'main'
run: |
echo "DOCKER_TAG=ghcr.io/stack-app-br/evolution-api:latest" >> $GITHUB_ENV
echo "DOCKER_TAG=ghcr.io/atendai/evolution-api:latest" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"amqplib": "^0.10.3",
"@aws-sdk/client-sqs": "^3.569.0",
"axios": "^1.6.5",
"baileys": "^6.7.2",
"@whiskeysockets/baileys": "6.6.0",
"class-validator": "^0.14.1",
"compression": "^1.7.4",
"cors": "^2.8.5",
Expand Down
2 changes: 1 addition & 1 deletion src/api/controllers/instance.controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { delay } from 'baileys';
import { delay } from '@whiskeysockets/baileys';
import { isURL } from 'class-validator';
import EventEmitter2 from 'eventemitter2';
import { v4 } from 'uuid';
Expand Down
2 changes: 1 addition & 1 deletion src/api/dto/chat.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { proto, WAPresence, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from 'baileys';
import { proto, WAPresence, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '@whiskeysockets/baileys';

export class OnWhatsAppDto {
constructor(
Expand Down
2 changes: 1 addition & 1 deletion src/api/dto/instance.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WAPresence } from 'baileys';
import { WAPresence } from '@whiskeysockets/baileys';

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

Expand Down
2 changes: 1 addition & 1 deletion src/api/dto/sendMessage.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { proto, WAPresence } from 'baileys';
import { proto, WAPresence } from '@whiskeysockets/baileys';

export class Quoted {
key: proto.IMessageKey;
Expand Down
2 changes: 1 addition & 1 deletion src/api/integrations/chatwoot/services/chatwoot.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import ChatwootClient, {
inbox,
} from '@figuro/chatwoot-sdk';
import { request as chatwootRequest } from '@figuro/chatwoot-sdk/dist/core/request';
import { proto } from '@whiskeysockets/baileys';
import axios from 'axios';
import { proto } from 'baileys';
import FormData from 'form-data';
import { createReadStream, unlinkSync, writeFileSync } from 'fs';
import Jimp from 'jimp';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { inbox } from '@figuro/chatwoot-sdk';
import { proto } from 'baileys';
import { proto } from '@whiskeysockets/baileys';

import { InstanceDto } from '../../../../api/dto/instance.dto';
import { ChatwootRaw, ContactRaw, MessageRaw } from '../../../../api/models';
Expand Down
4 changes: 2 additions & 2 deletions src/api/models/integration.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export class IntegrationRaw {
token?: string;
}

const sqsSchema = new Schema<IntegrationRaw>({
const integrationSchema = new Schema<IntegrationRaw>({
_id: { type: String, _id: true },
integration: { type: String, required: true },
number: { type: String, required: true },
token: { type: String, required: true },
});

export const IntegrationModel = dbserver?.model(IntegrationRaw.name, sqsSchema, 'integration');
export const IntegrationModel = dbserver?.model(IntegrationRaw.name, integrationSchema, 'integration');
export type IntegrationModel = typeof IntegrationModel;
2 changes: 1 addition & 1 deletion src/api/services/cache.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BufferJSON } from 'baileys';
import { BufferJSON } from '@whiskeysockets/baileys';

import { Logger } from '../../config/logger.config';
import { ICache } from '../abstract/abstract.cache';
Expand Down
2 changes: 1 addition & 1 deletion src/api/services/channel.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WASocket } from '@whiskeysockets/baileys';
import axios from 'axios';
import { WASocket } from 'baileys';
import { execSync } from 'child_process';
import { isURL } from 'class-validator';
import EventEmitter2 from 'eventemitter2';
Expand Down
8 changes: 4 additions & 4 deletions src/api/services/channels/whatsapp.baileys.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import ffmpegPath from '@ffmpeg-installer/ffmpeg';
import { Boom } from '@hapi/boom';
import axios from 'axios';
import makeWASocket, {
AnyMessageContent,
BufferedEventData,
Expand Down Expand Up @@ -36,9 +35,10 @@ import makeWASocket, {
WAMessageUpdate,
WAPresence,
WASocket,
} from 'baileys';
import { Label } from 'baileys/lib/Types/Label';
import { LabelAssociation } from 'baileys/lib/Types/LabelAssociation';
} from '@whiskeysockets/baileys';
import { Label } from '@whiskeysockets/baileys/lib/Types/Label';
import { LabelAssociation } from '@whiskeysockets/baileys/lib/Types/LabelAssociation';
import axios from 'axios';
import { exec } from 'child_process';
import { isBase64, isURL } from 'class-validator';
import EventEmitter2 from 'eventemitter2';
Expand Down
2 changes: 1 addition & 1 deletion src/api/types/wa.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-namespace */
import { AuthenticationState, WAConnectionState } from 'baileys';
import { AuthenticationState, WAConnectionState } from '@whiskeysockets/baileys';

export enum Events {
APPLICATION_STARTUP = 'application.startup',
Expand Down
2 changes: 1 addition & 1 deletion src/cache/rediscache.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BufferJSON } from 'baileys';
import { BufferJSON } from '@whiskeysockets/baileys';
import { RedisClientType } from 'redis';

import { ICache } from '../api/abstract/abstract.cache';
Expand Down
9 changes: 8 additions & 1 deletion src/utils/use-multi-file-auth-state-db.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { AuthenticationCreds, AuthenticationState, BufferJSON, initAuthCreds, proto, SignalDataTypeMap } from 'baileys';
import {
AuthenticationCreds,
AuthenticationState,
BufferJSON,
initAuthCreds,
proto,
SignalDataTypeMap,
} from '@whiskeysockets/baileys';

import { configService, Database } from '../config/env.config';
import { Logger } from '../config/logger.config';
Expand Down
8 changes: 7 additions & 1 deletion src/utils/use-multi-file-auth-state-redis-db.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { AuthenticationCreds, AuthenticationState, initAuthCreds, proto, SignalDataTypeMap } from 'baileys';
import {
AuthenticationCreds,
AuthenticationState,
initAuthCreds,
proto,
SignalDataTypeMap,
} from '@whiskeysockets/baileys';

import { CacheService } from '../api/services/cache.service';
import { Logger } from '../config/logger.config';
Expand Down

0 comments on commit 283b497

Please sign in to comment.