driftstack-sdk 0.1.3__tar.gz → 0.1.4__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.
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/PKG-INFO +1 -1
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/pyproject.toml +1 -1
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/__init__.py +2 -0
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/_generated/models.py +1 -1
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/_version.py +1 -1
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/errors.py +23 -0
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/http.py +9 -0
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/.gitignore +0 -0
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/README.md +0 -0
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/_generated/__init__.py +0 -0
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/client.py +0 -0
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/py.typed +0 -0
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/resources/__init__.py +0 -0
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/resources/_common.py +0 -0
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/resources/api_keys.py +0 -0
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/resources/sessions.py +0 -0
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/resources/usage.py +0 -0
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/resources/webhooks.py +0 -0
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/retry.py +0 -0
- {driftstack_sdk-0.1.3 → driftstack_sdk-0.1.4}/src/driftstack/webhook_signature.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: driftstack-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Driftstack Python SDK — stealth iPhone Safari automation. Import as `driftstack`.
|
|
5
5
|
Project-URL: Homepage, https://driftstack.dev
|
|
6
6
|
Project-URL: Repository, https://github.com/driftstackdev/driftstack-api
|
|
@@ -31,6 +31,7 @@ from driftstack.errors import (
|
|
|
31
31
|
RevokedKeyError,
|
|
32
32
|
SessionDestroyedError,
|
|
33
33
|
SessionNotFoundError,
|
|
34
|
+
SessionTimeoutError,
|
|
34
35
|
TransportError,
|
|
35
36
|
ValidationError,
|
|
36
37
|
)
|
|
@@ -53,6 +54,7 @@ __all__ = [
|
|
|
53
54
|
"ConcurrencyLimitError",
|
|
54
55
|
"SessionNotFoundError",
|
|
55
56
|
"SessionDestroyedError",
|
|
57
|
+
"SessionTimeoutError",
|
|
56
58
|
"DriverError",
|
|
57
59
|
"ValidationError",
|
|
58
60
|
"TransportError",
|
|
@@ -94,6 +94,28 @@ class SessionDestroyedError(DriftstackError):
|
|
|
94
94
|
"""The session was destroyed; further operations on it are rejected (410)."""
|
|
95
95
|
|
|
96
96
|
|
|
97
|
+
class SessionTimeoutError(DriftstackError):
|
|
98
|
+
"""The operation exceeded the per-call ``timeout_ms`` (504).
|
|
99
|
+
|
|
100
|
+
Distinguished from ``DriverError`` so customers can react specifically
|
|
101
|
+
to "didn't finish in time" without conflating with downstream driver
|
|
102
|
+
failures. ``timeout_ms`` is the bound the server actually applied
|
|
103
|
+
(may differ from the request if the server clamped it).
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
def __init__(
|
|
107
|
+
self,
|
|
108
|
+
message: str,
|
|
109
|
+
*,
|
|
110
|
+
timeout_ms: int | None = None,
|
|
111
|
+
status: int | None = 504,
|
|
112
|
+
problem_type: str | None = None,
|
|
113
|
+
problem: dict[str, Any] | None = None,
|
|
114
|
+
) -> None:
|
|
115
|
+
super().__init__(message, status=status, problem_type=problem_type, problem=problem)
|
|
116
|
+
self.timeout_ms = timeout_ms
|
|
117
|
+
|
|
118
|
+
|
|
97
119
|
# ── Rate / quota (429) ────────────────────────────────────────────────────
|
|
98
120
|
|
|
99
121
|
|
|
@@ -188,6 +210,7 @@ PROBLEM_TYPE_TO_ERROR: dict[str, type[DriftstackError]] = {
|
|
|
188
210
|
"https://errors.driftstack.dev/expired-key": ExpiredKeyError,
|
|
189
211
|
"https://errors.driftstack.dev/invalid-key": InvalidKeyError,
|
|
190
212
|
"https://errors.driftstack.dev/session-destroyed": SessionDestroyedError,
|
|
213
|
+
"https://errors.driftstack.dev/session-timeout": SessionTimeoutError,
|
|
191
214
|
"https://errors.driftstack.dev/driver-error": DriverError,
|
|
192
215
|
"https://errors.driftstack.dev/driver-not-integrated": DriverError,
|
|
193
216
|
"https://errors.driftstack.dev/validation-failed": ValidationError,
|
|
@@ -25,6 +25,7 @@ from driftstack._version import __version__
|
|
|
25
25
|
from driftstack.errors import (
|
|
26
26
|
PROBLEM_TYPE_TO_ERROR,
|
|
27
27
|
ConcurrencyLimitError,
|
|
28
|
+
SessionTimeoutError,
|
|
28
29
|
DriftstackError,
|
|
29
30
|
QuotaExceededError,
|
|
30
31
|
RateLimitError,
|
|
@@ -126,6 +127,14 @@ def _error_from_response_data(
|
|
|
126
127
|
problem_type=problem_type,
|
|
127
128
|
problem=problem,
|
|
128
129
|
)
|
|
130
|
+
if error_cls is SessionTimeoutError:
|
|
131
|
+
return SessionTimeoutError(
|
|
132
|
+
detail,
|
|
133
|
+
timeout_ms=_int_or_none(problem.get("timeout_ms")),
|
|
134
|
+
status=status,
|
|
135
|
+
problem_type=problem_type,
|
|
136
|
+
problem=problem,
|
|
137
|
+
)
|
|
129
138
|
return error_cls(detail, status=status, problem_type=problem_type, problem=problem)
|
|
130
139
|
|
|
131
140
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|