18 lines
881 B
Python
18 lines
881 B
Python
from typing import Protocol, Iterable, Any
|
|
from .models import ConnectorConfig, SyncCursor, Change, Document
|
|
|
|
class HTTP(Protocol):
|
|
def request(self, method: str, url: str, *, headers: dict[str, str], params: dict[str, Any] | None = None) -> dict[str, Any]: ...
|
|
|
|
class SecretStore(Protocol):
|
|
def get(self, ref: str) -> str: ...
|
|
|
|
class Publisher(Protocol):
|
|
def upsert(self, documents: Iterable[Document]) -> None: ...
|
|
def delete(self, ids: Iterable[str], tenant_id: str) -> None: ...
|
|
|
|
class Connector(Protocol):
|
|
def full(self, config: ConnectorConfig) -> tuple[list[Document], SyncCursor]: ...
|
|
def incremental(self, config: ConnectorConfig, cursor: SyncCursor, changes: list[Change] | None = None) -> tuple[list[Document], SyncCursor]: ...
|
|
def webhook(self, config: ConnectorConfig, payload: dict[str, Any], headers: dict[str, str]) -> list[Change]: ...
|