fix: read identity devices

This commit is contained in:
zhom committed 2026-10-14 18:20:42 +04:00
1 parent 49690a85be
commit e3d4959ebe
17 files changed
+770 -21

No files matched your search

+9
View File
@@ -24,6 +24,7 @@ from .models import (
AgentTyping,
ApiBulkCreateResponse,
ApiGroupResponse,
ApiProfileFingerprintResponse,
ApiProfileResponse,
ApiProfilesResponse,
ApiProxyResponse,
@@ -282,6 +283,14 @@ class DonutClient:
"""GET /v1/profiles/{id}"""
return self._request("GET", f"/v1/profiles/{_segment(profile_id)}")
def get_profile_fingerprint(self, profile_id: str) -> ApiProfileFingerprintResponse:
"""GET /v1/profiles/{id}/fingerprint
The device the profile presents. May start the profile's browser
version headless for a moment.
"""
return self._request("GET", f"/v1/profiles/{_segment(profile_id)}/fingerprint")
def create_profile(
self,
*,
+1
View File
@@ -66,6 +66,7 @@ OPERATIONS: Dict[Operation, str] = {
("GET", "/v1/profiles/import/detect"): "detect_import_profiles",
("DELETE", "/v1/profiles/{id}"): "delete_profile",
("GET", "/v1/profiles/{id}"): "get_profile",
("GET", "/v1/profiles/{id}/fingerprint"): "get_profile_fingerprint",
("PUT", "/v1/profiles/{id}"): "update_profile",
("POST", "/v1/profiles/{id}/agent/click"): "agent_click",
("POST", "/v1/profiles/{id}/agent/extract"): "agent_extract",
+8
View File
@@ -23,6 +23,7 @@ __all__ = [
"ApiProfile",
"ApiProfilesResponse",
"ApiProfileResponse",
"ApiProfileFingerprintResponse",
"ApiGroupResponse",
"ApiStatusResponse",
"ProfilePatch",
@@ -145,6 +146,13 @@ class ApiProfileResponse(TypedDict):
profile: ApiProfile
class ApiProfileFingerprintResponse(TypedDict, total=False):
#: The device the profile presents, as a JSON-encoded object: the shape
#: ``wayfern_config.fingerprint`` takes on create. ``None`` when there is
#: none to show.
fingerprint: Optional[str]
class ApiGroupResponse(TypedDict):
id: str
name: str
+10
View File
@@ -44,6 +44,16 @@ CASES: List[Case] = [
# -- profiles ----------------------------------------------------------
("list_profiles", (), {}, "GET", "/v1/profiles", None, {}, "/v1/profiles"),
("get_profile", ("p1",), {}, "GET", "/v1/profiles/p1", None, {}, "/v1/profiles/{id}"),
(
"get_profile_fingerprint",
("p1",),
{},
"GET",
"/v1/profiles/p1/fingerprint",
None,
{},
"/v1/profiles/{id}/fingerprint",
),
(
"create_profile",
(),