mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-20 04:12:23 -06:00
refactor: event folder
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import { WAPresence } from 'baileys';
|
||||
|
||||
export class InstanceDto {
|
||||
import { IntegrationDto } from './integration.dto';
|
||||
|
||||
export class InstanceDto extends IntegrationDto {
|
||||
instanceName: string;
|
||||
instanceId?: string;
|
||||
qrcode?: boolean;
|
||||
businessId?: string;
|
||||
number?: string;
|
||||
integration?: string;
|
||||
token?: string;
|
||||
webhookUrl?: string;
|
||||
webhookByEvents?: boolean;
|
||||
webhookBase64?: boolean;
|
||||
webhookEvents?: string[];
|
||||
// settings
|
||||
rejectCall?: boolean;
|
||||
msgCall?: string;
|
||||
groupsIgnore?: boolean;
|
||||
@@ -18,31 +18,12 @@ export class InstanceDto {
|
||||
readMessages?: boolean;
|
||||
readStatus?: boolean;
|
||||
syncFullHistory?: boolean;
|
||||
chatwootAccountId?: string;
|
||||
chatwootToken?: string;
|
||||
chatwootUrl?: string;
|
||||
chatwootSignMsg?: boolean;
|
||||
chatwootReopenConversation?: boolean;
|
||||
chatwootConversationPending?: boolean;
|
||||
chatwootMergeBrazilContacts?: boolean;
|
||||
chatwootImportContacts?: boolean;
|
||||
chatwootImportMessages?: boolean;
|
||||
chatwootDaysLimitImportMessages?: number;
|
||||
chatwootNameInbox?: string;
|
||||
chatwootOrganization?: string;
|
||||
chatwootLogo?: string;
|
||||
websocketEnabled?: boolean;
|
||||
websocketEvents?: string[];
|
||||
rabbitmqEnabled?: boolean;
|
||||
rabbitmqEvents?: string[];
|
||||
sqsEnabled?: boolean;
|
||||
sqsEvents?: string[];
|
||||
// proxy
|
||||
proxyHost?: string;
|
||||
proxyPort?: string;
|
||||
proxyProtocol?: string;
|
||||
proxyUsername?: string;
|
||||
proxyPassword?: string;
|
||||
businessId?: string;
|
||||
}
|
||||
|
||||
export class SetPresenceDto {
|
||||
|
||||
28
src/api/dto/integration.dto.ts
Normal file
28
src/api/dto/integration.dto.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { RabbitMQInstanceMixin } from '@api/integrations/event/rabbitmq/dto/rabbitmq.dto';
|
||||
import { SQSInstanceMixin } from '@api/integrations/event/sqs/dto/sqs.dto';
|
||||
import { WebhookInstanceMixin } from '@api/integrations/event/webhook/dto/webhook.dto';
|
||||
import { WebsocketInstanceMixin } from '@api/integrations/event/websocket/dto/websocket.dto';
|
||||
|
||||
export type Constructor<T = {}> = new (...args: any[]) => T;
|
||||
|
||||
function ChatwootInstanceMixin<TBase extends Constructor>(Base: TBase) {
|
||||
return class extends Base {
|
||||
chatwootAccountId?: string;
|
||||
chatwootToken?: string;
|
||||
chatwootUrl?: string;
|
||||
chatwootSignMsg?: boolean;
|
||||
chatwootReopenConversation?: boolean;
|
||||
chatwootConversationPending?: boolean;
|
||||
chatwootMergeBrazilContacts?: boolean;
|
||||
chatwootImportContacts?: boolean;
|
||||
chatwootImportMessages?: boolean;
|
||||
chatwootDaysLimitImportMessages?: number;
|
||||
chatwootNameInbox?: string;
|
||||
chatwootOrganization?: string;
|
||||
chatwootLogo?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export class IntegrationDto extends WebhookInstanceMixin(
|
||||
WebsocketInstanceMixin(RabbitMQInstanceMixin(SQSInstanceMixin(ChatwootInstanceMixin(class {})))),
|
||||
) {}
|
||||
@@ -1,7 +0,0 @@
|
||||
export class WebhookDto {
|
||||
enabled?: boolean;
|
||||
url?: string;
|
||||
events?: string[];
|
||||
webhookByEvents?: boolean;
|
||||
webhookBase64?: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user