Skip to content

Commit 2228d58

Browse files
committed
version: 2.2.1 sync
1 parent 3a0487a commit 2228d58

File tree

82 files changed

+14932
-747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+14932
-747
lines changed

.env.example

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ SERVER_URL=http://localhost:8080
55

66
SENTRY_DSN=
77

8-
TZ=America/Sao_Paulo
9-
108
# Cors - * for all or set separate by commas - ex.: 'yourdomain1.com, yourdomain2.com'
119
CORS_ORIGIN=*
1210
CORS_METHODS=GET,POST,PUT,DELETE
@@ -28,10 +26,10 @@ DEL_INSTANCE=false
2826

2927
# Provider: postgresql | mysql
3028
DATABASE_PROVIDER=postgresql
31-
DATABASE_CONNECTION_URI='postgresql://user:pass@localhost:5432/evolution?schema=public'
29+
DATABASE_CONNECTION_URI='postgresql://user:pass@postgres:5432/evolution?schema=public'
3230
# Client name for the database connection
3331
# It is used to separate an API installation from another that uses the same database.
34-
DATABASE_CONNECTION_CLIENT_NAME=evolution
32+
DATABASE_CONNECTION_CLIENT_NAME=evolution_exchange
3533

3634
# Choose the data you want to save in the application's database
3735
DATABASE_SAVE_DATA_INSTANCE=true
@@ -92,7 +90,7 @@ WEBSOCKET_ENABLED=false
9290
WEBSOCKET_GLOBAL_EVENTS=false
9391

9492
# Pusher - Environment variables
95-
PUSHER_ENABLED=true
93+
PUSHER_ENABLED=false
9694
PUSHER_GLOBAL_ENABLED=false
9795
PUSHER_GLOBAL_APP_ID=
9896
PUSHER_GLOBAL_KEY=
@@ -226,6 +224,10 @@ S3_USE_SSL=true
226224
# S3_USE_SSL=true
227225
# S3_REGION=eu-south
228226

227+
# Evolution Audio Converter - Environment variables - https://github.com/EvolutionAPI/evolution-audio-converter
228+
# API_AUDIO_CONVERTER=http://localhost:4040/process-audio
229+
# API_AUDIO_CONVERTER_KEY=429683C4C977415CAAFCCE10F7D57E11
230+
229231
# Define a global apikey to access all instances.
230232
# OBS: This key must be inserted in the request header to create an instance.
231233
AUTHENTICATION_API_KEY=429683C4C977415CAAFCCE10F7D57E11

.eslintrc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
module.exports = {
22
parser: '@typescript-eslint/parser',
33
parserOptions: {
4-
sourceType: 'CommonJS',
4+
project: 'tsconfig.json',
5+
tsconfigRootDir: __dirname,
6+
sourceType: 'module',
7+
warnOnUnsupportedTypeScriptVersion: false,
8+
EXPERIMENTAL_useSourceOfProjectReferenceRedirect: true,
59
},
610
plugins: ['@typescript-eslint', 'simple-import-sort', 'import'],
711
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Check Code Quality
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
check-lint-and-build:
7+
runs-on: ubuntu-latest
8+
timeout-minutes: 10
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Install Node
14+
uses: actions/setup-node@v1
15+
with:
16+
node-version: 20.x
17+
18+
- name: Install packages
19+
run: npm install
20+
21+
- name: Check linting
22+
run: npm run lint:check
23+
24+
- name: Check build
25+
run: npm run db:generate
26+
27+
- name: Check build
28+
run: npm run build

.github/workflows/publish_docker_image.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ lerna-debug.log*
2121
# Package
2222
/yarn.lock
2323
/pnpm-lock.yaml
24-
/package-lock.json
2524

2625
# IDEs
2726
.vscode/*

CHANGELOG.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,43 @@
1-
# 2.2.0 (develop)
1+
# 2.2.1 (2025-01-22 14:37)
2+
3+
### Features
4+
5+
* Retry system for send webhooks
6+
* Message filtering to support timestamp range queries
7+
* Chats filtering to support timestamp range queries
8+
9+
### Fixed
10+
11+
* Correction of webhook global
12+
* Fixed send audio with whatsapp cloud api
13+
* Refactor on fetch chats
14+
* Refactor on Evolution Channel
15+
16+
# 2.2.0 (2024-10-18 10:00)
217

318
### Features
419

520
* Fake Call function
6-
* Send List Message
7-
* Send Button Message
21+
* Send List with Baileys
22+
* Send Buttons with Baileys
823
* Added unreadMessages to chats
924
* Pusher event integration
25+
* Add support for splitMessages and timePerChar in Integrations
26+
* Audio Converter via API
1027
* Send PTV messages with Baileys
1128

1229
### Fixed
1330

1431
* Fixed prefilledVariables in startTypebot
1532
* Fix duplicate file upload
1633
* Mark as read from me and groups
17-
* fetch chats query
34+
* Fetch chats query
35+
* Ads messages in chatwoot
36+
* Add indexes to improve performance in Evolution
37+
* Add logical or permanent message deletion based on env config
38+
* Add support for fetching multiple instances by key
39+
* Update instance.controller.ts to filter by instanceName
40+
* Receive template button reply message
1841

1942
# 2.1.2 (2024-10-06 10:09)
2043

Docker/minio/docker-compose.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: '3.3'
2+
3+
services:
4+
minio:
5+
container_name: minio
6+
image: quay.io/minio/minio
7+
networks:
8+
- evolution-net
9+
command: server /data --console-address ":9001"
10+
restart: always
11+
ports:
12+
- 5432:5432
13+
environment:
14+
- MINIO_ROOT_USER=USER
15+
- MINIO_ROOT_PASSWORD=PASSWORD
16+
- MINIO_BROWSER_REDIRECT_URL=http:/localhost:9001
17+
- MINIO_SERVER_URL=http://localhost:9000
18+
volumes:
19+
- minio_data:/data
20+
expose:
21+
- 9000
22+
- 9001
23+
24+
volumes:
25+
minio_data:
26+
27+
28+
networks:
29+
evolution-net:
30+
name: evolution-net
31+
driver: bridge

Docker/swarm/evolution_api_v2.yaml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
version: "3.7"
22

33
services:
4-
evolution_v2_lite:
4+
evolution_v2:
55
image: atendai/evolution-api-lite:latest
6-
entrypoint: ["/bin/bash", "-c", ". ./Docker/scripts/deploy_database.sh && npm run start:prod" ]
76
volumes:
87
- evolution_instances:/evolution/instances
98
networks:
@@ -20,10 +19,10 @@ services:
2019
- DATABASE_SAVE_DATA_CHATS=true
2120
- DATABASE_SAVE_DATA_LABELS=true
2221
- DATABASE_SAVE_DATA_HISTORIC=true
23-
- DATABASE_CONNECTION_CLIENT_NAME=evolution_v2_lite
22+
- DATABASE_CONNECTION_CLIENT_NAME=evolution_v2
2423
- RABBITMQ_ENABLED=false
2524
- RABBITMQ_URI=amqp://admin:admin@rabbitmq:5672/default
26-
- RABBITMQ_EXCHANGE_NAME=evolution_v2_lite
25+
- RABBITMQ_EXCHANGE_NAME=evolution_v2
2726
- RABBITMQ_GLOBAL_ENABLED=false
2827
- RABBITMQ_EVENTS_APPLICATION_STARTUP=false
2928
- RABBITMQ_EVENTS_INSTANCE_CREATE=false
@@ -97,9 +96,16 @@ services:
9796
- QRCODE_LIMIT=30
9897
- CACHE_REDIS_ENABLED=true
9998
- CACHE_REDIS_URI=redis://evo_redis:6379/1
100-
- CACHE_REDIS_PREFIX_KEY=evolution_v2_lite
99+
- CACHE_REDIS_PREFIX_KEY=evolution_v2
101100
- CACHE_REDIS_SAVE_INSTANCES=false
102101
- CACHE_LOCAL_ENABLED=false
102+
- S3_ENABLED=true
103+
- S3_ACCESS_KEY=
104+
- S3_SECRET_KEY=
105+
- S3_BUCKET=evolution
106+
- S3_PORT=443
107+
- S3_ENDPOINT=files.site.com
108+
- S3_USE_SSL=true
103109
- AUTHENTICATION_API_KEY=429683C4C977415CAAFCCE10F7D57E11
104110
- AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
105111
- LANGUAGE=en
@@ -111,18 +117,18 @@ services:
111117
- node.hostname == evolution-manager
112118
labels:
113119
- traefik.enable=true
114-
- traefik.http.routers.evolution_v2_lite.rule=Host(`evo2.site.com`)
115-
- traefik.http.routers.evolution_v2_lite.entrypoints=websecure
116-
- traefik.http.routers.evolution_v2_lite.tls.certresolver=letsencryptresolver
117-
- traefik.http.routers.evolution_v2_lite.priority=1
118-
- traefik.http.routers.evolution_v2_lite.service=evolution_v2_lite
119-
- traefik.http.services.evolution_v2_lite.loadbalancer.server.port=8080
120-
- traefik.http.services.evolution_v2_lite.loadbalancer.passHostHeader=true
120+
- traefik.http.routers.evolution_v2.rule=Host(`evo2.site.com`)
121+
- traefik.http.routers.evolution_v2.entrypoints=websecure
122+
- traefik.http.routers.evolution_v2.tls.certresolver=letsencryptresolver
123+
- traefik.http.routers.evolution_v2.priority=1
124+
- traefik.http.routers.evolution_v2.service=evolution_v2
125+
- traefik.http.services.evolution_v2.loadbalancer.server.port=8080
126+
- traefik.http.services.evolution_v2.loadbalancer.passHostHeader=true
121127

122128
volumes:
123129
evolution_instances:
124130
external: true
125-
name: evolution_v2_lite_data
131+
name: evolution_v2_data
126132

127133
networks:
128134
network_public:

Dockerfile

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,56 @@
11
FROM node:20-alpine AS builder
22

3-
RUN apk add git wget curl bash
3+
RUN apk update && \
4+
apk add git wget curl bash openssl
5+
6+
LABEL version="2.2.1" description="Api to control whatsapp features through http requests."
7+
LABEL maintainer="Davidson Gomes" git="https://github.com/DavidsonGomes"
8+
LABEL contact="contato@atendai.com"
49

510
WORKDIR /evolution
611

712
COPY ./package.json ./tsconfig.json ./
8-
RUN npm install --omit=dev
913

10-
RUN rm -rf /var/cache/apk/*
14+
RUN npm install
1115

1216
COPY ./src ./src
1317
COPY ./public ./public
1418
COPY ./prisma ./prisma
1519
COPY ./.env.example ./.env
1620
COPY ./runWithProvider.js ./
1721
COPY ./tsup.config.ts ./
22+
1823
COPY ./Docker ./Docker
1924

20-
RUN chmod +x ./Docker/scripts/* && dos2unix ./Docker/scripts/* && \
21-
./Docker/scripts/generate_database.sh && \
22-
npm run build
25+
RUN chmod +x ./Docker/scripts/* && dos2unix ./Docker/scripts/*
26+
27+
RUN ./Docker/scripts/generate_database.sh
28+
29+
RUN npm run build
2330

2431
FROM node:20-alpine AS final
2532

26-
RUN apk add git wget curl bash
33+
RUN apk update && \
34+
apk add tzdata bash openssl
35+
36+
ENV TZ=America/Sao_Paulo
2737

2838
WORKDIR /evolution
2939

30-
COPY --from=builder /evolution ./
40+
COPY --from=builder /evolution/package.json ./package.json
41+
COPY --from=builder /evolution/package-lock.json ./package-lock.json
42+
43+
COPY --from=builder /evolution/node_modules ./node_modules
44+
COPY --from=builder /evolution/dist ./dist
45+
COPY --from=builder /evolution/prisma ./prisma
46+
COPY --from=builder /evolution/public ./public
47+
COPY --from=builder /evolution/.env ./.env
48+
COPY --from=builder /evolution/Docker ./Docker
49+
COPY --from=builder /evolution/runWithProvider.js ./runWithProvider.js
50+
COPY --from=builder /evolution/tsup.config.ts ./tsup.config.ts
3151

3252
ENV DOCKER_ENV=true
3353

3454
EXPOSE 8080
3555

36-
ENTRYPOINT ["/bin/bash", "-c", "npm run start:prod" ]
56+
ENTRYPOINT ["/bin/bash", "-c", ". ./Docker/scripts/deploy_database.sh && npm run start:prod" ]

0 commit comments

Comments
 (0)