diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e72f113..7ccfe12 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.14.0" + ".": "1.15.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index da1e5f4..99da62d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 8 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-a38595b18a0fe26de444a0dd332f15f1e9e35667fca933d454c303676fac93e2.yml -openapi_spec_hash: 1c4882ef9df6782c91ee94c1f2908a90 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-558cea4d1e47f7f79e5a42b1113401d9488399f96ce57000488ba82eefc74119.yml +openapi_spec_hash: 576db82fb9e7648107687ee308db7eae config_hash: 4e76a07aea49753a61313dcd8c10fb0f diff --git a/CHANGELOG.md b/CHANGELOG.md index d5fc0f7..41ceaee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.15.0 (2025-09-14) + +Full Changelog: [v1.14.0...v1.15.0](https://github.com/brand-dot-dev/python-sdk/compare/v1.14.0...v1.15.0) + +### Features + +* **api:** api update ([7f5f368](https://github.com/brand-dot-dev/python-sdk/commit/7f5f368fee87e0b76cb2598bd84fe74be2ca3c98)) + ## 1.14.0 (2025-09-07) Full Changelog: [v1.13.0...v1.14.0](https://github.com/brand-dot-dev/python-sdk/compare/v1.13.0...v1.14.0) diff --git a/pyproject.toml b/pyproject.toml index 3558de3..5acb73e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "brand.dev" -version = "1.14.0" +version = "1.15.0" description = "The official Python library for the brand.dev API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/brand/dev/_version.py b/src/brand/dev/_version.py index 8ce3075..24ab3aa 100644 --- a/src/brand/dev/_version.py +++ b/src/brand/dev/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "brand.dev" -__version__ = "1.14.0" # x-release-please-version +__version__ = "1.15.0" # x-release-please-version diff --git a/src/brand/dev/resources/brand.py b/src/brand/dev/resources/brand.py index 2cee6bb..8628087 100644 --- a/src/brand/dev/resources/brand.py +++ b/src/brand/dev/resources/brand.py @@ -445,6 +445,9 @@ def screenshot( *, domain: str, full_screenshot: Literal["true", "false"] | NotGiven = NOT_GIVEN, + page: Literal["login", "signup", "blog", "careers", "pricing", "terms", "privacy", "contact"] + | NotGiven = NOT_GIVEN, + prioritize: Literal["speed", "quality"] | NotGiven = NOT_GIVEN, # 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. extra_headers: Headers | None = None, @@ -455,8 +458,9 @@ def screenshot( """Beta feature: Capture a screenshot of a website. Supports both viewport - (standard browser view) and full-page screenshots. Returns a URL to the uploaded - screenshot image hosted on our CDN. + (standard browser view) and full-page screenshots. Can also screenshot specific + page types (login, pricing, etc.) by using heuristics to find the appropriate + URL. Returns a URL to the uploaded screenshot image hosted on our CDN. Args: domain: Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The @@ -466,6 +470,15 @@ def screenshot( screenshot capturing all content. If 'false' or not provided, takes a viewport screenshot (standard browser view). + page: Optional parameter to specify which page type to screenshot. If provided, the + system will scrape the domain's links and use heuristics to find the most + appropriate URL for the specified page type (30 supported languages). If not + provided, screenshots the main domain landing page. + + prioritize: Optional parameter to prioritize screenshot capture. 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. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -485,6 +498,8 @@ def screenshot( { "domain": domain, "full_screenshot": full_screenshot, + "page": page, + "prioritize": prioritize, }, brand_screenshot_params.BrandScreenshotParams, ), @@ -496,6 +511,7 @@ def styleguide( self, *, domain: str, + prioritize: Literal["speed", "quality"] | NotGiven = NOT_GIVEN, timeout_ms: int | NotGiven = NOT_GIVEN, # 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. @@ -513,6 +529,11 @@ def 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 'speed' 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). @@ -535,6 +556,7 @@ def styleguide( query=maybe_transform( { "domain": domain, + "prioritize": prioritize, "timeout_ms": timeout_ms, }, brand_styleguide_params.BrandStyleguideParams, @@ -949,6 +971,9 @@ async def screenshot( *, domain: str, full_screenshot: Literal["true", "false"] | NotGiven = NOT_GIVEN, + page: Literal["login", "signup", "blog", "careers", "pricing", "terms", "privacy", "contact"] + | NotGiven = NOT_GIVEN, + prioritize: Literal["speed", "quality"] | NotGiven = NOT_GIVEN, # 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. extra_headers: Headers | None = None, @@ -959,8 +984,9 @@ async def screenshot( """Beta feature: Capture a screenshot of a website. Supports both viewport - (standard browser view) and full-page screenshots. Returns a URL to the uploaded - screenshot image hosted on our CDN. + (standard browser view) and full-page screenshots. Can also screenshot specific + page types (login, pricing, etc.) by using heuristics to find the appropriate + URL. Returns a URL to the uploaded screenshot image hosted on our CDN. Args: domain: Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The @@ -970,6 +996,15 @@ async def screenshot( screenshot capturing all content. If 'false' or not provided, takes a viewport screenshot (standard browser view). + page: Optional parameter to specify which page type to screenshot. If provided, the + system will scrape the domain's links and use heuristics to find the most + appropriate URL for the specified page type (30 supported languages). If not + provided, screenshots the main domain landing page. + + prioritize: Optional parameter to prioritize screenshot capture. 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. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -989,6 +1024,8 @@ async def screenshot( { "domain": domain, "full_screenshot": full_screenshot, + "page": page, + "prioritize": prioritize, }, brand_screenshot_params.BrandScreenshotParams, ), @@ -1000,6 +1037,7 @@ async def styleguide( self, *, domain: str, + prioritize: Literal["speed", "quality"] | NotGiven = NOT_GIVEN, timeout_ms: int | NotGiven = NOT_GIVEN, # 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. @@ -1017,6 +1055,11 @@ async def 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 'speed' 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). @@ -1039,6 +1082,7 @@ async def styleguide( query=await async_maybe_transform( { "domain": domain, + "prioritize": prioritize, "timeout_ms": timeout_ms, }, brand_styleguide_params.BrandStyleguideParams, diff --git a/src/brand/dev/types/brand_screenshot_params.py b/src/brand/dev/types/brand_screenshot_params.py index 5027d90..4f26b1f 100644 --- a/src/brand/dev/types/brand_screenshot_params.py +++ b/src/brand/dev/types/brand_screenshot_params.py @@ -22,3 +22,19 @@ class BrandScreenshotParams(TypedDict, total=False): If 'true', takes a full page screenshot capturing all content. If 'false' or not provided, takes a viewport screenshot (standard browser view). """ + + page: Literal["login", "signup", "blog", "careers", "pricing", "terms", "privacy", "contact"] + """Optional parameter to specify which page type to screenshot. + + If provided, the system will scrape the domain's links and use heuristics to + find the most appropriate URL for the specified page type (30 supported + languages). If not provided, screenshots the main domain landing page. + """ + + prioritize: Literal["speed", "quality"] + """Optional parameter to prioritize screenshot capture. + + 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. + """ diff --git a/src/brand/dev/types/brand_styleguide_params.py b/src/brand/dev/types/brand_styleguide_params.py index 42b3f38..3634bce 100644 --- a/src/brand/dev/types/brand_styleguide_params.py +++ b/src/brand/dev/types/brand_styleguide_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -16,6 +16,14 @@ class BrandStyleguideParams(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 'speed' if not + provided. + """ + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. diff --git a/tests/api_resources/test_brand.py b/tests/api_resources/test_brand.py index d1dfb61..15e05ed 100644 --- a/tests/api_resources/test_brand.py +++ b/tests/api_resources/test_brand.py @@ -338,6 +338,8 @@ def test_method_screenshot_with_all_params(self, client: BrandDev) -> None: brand = client.brand.screenshot( domain="domain", full_screenshot="true", + page="login", + prioritize="speed", ) assert_matches_type(BrandScreenshotResponse, brand, path=["response"]) @@ -380,6 +382,7 @@ def test_method_styleguide(self, client: BrandDev) -> None: def test_method_styleguide_with_all_params(self, client: BrandDev) -> None: brand = client.brand.styleguide( domain="domain", + prioritize="speed", timeout_ms=1, ) assert_matches_type(BrandStyleguideResponse, brand, path=["response"]) @@ -728,6 +731,8 @@ async def test_method_screenshot_with_all_params(self, async_client: AsyncBrandD brand = await async_client.brand.screenshot( domain="domain", full_screenshot="true", + page="login", + prioritize="speed", ) assert_matches_type(BrandScreenshotResponse, brand, path=["response"]) @@ -770,6 +775,7 @@ async def test_method_styleguide(self, async_client: AsyncBrandDev) -> None: async def test_method_styleguide_with_all_params(self, async_client: AsyncBrandDev) -> None: brand = await async_client.brand.styleguide( domain="domain", + prioritize="speed", timeout_ms=1, ) assert_matches_type(BrandStyleguideResponse, brand, path=["response"])