UNPKG

arvo-event-handler

Version:

Type-safe event handler system with versioning, telemetry, and contract validation for distributed Arvo event-driven architectures, featuring routing and multi-handler support.

13 lines (12 loc) 731 B
import type { Span } from '@opentelemetry/api'; import { type ArvoEvent, type ArvoOrchestrationSubjectContent } from 'arvo-core'; import type { SyncEventResource } from '../../SyncEventResource'; /** * Validates and parses an orchestration event's subject. * * Ensures the event subject is valid and matches the expected orchestrator source. * Returns null if validation fails, allowing graceful handling of mismatched events. * * @returns Parsed subject content or null if validation fails */ export declare const validateAndParseSubject: (event: ArvoEvent, expectedSource: string, syncEventResource: SyncEventResource<any>, span: Span, handlerType: "orchestrator" | "resumable") => ArvoOrchestrationSubjectContent | null;