Skip to content

Commit 48e74c7

Browse files
feat(api): api update
1 parent 2ea55a4 commit 48e74c7

File tree

5 files changed

+106
-26
lines changed

5 files changed

+106
-26
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 17
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-6f475030f25058d2a692446a9ce20a095e0a8b4c3f73627841d274d4141fb48f.yml
3-
openapi_spec_hash: ebd8e01a380d203620785ca2cbd9e1b9
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-c8306e25d5c8e0d16318b9d44a683dd3d10f8d8b3d56ecbd1952d7f9e95d7f08.yml
3+
openapi_spec_hash: 9877212f13f31009e05d8a1f8b2dd750
44
config_hash: f23d5011c9a89d67725b48e96ffb7c99

src/steel/types/session_context.py

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,64 @@
1111

1212

1313
class Cookie(BaseModel):
14-
domain: str
15-
"""Domain the cookie belongs to"""
16-
1714
name: str
18-
"""Name of the cookie"""
15+
"""The name of the cookie"""
1916

2017
value: str
21-
"""Value of the cookie"""
18+
"""The value of the cookie"""
19+
20+
domain: Optional[str] = None
21+
"""The domain of the cookie"""
2222

2323
expires: Optional[float] = None
24-
"""Unix timestamp when the cookie expires"""
24+
"""The expiration date of the cookie"""
2525

2626
http_only: Optional[bool] = FieldInfo(alias="httpOnly", default=None)
2727
"""Whether the cookie is HTTP only"""
2828

29+
partition_key: Optional[str] = FieldInfo(alias="partitionKey", default=None)
30+
"""The partition key of the cookie"""
31+
2932
path: Optional[str] = None
30-
"""Path the cookie is valid for"""
33+
"""The path of the cookie"""
34+
35+
priority: Optional[Literal["Low", "Medium", "High"]] = None
36+
"""The priority of the cookie"""
37+
38+
same_party: Optional[bool] = FieldInfo(alias="sameParty", default=None)
39+
"""Whether the cookie is a same party cookie"""
3140

3241
same_site: Optional[Literal["Strict", "Lax", "None"]] = FieldInfo(alias="sameSite", default=None)
33-
"""SameSite attribute of the cookie"""
42+
"""The same site attribute of the cookie"""
3443

3544
secure: Optional[bool] = None
36-
"""Whether the cookie requires HTTPS"""
45+
"""Whether the cookie is secure"""
46+
47+
session: Optional[bool] = None
48+
"""Whether the cookie is a session cookie"""
49+
50+
size: Optional[float] = None
51+
"""The size of the cookie"""
52+
53+
source_port: Optional[float] = FieldInfo(alias="sourcePort", default=None)
54+
"""The source port of the cookie"""
55+
56+
source_scheme: Optional[Literal["Unset", "NonSecure", "Secure"]] = FieldInfo(alias="sourceScheme", default=None)
57+
"""The source scheme of the cookie"""
58+
59+
url: Optional[str] = None
60+
"""The URL of the cookie"""
3761

3862

3963
class SessionContext(BaseModel):
4064
cookies: Optional[List[Cookie]] = None
41-
"""Cookies from the session"""
65+
"""Cookies to initialize in the session"""
66+
67+
indexed_db: Optional[Dict[str, List[Dict[str, object]]]] = FieldInfo(alias="indexedDB", default=None)
68+
"""Domain-specific indexedDB items to initialize in the session"""
4269

4370
local_storage: Optional[Dict[str, Dict[str, object]]] = FieldInfo(alias="localStorage", default=None)
44-
"""Local storage items from the session"""
71+
"""Domain-specific localStorage items to initialize in the session"""
72+
73+
session_storage: Optional[Dict[str, Dict[str, object]]] = FieldInfo(alias="sessionStorage", default=None)
74+
"""Domain-specific sessionStorage items to initialize in the session"""

src/steel/types/session_create_params.py

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,34 +67,64 @@ class Dimensions(TypedDict, total=False):
6767

6868

6969
class SessionContextCookie(TypedDict, total=False):
70-
domain: Required[str]
71-
"""Domain the cookie belongs to"""
72-
7370
name: Required[str]
74-
"""Name of the cookie"""
71+
"""The name of the cookie"""
7572

7673
value: Required[str]
77-
"""Value of the cookie"""
74+
"""The value of the cookie"""
75+
76+
domain: str
77+
"""The domain of the cookie"""
7878

7979
expires: float
80-
"""Unix timestamp when the cookie expires"""
80+
"""The expiration date of the cookie"""
8181

8282
http_only: Annotated[bool, PropertyInfo(alias="httpOnly")]
8383
"""Whether the cookie is HTTP only"""
8484

85+
partition_key: Annotated[str, PropertyInfo(alias="partitionKey")]
86+
"""The partition key of the cookie"""
87+
8588
path: str
86-
"""Path the cookie is valid for"""
89+
"""The path of the cookie"""
90+
91+
priority: Literal["Low", "Medium", "High"]
92+
"""The priority of the cookie"""
93+
94+
same_party: Annotated[bool, PropertyInfo(alias="sameParty")]
95+
"""Whether the cookie is a same party cookie"""
8796

8897
same_site: Annotated[Literal["Strict", "Lax", "None"], PropertyInfo(alias="sameSite")]
89-
"""SameSite attribute of the cookie"""
98+
"""The same site attribute of the cookie"""
9099

91100
secure: bool
92-
"""Whether the cookie requires HTTPS"""
101+
"""Whether the cookie is secure"""
102+
103+
session: bool
104+
"""Whether the cookie is a session cookie"""
105+
106+
size: float
107+
"""The size of the cookie"""
108+
109+
source_port: Annotated[float, PropertyInfo(alias="sourcePort")]
110+
"""The source port of the cookie"""
111+
112+
source_scheme: Annotated[Literal["Unset", "NonSecure", "Secure"], PropertyInfo(alias="sourceScheme")]
113+
"""The source scheme of the cookie"""
114+
115+
url: str
116+
"""The URL of the cookie"""
93117

94118

95119
class SessionContext(TypedDict, total=False):
96120
cookies: Iterable[SessionContextCookie]
97121
"""Cookies to initialize in the session"""
98122

123+
indexed_db: Annotated[Dict[str, Iterable[Dict[str, object]]], PropertyInfo(alias="indexedDB")]
124+
"""Domain-specific indexedDB items to initialize in the session"""
125+
99126
local_storage: Annotated[Dict[str, Dict[str, object]], PropertyInfo(alias="localStorage")]
100127
"""Domain-specific localStorage items to initialize in the session"""
128+
129+
session_storage: Annotated[Dict[str, Dict[str, object]], PropertyInfo(alias="sessionStorage")]
130+
"""Domain-specific sessionStorage items to initialize in the session"""
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Dict, List
3+
from typing import List
44
from typing_extensions import TypeAlias
55

66
__all__ = ["SessionEventsResponse"]
77

8-
SessionEventsResponse: TypeAlias = List[Dict[str, object]]
8+
SessionEventsResponse: TypeAlias = List[object]

tests/api_resources/test_sessions.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,27 @@ def test_method_create_with_all_params(self, client: Steel) -> None:
4545
session_context={
4646
"cookies": [
4747
{
48-
"domain": "domain",
4948
"name": "name",
5049
"value": "value",
50+
"domain": "domain",
5151
"expires": 0,
5252
"http_only": True,
53+
"partition_key": "partitionKey",
5354
"path": "path",
55+
"priority": "Low",
56+
"same_party": True,
5457
"same_site": "Strict",
5558
"secure": True,
59+
"session": True,
60+
"size": 0,
61+
"source_port": 0,
62+
"source_scheme": "Unset",
63+
"url": "url",
5664
}
5765
],
66+
"indexed_db": {"foo": [{"foo": "bar"}]},
5867
"local_storage": {"foo": {"foo": "bar"}},
68+
"session_storage": {"foo": {"foo": "bar"}},
5969
},
6070
session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
6171
solve_captcha=True,
@@ -357,17 +367,27 @@ async def test_method_create_with_all_params(self, async_client: AsyncSteel) ->
357367
session_context={
358368
"cookies": [
359369
{
360-
"domain": "domain",
361370
"name": "name",
362371
"value": "value",
372+
"domain": "domain",
363373
"expires": 0,
364374
"http_only": True,
375+
"partition_key": "partitionKey",
365376
"path": "path",
377+
"priority": "Low",
378+
"same_party": True,
366379
"same_site": "Strict",
367380
"secure": True,
381+
"session": True,
382+
"size": 0,
383+
"source_port": 0,
384+
"source_scheme": "Unset",
385+
"url": "url",
368386
}
369387
],
388+
"indexed_db": {"foo": [{"foo": "bar"}]},
370389
"local_storage": {"foo": {"foo": "bar"}},
390+
"session_storage": {"foo": {"foo": "bar"}},
371391
},
372392
session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
373393
solve_captcha=True,

0 commit comments

Comments
 (0)