11import { PrismaRepository } from '@api/repository/repository.service' ;
22import { WAMonitoringService } from '@api/services/monitor.service' ;
3+ import { Events } from '@api/types/wa.types' ;
34import { Auth , ConfigService , HttpServer , Typebot } from '@config/env.config' ;
45import { Instance , IntegrationSession , Message , Typebot as TypebotModel } from '@prisma/client' ;
56import { getConversationMessage } from '@utils/getConversationMessage' ;
@@ -8,19 +9,18 @@ import axios from 'axios';
89
910import { BaseChatbotService } from '../../base-chatbot.service' ;
1011import { OpenaiService } from '../../openai/services/openai.service' ;
11- import { Events } from '@api/types/wa.types' ;
1212
1313export class TypebotService extends BaseChatbotService < TypebotModel , any > {
14- private openaiService : OpenaiService ;
15-
14+ private openaiService : OpenaiService ;
15+
1616 constructor (
1717 waMonitor : WAMonitoringService ,
1818 configService : ConfigService ,
1919 prismaRepository : PrismaRepository ,
2020 openaiService : OpenaiService ,
2121 ) {
2222 super ( waMonitor , prismaRepository , 'TypebotService' , configService ) ;
23- this . openaiService = openaiService ;
23+ this . openaiService = openaiService ;
2424 }
2525
2626 /**
@@ -154,11 +154,11 @@ export class TypebotService extends BaseChatbotService<TypebotModel, any> {
154154 }
155155
156156 const typebotData = {
157- remoteJid : data . remoteJid ,
158- status : 'opened' ,
159- session,
157+ remoteJid : data . remoteJid ,
158+ status : 'opened' ,
159+ session,
160160 } ;
161- this . waMonitor . waInstances [ instance . name ] . sendDataWebhook ( Events . TYPEBOT_CHANGE_STATUS , typebotData ) ;
161+ this . waMonitor . waInstances [ instance . name ] . sendDataWebhook ( Events . TYPEBOT_CHANGE_STATUS , typebotData ) ;
162162
163163 return { ...request . data , session } ;
164164 } catch ( error ) {
@@ -433,7 +433,6 @@ export class TypebotService extends BaseChatbotService<TypebotModel, any> {
433433 session,
434434 } ;
435435 instance . sendDataWebhook ( Events . TYPEBOT_CHANGE_STATUS , typebotData ) ;
436-
437436 }
438437 }
439438
@@ -677,13 +676,13 @@ export class TypebotService extends BaseChatbotService<TypebotModel, any> {
677676 } ,
678677 } ) ;
679678 }
680-
679+
681680 const typebotData = {
682681 remoteJid : remoteJid ,
683682 status : statusChange ,
684683 session,
685684 } ;
686- waInstance . sendDataWebhook ( Events . TYPEBOT_CHANGE_STATUS , typebotData ) ;
685+ waInstance . sendDataWebhook ( Events . TYPEBOT_CHANGE_STATUS , typebotData ) ;
687686
688687 return ;
689688 }
@@ -836,13 +835,13 @@ export class TypebotService extends BaseChatbotService<TypebotModel, any> {
836835 } ,
837836 } ) ;
838837 }
839-
838+
840839 const typebotData = {
841- remoteJid : remoteJid ,
842- status : statusChange ,
843- session,
844- } ;
845- waInstance . sendDataWebhook ( Events . TYPEBOT_CHANGE_STATUS , typebotData ) ;
840+ remoteJid : remoteJid ,
841+ status : statusChange ,
842+ session,
843+ } ;
844+ waInstance . sendDataWebhook ( Events . TYPEBOT_CHANGE_STATUS , typebotData ) ;
846845
847846 return ;
848847 }
@@ -945,7 +944,7 @@ export class TypebotService extends BaseChatbotService<TypebotModel, any> {
945944 session,
946945 } ;
947946
948- waInstance . sendDataWebhook ( Events . TYPEBOT_CHANGE_STATUS , typebotData ) ;
947+ waInstance . sendDataWebhook ( Events . TYPEBOT_CHANGE_STATUS , typebotData ) ;
949948
950949 return ;
951950 }
0 commit comments