Skip to content

Commit 323c9e5

Browse files
authored
Merge pull request #113 from steel-dev/release-please--branches--main--changes--next
release: 0.3.0
2 parents 8305e23 + aa3ad5d commit 323c9e5

12 files changed

Lines changed: 277 additions & 27 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.2.0"
2+
".": "0.3.0"
33
}

.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-c8306e25d5c8e0d16318b9d44a683dd3d10f8d8b3d56ecbd1952d7f9e95d7f08.yml
3-
openapi_spec_hash: 9877212f13f31009e05d8a1f8b2dd750
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-df307c8d4d17c23d37054bf05f4d0a154be8011730c73ef8b3cfc987bcbdc05e.yml
3+
openapi_spec_hash: f3227dde2385091c20c58a17621286c7
44
config_hash: f23d5011c9a89d67725b48e96ffb7c99

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Changelog
22

3+
## 0.3.0 (2025-05-12)
4+
5+
Full Changelog: [v0.2.0...v0.3.0](https://github.com/steel-dev/steel-python/compare/v0.2.0...v0.3.0)
6+
7+
### Features
8+
9+
* **api:** api update ([de03f2d](https://github.com/steel-dev/steel-python/commit/de03f2d18de91dd52b45652466a6bc9c2772a00a))
10+
11+
12+
### Bug Fixes
13+
14+
* **package:** support direct resource imports ([6bcebb1](https://github.com/steel-dev/steel-python/commit/6bcebb13d5af14d8e6415d0d0256b22431f78e76))
15+
16+
17+
### Chores
18+
19+
* **internal:** avoid errors for isinstance checks on proxies ([5517961](https://github.com/steel-dev/steel-python/commit/5517961f8463167e35f6e0befea81caf4d4fbfd4))
20+
321
## 0.2.0 (2025-04-24)
422

523
Full Changelog: [v0.1.0...v0.2.0](https://github.com/steel-dev/steel-python/compare/v0.1.0...v0.2.0)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "steel-sdk"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
description = "The official Python library for the steel API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/steel/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
import typing as _t
4+
35
from . import types
46
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
57
from ._utils import file_from_path
@@ -68,6 +70,9 @@
6870
"DefaultAsyncHttpxClient",
6971
]
7072

73+
if not _t.TYPE_CHECKING:
74+
from ._utils._resources_proxy import resources as resources
75+
7176
_setup_logging()
7277

7378
# Update the __module__ attribute for exported symbols so that

src/steel/_utils/_proxy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ def __dir__(self) -> Iterable[str]:
4646
@property # type: ignore
4747
@override
4848
def __class__(self) -> type: # pyright: ignore
49-
proxied = self.__get_proxied__()
49+
try:
50+
proxied = self.__get_proxied__()
51+
except Exception:
52+
return type(self)
5053
if issubclass(type(proxied), LazyProxy):
5154
return type(proxied)
5255
return proxied.__class__
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from __future__ import annotations
2+
3+
from typing import Any
4+
from typing_extensions import override
5+
6+
from ._proxy import LazyProxy
7+
8+
9+
class ResourcesProxy(LazyProxy[Any]):
10+
"""A proxy for the `steel.resources` module.
11+
12+
This is used so that we can lazily import `steel.resources` only when
13+
needed *and* so that users can just import `steel` and reference `steel.resources`
14+
"""
15+
16+
@override
17+
def __load__(self) -> Any:
18+
import importlib
19+
20+
mod = importlib.import_module("steel.resources")
21+
return mod
22+
23+
24+
resources = ResourcesProxy().__as_proxied__()

src/steel/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "steel"
4-
__version__ = "0.2.0" # x-release-please-version
4+
__version__ = "0.3.0" # x-release-please-version

src/steel/types/session_context.py

Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,36 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import Dict, List, Optional
4+
from datetime import datetime
45
from typing_extensions import Literal
56

67
from pydantic import Field as FieldInfo
78

89
from .._models import BaseModel
910

10-
__all__ = ["SessionContext", "Cookie"]
11+
__all__ = [
12+
"SessionContext",
13+
"Cookie",
14+
"CookiePartitionKey",
15+
"IndexedDB",
16+
"IndexedDBData",
17+
"IndexedDBDataRecord",
18+
"IndexedDBDataRecordBlobFile",
19+
]
20+
21+
22+
class CookiePartitionKey(BaseModel):
23+
has_cross_site_ancestor: bool = FieldInfo(alias="hasCrossSiteAncestor")
24+
"""
25+
Indicates if the cookie has any ancestors that are cross-site to the
26+
topLevelSite.
27+
"""
28+
29+
top_level_site: str = FieldInfo(alias="topLevelSite")
30+
"""
31+
The site of the top-level URL the browser was visiting at the start of the
32+
request to the endpoint that set the cookie.
33+
"""
1134

1235

1336
class Cookie(BaseModel):
@@ -26,7 +49,7 @@ class Cookie(BaseModel):
2649
http_only: Optional[bool] = FieldInfo(alias="httpOnly", default=None)
2750
"""Whether the cookie is HTTP only"""
2851

29-
partition_key: Optional[str] = FieldInfo(alias="partitionKey", default=None)
52+
partition_key: Optional[CookiePartitionKey] = FieldInfo(alias="partitionKey", default=None)
3053
"""The partition key of the cookie"""
3154

3255
path: Optional[str] = None
@@ -60,15 +83,53 @@ class Cookie(BaseModel):
6083
"""The URL of the cookie"""
6184

6285

86+
class IndexedDBDataRecordBlobFile(BaseModel):
87+
blob_number: float = FieldInfo(alias="blobNumber")
88+
89+
mime_type: str = FieldInfo(alias="mimeType")
90+
91+
size: float
92+
93+
filename: Optional[str] = None
94+
95+
last_modified: Optional[datetime] = FieldInfo(alias="lastModified", default=None)
96+
97+
path: Optional[str] = None
98+
99+
100+
class IndexedDBDataRecord(BaseModel):
101+
blob_files: Optional[List[IndexedDBDataRecordBlobFile]] = FieldInfo(alias="blobFiles", default=None)
102+
103+
key: Optional[object] = None
104+
105+
value: Optional[object] = None
106+
107+
108+
class IndexedDBData(BaseModel):
109+
id: float
110+
111+
name: str
112+
113+
records: List[IndexedDBDataRecord]
114+
115+
116+
class IndexedDB(BaseModel):
117+
id: float
118+
119+
data: List[IndexedDBData]
120+
121+
name: str
122+
123+
63124
class SessionContext(BaseModel):
64125
cookies: Optional[List[Cookie]] = None
65126
"""Cookies to initialize in the session"""
66127

67-
indexed_db: Optional[Dict[str, List[Dict[str, object]]]] = FieldInfo(alias="indexedDB", default=None)
128+
indexed_db: Optional[Dict[str, List[IndexedDB]]] = FieldInfo(alias="indexedDB", default=None)
68129
"""Domain-specific indexedDB items to initialize in the session"""
69130

70-
local_storage: Optional[Dict[str, Dict[str, object]]] = FieldInfo(alias="localStorage", default=None)
131+
local_storage: Optional[Dict[str, Dict[str, str]]] = FieldInfo(alias="localStorage", default=None)
71132
"""Domain-specific localStorage items to initialize in the session"""
72133

73-
session_storage: Optional[Dict[str, Dict[str, object]]] = FieldInfo(alias="sessionStorage", default=None)
134+
session_storage: Optional[Dict[str, Dict[str, str]]] = FieldInfo(alias="sessionStorage", default=None)
74135
"""Domain-specific sessionStorage items to initialize in the session"""

src/steel/types/session_create_params.py

Lines changed: 69 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,23 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Iterable
5+
from typing import Dict, Union, Iterable
6+
from datetime import datetime
67
from typing_extensions import Literal, Required, Annotated, TypedDict
78

89
from .._utils import PropertyInfo
910

10-
__all__ = ["SessionCreateParams", "Dimensions", "SessionContext", "SessionContextCookie"]
11+
__all__ = [
12+
"SessionCreateParams",
13+
"Dimensions",
14+
"SessionContext",
15+
"SessionContextCookie",
16+
"SessionContextCookiePartitionKey",
17+
"SessionContextIndexedDB",
18+
"SessionContextIndexedDBData",
19+
"SessionContextIndexedDBDataRecord",
20+
"SessionContextIndexedDBDataRecordBlobFile",
21+
]
1122

1223

1324
class SessionCreateParams(TypedDict, total=False):
@@ -66,6 +77,20 @@ class Dimensions(TypedDict, total=False):
6677
"""Width of the session"""
6778

6879

80+
class SessionContextCookiePartitionKey(TypedDict, total=False):
81+
has_cross_site_ancestor: Required[Annotated[bool, PropertyInfo(alias="hasCrossSiteAncestor")]]
82+
"""
83+
Indicates if the cookie has any ancestors that are cross-site to the
84+
topLevelSite.
85+
"""
86+
87+
top_level_site: Required[Annotated[str, PropertyInfo(alias="topLevelSite")]]
88+
"""
89+
The site of the top-level URL the browser was visiting at the start of the
90+
request to the endpoint that set the cookie.
91+
"""
92+
93+
6994
class SessionContextCookie(TypedDict, total=False):
7095
name: Required[str]
7196
"""The name of the cookie"""
@@ -82,7 +107,7 @@ class SessionContextCookie(TypedDict, total=False):
82107
http_only: Annotated[bool, PropertyInfo(alias="httpOnly")]
83108
"""Whether the cookie is HTTP only"""
84109

85-
partition_key: Annotated[str, PropertyInfo(alias="partitionKey")]
110+
partition_key: Annotated[SessionContextCookiePartitionKey, PropertyInfo(alias="partitionKey")]
86111
"""The partition key of the cookie"""
87112

88113
path: str
@@ -116,15 +141,53 @@ class SessionContextCookie(TypedDict, total=False):
116141
"""The URL of the cookie"""
117142

118143

144+
class SessionContextIndexedDBDataRecordBlobFile(TypedDict, total=False):
145+
blob_number: Required[Annotated[float, PropertyInfo(alias="blobNumber")]]
146+
147+
mime_type: Required[Annotated[str, PropertyInfo(alias="mimeType")]]
148+
149+
size: Required[float]
150+
151+
filename: str
152+
153+
last_modified: Annotated[Union[str, datetime], PropertyInfo(alias="lastModified", format="iso8601")]
154+
155+
path: str
156+
157+
158+
class SessionContextIndexedDBDataRecord(TypedDict, total=False):
159+
blob_files: Annotated[Iterable[SessionContextIndexedDBDataRecordBlobFile], PropertyInfo(alias="blobFiles")]
160+
161+
key: object
162+
163+
value: object
164+
165+
166+
class SessionContextIndexedDBData(TypedDict, total=False):
167+
id: Required[float]
168+
169+
name: Required[str]
170+
171+
records: Required[Iterable[SessionContextIndexedDBDataRecord]]
172+
173+
174+
class SessionContextIndexedDB(TypedDict, total=False):
175+
id: Required[float]
176+
177+
data: Required[Iterable[SessionContextIndexedDBData]]
178+
179+
name: Required[str]
180+
181+
119182
class SessionContext(TypedDict, total=False):
120183
cookies: Iterable[SessionContextCookie]
121184
"""Cookies to initialize in the session"""
122185

123-
indexed_db: Annotated[Dict[str, Iterable[Dict[str, object]]], PropertyInfo(alias="indexedDB")]
186+
indexed_db: Annotated[Dict[str, Iterable[SessionContextIndexedDB]], PropertyInfo(alias="indexedDB")]
124187
"""Domain-specific indexedDB items to initialize in the session"""
125188

126-
local_storage: Annotated[Dict[str, Dict[str, object]], PropertyInfo(alias="localStorage")]
189+
local_storage: Annotated[Dict[str, Dict[str, str]], PropertyInfo(alias="localStorage")]
127190
"""Domain-specific localStorage items to initialize in the session"""
128191

129-
session_storage: Annotated[Dict[str, Dict[str, object]], PropertyInfo(alias="sessionStorage")]
192+
session_storage: Annotated[Dict[str, Dict[str, str]], PropertyInfo(alias="sessionStorage")]
130193
"""Domain-specific sessionStorage items to initialize in the session"""

0 commit comments

Comments
 (0)