mirror of
https://github.com/actionbook/actionbook.git
synced 2026-09-19 03:28:06 +08:00
5662e46c3a
Add #[allow(dead_code)] attributes to: - Camoufox WebDriver driver unused fields and methods - Camoufox REST API client unused imports - Browser router helper methods (as_cdp, as_camofox, etc.) - Fingerprint generator module (Phase 2 - not yet integrated) - Human behavior simulation module (Phase 3 - not yet integrated) - Enhanced stealth module (Phase 1 - not yet integrated) These are preparatory implementations for future Camoufox backend integration. Suppressing warnings keeps build output clean while preserving the code for upcoming CLI integration. Modified files: - src/browser/camofox/mod.rs - src/browser/camofox_webdriver/driver.rs - src/browser/fingerprint_generator.rs - src/browser/human_behavior.rs - src/browser/mod.rs - src/browser/router.rs - src/browser/stealth_enhanced.rs
58 lines
1.4 KiB
Python
58 lines
1.4 KiB
Python
"""Pydantic models for Camoufox REST API."""
|
|
|
|
from pydantic import BaseModel, Field, ConfigDict
|
|
from typing import Optional, List
|
|
|
|
|
|
class CreateTabRequest(BaseModel):
|
|
"""Request to create a new tab."""
|
|
model_config = ConfigDict(populate_by_name=True)
|
|
|
|
user_id: str = Field(alias="userId")
|
|
session_key: str = Field(alias="sessionKey")
|
|
url: str
|
|
|
|
|
|
class CreateTabResponse(BaseModel):
|
|
"""Response with created tab info."""
|
|
id: str
|
|
url: str
|
|
|
|
|
|
class ClickRequest(BaseModel):
|
|
"""Request to click an element."""
|
|
model_config = ConfigDict(populate_by_name=True)
|
|
|
|
user_id: str = Field(alias="userId")
|
|
element_ref: str = Field(alias="elementRef")
|
|
|
|
|
|
class TypeTextRequest(BaseModel):
|
|
"""Request to type text into element."""
|
|
model_config = ConfigDict(populate_by_name=True)
|
|
|
|
user_id: str = Field(alias="userId")
|
|
element_ref: str = Field(alias="elementRef")
|
|
text: str
|
|
|
|
|
|
class NavigateRequest(BaseModel):
|
|
"""Request to navigate to URL."""
|
|
model_config = ConfigDict(populate_by_name=True)
|
|
|
|
user_id: str = Field(alias="userId")
|
|
url: str
|
|
|
|
|
|
class AccessibilityNode(BaseModel):
|
|
"""Accessibility tree node."""
|
|
role: str
|
|
name: Optional[str] = None
|
|
element_ref: Optional[str] = None
|
|
children: Optional[List['AccessibilityNode']] = None
|
|
|
|
|
|
class SnapshotResponse(BaseModel):
|
|
"""Response with accessibility tree snapshot."""
|
|
tree: AccessibilityNode
|