Skip to content

Commit da06ed1

Browse files
committed
Merge branch 'release/1.7.5'
2 parents 633dbb8 + 67afbd6 commit da06ed1

30 files changed

+320
-150
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.github/workflows/publish_docker_image.yml

Lines changed: 34 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,52 @@ name: Build Docker image
22

33
on:
44
push:
5-
tags: ['v*']
5+
branches:
6+
- develop
7+
- main
8+
tags:
9+
- v*
10+
workflow_dispatch:
611

712
jobs:
8-
build-amd:
13+
build:
914
runs-on: ubuntu-latest
15+
env:
16+
GIT_REF: ${{ github.head_ref || github.ref_name }} # ref_name to get tags/branches
17+
permissions:
18+
contents: read
19+
packages: write
1020
steps:
11-
- name: Check out the repo
12-
uses: actions/checkout@v3
21+
- name: Checkout
22+
uses: actions/checkout@v4
1323

14-
- name: Extract existing image metadata
15-
id: image-meta
16-
uses: docker/metadata-action@v4
17-
with:
18-
images: atendai/evolution-api
24+
- name: Set up QEMU
25+
uses: docker/setup-qemu-action@v3
1926

2027
- name: Set up Docker Buildx
21-
uses: docker/setup-buildx-action@v2
22-
23-
- name: Log in to Docker Hub
24-
uses: docker/login-action@v2
25-
with:
26-
username: ${{ secrets.DOCKER_USERNAME }}
27-
password: ${{ secrets.DOCKER_PASSWORD }}
28+
uses: docker/setup-buildx-action@v3
2829

29-
- name: Build and push AMD image
30-
uses: docker/build-push-action@v4
31-
with:
32-
context: .
33-
labels: ${{ steps.image-meta.outputs.labels }}
34-
platforms: linux/amd64
35-
push: true
30+
- name: set docker tag
31+
run: |
32+
echo "DOCKER_TAG=ghcr.io/atendai/evolution-api:$GIT_REF" >> $GITHUB_ENV
3633
37-
build-arm:
38-
runs-on: buildjet-4vcpu-ubuntu-2204-arm
39-
steps:
40-
- name: Check out the repo
41-
uses: actions/checkout@v3
42-
43-
- name: Extract existing image metadata
44-
id: image-meta
45-
uses: docker/metadata-action@v4
46-
with:
47-
images: atendai/evolution-api
48-
49-
- name: Set up Docker Buildx
50-
uses: docker/setup-buildx-action@v2
34+
- name: replace docker tag if main
35+
if: github.ref_name == 'main'
36+
run: |
37+
echo "DOCKER_TAG=ghcr.io/atendai/evolution-api:latest" >> $GITHUB_ENV
5138
52-
- name: Log in to Docker Hub
53-
uses: docker/login-action@v2
39+
- name: Login to GitHub Container Registry
40+
uses: docker/login-action@v3
5441
with:
55-
username: ${{ secrets.DOCKER_USERNAME }}
56-
password: ${{ secrets.DOCKER_PASSWORD }}
42+
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
5745

58-
- name: Build and push ARM image
59-
uses: docker/build-push-action@v4
46+
- name: Build and push
47+
uses: docker/build-push-action@v2
6048
with:
6149
context: .
62-
labels: ${{ steps.image-meta.outputs.labels }}
63-
platforms: linux/arm64
50+
file: ./Dockerfile
51+
platforms: linux/amd64,linux/arm64
6452
push: true
53+
tags: ${{ env.DOCKER_TAG }}

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# 1.7.5 (2024-05-21 08:50)
2+
3+
### Fixed
4+
* Add merge_brazil_contacts function to solve nine digit in brazilian numbers
5+
* Optimize ChatwootService method for updating contact
6+
* Fix swagger auth
7+
* Update aws sdk v3
8+
* Fix getOpenConversationByContact and init queries error
9+
* Method to mark chat as unread
10+
* Added environment variable to manually select the WhatsApp web version for the baileys lib (optional)
11+
112
# 1.7.4 (2024-04-28 09:46)
213

314
### Fixed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM node:20.7.0-alpine AS builder
22

3-
LABEL version="1.7.4" description="Api to control whatsapp features through http requests."
3+
LABEL version="1.7.5" description="Api to control whatsapp features through http requests."
44
LABEL maintainer="Davidson Gomes" git="https://github.com/DavidsonGomes"
55
LABEL contact="[email protected]"
66

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "evolution-api",
3-
"version": "1.7.4",
3+
"version": "1.7.5",
44
"description": "Rest api for communication with WhatsApp",
55
"main": "./dist/src/main.js",
66
"scripts": {
@@ -47,9 +47,9 @@
4747
"@hapi/boom": "^10.0.1",
4848
"@sentry/node": "^7.59.2",
4949
"amqplib": "^0.10.3",
50-
"aws-sdk": "^2.1499.0",
50+
"@aws-sdk/client-sqs": "^3.569.0",
5151
"axios": "^1.6.5",
52-
"baileys": "^6.7.0",
52+
"@whiskeysockets/baileys": "^6.7.2",
5353
"class-validator": "^0.14.1",
5454
"compression": "^1.7.4",
5555
"cors": "^2.8.5",

src/api/controllers/chat.controller.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
BlockUserDto,
55
DeleteMessage,
66
getBase64FromMediaMessageDto,
7+
MarkChatUnreadDto,
78
NumberDto,
89
PrivacySettingDto,
910
ProfileNameDto,
@@ -40,6 +41,11 @@ export class ChatController {
4041
return await this.waMonitor.waInstances[instanceName].archiveChat(data);
4142
}
4243

44+
public async markChatUnread({ instanceName }: InstanceDto, data: MarkChatUnreadDto) {
45+
logger.verbose('requested markChatUnread from ' + instanceName + ' instance');
46+
return await this.waMonitor.waInstances[instanceName].markChatUnread(data);
47+
}
48+
4349
public async deleteMessage({ instanceName }: InstanceDto, data: DeleteMessage) {
4450
logger.verbose('requested deleteMessage from ' + instanceName + ' instance');
4551
return await this.waMonitor.waInstances[instanceName].deleteMessage(data);

src/api/controllers/instance.controller.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { delay } from 'baileys';
1+
import { delay } from '@whiskeysockets/baileys';
22
import { isURL } from 'class-validator';
33
import EventEmitter2 from 'eventemitter2';
44
import { v4 } from 'uuid';
@@ -66,6 +66,7 @@ export class InstanceController {
6666
chatwoot_conversation_pending,
6767
chatwoot_import_contacts,
6868
chatwoot_name_inbox,
69+
chatwoot_merge_brazil_contacts,
6970
chatwoot_import_messages,
7071
chatwoot_days_limit_import_messages,
7172
reject_call,
@@ -519,6 +520,7 @@ export class InstanceController {
519520
reopen_conversation: chatwoot_reopen_conversation || false,
520521
conversation_pending: chatwoot_conversation_pending || false,
521522
import_contacts: chatwoot_import_contacts ?? true,
523+
merge_brazil_contacts: chatwoot_merge_brazil_contacts ?? false,
522524
import_messages: chatwoot_import_messages ?? true,
523525
days_limit_import_messages: chatwoot_days_limit_import_messages ?? 60,
524526
auto_create: true,
@@ -574,6 +576,7 @@ export class InstanceController {
574576
sign_msg: chatwoot_sign_msg || false,
575577
reopen_conversation: chatwoot_reopen_conversation || false,
576578
conversation_pending: chatwoot_conversation_pending || false,
579+
merge_brazil_contacts: chatwoot_merge_brazil_contacts ?? false,
577580
import_contacts: chatwoot_import_contacts ?? true,
578581
import_messages: chatwoot_import_messages ?? true,
579582
days_limit_import_messages: chatwoot_days_limit_import_messages || 60,

src/api/dto/chat.dto.ts

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

33
export class OnWhatsAppDto {
44
constructor(
@@ -73,6 +73,11 @@ export class ArchiveChatDto {
7373
archive: boolean;
7474
}
7575

76+
export class MarkChatUnreadDto {
77+
lastMessage?: LastMessage;
78+
chat?: string;
79+
}
80+
7681
class PrivacySetting {
7782
readreceipts: WAReadReceiptsValue;
7883
profile: WAPrivacyValue;

src/api/dto/instance.dto.ts

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

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

@@ -27,6 +27,7 @@ export class InstanceDto {
2727
chatwoot_sign_msg?: boolean;
2828
chatwoot_reopen_conversation?: boolean;
2929
chatwoot_conversation_pending?: boolean;
30+
chatwoot_merge_brazil_contacts?: boolean;
3031
chatwoot_import_contacts?: boolean;
3132
chatwoot_import_messages?: boolean;
3233
chatwoot_days_limit_import_messages?: number;

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 'baileys';
1+
import { proto, WAPresence } from '@whiskeysockets/baileys';
22

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

src/api/integrations/chatwoot/controllers/chatwoot.controller.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export class ChatwootController {
5353
data.conversation_pending = false;
5454
data.import_contacts = false;
5555
data.import_messages = false;
56+
data.merge_brazil_contacts = false;
5657
data.days_limit_import_messages = 0;
5758
data.auto_create = false;
5859
data.name_inbox = '';

src/api/integrations/chatwoot/dto/chatwoot.dto.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export class ChatwootDto {
99
number?: string;
1010
reopen_conversation?: boolean;
1111
conversation_pending?: boolean;
12+
merge_brazil_contacts?: boolean;
1213
import_contacts?: boolean;
1314
import_messages?: boolean;
1415
days_limit_import_messages?: number;

src/api/integrations/chatwoot/models/chatwoot.model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export class ChatwootRaw {
1414
number?: string;
1515
reopen_conversation?: boolean;
1616
conversation_pending?: boolean;
17+
merge_brazil_contacts?: boolean;
1718
import_contacts?: boolean;
1819
import_messages?: boolean;
1920
days_limit_import_messages?: number;
@@ -31,6 +32,7 @@ const chatwootSchema = new Schema<ChatwootRaw>({
3132
number: { type: String, required: true },
3233
reopen_conversation: { type: Boolean, required: true },
3334
conversation_pending: { type: Boolean, required: true },
35+
merge_brazil_contacts: { type: Boolean, required: true },
3436
import_contacts: { type: Boolean, required: true },
3537
import_messages: { type: Boolean, required: true },
3638
days_limit_import_messages: { type: Number, required: true },

0 commit comments

Comments
 (0)