Source code for human_requests.abstraction.warmup

from __future__ import annotations

from dataclasses import dataclass
from typing import TYPE_CHECKING

from human_requests.network_analyzer.anomaly_sniffer import HeaderAnomalySniffer

if TYPE_CHECKING:
    from human_requests import HumanBrowser, HumanContext, HumanPage


@dataclass
[docs] class Warmup: """Runtime context passed to warmup scripts."""
[docs] browser: "HumanBrowser"
"""Browser session available to warmup scripts."""
[docs] context: "HumanContext"
"""Browser context created during warmup."""
[docs] page: "HumanPage"
"""Page used during warmup scripts."""
[docs] sniffer: HeaderAnomalySniffer | None
"""Optional header sniffer used during warmup when header sniffing is enabled."""
[docs] timeout_ms: int
"""Effective timeout, in milliseconds, shared by warmup actions."""
[docs] test_mode: bool
"""Whether the client was started in test mode."""
[docs] prefixes: dict[str, str]
"""Resolved shared prefix values configured for the app."""