Skip to content

Commit 6ae068d

Browse files
feat(api): api update
1 parent c360fbf commit 6ae068d

6 files changed

Lines changed: 85 additions & 3 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 36
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-a7c3e89bea1fa5763c069e476aa0296b237d3392485bb5b37058b8b7b0210ce1.yml
3-
openapi_spec_hash: 0451eda3557144cd15da8580e1e5d8fc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-aa04a4c92f7068c304082be35f7b4c1474d12772ab9756e0a3819db9f14e1063.yml
3+
openapi_spec_hash: 19b08d835a276c527167b13b86225ae1
44
config_hash: e49b3f69d57d7ffa0420acf772d5c846

src/steel/resources/sessions/sessions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def create(
8282
block_ads: bool | Omit = omit,
8383
concurrency: int | Omit = omit,
8484
credentials: session_create_params.Credentials | Omit = omit,
85+
debug_config: session_create_params.DebugConfig | Omit = omit,
8586
device_config: session_create_params.DeviceConfig | Omit = omit,
8687
dimensions: session_create_params.Dimensions | Omit = omit,
8788
extension_ids: SequenceNotStr[str] | Omit = omit,
@@ -117,6 +118,9 @@ def create(
117118
118119
credentials: Configuration for session credentials
119120
121+
debug_config: Configuration for the debug URL and session viewer. Controls interaction
122+
capabilities, cursor visibility, and other debug-related settings.
123+
120124
device_config: Device configuration for the session. Specify 'mobile' for mobile device
121125
fingerprints and configurations.
122126
@@ -177,6 +181,7 @@ def create(
177181
"block_ads": block_ads,
178182
"concurrency": concurrency,
179183
"credentials": credentials,
184+
"debug_config": debug_config,
180185
"device_config": device_config,
181186
"dimensions": dimensions,
182187
"extension_ids": extension_ids,
@@ -861,6 +866,7 @@ async def create(
861866
block_ads: bool | Omit = omit,
862867
concurrency: int | Omit = omit,
863868
credentials: session_create_params.Credentials | Omit = omit,
869+
debug_config: session_create_params.DebugConfig | Omit = omit,
864870
device_config: session_create_params.DeviceConfig | Omit = omit,
865871
dimensions: session_create_params.Dimensions | Omit = omit,
866872
extension_ids: SequenceNotStr[str] | Omit = omit,
@@ -896,6 +902,9 @@ async def create(
896902
897903
credentials: Configuration for session credentials
898904
905+
debug_config: Configuration for the debug URL and session viewer. Controls interaction
906+
capabilities, cursor visibility, and other debug-related settings.
907+
899908
device_config: Device configuration for the session. Specify 'mobile' for mobile device
900909
fingerprints and configurations.
901910
@@ -956,6 +965,7 @@ async def create(
956965
"block_ads": block_ads,
957966
"concurrency": concurrency,
958967
"credentials": credentials,
968+
"debug_config": debug_config,
959969
"device_config": device_config,
960970
"dimensions": dimensions,
961971
"extension_ids": extension_ids,

src/steel/types/session.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from .._models import BaseModel
1010

11-
__all__ = ["Session", "Dimensions", "OptimizeBandwidth", "DeviceConfig", "StealthConfig"]
11+
__all__ = ["Session", "Dimensions", "OptimizeBandwidth", "DebugConfig", "DeviceConfig", "StealthConfig"]
1212

1313

1414
class Dimensions(BaseModel):
@@ -31,6 +31,20 @@ class OptimizeBandwidth(BaseModel):
3131
block_url_patterns: Optional[List[str]] = FieldInfo(alias="blockUrlPatterns", default=None)
3232

3333

34+
class DebugConfig(BaseModel):
35+
interactive: Optional[bool] = None
36+
"""Whether interaction is allowed via the debug URL viewer.
37+
38+
When false, the session viewer is view-only.
39+
"""
40+
41+
system_cursor: Optional[bool] = FieldInfo(alias="systemCursor", default=None)
42+
"""
43+
Whether the OS-level mouse cursor is shown in the WebRTC stream (headful mode
44+
only).
45+
"""
46+
47+
3448
class DeviceConfig(BaseModel):
3549
device: Optional[Literal["desktop", "mobile"]] = None
3650

@@ -89,6 +103,12 @@ class Session(BaseModel):
89103
websocket_url: str = FieldInfo(alias="websocketUrl")
90104
"""URL for the session's WebSocket connection"""
91105

106+
debug_config: Optional[DebugConfig] = FieldInfo(alias="debugConfig", default=None)
107+
"""Configuration for the debug URL and session viewer.
108+
109+
Controls interaction capabilities and cursor visibility.
110+
"""
111+
92112
device_config: Optional[DeviceConfig] = FieldInfo(alias="deviceConfig", default=None)
93113
"""Device configuration for the session"""
94114

src/steel/types/session_create_params.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
__all__ = [
1313
"SessionCreateParams",
1414
"Credentials",
15+
"DebugConfig",
1516
"DeviceConfig",
1617
"Dimensions",
1718
"OptimizeBandwidth",
@@ -41,6 +42,13 @@ class SessionCreateParams(TypedDict, total=False):
4142
credentials: Credentials
4243
"""Configuration for session credentials"""
4344

45+
debug_config: Annotated[DebugConfig, PropertyInfo(alias="debugConfig")]
46+
"""Configuration for the debug URL and session viewer.
47+
48+
Controls interaction capabilities, cursor visibility, and other debug-related
49+
settings.
50+
"""
51+
4452
device_config: Annotated[DeviceConfig, PropertyInfo(alias="deviceConfig")]
4553
"""Device configuration for the session.
4654
@@ -130,6 +138,21 @@ class Credentials(TypedDict, total=False):
130138
exact_origin: Annotated[bool, PropertyInfo(alias="exactOrigin")]
131139

132140

141+
class DebugConfig(TypedDict, total=False):
142+
interactive: bool
143+
"""Allow interaction with the browser session via the debug URL viewer.
144+
145+
When false, the session viewer will be view-only. Default is true.
146+
"""
147+
148+
system_cursor: Annotated[bool, PropertyInfo(alias="systemCursor")]
149+
"""Show the OS-level mouse cursor in the WebRTC stream (headful mode only).
150+
151+
When false, the system cursor will not be rendered in the stream. Default is
152+
true.
153+
"""
154+
155+
133156
class DeviceConfig(TypedDict, total=False):
134157
device: Literal["desktop", "mobile"]
135158

src/steel/types/sessionslist.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"Session",
1414
"SessionDimensions",
1515
"SessionOptimizeBandwidth",
16+
"SessionDebugConfig",
1617
"SessionDeviceConfig",
1718
"SessionStealthConfig",
1819
]
@@ -38,6 +39,20 @@ class SessionOptimizeBandwidth(BaseModel):
3839
block_url_patterns: Optional[List[str]] = FieldInfo(alias="blockUrlPatterns", default=None)
3940

4041

42+
class SessionDebugConfig(BaseModel):
43+
interactive: Optional[bool] = None
44+
"""Whether interaction is allowed via the debug URL viewer.
45+
46+
When false, the session viewer is view-only.
47+
"""
48+
49+
system_cursor: Optional[bool] = FieldInfo(alias="systemCursor", default=None)
50+
"""
51+
Whether the OS-level mouse cursor is shown in the WebRTC stream (headful mode
52+
only).
53+
"""
54+
55+
4156
class SessionDeviceConfig(BaseModel):
4257
device: Optional[Literal["desktop", "mobile"]] = None
4358

@@ -96,6 +111,12 @@ class Session(BaseModel):
96111
websocket_url: str = FieldInfo(alias="websocketUrl")
97112
"""URL for the session's WebSocket connection"""
98113

114+
debug_config: Optional[SessionDebugConfig] = FieldInfo(alias="debugConfig", default=None)
115+
"""Configuration for the debug URL and session viewer.
116+
117+
Controls interaction capabilities and cursor visibility.
118+
"""
119+
99120
device_config: Optional[SessionDeviceConfig] = FieldInfo(alias="deviceConfig", default=None)
100121
"""Device configuration for the session"""
101122

tests/api_resources/test_sessions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ def test_method_create_with_all_params(self, client: Steel) -> None:
4343
"blur_fields": True,
4444
"exact_origin": True,
4545
},
46+
debug_config={
47+
"interactive": True,
48+
"system_cursor": True,
49+
},
4650
device_config={"device": "desktop"},
4751
dimensions={
4852
"height": 0,
@@ -899,6 +903,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncSteel) ->
899903
"blur_fields": True,
900904
"exact_origin": True,
901905
},
906+
debug_config={
907+
"interactive": True,
908+
"system_cursor": True,
909+
},
902910
device_config={"device": "desktop"},
903911
dimensions={
904912
"height": 0,

0 commit comments

Comments
 (0)