From e20d9257c12efd897a0104bd9c9032741a0dbb68 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:11:52 +0000 Subject: [PATCH 1/3] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d2dca25..ed1d7f9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-98ef96cef5b06ad7a29dadba48258da7d9ea0a2b3938dc9e714ae06eb9afa1a3.yml -openapi_spec_hash: 9e957a30999dff7d4ada925e437bd202 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-2cdd67823c6ac9d1ab68032a695c31a098ad285ffb0c073b9dfc00afe5de9b88.yml +openapi_spec_hash: ac8a965beb9b667b6204a5c573507219 config_hash: c3aaaa9794dba44d524c06591ab17894 From bfe9b298f2c51f4d2762da550344251c2b0b7256 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:14:25 +0000 Subject: [PATCH 2/3] feat(api): manual updates --- .stats.yml | 4 +- lib/brand_dev.rb | 8 + lib/brand_dev/models.rb | 8 + .../models/brand_web_scrape_html_params.rb | 22 ++ .../models/brand_web_scrape_html_response.rb | 45 +++ .../models/brand_web_scrape_images_params.rb | 22 ++ .../brand_web_scrape_images_response.rb | 111 ++++++++ .../models/brand_web_scrape_md_params.rb | 42 +++ .../models/brand_web_scrape_md_response.rb | 45 +++ .../models/brand_web_scrape_sitemap_params.rb | 26 ++ .../brand_web_scrape_sitemap_response.rb | 91 ++++++ lib/brand_dev/resources/brand.rb | 105 +++++++ rbi/brand_dev/models.rbi | 8 + .../models/brand_web_scrape_html_params.rbi | 40 +++ .../models/brand_web_scrape_html_response.rbi | 92 +++++++ .../models/brand_web_scrape_images_params.rbi | 43 +++ .../brand_web_scrape_images_response.rbi | 259 ++++++++++++++++++ .../models/brand_web_scrape_md_params.rbi | 67 +++++ .../models/brand_web_scrape_md_response.rbi | 92 +++++++ .../brand_web_scrape_sitemap_params.rbi | 45 +++ .../brand_web_scrape_sitemap_response.rbi | 167 +++++++++++ rbi/brand_dev/resources/brand.rbi | 71 +++++ sig/brand_dev/models.rbs | 8 + .../models/brand_web_scrape_html_params.rbs | 20 ++ .../models/brand_web_scrape_html_response.rbs | 40 +++ .../models/brand_web_scrape_images_params.rbs | 20 ++ .../brand_web_scrape_images_response.rbs | 98 +++++++ .../models/brand_web_scrape_md_params.rbs | 36 +++ .../models/brand_web_scrape_md_response.rbs | 40 +++ .../brand_web_scrape_sitemap_params.rbs | 23 ++ .../brand_web_scrape_sitemap_response.rbs | 77 ++++++ sig/brand_dev/resources/brand.rbs | 22 ++ test/brand_dev/resources/brand_test.rb | 73 +++++ 33 files changed, 1868 insertions(+), 2 deletions(-) create mode 100644 lib/brand_dev/models/brand_web_scrape_html_params.rb create mode 100644 lib/brand_dev/models/brand_web_scrape_html_response.rb create mode 100644 lib/brand_dev/models/brand_web_scrape_images_params.rb create mode 100644 lib/brand_dev/models/brand_web_scrape_images_response.rb create mode 100644 lib/brand_dev/models/brand_web_scrape_md_params.rb create mode 100644 lib/brand_dev/models/brand_web_scrape_md_response.rb create mode 100644 lib/brand_dev/models/brand_web_scrape_sitemap_params.rb create mode 100644 lib/brand_dev/models/brand_web_scrape_sitemap_response.rb create mode 100644 rbi/brand_dev/models/brand_web_scrape_html_params.rbi create mode 100644 rbi/brand_dev/models/brand_web_scrape_html_response.rbi create mode 100644 rbi/brand_dev/models/brand_web_scrape_images_params.rbi create mode 100644 rbi/brand_dev/models/brand_web_scrape_images_response.rbi create mode 100644 rbi/brand_dev/models/brand_web_scrape_md_params.rbi create mode 100644 rbi/brand_dev/models/brand_web_scrape_md_response.rbi create mode 100644 rbi/brand_dev/models/brand_web_scrape_sitemap_params.rbi create mode 100644 rbi/brand_dev/models/brand_web_scrape_sitemap_response.rbi create mode 100644 sig/brand_dev/models/brand_web_scrape_html_params.rbs create mode 100644 sig/brand_dev/models/brand_web_scrape_html_response.rbs create mode 100644 sig/brand_dev/models/brand_web_scrape_images_params.rbs create mode 100644 sig/brand_dev/models/brand_web_scrape_images_response.rbs create mode 100644 sig/brand_dev/models/brand_web_scrape_md_params.rbs create mode 100644 sig/brand_dev/models/brand_web_scrape_md_response.rbs create mode 100644 sig/brand_dev/models/brand_web_scrape_sitemap_params.rbs create mode 100644 sig/brand_dev/models/brand_web_scrape_sitemap_response.rbs diff --git a/.stats.yml b/.stats.yml index ed1d7f9..aaa0f9f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 16 +configured_endpoints: 20 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-2cdd67823c6ac9d1ab68032a695c31a098ad285ffb0c073b9dfc00afe5de9b88.yml openapi_spec_hash: ac8a965beb9b667b6204a5c573507219 -config_hash: c3aaaa9794dba44d524c06591ab17894 +config_hash: 4cd3173ea1cce7183640aae49cfbb374 diff --git a/lib/brand_dev.rb b/lib/brand_dev.rb index 1f65f4b..391d3ad 100644 --- a/lib/brand_dev.rb +++ b/lib/brand_dev.rb @@ -84,5 +84,13 @@ require_relative "brand_dev/models/brand_screenshot_response" require_relative "brand_dev/models/brand_styleguide_params" require_relative "brand_dev/models/brand_styleguide_response" +require_relative "brand_dev/models/brand_web_scrape_html_params" +require_relative "brand_dev/models/brand_web_scrape_html_response" +require_relative "brand_dev/models/brand_web_scrape_images_params" +require_relative "brand_dev/models/brand_web_scrape_images_response" +require_relative "brand_dev/models/brand_web_scrape_md_params" +require_relative "brand_dev/models/brand_web_scrape_md_response" +require_relative "brand_dev/models/brand_web_scrape_sitemap_params" +require_relative "brand_dev/models/brand_web_scrape_sitemap_response" require_relative "brand_dev/models" require_relative "brand_dev/resources/brand" diff --git a/lib/brand_dev/models.rb b/lib/brand_dev/models.rb index dd2155e..61ba941 100644 --- a/lib/brand_dev/models.rb +++ b/lib/brand_dev/models.rb @@ -70,4 +70,12 @@ module BrandDev BrandScreenshotParams = BrandDev::Models::BrandScreenshotParams BrandStyleguideParams = BrandDev::Models::BrandStyleguideParams + + BrandWebScrapeHTMLParams = BrandDev::Models::BrandWebScrapeHTMLParams + + BrandWebScrapeImagesParams = BrandDev::Models::BrandWebScrapeImagesParams + + BrandWebScrapeMdParams = BrandDev::Models::BrandWebScrapeMdParams + + BrandWebScrapeSitemapParams = BrandDev::Models::BrandWebScrapeSitemapParams end diff --git a/lib/brand_dev/models/brand_web_scrape_html_params.rb b/lib/brand_dev/models/brand_web_scrape_html_params.rb new file mode 100644 index 0000000..764275a --- /dev/null +++ b/lib/brand_dev/models/brand_web_scrape_html_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module BrandDev + module Models + # @see BrandDev::Resources::Brand#web_scrape_html + class BrandWebScrapeHTMLParams < BrandDev::Internal::Type::BaseModel + extend BrandDev::Internal::Type::RequestParameters::Converter + include BrandDev::Internal::Type::RequestParameters + + # @!attribute url + # Full URL to scrape (must include http:// or https:// protocol) + # + # @return [String] + required :url, String + + # @!method initialize(url:, request_options: {}) + # @param url [String] Full URL to scrape (must include http:// or https:// protocol) + # + # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/brand_dev/models/brand_web_scrape_html_response.rb b/lib/brand_dev/models/brand_web_scrape_html_response.rb new file mode 100644 index 0000000..634c23e --- /dev/null +++ b/lib/brand_dev/models/brand_web_scrape_html_response.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module BrandDev + module Models + # @see BrandDev::Resources::Brand#web_scrape_html + class BrandWebScrapeHTMLResponse < BrandDev::Internal::Type::BaseModel + # @!attribute html + # Raw HTML content of the page + # + # @return [String] + required :html, String + + # @!attribute success + # Indicates success + # + # @return [Boolean, BrandDev::Models::BrandWebScrapeHTMLResponse::Success] + required :success, enum: -> { BrandDev::Models::BrandWebScrapeHTMLResponse::Success } + + # @!attribute url + # The URL that was scraped + # + # @return [String] + required :url, String + + # @!method initialize(html:, success:, url:) + # @param html [String] Raw HTML content of the page + # + # @param success [Boolean, BrandDev::Models::BrandWebScrapeHTMLResponse::Success] Indicates success + # + # @param url [String] The URL that was scraped + + # Indicates success + # + # @see BrandDev::Models::BrandWebScrapeHTMLResponse#success + module Success + extend BrandDev::Internal::Type::Enum + + TRUE = true + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/brand_dev/models/brand_web_scrape_images_params.rb b/lib/brand_dev/models/brand_web_scrape_images_params.rb new file mode 100644 index 0000000..7cc7159 --- /dev/null +++ b/lib/brand_dev/models/brand_web_scrape_images_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module BrandDev + module Models + # @see BrandDev::Resources::Brand#web_scrape_images + class BrandWebScrapeImagesParams < BrandDev::Internal::Type::BaseModel + extend BrandDev::Internal::Type::RequestParameters::Converter + include BrandDev::Internal::Type::RequestParameters + + # @!attribute url + # Full URL to scrape images from (must include http:// or https:// protocol) + # + # @return [String] + required :url, String + + # @!method initialize(url:, request_options: {}) + # @param url [String] Full URL to scrape images from (must include http:// or https:// protocol) + # + # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/brand_dev/models/brand_web_scrape_images_response.rb b/lib/brand_dev/models/brand_web_scrape_images_response.rb new file mode 100644 index 0000000..5306b8c --- /dev/null +++ b/lib/brand_dev/models/brand_web_scrape_images_response.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true + +module BrandDev + module Models + # @see BrandDev::Resources::Brand#web_scrape_images + class BrandWebScrapeImagesResponse < BrandDev::Internal::Type::BaseModel + # @!attribute images + # Array of scraped images + # + # @return [Array] + required :images, + -> { BrandDev::Internal::Type::ArrayOf[BrandDev::Models::BrandWebScrapeImagesResponse::Image] } + + # @!attribute success + # Indicates success + # + # @return [Boolean, BrandDev::Models::BrandWebScrapeImagesResponse::Success] + required :success, enum: -> { BrandDev::Models::BrandWebScrapeImagesResponse::Success } + + # @!attribute url + # The URL that was scraped + # + # @return [String] + required :url, String + + # @!method initialize(images:, success:, url:) + # @param images [Array] Array of scraped images + # + # @param success [Boolean, BrandDev::Models::BrandWebScrapeImagesResponse::Success] Indicates success + # + # @param url [String] The URL that was scraped + + class Image < BrandDev::Internal::Type::BaseModel + # @!attribute alt + # Alt text of the image, or null if not present + # + # @return [String, nil] + required :alt, String, nil?: true + + # @!attribute element + # The HTML element the image was found in + # + # @return [Symbol, BrandDev::Models::BrandWebScrapeImagesResponse::Image::Element] + required :element, enum: -> { BrandDev::Models::BrandWebScrapeImagesResponse::Image::Element } + + # @!attribute src + # The image source - can be a URL, inline HTML (for SVGs), or a base64 data URI + # + # @return [String] + required :src, String + + # @!attribute type + # The type/format of the src value + # + # @return [Symbol, BrandDev::Models::BrandWebScrapeImagesResponse::Image::Type] + required :type, enum: -> { BrandDev::Models::BrandWebScrapeImagesResponse::Image::Type } + + # @!method initialize(alt:, element:, src:, type:) + # @param alt [String, nil] Alt text of the image, or null if not present + # + # @param element [Symbol, BrandDev::Models::BrandWebScrapeImagesResponse::Image::Element] The HTML element the image was found in + # + # @param src [String] The image source - can be a URL, inline HTML (for SVGs), or a base64 data URI + # + # @param type [Symbol, BrandDev::Models::BrandWebScrapeImagesResponse::Image::Type] The type/format of the src value + + # The HTML element the image was found in + # + # @see BrandDev::Models::BrandWebScrapeImagesResponse::Image#element + module Element + extend BrandDev::Internal::Type::Enum + + IMG = :img + SVG = :svg + LINK = :link + SOURCE = :source + VIDEO = :video + + # @!method self.values + # @return [Array] + end + + # The type/format of the src value + # + # @see BrandDev::Models::BrandWebScrapeImagesResponse::Image#type + module Type + extend BrandDev::Internal::Type::Enum + + URL = :url + HTML = :html + BASE64 = :base64 + + # @!method self.values + # @return [Array] + end + end + + # Indicates success + # + # @see BrandDev::Models::BrandWebScrapeImagesResponse#success + module Success + extend BrandDev::Internal::Type::Enum + + TRUE = true + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/brand_dev/models/brand_web_scrape_md_params.rb b/lib/brand_dev/models/brand_web_scrape_md_params.rb new file mode 100644 index 0000000..60337a8 --- /dev/null +++ b/lib/brand_dev/models/brand_web_scrape_md_params.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module BrandDev + module Models + # @see BrandDev::Resources::Brand#web_scrape_md + class BrandWebScrapeMdParams < BrandDev::Internal::Type::BaseModel + extend BrandDev::Internal::Type::RequestParameters::Converter + include BrandDev::Internal::Type::RequestParameters + + # @!attribute url + # Full URL to scrape and convert to markdown (must include http:// or https:// + # protocol) + # + # @return [String] + required :url, String + + # @!attribute include_images + # Include image references in Markdown output + # + # @return [Boolean, nil] + optional :include_images, BrandDev::Internal::Type::Boolean + + # @!attribute include_links + # Preserve hyperlinks in Markdown output + # + # @return [Boolean, nil] + optional :include_links, BrandDev::Internal::Type::Boolean + + # @!method initialize(url:, include_images: nil, include_links: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {BrandDev::Models::BrandWebScrapeMdParams} for more details. + # + # @param url [String] Full URL to scrape and convert to markdown (must include http:// or https:// pro + # + # @param include_images [Boolean] Include image references in Markdown output + # + # @param include_links [Boolean] Preserve hyperlinks in Markdown output + # + # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/brand_dev/models/brand_web_scrape_md_response.rb b/lib/brand_dev/models/brand_web_scrape_md_response.rb new file mode 100644 index 0000000..ed96763 --- /dev/null +++ b/lib/brand_dev/models/brand_web_scrape_md_response.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module BrandDev + module Models + # @see BrandDev::Resources::Brand#web_scrape_md + class BrandWebScrapeMdResponse < BrandDev::Internal::Type::BaseModel + # @!attribute markdown + # Page content converted to GitHub Flavored Markdown + # + # @return [String] + required :markdown, String + + # @!attribute success + # Indicates success + # + # @return [Boolean, BrandDev::Models::BrandWebScrapeMdResponse::Success] + required :success, enum: -> { BrandDev::Models::BrandWebScrapeMdResponse::Success } + + # @!attribute url + # The URL that was scraped + # + # @return [String] + required :url, String + + # @!method initialize(markdown:, success:, url:) + # @param markdown [String] Page content converted to GitHub Flavored Markdown + # + # @param success [Boolean, BrandDev::Models::BrandWebScrapeMdResponse::Success] Indicates success + # + # @param url [String] The URL that was scraped + + # Indicates success + # + # @see BrandDev::Models::BrandWebScrapeMdResponse#success + module Success + extend BrandDev::Internal::Type::Enum + + TRUE = true + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/brand_dev/models/brand_web_scrape_sitemap_params.rb b/lib/brand_dev/models/brand_web_scrape_sitemap_params.rb new file mode 100644 index 0000000..981602a --- /dev/null +++ b/lib/brand_dev/models/brand_web_scrape_sitemap_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module BrandDev + module Models + # @see BrandDev::Resources::Brand#web_scrape_sitemap + class BrandWebScrapeSitemapParams < BrandDev::Internal::Type::BaseModel + extend BrandDev::Internal::Type::RequestParameters::Converter + include BrandDev::Internal::Type::RequestParameters + + # @!attribute domain + # Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be + # automatically normalized and validated. + # + # @return [String] + required :domain, String + + # @!method initialize(domain:, request_options: {}) + # Some parameter documentations has been truncated, see + # {BrandDev::Models::BrandWebScrapeSitemapParams} for more details. + # + # @param domain [String] Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be auto + # + # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/brand_dev/models/brand_web_scrape_sitemap_response.rb b/lib/brand_dev/models/brand_web_scrape_sitemap_response.rb new file mode 100644 index 0000000..a442381 --- /dev/null +++ b/lib/brand_dev/models/brand_web_scrape_sitemap_response.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +module BrandDev + module Models + # @see BrandDev::Resources::Brand#web_scrape_sitemap + class BrandWebScrapeSitemapResponse < BrandDev::Internal::Type::BaseModel + # @!attribute domain + # The normalized domain that was crawled + # + # @return [String] + required :domain, String + + # @!attribute meta + # Metadata about the sitemap crawl operation + # + # @return [BrandDev::Models::BrandWebScrapeSitemapResponse::Meta] + required :meta, -> { BrandDev::Models::BrandWebScrapeSitemapResponse::Meta } + + # @!attribute success + # Indicates success + # + # @return [Boolean, BrandDev::Models::BrandWebScrapeSitemapResponse::Success] + required :success, enum: -> { BrandDev::Models::BrandWebScrapeSitemapResponse::Success } + + # @!attribute urls + # Array of discovered page URLs from the sitemap (max 500) + # + # @return [Array] + required :urls, BrandDev::Internal::Type::ArrayOf[String] + + # @!method initialize(domain:, meta:, success:, urls:) + # @param domain [String] The normalized domain that was crawled + # + # @param meta [BrandDev::Models::BrandWebScrapeSitemapResponse::Meta] Metadata about the sitemap crawl operation + # + # @param success [Boolean, BrandDev::Models::BrandWebScrapeSitemapResponse::Success] Indicates success + # + # @param urls [Array] Array of discovered page URLs from the sitemap (max 500) + + # @see BrandDev::Models::BrandWebScrapeSitemapResponse#meta + class Meta < BrandDev::Internal::Type::BaseModel + # @!attribute errors + # Number of errors encountered during crawling + # + # @return [Integer] + required :errors, Integer + + # @!attribute sitemaps_discovered + # Total number of sitemap files discovered + # + # @return [Integer] + required :sitemaps_discovered, Integer, api_name: :sitemapsDiscovered + + # @!attribute sitemaps_fetched + # Number of sitemap files successfully fetched and parsed + # + # @return [Integer] + required :sitemaps_fetched, Integer, api_name: :sitemapsFetched + + # @!attribute sitemaps_skipped + # Number of sitemap files skipped (due to errors, timeouts, or limits) + # + # @return [Integer] + required :sitemaps_skipped, Integer, api_name: :sitemapsSkipped + + # @!method initialize(errors:, sitemaps_discovered:, sitemaps_fetched:, sitemaps_skipped:) + # Metadata about the sitemap crawl operation + # + # @param errors [Integer] Number of errors encountered during crawling + # + # @param sitemaps_discovered [Integer] Total number of sitemap files discovered + # + # @param sitemaps_fetched [Integer] Number of sitemap files successfully fetched and parsed + # + # @param sitemaps_skipped [Integer] Number of sitemap files skipped (due to errors, timeouts, or limits) + end + + # Indicates success + # + # @see BrandDev::Models::BrandWebScrapeSitemapResponse#success + module Success + extend BrandDev::Internal::Type::Enum + + TRUE = true + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/brand_dev/resources/brand.rb b/lib/brand_dev/resources/brand.rb index 11d7fa1..6497860 100644 --- a/lib/brand_dev/resources/brand.rb +++ b/lib/brand_dev/resources/brand.rb @@ -521,6 +521,111 @@ def styleguide(params) ) end + # Scrapes the given URL and returns the raw HTML content of the page. Uses + # automatic proxy escalation to handle blocked sites. + # + # @overload web_scrape_html(url:, request_options: {}) + # + # @param url [String] Full URL to scrape (must include http:// or https:// protocol) + # + # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [BrandDev::Models::BrandWebScrapeHTMLResponse] + # + # @see BrandDev::Models::BrandWebScrapeHTMLParams + def web_scrape_html(params) + parsed, options = BrandDev::BrandWebScrapeHTMLParams.dump_request(params) + @client.request( + method: :get, + path: "web/scrape/html", + query: parsed, + model: BrandDev::Models::BrandWebScrapeHTMLResponse, + options: options + ) + end + + # Scrapes all images from the given URL. Extracts images from img, svg, + # picture/source, link, and video elements including inline SVGs, base64 data + # URIs, and standard URLs. + # + # @overload web_scrape_images(url:, request_options: {}) + # + # @param url [String] Full URL to scrape images from (must include http:// or https:// protocol) + # + # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [BrandDev::Models::BrandWebScrapeImagesResponse] + # + # @see BrandDev::Models::BrandWebScrapeImagesParams + def web_scrape_images(params) + parsed, options = BrandDev::BrandWebScrapeImagesParams.dump_request(params) + @client.request( + method: :get, + path: "web/scrape/images", + query: parsed, + model: BrandDev::Models::BrandWebScrapeImagesResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {BrandDev::Models::BrandWebScrapeMdParams} for more details. + # + # Scrapes the given URL, converts the HTML content to GitHub Flavored Markdown + # (GFM), and returns the result. Uses automatic proxy escalation to handle blocked + # sites. + # + # @overload web_scrape_md(url:, include_images: nil, include_links: nil, request_options: {}) + # + # @param url [String] Full URL to scrape and convert to markdown (must include http:// or https:// pro + # + # @param include_images [Boolean] Include image references in Markdown output + # + # @param include_links [Boolean] Preserve hyperlinks in Markdown output + # + # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [BrandDev::Models::BrandWebScrapeMdResponse] + # + # @see BrandDev::Models::BrandWebScrapeMdParams + def web_scrape_md(params) + parsed, options = BrandDev::BrandWebScrapeMdParams.dump_request(params) + @client.request( + method: :get, + path: "web/scrape/markdown", + query: parsed.transform_keys(include_images: "includeImages", include_links: "includeLinks"), + model: BrandDev::Models::BrandWebScrapeMdResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {BrandDev::Models::BrandWebScrapeSitemapParams} for more details. + # + # Crawls the sitemap of the given domain and returns all discovered page URLs. + # Supports sitemap index files (recursive), parallel fetching with concurrency + # control, deduplication, and filters out non-page resources (images, PDFs, etc.). + # + # @overload web_scrape_sitemap(domain:, request_options: {}) + # + # @param domain [String] Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be auto + # + # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [BrandDev::Models::BrandWebScrapeSitemapResponse] + # + # @see BrandDev::Models::BrandWebScrapeSitemapParams + def web_scrape_sitemap(params) + parsed, options = BrandDev::BrandWebScrapeSitemapParams.dump_request(params) + @client.request( + method: :get, + path: "web/scrape/sitemap", + query: parsed, + model: BrandDev::Models::BrandWebScrapeSitemapResponse, + options: options + ) + end + # @api private # # @param client [BrandDev::Client] diff --git a/rbi/brand_dev/models.rbi b/rbi/brand_dev/models.rbi index b7f8e4f..d7c026f 100644 --- a/rbi/brand_dev/models.rbi +++ b/rbi/brand_dev/models.rbi @@ -34,4 +34,12 @@ module BrandDev BrandScreenshotParams = BrandDev::Models::BrandScreenshotParams BrandStyleguideParams = BrandDev::Models::BrandStyleguideParams + + BrandWebScrapeHTMLParams = BrandDev::Models::BrandWebScrapeHTMLParams + + BrandWebScrapeImagesParams = BrandDev::Models::BrandWebScrapeImagesParams + + BrandWebScrapeMdParams = BrandDev::Models::BrandWebScrapeMdParams + + BrandWebScrapeSitemapParams = BrandDev::Models::BrandWebScrapeSitemapParams end diff --git a/rbi/brand_dev/models/brand_web_scrape_html_params.rbi b/rbi/brand_dev/models/brand_web_scrape_html_params.rbi new file mode 100644 index 0000000..042cf8b --- /dev/null +++ b/rbi/brand_dev/models/brand_web_scrape_html_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module BrandDev + module Models + class BrandWebScrapeHTMLParams < BrandDev::Internal::Type::BaseModel + extend BrandDev::Internal::Type::RequestParameters::Converter + include BrandDev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(BrandDev::BrandWebScrapeHTMLParams, BrandDev::Internal::AnyHash) + end + + # Full URL to scrape (must include http:// or https:// protocol) + sig { returns(String) } + attr_accessor :url + + sig do + params( + url: String, + request_options: BrandDev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Full URL to scrape (must include http:// or https:// protocol) + url:, + request_options: {} + ) + end + + sig do + override.returns( + { url: String, request_options: BrandDev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/brand_dev/models/brand_web_scrape_html_response.rbi b/rbi/brand_dev/models/brand_web_scrape_html_response.rbi new file mode 100644 index 0000000..62e0ea6 --- /dev/null +++ b/rbi/brand_dev/models/brand_web_scrape_html_response.rbi @@ -0,0 +1,92 @@ +# typed: strong + +module BrandDev + module Models + class BrandWebScrapeHTMLResponse < BrandDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + BrandDev::Models::BrandWebScrapeHTMLResponse, + BrandDev::Internal::AnyHash + ) + end + + # Raw HTML content of the page + sig { returns(String) } + attr_accessor :html + + # Indicates success + sig do + returns( + BrandDev::Models::BrandWebScrapeHTMLResponse::Success::TaggedBoolean + ) + end + attr_accessor :success + + # The URL that was scraped + sig { returns(String) } + attr_accessor :url + + sig do + params( + html: String, + success: + BrandDev::Models::BrandWebScrapeHTMLResponse::Success::OrBoolean, + url: String + ).returns(T.attached_class) + end + def self.new( + # Raw HTML content of the page + html:, + # Indicates success + success:, + # The URL that was scraped + url: + ) + end + + sig do + override.returns( + { + html: String, + success: + BrandDev::Models::BrandWebScrapeHTMLResponse::Success::TaggedBoolean, + url: String + } + ) + end + def to_hash + end + + # Indicates success + module Success + extend BrandDev::Internal::Type::Enum + + TaggedBoolean = + T.type_alias do + T.all( + T::Boolean, + BrandDev::Models::BrandWebScrapeHTMLResponse::Success + ) + end + OrBoolean = T.type_alias { T::Boolean } + + TRUE = + T.let( + true, + BrandDev::Models::BrandWebScrapeHTMLResponse::Success::TaggedBoolean + ) + + sig do + override.returns( + T::Array[ + BrandDev::Models::BrandWebScrapeHTMLResponse::Success::TaggedBoolean + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/brand_dev/models/brand_web_scrape_images_params.rbi b/rbi/brand_dev/models/brand_web_scrape_images_params.rbi new file mode 100644 index 0000000..23a0654 --- /dev/null +++ b/rbi/brand_dev/models/brand_web_scrape_images_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module BrandDev + module Models + class BrandWebScrapeImagesParams < BrandDev::Internal::Type::BaseModel + extend BrandDev::Internal::Type::RequestParameters::Converter + include BrandDev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + BrandDev::BrandWebScrapeImagesParams, + BrandDev::Internal::AnyHash + ) + end + + # Full URL to scrape images from (must include http:// or https:// protocol) + sig { returns(String) } + attr_accessor :url + + sig do + params( + url: String, + request_options: BrandDev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Full URL to scrape images from (must include http:// or https:// protocol) + url:, + request_options: {} + ) + end + + sig do + override.returns( + { url: String, request_options: BrandDev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/brand_dev/models/brand_web_scrape_images_response.rbi b/rbi/brand_dev/models/brand_web_scrape_images_response.rbi new file mode 100644 index 0000000..fed2ccf --- /dev/null +++ b/rbi/brand_dev/models/brand_web_scrape_images_response.rbi @@ -0,0 +1,259 @@ +# typed: strong + +module BrandDev + module Models + class BrandWebScrapeImagesResponse < BrandDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + BrandDev::Models::BrandWebScrapeImagesResponse, + BrandDev::Internal::AnyHash + ) + end + + # Array of scraped images + sig do + returns(T::Array[BrandDev::Models::BrandWebScrapeImagesResponse::Image]) + end + attr_accessor :images + + # Indicates success + sig do + returns( + BrandDev::Models::BrandWebScrapeImagesResponse::Success::TaggedBoolean + ) + end + attr_accessor :success + + # The URL that was scraped + sig { returns(String) } + attr_accessor :url + + sig do + params( + images: + T::Array[ + BrandDev::Models::BrandWebScrapeImagesResponse::Image::OrHash + ], + success: + BrandDev::Models::BrandWebScrapeImagesResponse::Success::OrBoolean, + url: String + ).returns(T.attached_class) + end + def self.new( + # Array of scraped images + images:, + # Indicates success + success:, + # The URL that was scraped + url: + ) + end + + sig do + override.returns( + { + images: + T::Array[BrandDev::Models::BrandWebScrapeImagesResponse::Image], + success: + BrandDev::Models::BrandWebScrapeImagesResponse::Success::TaggedBoolean, + url: String + } + ) + end + def to_hash + end + + class Image < BrandDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + BrandDev::Models::BrandWebScrapeImagesResponse::Image, + BrandDev::Internal::AnyHash + ) + end + + # Alt text of the image, or null if not present + sig { returns(T.nilable(String)) } + attr_accessor :alt + + # The HTML element the image was found in + sig do + returns( + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Element::TaggedSymbol + ) + end + attr_accessor :element + + # The image source - can be a URL, inline HTML (for SVGs), or a base64 data URI + sig { returns(String) } + attr_accessor :src + + # The type/format of the src value + sig do + returns( + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig do + params( + alt: T.nilable(String), + element: + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Element::OrSymbol, + src: String, + type: + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Alt text of the image, or null if not present + alt:, + # The HTML element the image was found in + element:, + # The image source - can be a URL, inline HTML (for SVGs), or a base64 data URI + src:, + # The type/format of the src value + type: + ) + end + + sig do + override.returns( + { + alt: T.nilable(String), + element: + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Element::TaggedSymbol, + src: String, + type: + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # The HTML element the image was found in + module Element + extend BrandDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Element + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMG = + T.let( + :img, + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Element::TaggedSymbol + ) + SVG = + T.let( + :svg, + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Element::TaggedSymbol + ) + LINK = + T.let( + :link, + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Element::TaggedSymbol + ) + SOURCE = + T.let( + :source, + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Element::TaggedSymbol + ) + VIDEO = + T.let( + :video, + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Element::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Element::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type/format of the src value + module Type + extend BrandDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + URL = + T.let( + :url, + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Type::TaggedSymbol + ) + HTML = + T.let( + :html, + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Type::TaggedSymbol + ) + BASE64 = + T.let( + :base64, + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + BrandDev::Models::BrandWebScrapeImagesResponse::Image::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # Indicates success + module Success + extend BrandDev::Internal::Type::Enum + + TaggedBoolean = + T.type_alias do + T.all( + T::Boolean, + BrandDev::Models::BrandWebScrapeImagesResponse::Success + ) + end + OrBoolean = T.type_alias { T::Boolean } + + TRUE = + T.let( + true, + BrandDev::Models::BrandWebScrapeImagesResponse::Success::TaggedBoolean + ) + + sig do + override.returns( + T::Array[ + BrandDev::Models::BrandWebScrapeImagesResponse::Success::TaggedBoolean + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/brand_dev/models/brand_web_scrape_md_params.rbi b/rbi/brand_dev/models/brand_web_scrape_md_params.rbi new file mode 100644 index 0000000..7f7fec2 --- /dev/null +++ b/rbi/brand_dev/models/brand_web_scrape_md_params.rbi @@ -0,0 +1,67 @@ +# typed: strong + +module BrandDev + module Models + class BrandWebScrapeMdParams < BrandDev::Internal::Type::BaseModel + extend BrandDev::Internal::Type::RequestParameters::Converter + include BrandDev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(BrandDev::BrandWebScrapeMdParams, BrandDev::Internal::AnyHash) + end + + # Full URL to scrape and convert to markdown (must include http:// or https:// + # protocol) + sig { returns(String) } + attr_accessor :url + + # Include image references in Markdown output + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_images + + sig { params(include_images: T::Boolean).void } + attr_writer :include_images + + # Preserve hyperlinks in Markdown output + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_links + + sig { params(include_links: T::Boolean).void } + attr_writer :include_links + + sig do + params( + url: String, + include_images: T::Boolean, + include_links: T::Boolean, + request_options: BrandDev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Full URL to scrape and convert to markdown (must include http:// or https:// + # protocol) + url:, + # Include image references in Markdown output + include_images: nil, + # Preserve hyperlinks in Markdown output + include_links: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + url: String, + include_images: T::Boolean, + include_links: T::Boolean, + request_options: BrandDev::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/brand_dev/models/brand_web_scrape_md_response.rbi b/rbi/brand_dev/models/brand_web_scrape_md_response.rbi new file mode 100644 index 0000000..b5ab6e8 --- /dev/null +++ b/rbi/brand_dev/models/brand_web_scrape_md_response.rbi @@ -0,0 +1,92 @@ +# typed: strong + +module BrandDev + module Models + class BrandWebScrapeMdResponse < BrandDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + BrandDev::Models::BrandWebScrapeMdResponse, + BrandDev::Internal::AnyHash + ) + end + + # Page content converted to GitHub Flavored Markdown + sig { returns(String) } + attr_accessor :markdown + + # Indicates success + sig do + returns( + BrandDev::Models::BrandWebScrapeMdResponse::Success::TaggedBoolean + ) + end + attr_accessor :success + + # The URL that was scraped + sig { returns(String) } + attr_accessor :url + + sig do + params( + markdown: String, + success: + BrandDev::Models::BrandWebScrapeMdResponse::Success::OrBoolean, + url: String + ).returns(T.attached_class) + end + def self.new( + # Page content converted to GitHub Flavored Markdown + markdown:, + # Indicates success + success:, + # The URL that was scraped + url: + ) + end + + sig do + override.returns( + { + markdown: String, + success: + BrandDev::Models::BrandWebScrapeMdResponse::Success::TaggedBoolean, + url: String + } + ) + end + def to_hash + end + + # Indicates success + module Success + extend BrandDev::Internal::Type::Enum + + TaggedBoolean = + T.type_alias do + T.all( + T::Boolean, + BrandDev::Models::BrandWebScrapeMdResponse::Success + ) + end + OrBoolean = T.type_alias { T::Boolean } + + TRUE = + T.let( + true, + BrandDev::Models::BrandWebScrapeMdResponse::Success::TaggedBoolean + ) + + sig do + override.returns( + T::Array[ + BrandDev::Models::BrandWebScrapeMdResponse::Success::TaggedBoolean + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/brand_dev/models/brand_web_scrape_sitemap_params.rbi b/rbi/brand_dev/models/brand_web_scrape_sitemap_params.rbi new file mode 100644 index 0000000..9a48c99 --- /dev/null +++ b/rbi/brand_dev/models/brand_web_scrape_sitemap_params.rbi @@ -0,0 +1,45 @@ +# typed: strong + +module BrandDev + module Models + class BrandWebScrapeSitemapParams < BrandDev::Internal::Type::BaseModel + extend BrandDev::Internal::Type::RequestParameters::Converter + include BrandDev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + BrandDev::BrandWebScrapeSitemapParams, + BrandDev::Internal::AnyHash + ) + end + + # Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be + # automatically normalized and validated. + sig { returns(String) } + attr_accessor :domain + + sig do + params( + domain: String, + request_options: BrandDev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be + # automatically normalized and validated. + domain:, + request_options: {} + ) + end + + sig do + override.returns( + { domain: String, request_options: BrandDev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/brand_dev/models/brand_web_scrape_sitemap_response.rbi b/rbi/brand_dev/models/brand_web_scrape_sitemap_response.rbi new file mode 100644 index 0000000..333f297 --- /dev/null +++ b/rbi/brand_dev/models/brand_web_scrape_sitemap_response.rbi @@ -0,0 +1,167 @@ +# typed: strong + +module BrandDev + module Models + class BrandWebScrapeSitemapResponse < BrandDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + BrandDev::Models::BrandWebScrapeSitemapResponse, + BrandDev::Internal::AnyHash + ) + end + + # The normalized domain that was crawled + sig { returns(String) } + attr_accessor :domain + + # Metadata about the sitemap crawl operation + sig { returns(BrandDev::Models::BrandWebScrapeSitemapResponse::Meta) } + attr_reader :meta + + sig do + params( + meta: BrandDev::Models::BrandWebScrapeSitemapResponse::Meta::OrHash + ).void + end + attr_writer :meta + + # Indicates success + sig do + returns( + BrandDev::Models::BrandWebScrapeSitemapResponse::Success::TaggedBoolean + ) + end + attr_accessor :success + + # Array of discovered page URLs from the sitemap (max 500) + sig { returns(T::Array[String]) } + attr_accessor :urls + + sig do + params( + domain: String, + meta: BrandDev::Models::BrandWebScrapeSitemapResponse::Meta::OrHash, + success: + BrandDev::Models::BrandWebScrapeSitemapResponse::Success::OrBoolean, + urls: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # The normalized domain that was crawled + domain:, + # Metadata about the sitemap crawl operation + meta:, + # Indicates success + success:, + # Array of discovered page URLs from the sitemap (max 500) + urls: + ) + end + + sig do + override.returns( + { + domain: String, + meta: BrandDev::Models::BrandWebScrapeSitemapResponse::Meta, + success: + BrandDev::Models::BrandWebScrapeSitemapResponse::Success::TaggedBoolean, + urls: T::Array[String] + } + ) + end + def to_hash + end + + class Meta < BrandDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + BrandDev::Models::BrandWebScrapeSitemapResponse::Meta, + BrandDev::Internal::AnyHash + ) + end + + # Number of errors encountered during crawling + sig { returns(Integer) } + attr_accessor :errors + + # Total number of sitemap files discovered + sig { returns(Integer) } + attr_accessor :sitemaps_discovered + + # Number of sitemap files successfully fetched and parsed + sig { returns(Integer) } + attr_accessor :sitemaps_fetched + + # Number of sitemap files skipped (due to errors, timeouts, or limits) + sig { returns(Integer) } + attr_accessor :sitemaps_skipped + + # Metadata about the sitemap crawl operation + sig do + params( + errors: Integer, + sitemaps_discovered: Integer, + sitemaps_fetched: Integer, + sitemaps_skipped: Integer + ).returns(T.attached_class) + end + def self.new( + # Number of errors encountered during crawling + errors:, + # Total number of sitemap files discovered + sitemaps_discovered:, + # Number of sitemap files successfully fetched and parsed + sitemaps_fetched:, + # Number of sitemap files skipped (due to errors, timeouts, or limits) + sitemaps_skipped: + ) + end + + sig do + override.returns( + { + errors: Integer, + sitemaps_discovered: Integer, + sitemaps_fetched: Integer, + sitemaps_skipped: Integer + } + ) + end + def to_hash + end + end + + # Indicates success + module Success + extend BrandDev::Internal::Type::Enum + + TaggedBoolean = + T.type_alias do + T.all( + T::Boolean, + BrandDev::Models::BrandWebScrapeSitemapResponse::Success + ) + end + OrBoolean = T.type_alias { T::Boolean } + + TRUE = + T.let( + true, + BrandDev::Models::BrandWebScrapeSitemapResponse::Success::TaggedBoolean + ) + + sig do + override.returns( + T::Array[ + BrandDev::Models::BrandWebScrapeSitemapResponse::Success::TaggedBoolean + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/brand_dev/resources/brand.rbi b/rbi/brand_dev/resources/brand.rbi index 7ff202a..f3ccbf7 100644 --- a/rbi/brand_dev/resources/brand.rbi +++ b/rbi/brand_dev/resources/brand.rbi @@ -462,6 +462,77 @@ module BrandDev ) end + # Scrapes the given URL and returns the raw HTML content of the page. Uses + # automatic proxy escalation to handle blocked sites. + sig do + params( + url: String, + request_options: BrandDev::RequestOptions::OrHash + ).returns(BrandDev::Models::BrandWebScrapeHTMLResponse) + end + def web_scrape_html( + # Full URL to scrape (must include http:// or https:// protocol) + url:, + request_options: {} + ) + end + + # Scrapes all images from the given URL. Extracts images from img, svg, + # picture/source, link, and video elements including inline SVGs, base64 data + # URIs, and standard URLs. + sig do + params( + url: String, + request_options: BrandDev::RequestOptions::OrHash + ).returns(BrandDev::Models::BrandWebScrapeImagesResponse) + end + def web_scrape_images( + # Full URL to scrape images from (must include http:// or https:// protocol) + url:, + request_options: {} + ) + end + + # Scrapes the given URL, converts the HTML content to GitHub Flavored Markdown + # (GFM), and returns the result. Uses automatic proxy escalation to handle blocked + # sites. + sig do + params( + url: String, + include_images: T::Boolean, + include_links: T::Boolean, + request_options: BrandDev::RequestOptions::OrHash + ).returns(BrandDev::Models::BrandWebScrapeMdResponse) + end + def web_scrape_md( + # Full URL to scrape and convert to markdown (must include http:// or https:// + # protocol) + url:, + # Include image references in Markdown output + include_images: nil, + # Preserve hyperlinks in Markdown output + include_links: nil, + request_options: {} + ) + end + + # Crawls the sitemap of the given domain and returns all discovered page URLs. + # Supports sitemap index files (recursive), parallel fetching with concurrency + # control, deduplication, and filters out non-page resources (images, PDFs, etc.). + sig do + params( + domain: String, + request_options: BrandDev::RequestOptions::OrHash + ).returns(BrandDev::Models::BrandWebScrapeSitemapResponse) + end + def web_scrape_sitemap( + # Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be + # automatically normalized and validated. + domain:, + request_options: {} + ) + end + # @api private sig { params(client: BrandDev::Client).returns(T.attached_class) } def self.new(client:) diff --git a/sig/brand_dev/models.rbs b/sig/brand_dev/models.rbs index 2690500..4a5e14b 100644 --- a/sig/brand_dev/models.rbs +++ b/sig/brand_dev/models.rbs @@ -30,4 +30,12 @@ module BrandDev class BrandScreenshotParams = BrandDev::Models::BrandScreenshotParams class BrandStyleguideParams = BrandDev::Models::BrandStyleguideParams + + class BrandWebScrapeHTMLParams = BrandDev::Models::BrandWebScrapeHTMLParams + + class BrandWebScrapeImagesParams = BrandDev::Models::BrandWebScrapeImagesParams + + class BrandWebScrapeMdParams = BrandDev::Models::BrandWebScrapeMdParams + + class BrandWebScrapeSitemapParams = BrandDev::Models::BrandWebScrapeSitemapParams end diff --git a/sig/brand_dev/models/brand_web_scrape_html_params.rbs b/sig/brand_dev/models/brand_web_scrape_html_params.rbs new file mode 100644 index 0000000..08c18fb --- /dev/null +++ b/sig/brand_dev/models/brand_web_scrape_html_params.rbs @@ -0,0 +1,20 @@ +module BrandDev + module Models + type brand_web_scrape_html_params = + { url: String } & BrandDev::Internal::Type::request_parameters + + class BrandWebScrapeHTMLParams < BrandDev::Internal::Type::BaseModel + extend BrandDev::Internal::Type::RequestParameters::Converter + include BrandDev::Internal::Type::RequestParameters + + attr_accessor url: String + + def initialize: ( + url: String, + ?request_options: BrandDev::request_opts + ) -> void + + def to_hash: -> { url: String, request_options: BrandDev::RequestOptions } + end + end +end diff --git a/sig/brand_dev/models/brand_web_scrape_html_response.rbs b/sig/brand_dev/models/brand_web_scrape_html_response.rbs new file mode 100644 index 0000000..c33095e --- /dev/null +++ b/sig/brand_dev/models/brand_web_scrape_html_response.rbs @@ -0,0 +1,40 @@ +module BrandDev + module Models + type brand_web_scrape_html_response = + { + html: String, + success: BrandDev::Models::BrandWebScrapeHTMLResponse::success, + url: String + } + + class BrandWebScrapeHTMLResponse < BrandDev::Internal::Type::BaseModel + attr_accessor html: String + + attr_accessor success: BrandDev::Models::BrandWebScrapeHTMLResponse::success + + attr_accessor url: String + + def initialize: ( + html: String, + success: BrandDev::Models::BrandWebScrapeHTMLResponse::success, + url: String + ) -> void + + def to_hash: -> { + html: String, + success: BrandDev::Models::BrandWebScrapeHTMLResponse::success, + url: String + } + + type success = true + + module Success + extend BrandDev::Internal::Type::Enum + + TRUE: true + + def self?.values: -> ::Array[BrandDev::Models::BrandWebScrapeHTMLResponse::success] + end + end + end +end diff --git a/sig/brand_dev/models/brand_web_scrape_images_params.rbs b/sig/brand_dev/models/brand_web_scrape_images_params.rbs new file mode 100644 index 0000000..daa60b3 --- /dev/null +++ b/sig/brand_dev/models/brand_web_scrape_images_params.rbs @@ -0,0 +1,20 @@ +module BrandDev + module Models + type brand_web_scrape_images_params = + { url: String } & BrandDev::Internal::Type::request_parameters + + class BrandWebScrapeImagesParams < BrandDev::Internal::Type::BaseModel + extend BrandDev::Internal::Type::RequestParameters::Converter + include BrandDev::Internal::Type::RequestParameters + + attr_accessor url: String + + def initialize: ( + url: String, + ?request_options: BrandDev::request_opts + ) -> void + + def to_hash: -> { url: String, request_options: BrandDev::RequestOptions } + end + end +end diff --git a/sig/brand_dev/models/brand_web_scrape_images_response.rbs b/sig/brand_dev/models/brand_web_scrape_images_response.rbs new file mode 100644 index 0000000..07d4fee --- /dev/null +++ b/sig/brand_dev/models/brand_web_scrape_images_response.rbs @@ -0,0 +1,98 @@ +module BrandDev + module Models + type brand_web_scrape_images_response = + { + images: ::Array[BrandDev::Models::BrandWebScrapeImagesResponse::Image], + success: BrandDev::Models::BrandWebScrapeImagesResponse::success, + url: String + } + + class BrandWebScrapeImagesResponse < BrandDev::Internal::Type::BaseModel + attr_accessor images: ::Array[BrandDev::Models::BrandWebScrapeImagesResponse::Image] + + attr_accessor success: BrandDev::Models::BrandWebScrapeImagesResponse::success + + attr_accessor url: String + + def initialize: ( + images: ::Array[BrandDev::Models::BrandWebScrapeImagesResponse::Image], + success: BrandDev::Models::BrandWebScrapeImagesResponse::success, + url: String + ) -> void + + def to_hash: -> { + images: ::Array[BrandDev::Models::BrandWebScrapeImagesResponse::Image], + success: BrandDev::Models::BrandWebScrapeImagesResponse::success, + url: String + } + + type image = + { + alt: String?, + element: BrandDev::Models::BrandWebScrapeImagesResponse::Image::element, + src: String, + type: BrandDev::Models::BrandWebScrapeImagesResponse::Image::type_ + } + + class Image < BrandDev::Internal::Type::BaseModel + attr_accessor alt: String? + + attr_accessor element: BrandDev::Models::BrandWebScrapeImagesResponse::Image::element + + attr_accessor src: String + + attr_accessor type: BrandDev::Models::BrandWebScrapeImagesResponse::Image::type_ + + def initialize: ( + alt: String?, + element: BrandDev::Models::BrandWebScrapeImagesResponse::Image::element, + src: String, + type: BrandDev::Models::BrandWebScrapeImagesResponse::Image::type_ + ) -> void + + def to_hash: -> { + alt: String?, + element: BrandDev::Models::BrandWebScrapeImagesResponse::Image::element, + src: String, + type: BrandDev::Models::BrandWebScrapeImagesResponse::Image::type_ + } + + type element = :img | :svg | :link | :source | :video + + module Element + extend BrandDev::Internal::Type::Enum + + IMG: :img + SVG: :svg + LINK: :link + SOURCE: :source + VIDEO: :video + + def self?.values: -> ::Array[BrandDev::Models::BrandWebScrapeImagesResponse::Image::element] + end + + type type_ = :url | :html | :base64 + + module Type + extend BrandDev::Internal::Type::Enum + + URL: :url + HTML: :html + BASE64: :base64 + + def self?.values: -> ::Array[BrandDev::Models::BrandWebScrapeImagesResponse::Image::type_] + end + end + + type success = true + + module Success + extend BrandDev::Internal::Type::Enum + + TRUE: true + + def self?.values: -> ::Array[BrandDev::Models::BrandWebScrapeImagesResponse::success] + end + end + end +end diff --git a/sig/brand_dev/models/brand_web_scrape_md_params.rbs b/sig/brand_dev/models/brand_web_scrape_md_params.rbs new file mode 100644 index 0000000..8e8eea2 --- /dev/null +++ b/sig/brand_dev/models/brand_web_scrape_md_params.rbs @@ -0,0 +1,36 @@ +module BrandDev + module Models + type brand_web_scrape_md_params = + { url: String, include_images: bool, include_links: bool } + & BrandDev::Internal::Type::request_parameters + + class BrandWebScrapeMdParams < BrandDev::Internal::Type::BaseModel + extend BrandDev::Internal::Type::RequestParameters::Converter + include BrandDev::Internal::Type::RequestParameters + + attr_accessor url: String + + attr_reader include_images: bool? + + def include_images=: (bool) -> bool + + attr_reader include_links: bool? + + def include_links=: (bool) -> bool + + def initialize: ( + url: String, + ?include_images: bool, + ?include_links: bool, + ?request_options: BrandDev::request_opts + ) -> void + + def to_hash: -> { + url: String, + include_images: bool, + include_links: bool, + request_options: BrandDev::RequestOptions + } + end + end +end diff --git a/sig/brand_dev/models/brand_web_scrape_md_response.rbs b/sig/brand_dev/models/brand_web_scrape_md_response.rbs new file mode 100644 index 0000000..e6db5eb --- /dev/null +++ b/sig/brand_dev/models/brand_web_scrape_md_response.rbs @@ -0,0 +1,40 @@ +module BrandDev + module Models + type brand_web_scrape_md_response = + { + markdown: String, + success: BrandDev::Models::BrandWebScrapeMdResponse::success, + url: String + } + + class BrandWebScrapeMdResponse < BrandDev::Internal::Type::BaseModel + attr_accessor markdown: String + + attr_accessor success: BrandDev::Models::BrandWebScrapeMdResponse::success + + attr_accessor url: String + + def initialize: ( + markdown: String, + success: BrandDev::Models::BrandWebScrapeMdResponse::success, + url: String + ) -> void + + def to_hash: -> { + markdown: String, + success: BrandDev::Models::BrandWebScrapeMdResponse::success, + url: String + } + + type success = true + + module Success + extend BrandDev::Internal::Type::Enum + + TRUE: true + + def self?.values: -> ::Array[BrandDev::Models::BrandWebScrapeMdResponse::success] + end + end + end +end diff --git a/sig/brand_dev/models/brand_web_scrape_sitemap_params.rbs b/sig/brand_dev/models/brand_web_scrape_sitemap_params.rbs new file mode 100644 index 0000000..10ef7a1 --- /dev/null +++ b/sig/brand_dev/models/brand_web_scrape_sitemap_params.rbs @@ -0,0 +1,23 @@ +module BrandDev + module Models + type brand_web_scrape_sitemap_params = + { domain: String } & BrandDev::Internal::Type::request_parameters + + class BrandWebScrapeSitemapParams < BrandDev::Internal::Type::BaseModel + extend BrandDev::Internal::Type::RequestParameters::Converter + include BrandDev::Internal::Type::RequestParameters + + attr_accessor domain: String + + def initialize: ( + domain: String, + ?request_options: BrandDev::request_opts + ) -> void + + def to_hash: -> { + domain: String, + request_options: BrandDev::RequestOptions + } + end + end +end diff --git a/sig/brand_dev/models/brand_web_scrape_sitemap_response.rbs b/sig/brand_dev/models/brand_web_scrape_sitemap_response.rbs new file mode 100644 index 0000000..dc249ab --- /dev/null +++ b/sig/brand_dev/models/brand_web_scrape_sitemap_response.rbs @@ -0,0 +1,77 @@ +module BrandDev + module Models + type brand_web_scrape_sitemap_response = + { + domain: String, + meta: BrandDev::Models::BrandWebScrapeSitemapResponse::Meta, + success: BrandDev::Models::BrandWebScrapeSitemapResponse::success, + urls: ::Array[String] + } + + class BrandWebScrapeSitemapResponse < BrandDev::Internal::Type::BaseModel + attr_accessor domain: String + + attr_accessor meta: BrandDev::Models::BrandWebScrapeSitemapResponse::Meta + + attr_accessor success: BrandDev::Models::BrandWebScrapeSitemapResponse::success + + attr_accessor urls: ::Array[String] + + def initialize: ( + domain: String, + meta: BrandDev::Models::BrandWebScrapeSitemapResponse::Meta, + success: BrandDev::Models::BrandWebScrapeSitemapResponse::success, + urls: ::Array[String] + ) -> void + + def to_hash: -> { + domain: String, + meta: BrandDev::Models::BrandWebScrapeSitemapResponse::Meta, + success: BrandDev::Models::BrandWebScrapeSitemapResponse::success, + urls: ::Array[String] + } + + type meta = + { + errors: Integer, + sitemaps_discovered: Integer, + sitemaps_fetched: Integer, + sitemaps_skipped: Integer + } + + class Meta < BrandDev::Internal::Type::BaseModel + attr_accessor errors: Integer + + attr_accessor sitemaps_discovered: Integer + + attr_accessor sitemaps_fetched: Integer + + attr_accessor sitemaps_skipped: Integer + + def initialize: ( + errors: Integer, + sitemaps_discovered: Integer, + sitemaps_fetched: Integer, + sitemaps_skipped: Integer + ) -> void + + def to_hash: -> { + errors: Integer, + sitemaps_discovered: Integer, + sitemaps_fetched: Integer, + sitemaps_skipped: Integer + } + end + + type success = true + + module Success + extend BrandDev::Internal::Type::Enum + + TRUE: true + + def self?.values: -> ::Array[BrandDev::Models::BrandWebScrapeSitemapResponse::success] + end + end + end +end diff --git a/sig/brand_dev/resources/brand.rbs b/sig/brand_dev/resources/brand.rbs index f591b56..f91712c 100644 --- a/sig/brand_dev/resources/brand.rbs +++ b/sig/brand_dev/resources/brand.rbs @@ -123,6 +123,28 @@ module BrandDev ?request_options: BrandDev::request_opts ) -> BrandDev::Models::BrandStyleguideResponse + def web_scrape_html: ( + url: String, + ?request_options: BrandDev::request_opts + ) -> BrandDev::Models::BrandWebScrapeHTMLResponse + + def web_scrape_images: ( + url: String, + ?request_options: BrandDev::request_opts + ) -> BrandDev::Models::BrandWebScrapeImagesResponse + + def web_scrape_md: ( + url: String, + ?include_images: bool, + ?include_links: bool, + ?request_options: BrandDev::request_opts + ) -> BrandDev::Models::BrandWebScrapeMdResponse + + def web_scrape_sitemap: ( + domain: String, + ?request_options: BrandDev::request_opts + ) -> BrandDev::Models::BrandWebScrapeSitemapResponse + def initialize: (client: BrandDev::Client) -> void end end diff --git a/test/brand_dev/resources/brand_test.rb b/test/brand_dev/resources/brand_test.rb index 00a8b5c..19dac7f 100644 --- a/test/brand_dev/resources/brand_test.rb +++ b/test/brand_dev/resources/brand_test.rb @@ -305,4 +305,77 @@ def test_styleguide_required_params } end end + + def test_web_scrape_html_required_params + skip("Mock server tests are disabled") + + response = @brand_dev.brand.web_scrape_html(url: "https://example.com") + + assert_pattern do + response => BrandDev::Models::BrandWebScrapeHTMLResponse + end + + assert_pattern do + response => { + html: String, + success: BrandDev::Models::BrandWebScrapeHTMLResponse::Success, + url: String + } + end + end + + def test_web_scrape_images_required_params + skip("Mock server tests are disabled") + + response = @brand_dev.brand.web_scrape_images(url: "https://example.com") + + assert_pattern do + response => BrandDev::Models::BrandWebScrapeImagesResponse + end + + assert_pattern do + response => { + images: ^(BrandDev::Internal::Type::ArrayOf[BrandDev::Models::BrandWebScrapeImagesResponse::Image]), + success: BrandDev::Models::BrandWebScrapeImagesResponse::Success, + url: String + } + end + end + + def test_web_scrape_md_required_params + skip("Mock server tests are disabled") + + response = @brand_dev.brand.web_scrape_md(url: "https://example.com") + + assert_pattern do + response => BrandDev::Models::BrandWebScrapeMdResponse + end + + assert_pattern do + response => { + markdown: String, + success: BrandDev::Models::BrandWebScrapeMdResponse::Success, + url: String + } + end + end + + def test_web_scrape_sitemap_required_params + skip("Mock server tests are disabled") + + response = @brand_dev.brand.web_scrape_sitemap(domain: "domain") + + assert_pattern do + response => BrandDev::Models::BrandWebScrapeSitemapResponse + end + + assert_pattern do + response => { + domain: String, + meta: BrandDev::Models::BrandWebScrapeSitemapResponse::Meta, + success: BrandDev::Models::BrandWebScrapeSitemapResponse::Success, + urls: ^(BrandDev::Internal::Type::ArrayOf[String]) + } + end + end end From 031246772b8cb26dd7b5223f9bf1232e13f43442 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:14:45 +0000 Subject: [PATCH 3/3] release: 0.26.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/brand_dev/version.rb | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a36746b..caf5ca3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.25.0" + ".": "0.26.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9769c21..e654ff7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.26.0 (2026-02-23) + +Full Changelog: [v0.25.0...v0.26.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.25.0...v0.26.0) + +### Features + +* **api:** manual updates ([bfe9b29](https://github.com/brand-dot-dev/ruby-sdk/commit/bfe9b298f2c51f4d2762da550344251c2b0b7256)) + ## 0.25.0 (2026-02-22) Full Changelog: [v0.24.0...v0.25.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.24.0...v0.25.0) diff --git a/Gemfile.lock b/Gemfile.lock index b751cd3..957c9ae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - brand.dev (0.25.0) + brand.dev (0.26.0) cgi connection_pool diff --git a/README.md b/README.md index 4b89fde..b46adeb 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "brand.dev", "~> 0.25.0" +gem "brand.dev", "~> 0.26.0" ``` diff --git a/lib/brand_dev/version.rb b/lib/brand_dev/version.rb index 5967e71..7b13d7d 100644 --- a/lib/brand_dev/version.rb +++ b/lib/brand_dev/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module BrandDev - VERSION = "0.25.0" + VERSION = "0.26.0" end