from typing import Any, Literal, Optional from pydantic import BaseModel, Field, HttpUrl WaitUntilValue = Literal["load", "domcontentloaded", "networkidle", "commit"] class VisitRequest(BaseModel): url: HttpUrl screenshot: bool = False waitUntil: WaitUntilValue = Field(default="load") waitTime: int = Field( default=0, ge=0, le=60, description=( "Extra seconds to wait AFTER waitUntil resolves. " "Useful for SPAs (e.g. MercadoLibre) that need extra time to hydrate polycards " "after the network goes idle. Max 60s." ), ) proxy: Optional[str] = None proxyAuth: Optional[dict[str, Any]] = None incognito: bool = False screenshotSelector: Optional[str] = None screenshotDelay: int = Field( default=0, ge=0, le=60000, description="Milliseconds to wait before taking the screenshot.", ) clickSelector: Optional[str] = None selectorTimeout: int = Field( default=1000, ge=100, le=30000, description="Milliseconds to wait for selectors used in screenshotSelector or clickSelector.", ) class ArasResponse(BaseModel): status: str message: str data: Any = None extra: Any = None code: str = "UNKNOWN_CODE"