mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-18 13:06:32 -06:00
feat: generic chatbot
This commit is contained in:
parent
891d00ccba
commit
61523c0a79
File diff suppressed because one or more lines are too long
2
manager/dist/index.html
vendored
2
manager/dist/index.html
vendored
@ -5,7 +5,7 @@
|
|||||||
<link rel="icon" type="image/png" href="/assets/images/evolution-logo.png" />
|
<link rel="icon" type="image/png" href="/assets/images/evolution-logo.png" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Evolution Manager</title>
|
<title>Evolution Manager</title>
|
||||||
<script type="module" crossorigin src="/assets/index-DvWuPxCF.js"></script>
|
<script type="module" crossorigin src="/assets/index-iGvDtq7l.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-BJ9JMAl_.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-BJ9JMAl_.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -3,7 +3,6 @@ import { InstanceDto } from '@api/dto/instance.dto';
|
|||||||
import { PrismaRepository } from '@api/repository/repository.service';
|
import { PrismaRepository } from '@api/repository/repository.service';
|
||||||
import { WAMonitoringService } from '@api/services/monitor.service';
|
import { WAMonitoringService } from '@api/services/monitor.service';
|
||||||
import { Logger } from '@config/logger.config';
|
import { Logger } from '@config/logger.config';
|
||||||
import { BadRequestException } from '@exceptions';
|
|
||||||
import { getConversationMessage } from '@utils/getConversationMessage';
|
import { getConversationMessage } from '@utils/getConversationMessage';
|
||||||
|
|
||||||
import { ChatbotController, ChatbotControllerInterface, EmitData } from '../../chatbot.controller';
|
import { ChatbotController, ChatbotControllerInterface, EmitData } from '../../chatbot.controller';
|
||||||
@ -524,8 +523,6 @@ export class GenericController extends ChatbotController implements ChatbotContr
|
|||||||
|
|
||||||
// Sessions
|
// Sessions
|
||||||
public async changeStatus(instance: InstanceDto, data: any) {
|
public async changeStatus(instance: InstanceDto, data: any) {
|
||||||
if (!this.integrationEnabled) throw new BadRequestException('Dify is disabled');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const instanceId = await this.prismaRepository.instance
|
const instanceId = await this.prismaRepository.instance
|
||||||
.findFirst({
|
.findFirst({
|
||||||
@ -603,8 +600,6 @@ export class GenericController extends ChatbotController implements ChatbotContr
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async fetchSessions(instance: InstanceDto, botId: string, remoteJid?: string) {
|
public async fetchSessions(instance: InstanceDto, botId: string, remoteJid?: string) {
|
||||||
if (!this.integrationEnabled) throw new BadRequestException('Dify is disabled');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const instanceId = await this.prismaRepository.instance
|
const instanceId = await this.prismaRepository.instance
|
||||||
.findFirst({
|
.findFirst({
|
||||||
@ -638,8 +633,6 @@ export class GenericController extends ChatbotController implements ChatbotContr
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async ignoreJid(instance: InstanceDto, data: IgnoreJidDto) {
|
public async ignoreJid(instance: InstanceDto, data: IgnoreJidDto) {
|
||||||
if (!this.integrationEnabled) throw new BadRequestException('Dify is disabled');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const instanceId = await this.prismaRepository.instance
|
const instanceId = await this.prismaRepository.instance
|
||||||
.findFirst({
|
.findFirst({
|
||||||
@ -689,8 +682,6 @@ export class GenericController extends ChatbotController implements ChatbotContr
|
|||||||
|
|
||||||
// Emit
|
// Emit
|
||||||
public async emit({ instance, remoteJid, msg }: EmitData) {
|
public async emit({ instance, remoteJid, msg }: EmitData) {
|
||||||
if (!this.integrationEnabled) return;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const settings = await this.settingsRepository.findFirst({
|
const settings = await this.settingsRepository.findFirst({
|
||||||
where: {
|
where: {
|
||||||
|
@ -106,7 +106,7 @@ export class RabbitmqController extends EventController implements EventControll
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
throw new NotFoundException('Instance rabbitmq not found');
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
@ -91,7 +91,7 @@ export class SqsController extends EventController implements EventControllerInt
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
throw new NotFoundException('Instance SQS not found');
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
@ -63,7 +63,7 @@ export class WebhookController extends EventController implements EventControlle
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
throw new NotFoundException('Instance webhook not found');
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
@ -102,7 +102,7 @@ export class WebsocketController extends EventController implements EventControl
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
throw new NotFoundException('Instance websocket not found');
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
Loading…
Reference in New Issue
Block a user