Skip to content

Commit b9ae401

Browse files
author
Josias Maceda
committed
fix: the lint with npm run lint
1 parent 0116bc4 commit b9ae401

File tree

2 files changed

+23
-24
lines changed

2 files changed

+23
-24
lines changed

src/api/integrations/chatbot/base-chatbot.controller.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { IgnoreJidDto } from '@api/dto/chatbot.dto';
22
import { InstanceDto } from '@api/dto/instance.dto';
33
import { PrismaRepository } from '@api/repository/repository.service';
44
import { WAMonitoringService } from '@api/services/monitor.service';
5+
import { Events } from '@api/types/wa.types';
56
import { Logger } from '@config/logger.config';
67
import { BadRequestException } from '@exceptions';
78
import { TriggerOperator, TriggerType } from '@prisma/client';
89
import { getConversationMessage } from '@utils/getConversationMessage';
910

1011
import { BaseChatbotDto } from './base-chatbot.dto';
1112
import { ChatbotController, ChatbotControllerInterface, EmitData } from './chatbot.controller';
12-
import { Events } from '@api/types/wa.types';
1313

1414
// Common settings interface for all chatbot integrations
1515
export interface ChatbotSettings {
@@ -59,7 +59,7 @@ export abstract class BaseChatbotController<BotType = any, BotData extends BaseC
5959
settingsRepository: any;
6060
sessionRepository: any;
6161
userMessageDebounce: { [key: string]: { message: string; timeoutId: NodeJS.Timeout } } = {};
62-
62+
6363
// Name of the integration, to be set by the derived class
6464
protected abstract readonly integrationName: string;
6565

@@ -446,14 +446,14 @@ export abstract class BaseChatbotController<BotType = any, BotData extends BaseC
446446
});
447447

448448
const remoteJid = data.remoteJid;
449-
const status = data.status;
449+
const status = data.status;
450450
const session = await this.getSession(remoteJid, instance);
451451

452452
if (this.integrationName === 'Typebot') {
453453
const typebotData = {
454454
remoteJid: remoteJid,
455455
status: status,
456-
session
456+
session,
457457
};
458458
this.waMonitor.waInstances[instance.instanceName].sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData);
459459
}
@@ -507,7 +507,7 @@ export abstract class BaseChatbotController<BotType = any, BotData extends BaseC
507507
status: status,
508508
session,
509509
};
510-
510+
511511
return { bot: { ...instance, bot: botData } };
512512
}
513513
} catch (error) {
@@ -887,7 +887,7 @@ export abstract class BaseChatbotController<BotType = any, BotData extends BaseC
887887
};
888888
this.waMonitor.waInstances[instance.instanceName].sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData);
889889
}
890-
890+
891891
return;
892892
}
893893

src/api/integrations/chatbot/typebot/services/typebot.service.ts

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { PrismaRepository } from '@api/repository/repository.service';
22
import { WAMonitoringService } from '@api/services/monitor.service';
3+
import { Events } from '@api/types/wa.types';
34
import { Auth, ConfigService, HttpServer, Typebot } from '@config/env.config';
45
import { Instance, IntegrationSession, Message, Typebot as TypebotModel } from '@prisma/client';
56
import { getConversationMessage } from '@utils/getConversationMessage';
@@ -8,19 +9,18 @@ import axios from 'axios';
89

910
import { BaseChatbotService } from '../../base-chatbot.service';
1011
import { OpenaiService } from '../../openai/services/openai.service';
11-
import { Events } from '@api/types/wa.types';
1212

1313
export 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

Comments
 (0)