UNPKG

@kenniy/godeye-event-contracts

Version:

Shared event schemas and stream definitions for 8Medical microservices architecture

60 lines 1.79 kB
export declare const SystemEventTypes: { readonly SERVICE_WELCOME: "service.welcome"; readonly SERVICE_ACKNOWLEDGMENT: "service.acknowledgment"; readonly SERVICE_HEARTBEAT: "service.heartbeat"; readonly EVENT_NOT_SPECIFIED: "system.event.not_specified"; }; export interface ServiceWelcomeEvent { eventId: string; timestamp: string; eventType: typeof SystemEventTypes.SERVICE_WELCOME; data: { serviceName: string; version: string; environment: string; port?: number; healthCheckUrl?: string; capabilities?: string[]; }; metadata: { correlationId: string; sourceService: string; version: '1.0'; }; } export interface ServiceAcknowledgmentEvent { eventId: string; timestamp: string; eventType: typeof SystemEventTypes.SERVICE_ACKNOWLEDGMENT; data: { acknowledgedService: string; acknowledgedBy: string; message?: string; }; metadata: { correlationId: string; sourceService: string; version: '1.0'; }; } export interface ServiceHeartbeatEvent { eventId: string; timestamp: string; eventType: typeof SystemEventTypes.SERVICE_HEARTBEAT; data: { serviceName: string; status: 'healthy' | 'degraded' | 'unhealthy'; uptime: number; memoryUsage?: number; cpuUsage?: number; activeConnections?: number; }; metadata: { correlationId: string; sourceService: string; version: '1.0'; }; } export type SystemEventType = typeof SystemEventTypes[keyof typeof SystemEventTypes]; export type SystemEvent = ServiceWelcomeEvent | ServiceAcknowledgmentEvent | ServiceHeartbeatEvent; //# sourceMappingURL=index.d.ts.map