migrated core_nest to mainroom
This commit is contained in:
43
mainroom/link/adapters/__init__.py
Normal file
43
mainroom/link/adapters/__init__.py
Normal file
@@ -0,0 +1,43 @@
|
||||
"""
|
||||
Adapters for different managed app frameworks.
|
||||
"""
|
||||
|
||||
from typing import Dict, List, Any, Optional
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class BaseAdapter(ABC):
|
||||
"""Base adapter interface."""
|
||||
|
||||
def __init__(self, config: Dict[str, Any]):
|
||||
"""
|
||||
Initialize adapter with configuration.
|
||||
|
||||
Args:
|
||||
config: Database connection or API endpoint configuration
|
||||
"""
|
||||
self.config = config
|
||||
|
||||
@abstractmethod
|
||||
def navigate(
|
||||
self,
|
||||
query: Optional[str] = None,
|
||||
entity: Optional[str] = None,
|
||||
id: Optional[int] = None
|
||||
) -> Dict[str, Any]:
|
||||
"""
|
||||
Navigate data graph.
|
||||
|
||||
Returns:
|
||||
{
|
||||
"nodes": [{"id": str, "type": str, "label": str, "data": dict}],
|
||||
"edges": [{"from": str, "to": str, "label": str}],
|
||||
"summary": {"title": str, "credentials": str|None, "fields": dict}
|
||||
}
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_queries(self) -> List[str]:
|
||||
"""Return list of available query names."""
|
||||
pass
|
||||
Reference in New Issue
Block a user