From e74edce25aa7523b51f814b402e4aac635e91913 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 16:09:34 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 +- src/context/dev/resources/style.py | 16 - .../types/style_extract_styleguide_params.py | 10 +- .../style_extract_styleguide_response.py | 292 +++++++++++------- tests/api_resources/test_style.py | 2 - 5 files changed, 186 insertions(+), 138 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7aefc87..a0614e1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-2ddb6d73ec8831eee4cb4352b85843a1f6f444e48d8be837cfcd118eddd2a63e.yml -openapi_spec_hash: 1163122fba27e56fa5879bc98d32ee14 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-56a21db16ac3a797f86daca01a2ea115a0365db4b2f9d8accdec4f4d3ee2eb83.yml +openapi_spec_hash: bfcef090896da96023c4485a3d69e350 config_hash: 38268bb88fc4dcbb8f2f94dd138b5910 diff --git a/src/context/dev/resources/style.py b/src/context/dev/resources/style.py index f7a7d84..36ea477 100644 --- a/src/context/dev/resources/style.py +++ b/src/context/dev/resources/style.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ..types import style_extract_fonts_params, style_extract_styleguide_params @@ -99,7 +97,6 @@ def extract_styleguide( *, direct_url: str | Omit = omit, domain: str | Omit = omit, - prioritize: Literal["speed", "quality"] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -121,11 +118,6 @@ def extract_styleguide( domain: Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. - prioritize: Optional parameter to prioritize screenshot capture for styleguide extraction. - If 'speed', optimizes for faster capture with basic quality. If 'quality', - optimizes for higher quality with longer wait times. Defaults to 'quality' if - not provided. - timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -149,7 +141,6 @@ def extract_styleguide( { "direct_url": direct_url, "domain": domain, - "prioritize": prioritize, "timeout_ms": timeout_ms, }, style_extract_styleguide_params.StyleExtractStyleguideParams, @@ -234,7 +225,6 @@ async def extract_styleguide( *, direct_url: str | Omit = omit, domain: str | Omit = omit, - prioritize: Literal["speed", "quality"] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -256,11 +246,6 @@ async def extract_styleguide( domain: Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. - prioritize: Optional parameter to prioritize screenshot capture for styleguide extraction. - If 'speed', optimizes for faster capture with basic quality. If 'quality', - optimizes for higher quality with longer wait times. Defaults to 'quality' if - not provided. - timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -284,7 +269,6 @@ async def extract_styleguide( { "direct_url": direct_url, "domain": domain, - "prioritize": prioritize, "timeout_ms": timeout_ms, }, style_extract_styleguide_params.StyleExtractStyleguideParams, diff --git a/src/context/dev/types/style_extract_styleguide_params.py b/src/context/dev/types/style_extract_styleguide_params.py index c338cb6..c07da4f 100644 --- a/src/context/dev/types/style_extract_styleguide_params.py +++ b/src/context/dev/types/style_extract_styleguide_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -22,14 +22,6 @@ class StyleExtractStyleguideParams(TypedDict, total=False): The domain will be automatically normalized and validated. """ - prioritize: Literal["speed", "quality"] - """Optional parameter to prioritize screenshot capture for styleguide extraction. - - If 'speed', optimizes for faster capture with basic quality. If 'quality', - optimizes for higher quality with longer wait times. Defaults to 'quality' if - not provided. - """ - timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. diff --git a/src/context/dev/types/style_extract_styleguide_response.py b/src/context/dev/types/style_extract_styleguide_response.py index 56ef048..3dfe70d 100644 --- a/src/context/dev/types/style_extract_styleguide_response.py +++ b/src/context/dev/types/style_extract_styleguide_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -32,131 +32,198 @@ class StyleguideColors(BaseModel): """Primary colors used on the website""" - accent: Optional[str] = None - """Accent color of the website (hex format)""" + accent: str + """Accent color (hex format)""" - background: Optional[str] = None - """Background color of the website (hex format)""" + background: str + """Background color (hex format)""" - text: Optional[str] = None - """Text color of the website (hex format)""" + text: str + """Text color (hex format)""" class StyleguideComponentsButtonLink(BaseModel): - """Link button style""" + background_color: str = FieldInfo(alias="backgroundColor") - background_color: Optional[str] = FieldInfo(alias="backgroundColor", default=None) + border_color: str = FieldInfo(alias="borderColor") + """ + Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + alpha) + """ - border_color: Optional[str] = FieldInfo(alias="borderColor", default=None) + border_radius: str = FieldInfo(alias="borderRadius") - border_radius: Optional[str] = FieldInfo(alias="borderRadius", default=None) + border_style: str = FieldInfo(alias="borderStyle") - border_style: Optional[str] = FieldInfo(alias="borderStyle", default=None) + border_width: str = FieldInfo(alias="borderWidth") - border_width: Optional[str] = FieldInfo(alias="borderWidth", default=None) + box_shadow: str = FieldInfo(alias="boxShadow") + """Computed box-shadow (comma-separated layers when present)""" - box_shadow: Optional[str] = FieldInfo(alias="boxShadow", default=None) + color: str - color: Optional[str] = None + css: str + """Ready-to-use CSS declaration block for this component style""" - font_size: Optional[str] = FieldInfo(alias="fontSize", default=None) + font_size: str = FieldInfo(alias="fontSize") - font_weight: Optional[float] = FieldInfo(alias="fontWeight", default=None) + font_weight: float = FieldInfo(alias="fontWeight") - padding: Optional[str] = None + min_height: str = FieldInfo(alias="minHeight") + """Sampled minimum height of the button box (typically px)""" - text_decoration: Optional[str] = FieldInfo(alias="textDecoration", default=None) + min_width: str = FieldInfo(alias="minWidth") + """Sampled minimum width of the button box (typically px)""" + + padding: str + + text_decoration: str = FieldInfo(alias="textDecoration") + + font_fallbacks: Optional[List[str]] = FieldInfo(alias="fontFallbacks", default=None) + """Full ordered font list from computed font-family""" + + font_family: Optional[str] = FieldInfo(alias="fontFamily", default=None) + """Primary button typeface (first in fontFallbacks)""" + + text_decoration_color: Optional[str] = FieldInfo(alias="textDecorationColor", default=None) + """Hex color of the underline when it differs from the text color""" class StyleguideComponentsButtonPrimary(BaseModel): - """Primary button style""" + background_color: str = FieldInfo(alias="backgroundColor") + + border_color: str = FieldInfo(alias="borderColor") + """ + Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + alpha) + """ - background_color: Optional[str] = FieldInfo(alias="backgroundColor", default=None) + border_radius: str = FieldInfo(alias="borderRadius") - border_color: Optional[str] = FieldInfo(alias="borderColor", default=None) + border_style: str = FieldInfo(alias="borderStyle") - border_radius: Optional[str] = FieldInfo(alias="borderRadius", default=None) + border_width: str = FieldInfo(alias="borderWidth") - border_style: Optional[str] = FieldInfo(alias="borderStyle", default=None) + box_shadow: str = FieldInfo(alias="boxShadow") + """Computed box-shadow (comma-separated layers when present)""" - border_width: Optional[str] = FieldInfo(alias="borderWidth", default=None) + color: str - box_shadow: Optional[str] = FieldInfo(alias="boxShadow", default=None) + css: str + """Ready-to-use CSS declaration block for this component style""" - color: Optional[str] = None + font_size: str = FieldInfo(alias="fontSize") - font_size: Optional[str] = FieldInfo(alias="fontSize", default=None) + font_weight: float = FieldInfo(alias="fontWeight") - font_weight: Optional[float] = FieldInfo(alias="fontWeight", default=None) + min_height: str = FieldInfo(alias="minHeight") + """Sampled minimum height of the button box (typically px)""" - padding: Optional[str] = None + min_width: str = FieldInfo(alias="minWidth") + """Sampled minimum width of the button box (typically px)""" - text_decoration: Optional[str] = FieldInfo(alias="textDecoration", default=None) + padding: str + + text_decoration: str = FieldInfo(alias="textDecoration") + + font_fallbacks: Optional[List[str]] = FieldInfo(alias="fontFallbacks", default=None) + """Full ordered font list from computed font-family""" + + font_family: Optional[str] = FieldInfo(alias="fontFamily", default=None) + """Primary button typeface (first in fontFallbacks)""" + + text_decoration_color: Optional[str] = FieldInfo(alias="textDecorationColor", default=None) + """Hex color of the underline when it differs from the text color""" class StyleguideComponentsButtonSecondary(BaseModel): - """Secondary button style""" + background_color: str = FieldInfo(alias="backgroundColor") + + border_color: str = FieldInfo(alias="borderColor") + """ + Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + alpha) + """ + + border_radius: str = FieldInfo(alias="borderRadius") - background_color: Optional[str] = FieldInfo(alias="backgroundColor", default=None) + border_style: str = FieldInfo(alias="borderStyle") - border_color: Optional[str] = FieldInfo(alias="borderColor", default=None) + border_width: str = FieldInfo(alias="borderWidth") - border_radius: Optional[str] = FieldInfo(alias="borderRadius", default=None) + box_shadow: str = FieldInfo(alias="boxShadow") + """Computed box-shadow (comma-separated layers when present)""" - border_style: Optional[str] = FieldInfo(alias="borderStyle", default=None) + color: str - border_width: Optional[str] = FieldInfo(alias="borderWidth", default=None) + css: str + """Ready-to-use CSS declaration block for this component style""" - box_shadow: Optional[str] = FieldInfo(alias="boxShadow", default=None) + font_size: str = FieldInfo(alias="fontSize") - color: Optional[str] = None + font_weight: float = FieldInfo(alias="fontWeight") - font_size: Optional[str] = FieldInfo(alias="fontSize", default=None) + min_height: str = FieldInfo(alias="minHeight") + """Sampled minimum height of the button box (typically px)""" - font_weight: Optional[float] = FieldInfo(alias="fontWeight", default=None) + min_width: str = FieldInfo(alias="minWidth") + """Sampled minimum width of the button box (typically px)""" - padding: Optional[str] = None + padding: str - text_decoration: Optional[str] = FieldInfo(alias="textDecoration", default=None) + text_decoration: str = FieldInfo(alias="textDecoration") + + font_fallbacks: Optional[List[str]] = FieldInfo(alias="fontFallbacks", default=None) + """Full ordered font list from computed font-family""" + + font_family: Optional[str] = FieldInfo(alias="fontFamily", default=None) + """Primary button typeface (first in fontFallbacks)""" + + text_decoration_color: Optional[str] = FieldInfo(alias="textDecorationColor", default=None) + """Hex color of the underline when it differs from the text color""" class StyleguideComponentsButton(BaseModel): """Button component styles""" link: Optional[StyleguideComponentsButtonLink] = None - """Link button style""" primary: Optional[StyleguideComponentsButtonPrimary] = None - """Primary button style""" secondary: Optional[StyleguideComponentsButtonSecondary] = None - """Secondary button style""" class StyleguideComponentsCard(BaseModel): """Card component style""" - background_color: Optional[str] = FieldInfo(alias="backgroundColor", default=None) + background_color: str = FieldInfo(alias="backgroundColor") - border_color: Optional[str] = FieldInfo(alias="borderColor", default=None) + border_color: str = FieldInfo(alias="borderColor") + """ + Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + alpha) + """ - border_radius: Optional[str] = FieldInfo(alias="borderRadius", default=None) + border_radius: str = FieldInfo(alias="borderRadius") - border_style: Optional[str] = FieldInfo(alias="borderStyle", default=None) + border_style: str = FieldInfo(alias="borderStyle") - border_width: Optional[str] = FieldInfo(alias="borderWidth", default=None) + border_width: str = FieldInfo(alias="borderWidth") - box_shadow: Optional[str] = FieldInfo(alias="boxShadow", default=None) + box_shadow: str = FieldInfo(alias="boxShadow") - padding: Optional[str] = None + css: str + """Ready-to-use CSS declaration block for this component style""" - text_color: Optional[str] = FieldInfo(alias="textColor", default=None) + padding: str + + text_color: str = FieldInfo(alias="textColor") class StyleguideComponents(BaseModel): """UI component styles""" - button: Optional[StyleguideComponentsButton] = None + button: StyleguideComponentsButton """Button component styles""" card: Optional[StyleguideComponentsCard] = None @@ -166,87 +233,93 @@ class StyleguideComponents(BaseModel): class StyleguideElementSpacing(BaseModel): """Spacing system used on the website""" - lg: Optional[str] = None - """Large spacing value""" + lg: str - md: Optional[str] = None - """Medium spacing value""" + md: str - sm: Optional[str] = None - """Small spacing value""" + sm: str - xl: Optional[str] = None - """Extra large spacing value""" + xl: str - xs: Optional[str] = None - """Extra small spacing value""" + xs: str class StyleguideShadows(BaseModel): """Shadow styles used on the website""" - inner: Optional[str] = None - """Inner shadow value""" + inner: str - lg: Optional[str] = None - """Large shadow value""" + lg: str - md: Optional[str] = None - """Medium shadow value""" + md: str - sm: Optional[str] = None - """Small shadow value""" + sm: str - xl: Optional[str] = None - """Extra large shadow value""" + xl: str class StyleguideTypographyHeadingsH1(BaseModel): - font_family: Optional[str] = FieldInfo(alias="fontFamily", default=None) + font_fallbacks: List[str] = FieldInfo(alias="fontFallbacks") + """Full ordered font list from resolved computed font-family""" + + font_family: str = FieldInfo(alias="fontFamily") + """Primary face (first family in the computed stack)""" - font_size: Optional[str] = FieldInfo(alias="fontSize", default=None) + font_size: str = FieldInfo(alias="fontSize") - font_weight: Optional[float] = FieldInfo(alias="fontWeight", default=None) + font_weight: float = FieldInfo(alias="fontWeight") - letter_spacing: Optional[str] = FieldInfo(alias="letterSpacing", default=None) + letter_spacing: str = FieldInfo(alias="letterSpacing") - line_height: Optional[str] = FieldInfo(alias="lineHeight", default=None) + line_height: str = FieldInfo(alias="lineHeight") class StyleguideTypographyHeadingsH2(BaseModel): - font_family: Optional[str] = FieldInfo(alias="fontFamily", default=None) + font_fallbacks: List[str] = FieldInfo(alias="fontFallbacks") + """Full ordered font list from resolved computed font-family""" + + font_family: str = FieldInfo(alias="fontFamily") + """Primary face (first family in the computed stack)""" - font_size: Optional[str] = FieldInfo(alias="fontSize", default=None) + font_size: str = FieldInfo(alias="fontSize") - font_weight: Optional[float] = FieldInfo(alias="fontWeight", default=None) + font_weight: float = FieldInfo(alias="fontWeight") - letter_spacing: Optional[str] = FieldInfo(alias="letterSpacing", default=None) + letter_spacing: str = FieldInfo(alias="letterSpacing") - line_height: Optional[str] = FieldInfo(alias="lineHeight", default=None) + line_height: str = FieldInfo(alias="lineHeight") class StyleguideTypographyHeadingsH3(BaseModel): - font_family: Optional[str] = FieldInfo(alias="fontFamily", default=None) + font_fallbacks: List[str] = FieldInfo(alias="fontFallbacks") + """Full ordered font list from resolved computed font-family""" + + font_family: str = FieldInfo(alias="fontFamily") + """Primary face (first family in the computed stack)""" - font_size: Optional[str] = FieldInfo(alias="fontSize", default=None) + font_size: str = FieldInfo(alias="fontSize") - font_weight: Optional[float] = FieldInfo(alias="fontWeight", default=None) + font_weight: float = FieldInfo(alias="fontWeight") - letter_spacing: Optional[str] = FieldInfo(alias="letterSpacing", default=None) + letter_spacing: str = FieldInfo(alias="letterSpacing") - line_height: Optional[str] = FieldInfo(alias="lineHeight", default=None) + line_height: str = FieldInfo(alias="lineHeight") class StyleguideTypographyHeadingsH4(BaseModel): - font_family: Optional[str] = FieldInfo(alias="fontFamily", default=None) + font_fallbacks: List[str] = FieldInfo(alias="fontFallbacks") + """Full ordered font list from resolved computed font-family""" + + font_family: str = FieldInfo(alias="fontFamily") + """Primary face (first family in the computed stack)""" - font_size: Optional[str] = FieldInfo(alias="fontSize", default=None) + font_size: str = FieldInfo(alias="fontSize") - font_weight: Optional[float] = FieldInfo(alias="fontWeight", default=None) + font_weight: float = FieldInfo(alias="fontWeight") - letter_spacing: Optional[str] = FieldInfo(alias="letterSpacing", default=None) + letter_spacing: str = FieldInfo(alias="letterSpacing") - line_height: Optional[str] = FieldInfo(alias="lineHeight", default=None) + line_height: str = FieldInfo(alias="lineHeight") class StyleguideTypographyHeadings(BaseModel): @@ -262,48 +335,49 @@ class StyleguideTypographyHeadings(BaseModel): class StyleguideTypographyP(BaseModel): - """Paragraph text styles""" + font_fallbacks: List[str] = FieldInfo(alias="fontFallbacks") + """Full ordered font list from resolved computed font-family""" - font_family: Optional[str] = FieldInfo(alias="fontFamily", default=None) + font_family: str = FieldInfo(alias="fontFamily") + """Primary face (first family in the computed stack)""" - font_size: Optional[str] = FieldInfo(alias="fontSize", default=None) + font_size: str = FieldInfo(alias="fontSize") - font_weight: Optional[float] = FieldInfo(alias="fontWeight", default=None) + font_weight: float = FieldInfo(alias="fontWeight") - letter_spacing: Optional[str] = FieldInfo(alias="letterSpacing", default=None) + letter_spacing: str = FieldInfo(alias="letterSpacing") - line_height: Optional[str] = FieldInfo(alias="lineHeight", default=None) + line_height: str = FieldInfo(alias="lineHeight") class StyleguideTypography(BaseModel): """Typography styles used on the website""" - headings: Optional[StyleguideTypographyHeadings] = None + headings: StyleguideTypographyHeadings """Heading styles""" p: Optional[StyleguideTypographyP] = None - """Paragraph text styles""" class Styleguide(BaseModel): """Comprehensive styleguide data extracted from the website""" - colors: Optional[StyleguideColors] = None + colors: StyleguideColors """Primary colors used on the website""" - components: Optional[StyleguideComponents] = None + components: StyleguideComponents """UI component styles""" - element_spacing: Optional[StyleguideElementSpacing] = FieldInfo(alias="elementSpacing", default=None) + element_spacing: StyleguideElementSpacing = FieldInfo(alias="elementSpacing") """Spacing system used on the website""" - mode: Optional[Literal["light", "dark"]] = None + mode: Literal["light", "dark"] """The primary color mode of the website design""" - shadows: Optional[StyleguideShadows] = None + shadows: StyleguideShadows """Shadow styles used on the website""" - typography: Optional[StyleguideTypography] = None + typography: StyleguideTypography """Typography styles used on the website""" diff --git a/tests/api_resources/test_style.py b/tests/api_resources/test_style.py index d1e8bc6..8c9f16a 100644 --- a/tests/api_resources/test_style.py +++ b/tests/api_resources/test_style.py @@ -75,7 +75,6 @@ def test_method_extract_styleguide_with_all_params(self, client: ContextDev) -> style = client.style.extract_styleguide( direct_url="https://example.com", domain="domain", - prioritize="speed", timeout_ms=1000, ) assert_matches_type(StyleExtractStyleguideResponse, style, path=["response"]) @@ -163,7 +162,6 @@ async def test_method_extract_styleguide_with_all_params(self, async_client: Asy style = await async_client.style.extract_styleguide( direct_url="https://example.com", domain="domain", - prioritize="speed", timeout_ms=1000, ) assert_matches_type(StyleExtractStyleguideResponse, style, path=["response"]) From 04abfcb26eedcc147946ff44d94e47d7efb7f666 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 16:09:50 +0000 Subject: [PATCH 2/2] release: 0.5.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/context/dev/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index da59f99..2aca35a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.0" + ".": "0.5.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ec33e3..4f1e853 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.5.0 (2026-04-03) + +Full Changelog: [v0.4.0...v0.5.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.4.0...v0.5.0) + +### Features + +* **api:** api update ([e74edce](https://github.com/context-dot-dev/context-python-sdk/commit/e74edce25aa7523b51f814b402e4aac635e91913)) + ## 0.4.0 (2026-03-28) Full Changelog: [v0.3.0...v0.4.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.3.0...v0.4.0) diff --git a/pyproject.toml b/pyproject.toml index 7842351..6f24b0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "context.dev" -version = "0.4.0" +version = "0.5.0" description = "The official Python library for the context.dev API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/context/dev/_version.py b/src/context/dev/_version.py index cc40342..6657ecc 100644 --- a/src/context/dev/_version.py +++ b/src/context/dev/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "context.dev" -__version__ = "0.4.0" # x-release-please-version +__version__ = "0.5.0" # x-release-please-version