fester/backend/events/types.py

39 lines
1.2 KiB
Python

"""
Event type constants — DEPRECATED.
Use `backend.events.schema.EventType` instead. These string constants
are kept only for backward compatibility with older emitters.
The string values intentionally match the EventType enum values so
legacy code comparing `event["type"] == "pipeline"` continues to work
with both old and new emitters.
"""
from backend.events.schema import EventType
# Legacy aliases — values match EventType enum values
EVENT_PIPELINE = EventType.PIPELINE_UPDATE.value # "pipeline_update"
EVENT_NODE = EventType.NODE_UPDATE.value # "node_update"
EVENT_POLICY = "policy" # not in EventType; meta-only
EVENT_SESSION = "session" # not in EventType; meta-only
# Also expose the simple short names the UI/CLI use
EVENT_PIPELINE_SHORT = "pipeline"
EVENT_NODE_SHORT = "node"
EVENT_FAILURE_SHORT = "failure"
EVENT_CACHE_SHORT = "cache"
EVENT_DEBUG_SHORT = "debug"
__all__ = [
"EventType",
"EVENT_PIPELINE",
"EVENT_NODE",
"EVENT_POLICY",
"EVENT_SESSION",
"EVENT_PIPELINE_SHORT",
"EVENT_NODE_SHORT",
"EVENT_FAILURE_SHORT",
"EVENT_CACHE_SHORT",
"EVENT_DEBUG_SHORT",
]