feat: Improved fetch instances endpoint and prepare changelog to version 1.1.0 in homolog

This commit is contained in:
Davidson Gomes 2023-06-10 18:56:11 -03:00
parent f067cb99c8
commit ae1c5908ae
4 changed files with 36 additions and 17 deletions

View File

@ -1,3 +1,14 @@
# 1.1.0 (homolog)
### Features
* Improved fetch instances endpoint, now it also fetch other instances even if they are not connected
### Fixed
* Adjust dockerfile variables
* tweaks in docker-compose to pass variables
# 1.0.9 (2023-06-10)
### Fixed

View File

@ -65,7 +65,7 @@ ENV WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=$WEBHOOK_EVENTS_GROUP_PARTICIPANTS_
ENV WEBHOOK_EVENTS_NEW_JWT_TOKEN=$WEBHOOK_EVENTS_NEW_JWT_TOKEN
ENV CONFIG_SESSION_PHONE_CLIENT=$CONFIG_SESSION_PHONE_CLIENT
ENV CONFIG_SESSION_PHONE_NAME=Chrome
ENV CONFIG_SESSION_PHONE_NAME="Chrome"
ENV QRCODE_LIMIT=$QRCODE_LIMIT

View File

@ -7,14 +7,13 @@ networks:
services:
api:
container_name: evolution_api
# image: davidsongomes/evolution-api:v1.0.9
build:
context: .
dockerfile: Dockerfile
ports:
- 8080:8080
volumes:
- /Users/davidson/Projects/atendai-api/instances:/evolution/instances
- /data/instances:/evolution/instances
environment:
# Determine how long the instance should be deleted from memory in case of no connection.
# Default time: 5 minutes
@ -41,7 +40,7 @@ services:
- REDIS_PREFIX_KEY=evolution
# Webhook Settings
# Define a global webhook that will listen for enabled events from all instances
- WEBHOOK_GLOBAL_URL=https://webhooks.n8n.evolution-api.com/webhook/0e66d93a-1671-474f-a07f-3f44b581d320
- WEBHOOK_GLOBAL_URL=url
- WEBHOOK_GLOBAL_ENABLED=false
# With this option activated, you work with a url per webhook event, respecting the global url and the name of each event
- WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false
@ -84,7 +83,7 @@ services:
- AUTHENTICATION_INSTANCE_MODE=server # container or server
# if you are using container mode, set the container name and the webhook url to default instance
- AUTHENTICATION_INSTANCE_NAME=evolution
- AUTHENTICATION_INSTANCE_WEBHOOK_URL=https://webhooks.n8n.evolution-api.com/webhook/0e66d93a-1671-474f-a07f-3f44b581d320
- AUTHENTICATION_INSTANCE_WEBHOOK_URL=url
command: ['node', './dist/src/main.js']
networks:
- evolution-net
@ -96,7 +95,7 @@ services:
image: mongo
restart: always
volumes:
- /Users/davidson/Projects/atendai-api/docker-compose-data/mongodb:/data/db
- /data/mongodb:/data/db
ports:
- 27017:27017
environment:
@ -112,7 +111,7 @@ services:
image: redis:latest
restart: always
volumes:
- /Users/davidson/Projects/atendai-api/docker-compose-data/redis:/data
- /data/redis:/data
ports:
- 6379:6379
networks:

View File

@ -60,16 +60,25 @@ export class WAMonitoringService {
const instances: any[] = [];
for await (const [key, value] of Object.entries(this.waInstances)) {
if (value && value.connectionStatus.state === 'open') {
instances.push({
instance: {
instanceName: key,
owner: value.wuid,
profileName: (await value.getProfileName()) || 'not loaded',
profilePictureUrl: value.profilePictureUrl,
status: (await value.getProfileStatus()) || '',
},
});
if (value) {
if (value.connectionStatus.state === 'open') {
instances.push({
instance: {
instanceName: key,
owner: value.wuid,
profileName: (await value.getProfileName()) || 'not loaded',
profilePictureUrl: value.profilePictureUrl,
status: (await value.getProfileStatus()) || '',
},
});
} else {
instances.push({
instance: {
instanceName: key,
status: value.connectionStatus.state,
},
});
}
}
}