feat: flowsint-transforms, flowsint-types, flowsint-core

This commit is contained in:
dextmorgn
2025-08-13 17:04:11 +02:00
parent c770b752ed
commit 5b62d9efba
200 changed files with 26326 additions and 1120 deletions

View File

@@ -0,0 +1,57 @@
from typing import Literal, Union, Any
from uuid import UUID
EventLevel = Literal["info", "warn", "error", "success", "debug"]
LEVEL_MAP = {
"info": "INFO",
"warn": "WARN",
"error": "FAILED",
"success": "SUCCESS",
"debug": "DEBUG",
}
class TestLogger:
@staticmethod
def _format_message(type: str, message: str) -> str:
"""Format the log message with type prefix"""
return f"[{type.upper()}] {message}"
@staticmethod
def _create_log(sketch_id: Union[str, UUID], log_type: str, content: str) -> Any:
"""Create a dummy log object for testing"""
class DummyLog:
def __init__(self):
self.id = 'dummy_id'
return DummyLog()
@staticmethod
def info(sketch_id: Union[str, UUID], message: str):
"""Log an info message"""
formatted_message = TestLogger._format_message("INFO", message)
print(formatted_message)
@staticmethod
def error(sketch_id: Union[str, UUID], message: str):
"""Log an error message"""
formatted_message = TestLogger._format_message("FAILED", message)
print(formatted_message)
@staticmethod
def warn(sketch_id: Union[str, UUID], message: str):
"""Log a warning message"""
formatted_message = TestLogger._format_message("WARNING", message)
print(formatted_message)
@staticmethod
def debug(sketch_id: Union[str, UUID], message: str):
"""Log a debug message"""
formatted_message = TestLogger._format_message("DEBUG", message)
print(formatted_message)
@staticmethod
def success(sketch_id: Union[str, UUID], message: str):
"""Log a success message"""
formatted_message = TestLogger._format_message("SUCCESS", message)
print(formatted_message)