robot-wrapper-sdk 0.2.24__tar.gz → 0.2.26__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/PKG-INFO +1 -1
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/pyproject.toml +1 -1
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_sdk/__init__.py +7 -1
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_sdk/application/usecases.py +6 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_sdk/domain/entities.py +3 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_sdk/domain/repositories.py +8 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_sdk/infrastructure/robot_api_repository.py +17 -2
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_wrapper_sdk.egg-info/PKG-INFO +1 -1
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/README.md +0 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/examples/main.py +0 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_sdk/application/__init__.py +0 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_sdk/domain/__init__.py +0 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_sdk/infrastructure/__init__.py +0 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_sdk/infrastructure/api_client.py +0 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_sdk/infrastructure/tests.py +0 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_sdk/tests.py +0 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_wrapper_sdk.egg-info/SOURCES.txt +0 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_wrapper_sdk.egg-info/dependency_links.txt +0 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_wrapper_sdk.egg-info/requires.txt +0 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_wrapper_sdk.egg-info/top_level.txt +0 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/setup.cfg +0 -0
- {robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/tests/main.py +0 -0
|
@@ -9,7 +9,7 @@ from .infrastructure.api_client import AsyncHTTPClient, HTTPClient
|
|
|
9
9
|
from .infrastructure.robot_api_repository import (AsyncRobotAPIRepository,
|
|
10
10
|
RobotAPIRepository)
|
|
11
11
|
|
|
12
|
-
__version__ = "0.2.
|
|
12
|
+
__version__ = "0.2.26"
|
|
13
13
|
class RobotPlatformModule:
|
|
14
14
|
"""Synchronous Facade for the Robot Platform SDK."""
|
|
15
15
|
|
|
@@ -51,6 +51,9 @@ class RobotPlatformModule:
|
|
|
51
51
|
def unlock_hardening_tasks(self, robot_ids: List[str]) -> None:
|
|
52
52
|
self.robot_usecase.unlock_hardening_tasks(robot_ids)
|
|
53
53
|
|
|
54
|
+
def unlock_acquire_tasks(self, robot_ids: List[str]) -> None:
|
|
55
|
+
self.robot_usecase.unlock_acquire_tasks(robot_ids)
|
|
56
|
+
|
|
54
57
|
def update_auth_status(self, robot_id: str, auth_status: str | RobotAuthStatus) -> None:
|
|
55
58
|
self.robot_usecase.update_auth_status(robot_id, auth_status)
|
|
56
59
|
|
|
@@ -127,6 +130,9 @@ class AsyncRobotPlatformModule:
|
|
|
127
130
|
async def unlock_hardening_tasks(self, robot_ids: List[str]) -> None:
|
|
128
131
|
await self.robot_usecase.unlock_hardening_tasks(robot_ids)
|
|
129
132
|
|
|
133
|
+
async def unlock_acquire_tasks(self, robot_ids: List[str]) -> None:
|
|
134
|
+
await self.robot_usecase.unlock_acquire_tasks(robot_ids)
|
|
135
|
+
|
|
130
136
|
async def update_auth_status(self, robot_id: str, auth_status: str | RobotAuthStatus) -> None:
|
|
131
137
|
await self.robot_usecase.update_auth_status(robot_id, auth_status)
|
|
132
138
|
|
|
@@ -45,6 +45,9 @@ class RobotUsecase:
|
|
|
45
45
|
def unlock_login_tasks(self, robot_ids: List[str]) -> None:
|
|
46
46
|
self.repo.unlock_login_tasks(robot_ids)
|
|
47
47
|
|
|
48
|
+
def unlock_acquire_tasks(self, robot_ids: List[str]) -> None:
|
|
49
|
+
self.repo.unlock_acquire_tasks(robot_ids)
|
|
50
|
+
|
|
48
51
|
def unlock_hardening_tasks(self, robot_ids: List[str]) -> None:
|
|
49
52
|
self.repo.unlock_hardening_tasks(robot_ids)
|
|
50
53
|
|
|
@@ -122,6 +125,9 @@ class AsyncRobotUsecase:
|
|
|
122
125
|
async def unlock_hardening_tasks(self, robot_ids: List[str]) -> None:
|
|
123
126
|
await self.repo.unlock_hardening_tasks(robot_ids)
|
|
124
127
|
|
|
128
|
+
async def unlock_acquire_tasks(self, robot_ids: List[str]) -> None:
|
|
129
|
+
await self.repo.unlock_acquire_tasks(robot_ids)
|
|
130
|
+
|
|
125
131
|
async def update_auth_status(self, robot_id: str, auth_status: str | RobotAuthStatus) -> None:
|
|
126
132
|
await self.repo.update_auth_status(robot_id, auth_status)
|
|
127
133
|
|
|
@@ -73,6 +73,9 @@ class Robot:
|
|
|
73
73
|
platform: str
|
|
74
74
|
status: str
|
|
75
75
|
auth_status: str
|
|
76
|
+
first_name: Optional[str] = None
|
|
77
|
+
last_name: Optional[str] = None
|
|
78
|
+
email: Optional[str] = None
|
|
76
79
|
metadata: Dict[str, Any] = field(default_factory=dict)
|
|
77
80
|
project_id: Optional[str] = None
|
|
78
81
|
primary_environment: Optional[str] = None
|
|
@@ -48,6 +48,10 @@ class RobotRepository(ABC):
|
|
|
48
48
|
def unlock_hardening_tasks(self, robot_ids: List[str]) -> None:
|
|
49
49
|
pass
|
|
50
50
|
|
|
51
|
+
@abstractmethod
|
|
52
|
+
def unlock_acquire_tasks(self, robot_ids: List[str]) -> None:
|
|
53
|
+
pass
|
|
54
|
+
|
|
51
55
|
@abstractmethod
|
|
52
56
|
def update_auth_status(self, robot_id: str, auth_status: str | RobotAuthStatus) -> None:
|
|
53
57
|
pass
|
|
@@ -134,6 +138,10 @@ class AsyncRobotRepository(ABC):
|
|
|
134
138
|
async def unlock_hardening_tasks(self, robot_ids: List[str]) -> None:
|
|
135
139
|
pass
|
|
136
140
|
|
|
141
|
+
@abstractmethod
|
|
142
|
+
async def unlock_acquire_tasks(self, robot_ids: List[str]) -> None:
|
|
143
|
+
pass
|
|
144
|
+
|
|
137
145
|
@abstractmethod
|
|
138
146
|
async def update_auth_status(self, robot_id: str, auth_status: str | RobotAuthStatus) -> None:
|
|
139
147
|
pass
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from dataclasses import asdict
|
|
1
|
+
from dataclasses import asdict, is_dataclass
|
|
2
2
|
from typing import Any, Dict, List, Optional, Tuple
|
|
3
3
|
|
|
4
4
|
from ..domain.entities import (AcquireRobotsMetadataFilter, BrowserCapture,
|
|
@@ -185,7 +185,15 @@ def _acquire_robots_payload(limit: int, lock_minutes: int, project_name: Optiona
|
|
|
185
185
|
if environment:
|
|
186
186
|
payload["environment"] = environment
|
|
187
187
|
if metadata:
|
|
188
|
-
|
|
188
|
+
if isinstance(metadata, list):
|
|
189
|
+
payload["metadata"] = [
|
|
190
|
+
asdict(m) if is_dataclass(m) else m
|
|
191
|
+
for m in metadata
|
|
192
|
+
]
|
|
193
|
+
elif isinstance(metadata, dict):
|
|
194
|
+
payload["metadata"] = metadata
|
|
195
|
+
else:
|
|
196
|
+
payload["metadata"] = asdict(metadata) if is_dataclass(metadata) else metadata
|
|
189
197
|
return payload
|
|
190
198
|
|
|
191
199
|
|
|
@@ -448,6 +456,13 @@ class AsyncRobotAPIRepository(AsyncRobotRepository):
|
|
|
448
456
|
json={"robot_ids": robot_ids},
|
|
449
457
|
)
|
|
450
458
|
|
|
459
|
+
async def unlock_acquire_tasks(self, robot_ids: List[str]) -> None:
|
|
460
|
+
await self.client.request(
|
|
461
|
+
"POST",
|
|
462
|
+
"/robots/acquire/unlock",
|
|
463
|
+
json={"robot_ids": robot_ids},
|
|
464
|
+
)
|
|
465
|
+
|
|
451
466
|
async def update_auth_status(self, robot_id: str, auth_status: str | RobotAuthStatus) -> None:
|
|
452
467
|
normalized_auth_status = normalize_robot_auth_status(auth_status)
|
|
453
468
|
ensure_valid_worker_robot_auth_status(normalized_auth_status)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_sdk/infrastructure/api_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_wrapper_sdk.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_wrapper_sdk.egg-info/requires.txt
RENAMED
|
File without changes
|
{robot_wrapper_sdk-0.2.24 → robot_wrapper_sdk-0.2.26}/robot_wrapper_sdk.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|