Compare commits

...

3 Commits

Author SHA1 Message Date
Davidson Gomes
43a8b34673 Merge branch 'release/1.2.0-1' 2023-07-14 14:17:57 -03:00
Davidson Gomes
6005d33c94 feat: Added verbose logs and format chatwoot service 2023-07-14 14:17:48 -03:00
Davidson Gomes
cffb4736ce Merge tag '1.2.0' into develop
* Native integration with chatwoot
* Added returning or non-returning participants option in fetchAllGroups
* Added group integration to chatwoot
* Added automation on create instance to chatwoot
* Added verbose logs and format chatwoot service

* Adjusts in docker-compose files
* Adjusts in number validation for AR and MX numbers
* Adjusts in env files, removed save old_messages
* Fix when sending a message to a group I don't belong returns a bad request
* Fits the format on return from the fetchAllGroups endpoint
* Adjust in send document with caption from chatwoot
* Fixed message with undefind in chatwoot
* Changed message in path /
* Test duplicate message media in groups chatwoot
* Optimize send message from group with mentions
* Fixed name of the profile status in fetchInstances
* Fixed error 500 when logout in instance with status = close
2023-07-14 13:17:44 -03:00

View File

@@ -97,12 +97,7 @@ export class InstanceController {
} }
} }
if ( if (!chatwoot_account_id || !chatwoot_token || !chatwoot_url) {
!chatwoot_account_id ||
!chatwoot_token ||
!chatwoot_url ||
!chatwoot_sign_msg
) {
this.logger.verbose('instance created'); this.logger.verbose('instance created');
this.logger.verbose({ this.logger.verbose({
instance: { instance: {
@@ -137,10 +132,6 @@ export class InstanceController {
throw new BadRequestException('url is required'); throw new BadRequestException('url is required');
} }
if (!chatwoot_sign_msg) {
throw new BadRequestException('sign_msg is required');
}
const urlServer = this.configService.get<HttpServer>('SERVER').URL; const urlServer = this.configService.get<HttpServer>('SERVER').URL;
try { try {
@@ -149,7 +140,7 @@ export class InstanceController {
account_id: chatwoot_account_id, account_id: chatwoot_account_id,
token: chatwoot_token, token: chatwoot_token,
url: chatwoot_url, url: chatwoot_url,
sign_msg: chatwoot_sign_msg, sign_msg: chatwoot_sign_msg || false,
name_inbox: instance.instanceName, name_inbox: instance.instanceName,
}); });
@@ -174,7 +165,7 @@ export class InstanceController {
account_id: chatwoot_account_id, account_id: chatwoot_account_id,
token: chatwoot_token, token: chatwoot_token,
url: chatwoot_url, url: chatwoot_url,
sign_msg: chatwoot_sign_msg, sign_msg: chatwoot_sign_msg || false,
name_inbox: instance.instanceName, name_inbox: instance.instanceName,
webhook_url: `${urlServer}/chatwoot/webhook/${instance.instanceName}`, webhook_url: `${urlServer}/chatwoot/webhook/${instance.instanceName}`,
}, },
@@ -227,12 +218,7 @@ export class InstanceController {
} }
} }
if ( if (!chatwoot_account_id || !chatwoot_token || !chatwoot_url) {
!chatwoot_account_id ||
!chatwoot_token ||
!chatwoot_url ||
!chatwoot_sign_msg
) {
let getQrcode: wa.QrCode; let getQrcode: wa.QrCode;
if (qrcode) { if (qrcode) {
@@ -280,10 +266,6 @@ export class InstanceController {
throw new BadRequestException('url is required'); throw new BadRequestException('url is required');
} }
if (!chatwoot_sign_msg) {
throw new BadRequestException('sign_msg is required');
}
const urlServer = this.configService.get<HttpServer>('SERVER').URL; const urlServer = this.configService.get<HttpServer>('SERVER').URL;
try { try {
@@ -292,7 +274,7 @@ export class InstanceController {
account_id: chatwoot_account_id, account_id: chatwoot_account_id,
token: chatwoot_token, token: chatwoot_token,
url: chatwoot_url, url: chatwoot_url,
sign_msg: chatwoot_sign_msg, sign_msg: chatwoot_sign_msg || false,
name_inbox: instance.instanceName, name_inbox: instance.instanceName,
}); });
@@ -320,7 +302,7 @@ export class InstanceController {
account_id: chatwoot_account_id, account_id: chatwoot_account_id,
token: chatwoot_token, token: chatwoot_token,
url: chatwoot_url, url: chatwoot_url,
sign_msg: chatwoot_sign_msg, sign_msg: chatwoot_sign_msg || false,
name_inbox: instance.instanceName, name_inbox: instance.instanceName,
webhook_url: `${urlServer}/chatwoot/webhook/${instance.instanceName}`, webhook_url: `${urlServer}/chatwoot/webhook/${instance.instanceName}`,
}, },