diff --git a/src/api/integrations/channel/meta/whatsapp.business.service.ts b/src/api/integrations/channel/meta/whatsapp.business.service.ts index b6500a0c..b038b8de 100644 --- a/src/api/integrations/channel/meta/whatsapp.business.service.ts +++ b/src/api/integrations/channel/meta/whatsapp.business.service.ts @@ -71,10 +71,7 @@ export class BusinessStartupService extends ChannelStartupService { } private isMediaMessage(message: any) { - return message.document || - message.image || - message.audio || - message.video + return message.document || message.image || message.audio || message.video; } private async post(message: any, params: string) { @@ -479,7 +476,7 @@ export class BusinessStartupService extends ChannelStartupService { message: { mediaUrl: messageRaw.message.mediaUrl, ...messageRaw, - } + }, }, () => {}, ); diff --git a/src/api/integrations/event/webhook/webhook.controller.ts b/src/api/integrations/event/webhook/webhook.controller.ts index 73d33afa..93a2244f 100644 --- a/src/api/integrations/event/webhook/webhook.controller.ts +++ b/src/api/integrations/event/webhook/webhook.controller.ts @@ -66,7 +66,6 @@ export class WebhookController extends EventController implements EventControlle local, }: EmitData): Promise { const instance = (await this.get(instanceName)) as wa.LocalWebHook; - const webhookConfig = configService.get('WEBHOOK'); const webhookLocal = instance?.events; @@ -86,7 +85,7 @@ export class WebhookController extends EventController implements EventControlle apikey: apiKey, }; - if (local && !instance || !instance?.enabled) { + if ((local && !instance) || !instance?.enabled) { if (Array.isArray(webhookLocal) && webhookLocal.includes(we)) { let baseURL: string; diff --git a/src/api/services/monitor.service.ts b/src/api/services/monitor.service.ts index c69e4fca..cd202506 100644 --- a/src/api/services/monitor.service.ts +++ b/src/api/services/monitor.service.ts @@ -72,14 +72,15 @@ export class WAMonitoringService { const clientName = this.configService.get('DATABASE').CONNECTION.CLIENT_NAME; - const where = instanceNames && instanceNames.length > 0 - ? { - name: { - in: instanceNames, - }, - clientName, - } - : { clientName }; + const where = + instanceNames && instanceNames.length > 0 + ? { + name: { + in: instanceNames, + }, + clientName, + } + : { clientName }; const instances = await this.prismaRepository.instance.findMany({ where, diff --git a/src/api/types/wa.types.ts b/src/api/types/wa.types.ts index 72c183b2..472b37af 100644 --- a/src/api/types/wa.types.ts +++ b/src/api/types/wa.types.ts @@ -131,7 +131,14 @@ export declare namespace wa { export type StatusMessage = 'ERROR' | 'PENDING' | 'SERVER_ACK' | 'DELIVERY_ACK' | 'READ' | 'DELETED' | 'PLAYED'; } -export const TypeMediaMessage = ['imageMessage', 'documentMessage', 'audioMessage', 'videoMessage', 'stickerMessage', 'ptvMessage']; +export const TypeMediaMessage = [ + 'imageMessage', + 'documentMessage', + 'audioMessage', + 'videoMessage', + 'stickerMessage', + 'ptvMessage', +]; export const MessageSubtype = [ 'ephemeralMessage', diff --git a/src/utils/getConversationMessage.ts b/src/utils/getConversationMessage.ts index eb4e56cf..2bd13b76 100644 --- a/src/utils/getConversationMessage.ts +++ b/src/utils/getConversationMessage.ts @@ -17,7 +17,8 @@ const getTypeMessage = (msg: any) => { msg?.message?.viewOnceMessageV2?.message?.audioMessage?.url, listResponseMessage: msg?.message?.listResponseMessage?.title, responseRowId: msg?.message?.listResponseMessage?.singleSelectReply?.selectedRowId, - templateButtonReplyMessage: msg?.message?.templateButtonReplyMessage?.selectedId || msg?.message?.buttonsResponseMessage?.selectedButtonId, + templateButtonReplyMessage: + msg?.message?.templateButtonReplyMessage?.selectedId || msg?.message?.buttonsResponseMessage?.selectedButtonId, // Medias audioMessage: msg?.message?.speechToText ? msg?.message?.speechToText diff --git a/src/utils/instrumentSentry.ts b/src/utils/instrumentSentry.ts index 8a660675..1a87086f 100644 --- a/src/utils/instrumentSentry.ts +++ b/src/utils/instrumentSentry.ts @@ -1,12 +1,12 @@ -import * as Sentry from "@sentry/node"; +import * as Sentry from '@sentry/node'; const dsn = process.env.SENTRY_DSN; if (dsn) { - Sentry.init({ - dsn: dsn, - environment: process.env.NODE_ENV || 'development', - tracesSampleRate: 1.0, - profilesSampleRate: 1.0, - }); -} \ No newline at end of file + Sentry.init({ + dsn: dsn, + environment: process.env.NODE_ENV || 'development', + tracesSampleRate: 1.0, + profilesSampleRate: 1.0, + }); +}