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.

31 lines (30 loc) 1.28 kB
import type { ArvoContract, VersionedArvoContract } from 'arvo-core'; import { type ArvoOrchestrationHandlerType } from './types'; /** * Validates that all service contracts have unique URIs. * * Ensures no duplicate contract URIs exist in the service collection. * Multiple versions of the same contract (same URI) are not permitted as * they create ambiguity in event routing and contract resolution. */ export declare const areServiceContractsUnique: (contracts: Record<string, ArvoContract | VersionedArvoContract<any, any>>) => { result: false; keys: [string, string]; contractUri: string; } | { result: true; }; /** * Validates service contracts for orchestration handlers. * * Performs two critical validations: * 1. Ensures all service contracts have unique URIs (no duplicate contracts) * 2. Prevents circular dependencies (self contract not registered as service) * * These validations prevent configuration errors that would cause runtime * failures or infinite execution loops in orchestration workflows. */ export declare const servicesValidation: (contracts: { self: ArvoContract | VersionedArvoContract<any, any>; services: Record<string, VersionedArvoContract<any, any>>; }, _handlerType: ArvoOrchestrationHandlerType) => void;