intento arreglar server.ts y webhook-manager.ts

pull/1/head
borja 7 months ago
parent f472d8cba4
commit a86beb81b7

@ -1,18 +1,20 @@
/// <reference types="bun-types" /> /// <reference types="bun-types" />
import { CommandService } from './services/command'; import { CommandService } from './services/command';
import { ResponseQueue } from './services/response-queue'; import { ResponseQueue } from './services/response-queue';
import { WebhookManager } from './services/webhook-manager';
// Bun is available globally when running under Bun runtime // Bun is available globally when running under Bun runtime
declare global { declare global {
var Bun: typeof import('bun'); var Bun: typeof import('bun');
} }
const REQUIRED_ENV = [ export const REQUIRED_ENV = [
'EVOLUTION_API_URL', 'EVOLUTION_API_URL',
'EVOLUTION_API_KEY', 'EVOLUTION_API_KEY',
'EVOLUTION_API_INSTANCE', 'EVOLUTION_API_INSTANCE',
'WHATSAPP_COMMUNITY_ID', 'WHATSAPP_COMMUNITY_ID',
'CHATBOT_PHONE_NUMBER' 'CHATBOT_PHONE_NUMBER',
'WEBHOOK_URL'
]; ];
type WebhookPayload = { type WebhookPayload = {

@ -21,10 +21,9 @@ type WebhookResponse = {
export class WebhookManager { export class WebhookManager {
private static readonly REQUIRED_EVENTS = [ private static readonly REQUIRED_EVENTS = [
'APPLICATION_STARTUP', 'APPLICATION_STARTUP',
'messages.upsert', 'MESSAGES.UPSERT',
'messages.update', 'MESSAGES.DELETE',
'messages.delete', 'GROUPS.UPDATE',
'groups.update',
]; ];
private static validateConfig() { private static validateConfig() {

Loading…
Cancel
Save