Skip to content

Commit 33f8f8a

Browse files
feat(api): api update
1 parent de020ba commit 33f8f8a

4 files changed

Lines changed: 21 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: 25
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-a4f78808dc23a76896b451576b3b44b0d663977f2032eaed0271dd386b20c43c.yml
3-
openapi_spec_hash: 01f9e1ae0d635f8b874f48e3ba461476
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-021b48afe1d6e3f54c4ebe3d0da4beb3fb8b69a6d384a4aeadbc5bab7f967603.yml
3+
openapi_spec_hash: 2aa5b59d78c708b094acf29cc0d9a68a
44
config_hash: c7b0cdaba3b9797b77efd89e1754d803

‎src/context/dev/resources/web.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ def extract_fonts(
288288
def extract_styleguide(
289289
self,
290290
*,
291+
color_scheme: Literal["light", "dark"] | Omit = omit,
291292
direct_url: str | Omit = omit,
292293
domain: str | Omit = omit,
293294
max_age_ms: int | Omit = omit,
@@ -304,6 +305,9 @@ def extract_styleguide(
304305
typography, spacing, shadows, and UI components.
305306
306307
Args:
308+
color_scheme: Optional browser color scheme to emulate for websites that respond to
309+
prefers-color-scheme. This value is part of the styleguide cache key.
310+
307311
direct_url: A specific URL to fetch the styleguide from directly, bypassing domain
308312
resolution (e.g., 'https://example.com/design-system'). When provided, the
309313
styleguide is extracted from this exact URL. You must provide either 'domain' or
@@ -339,6 +343,7 @@ def extract_styleguide(
339343
timeout=timeout,
340344
query=maybe_transform(
341345
{
346+
"color_scheme": color_scheme,
342347
"direct_url": direct_url,
343348
"domain": domain,
344349
"max_age_ms": max_age_ms,
@@ -2316,6 +2321,7 @@ async def extract_fonts(
23162321
async def extract_styleguide(
23172322
self,
23182323
*,
2324+
color_scheme: Literal["light", "dark"] | Omit = omit,
23192325
direct_url: str | Omit = omit,
23202326
domain: str | Omit = omit,
23212327
max_age_ms: int | Omit = omit,
@@ -2332,6 +2338,9 @@ async def extract_styleguide(
23322338
typography, spacing, shadows, and UI components.
23332339
23342340
Args:
2341+
color_scheme: Optional browser color scheme to emulate for websites that respond to
2342+
prefers-color-scheme. This value is part of the styleguide cache key.
2343+
23352344
direct_url: A specific URL to fetch the styleguide from directly, bypassing domain
23362345
resolution (e.g., 'https://example.com/design-system'). When provided, the
23372346
styleguide is extracted from this exact URL. You must provide either 'domain' or
@@ -2367,6 +2376,7 @@ async def extract_styleguide(
23672376
timeout=timeout,
23682377
query=await async_maybe_transform(
23692378
{
2379+
"color_scheme": color_scheme,
23702380
"direct_url": direct_url,
23712381
"domain": domain,
23722382
"max_age_ms": max_age_ms,

‎src/context/dev/types/web_extract_styleguide_params.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Annotated, TypedDict
5+
from typing_extensions import Literal, Annotated, TypedDict
66

77
from .._utils import PropertyInfo
88

99
__all__ = ["WebExtractStyleguideParams"]
1010

1111

1212
class WebExtractStyleguideParams(TypedDict, total=False):
13+
color_scheme: Annotated[Literal["light", "dark"], PropertyInfo(alias="colorScheme")]
14+
"""
15+
Optional browser color scheme to emulate for websites that respond to
16+
prefers-color-scheme. This value is part of the styleguide cache key.
17+
"""
18+
1319
direct_url: Annotated[str, PropertyInfo(alias="directUrl")]
1420
"""
1521
A specific URL to fetch the styleguide from directly, bypassing domain

‎tests/api_resources/test_web.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ def test_method_extract_styleguide(self, client: ContextDev) -> None:
203203
@parametrize
204204
def test_method_extract_styleguide_with_all_params(self, client: ContextDev) -> None:
205205
web = client.web.extract_styleguide(
206+
color_scheme="light",
206207
direct_url="https://example.com",
207208
domain="domain",
208209
max_age_ms=86400000,
@@ -803,6 +804,7 @@ async def test_method_extract_styleguide(self, async_client: AsyncContextDev) ->
803804
@parametrize
804805
async def test_method_extract_styleguide_with_all_params(self, async_client: AsyncContextDev) -> None:
805806
web = await async_client.web.extract_styleguide(
807+
color_scheme="light",
806808
direct_url="https://example.com",
807809
domain="domain",
808810
max_age_ms=86400000,

0 commit comments

Comments
 (0)