driftstack-sdk 0.1.2__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.
Files changed (20) hide show
  1. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/PKG-INFO +1 -1
  2. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/pyproject.toml +1 -1
  3. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/src/driftstack/__init__.py +2 -0
  4. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/src/driftstack/_generated/models.py +1 -7
  5. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/src/driftstack/_version.py +1 -1
  6. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/src/driftstack/errors.py +23 -0
  7. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/src/driftstack/http.py +9 -0
  8. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/.gitignore +0 -0
  9. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/README.md +0 -0
  10. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/src/driftstack/_generated/__init__.py +0 -0
  11. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/src/driftstack/client.py +0 -0
  12. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/src/driftstack/py.typed +0 -0
  13. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/src/driftstack/resources/__init__.py +0 -0
  14. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/src/driftstack/resources/_common.py +0 -0
  15. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/src/driftstack/resources/api_keys.py +0 -0
  16. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/src/driftstack/resources/sessions.py +0 -0
  17. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/src/driftstack/resources/usage.py +0 -0
  18. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/src/driftstack/resources/webhooks.py +0 -0
  19. {driftstack_sdk-0.1.2 → driftstack_sdk-0.1.4}/src/driftstack/retry.py +0 -0
  20. {driftstack_sdk-0.1.2 → 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.2
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
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "driftstack-sdk"
7
- version = "0.1.2"
7
+ version = "0.1.4"
8
8
  description = "Driftstack Python SDK — stealth iPhone Safari automation. Import as `driftstack`."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -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",
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: openapi.json
3
- # timestamp: 2026-05-03T09:09:33+00:00
3
+ # timestamp: 2026-05-03T10:23:59+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -201,15 +201,9 @@ class NavigateResponse(BaseModel):
201
201
  duration_ms: conint(ge=0)
202
202
 
203
203
 
204
- class Offset(BaseModel):
205
- x: int
206
- y: int
207
-
208
-
209
204
  class Action(BaseModel):
210
205
  kind: Literal["tap"]
211
206
  selector: constr(min_length=1)
212
- offset: Offset | None = None
213
207
 
214
208
 
215
209
  class Action1(BaseModel):
@@ -7,4 +7,4 @@ needed — useful for tools that scrape the version without installing.
7
7
 
8
8
  from __future__ import annotations
9
9
 
10
- __version__ = "0.1.2"
10
+ __version__ = "0.1.4"
@@ -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