mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-15 04:49:34 -06:00
- Added NATS package to dependencies - Created Prisma schema models for NATS configuration - Implemented NATS controller, router, and event management - Updated instance controller and event manager to support NATS - Added NATS configuration options in environment configuration - Included NATS events in instance validation schema
44 lines
904 B
TypeScript
44 lines
904 B
TypeScript
import { JSONSchema7 } from 'json-schema';
|
|
import { v4 } from 'uuid';
|
|
|
|
import { EventController } from './event.controller';
|
|
|
|
export * from '@api/integrations/event/pusher/pusher.schema';
|
|
export * from '@api/integrations/event/webhook/webhook.schema';
|
|
|
|
export const eventSchema: JSONSchema7 = {
|
|
$id: v4(),
|
|
type: 'object',
|
|
properties: {
|
|
websocket: {
|
|
$ref: '#/$defs/event',
|
|
},
|
|
rabbitmq: {
|
|
$ref: '#/$defs/event',
|
|
},
|
|
nats: {
|
|
$ref: '#/$defs/event',
|
|
},
|
|
sqs: {
|
|
$ref: '#/$defs/event',
|
|
},
|
|
},
|
|
$defs: {
|
|
event: {
|
|
type: 'object',
|
|
properties: {
|
|
enabled: { type: 'boolean', enum: [true, false] },
|
|
events: {
|
|
type: 'array',
|
|
minItems: 0,
|
|
items: {
|
|
type: 'string',
|
|
enum: EventController.events,
|
|
},
|
|
},
|
|
},
|
|
required: ['enabled'],
|
|
},
|
|
},
|
|
};
|