import { AutomationCustomer, AutomationJsonObject, AutomationJsonSchema, AutomationResourceReference, AutomationSourceApplication } from '../Common'; export interface AutomationEventDefinition { eventType: string; version: number; sourceApplication: AutomationSourceApplication; name: string; description?: string | null; payloadSchema: AutomationJsonSchema; /** Schema de la vista del envelope cuyos paths pueden utilizarse en filtros. */ filterSchema?: AutomationJsonSchema | null; requiredPermissions: string[]; enabled: boolean; } export interface AutomationEventEnvelope { id: string; spaceId: string; sourceApplication: AutomationSourceApplication; eventType: string; eventVersion: number; occurredAt: string; receivedAt: string; customer?: AutomationCustomer | null; /** Entidad principal sobre la que ocurrió el evento. */ subject?: AutomationResourceReference | null; correlationId?: string | null; causationId?: string | null; idempotencyKey?: string | null; payload: AutomationJsonObject; metadata?: AutomationJsonObject | null; } export declare enum AutomationEntryPointExclusionCode { ENTRY_POINT_DISABLED = "entryPointDisabled", SOURCE_APPLICATION_MISMATCH = "sourceApplicationMismatch", EVENT_TYPE_MISMATCH = "eventTypeMismatch", FILTERS_NOT_MATCHED = "filtersNotMatched", FLOW_NOT_ACTIVE = "flowNotActive", VERSION_NOT_PUBLISHED = "versionNotPublished", LOWER_PRIORITY = "lowerPriority", EXECUTION_MODE_RESTRICTED = "executionModeRestricted" } /** Motivo estructurado por el que un Entry Point no fue seleccionado. */ export interface AutomationEntryPointExclusion { /** Código estable para lógica, métricas y observabilidad. */ code: AutomationEntryPointExclusionCode; /** Explicación humana opcional; no debe utilizarse para lógica. */ message?: string | null; /** Datos diagnósticos específicos del código. */ details?: AutomationJsonObject | null; } export interface ResolveFlowEntryPointsRequest { event: AutomationEventEnvelope; } export interface ResolvedFlowEntryPoint { /** Definición estable del Flow. */ flowId: string; /** Versión publicada candidata a recibir el evento. */ flowVersionId: string; /** Entry Point evaluado. */ entryPointId: string; /** Prioridad utilizada para resolver candidatos. */ priority: number; /** Indica si el candidato debe iniciar una ejecución. */ selected: boolean; /** Motivo de exclusión; ausente cuando selected es true. */ exclusion?: AutomationEntryPointExclusion | null; } export interface ResolveFlowEntryPointsResult { matches: ResolvedFlowEntryPoint[]; }