From bfc24de9965adc6edd585b2491990771c6930306 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 12 Apr 2026 14:45:28 +0000 Subject: [PATCH 01/25] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 998ed687..e39c396c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-5ee7a321f8e01d2678d56277f011f71294c2b8ac4d0cff0bda412362c0d9cf73.yml -openapi_spec_hash: bf5d57e3bddb6975770cf85c267b5035 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-1d064d1bca27e031f7d9b542b011714fb6bbe06cd96b7884ed1df1b2dd8274eb.yml +openapi_spec_hash: c92f8ae2943fcaf6bddcb605354bce8e config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce From 9761d7d2aa1d54853138fd081ff9b664fda750b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 12 Apr 2026 14:52:49 +0000 Subject: [PATCH 02/25] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e39c396c..d6aa2858 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-1d064d1bca27e031f7d9b542b011714fb6bbe06cd96b7884ed1df1b2dd8274eb.yml -openapi_spec_hash: c92f8ae2943fcaf6bddcb605354bce8e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-a53e98e50a4e63511e7a494eb64d3b0617cfdb539353c0b369ba26fe38e2c069.yml +openapi_spec_hash: 2154f043db9fb371566745e96e9cc11b config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce From 6132fa4d45fd9efe68933332f908789b9ebcdbe9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 12 Apr 2026 14:57:55 +0000 Subject: [PATCH 03/25] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d6aa2858..6b1d08ed 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-a53e98e50a4e63511e7a494eb64d3b0617cfdb539353c0b369ba26fe38e2c069.yml -openapi_spec_hash: 2154f043db9fb371566745e96e9cc11b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-614b5e75731f2517a8000093185b13a53a57712f9b76fd206788ccd6f0bcef45.yml +openapi_spec_hash: 782af9c10f9fad64198c366929c66add config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce From e061d10c073bfc375f26f1eecf9c2452d461130c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 12 Apr 2026 21:17:26 +0000 Subject: [PATCH 04/25] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6b1d08ed..95c414d5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-614b5e75731f2517a8000093185b13a53a57712f9b76fd206788ccd6f0bcef45.yml -openapi_spec_hash: 782af9c10f9fad64198c366929c66add +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-8c7755d44545e3f10ee595024c331242e5428ba79df4710c8e02e8802219d3b6.yml +openapi_spec_hash: 699ef094c46d731c3234408056b06aef config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce From 4e74fe3f395778efb1ca3f1e752f2f71e21a3191 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Apr 2026 14:41:24 +0000 Subject: [PATCH 05/25] feat(api): api update --- .stats.yml | 4 +- .../style_extract_styleguide_response.rb | 72 ++++++++- .../style_extract_styleguide_response.rbi | 138 ++++++++++++++++++ .../style_extract_styleguide_response.rbs | 52 +++++++ 4 files changed, 263 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 95c414d5..c6a749e7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-8c7755d44545e3f10ee595024c331242e5428ba79df4710c8e02e8802219d3b6.yml -openapi_spec_hash: 699ef094c46d731c3234408056b06aef +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-86caee6743259bcab1e72868d17acdfc8a515d51b6d9b1e9a1dca49cdd3bd8da.yml +openapi_spec_hash: c0855025a8590139f57db43dd3e1bad1 config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce diff --git a/lib/context_dev/models/style_extract_styleguide_response.rb b/lib/context_dev/models/style_extract_styleguide_response.rb index 72ef6390..47f3c214 100644 --- a/lib/context_dev/models/style_extract_styleguide_response.rb +++ b/lib/context_dev/models/style_extract_styleguide_response.rb @@ -59,6 +59,16 @@ class Styleguide < ContextDev::Internal::Type::BaseModel -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing }, api_name: :elementSpacing + # @!attribute font_links + # Font assets keyed by family name as it appears in fontFamily/fontFallbacks + # (non-generic names only). Clients match typography.fontFamily / fontWeight or + # button styles to pick a file URL from files. + # + # @return [Hash{Symbol=>ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink}] + required :font_links, + -> { ContextDev::Internal::Type::HashOf[ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink] }, + api_name: :fontLinks + # @!attribute mode # The primary color mode of the website design # @@ -77,7 +87,11 @@ class Styleguide < ContextDev::Internal::Type::BaseModel # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography] required :typography, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography } - # @!method initialize(colors:, components:, element_spacing:, mode:, shadows:, typography:) + # @!method initialize(colors:, components:, element_spacing:, font_links:, mode:, shadows:, typography:) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::StyleExtractStyleguideResponse::Styleguide} for more + # details. + # # Comprehensive styleguide data extracted from the website # # @param colors [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors] Primary colors used on the website @@ -86,6 +100,8 @@ class Styleguide < ContextDev::Internal::Type::BaseModel # # @param element_spacing [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing] Spacing system used on the website # + # @param font_links [Hash{Symbol=>ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink}] Font assets keyed by family name as it appears in fontFamily/fontFallbacks (non- + # # @param mode [Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode] The primary color mode of the website design # # @param shadows [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows] Shadow styles used on the website @@ -694,6 +710,60 @@ class ElementSpacing < ContextDev::Internal::Type::BaseModel # @param xs [String] end + class FontLink < ContextDev::Internal::Type::BaseModel + # @!attribute files + # Upright font files keyed by weight string (e.g. "400" for regular, "500", + # "700"). Values are absolute URLs. + # + # @return [Hash{Symbol=>String}] + required :files, ContextDev::Internal::Type::HashOf[String] + + # @!attribute type + # + # @return [Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type] + required :type, + enum: -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type } + + # @!attribute category + # Google Fonts category when type is google (e.g. sans-serif, serif, monospace, + # display, handwriting). Omitted for custom fonts when unknown. + # + # @return [String, nil] + optional :category, String + + # @!attribute display_name + # Present when type is custom: human-readable name derived from the fontLinks key + # (strip build/hash suffixes, split camelCase / PascalCase, normalize separators). + # Google entries omit this. + # + # @return [String, nil] + optional :display_name, String, api_name: :displayName + + # @!method initialize(files:, type:, category: nil, display_name: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink} for + # more details. + # + # @param files [Hash{Symbol=>String}] Upright font files keyed by weight string (e.g. "400" for regular, "500", "700") + # + # @param type [Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type] + # + # @param category [String] Google Fonts category when type is google (e.g. sans-serif, serif, monospace, di + # + # @param display_name [String] Present when type is custom: human-readable name derived from the fontLinks key + + # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink#type + module Type + extend ContextDev::Internal::Type::Enum + + GOOGLE = :google + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + end + # The primary color mode of the website design # # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide#mode diff --git a/rbi/context_dev/models/style_extract_styleguide_response.rbi b/rbi/context_dev/models/style_extract_styleguide_response.rbi index 3078d93b..8608e338 100644 --- a/rbi/context_dev/models/style_extract_styleguide_response.rbi +++ b/rbi/context_dev/models/style_extract_styleguide_response.rbi @@ -142,6 +142,19 @@ module ContextDev end attr_writer :element_spacing + # Font assets keyed by family name as it appears in fontFamily/fontFallbacks + # (non-generic names only). Clients match typography.fontFamily / fontWeight or + # button styles to pick a file URL from files. + sig do + returns( + T::Hash[ + Symbol, + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink + ] + ) + end + attr_accessor :font_links + # The primary color mode of the website design sig do returns( @@ -191,6 +204,11 @@ module ContextDev ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::OrHash, element_spacing: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing::OrHash, + font_links: + T::Hash[ + Symbol, + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::OrHash + ], mode: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode::OrSymbol, shadows: @@ -206,6 +224,10 @@ module ContextDev components:, # Spacing system used on the website element_spacing:, + # Font assets keyed by family name as it appears in fontFamily/fontFallbacks + # (non-generic names only). Clients match typography.fontFamily / fontWeight or + # button styles to pick a file URL from files. + font_links:, # The primary color mode of the website design mode:, # Shadow styles used on the website @@ -224,6 +246,11 @@ module ContextDev ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components, element_spacing: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing, + font_links: + T::Hash[ + Symbol, + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink + ], mode: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode::TaggedSymbol, shadows: @@ -1048,6 +1075,117 @@ module ContextDev end end + class FontLink < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink, + ContextDev::Internal::AnyHash + ) + end + + # Upright font files keyed by weight string (e.g. "400" for regular, "500", + # "700"). Values are absolute URLs. + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :files + + sig do + returns( + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Google Fonts category when type is google (e.g. sans-serif, serif, monospace, + # display, handwriting). Omitted for custom fonts when unknown. + sig { returns(T.nilable(String)) } + attr_reader :category + + sig { params(category: String).void } + attr_writer :category + + # Present when type is custom: human-readable name derived from the fontLinks key + # (strip build/hash suffixes, split camelCase / PascalCase, normalize separators). + # Google entries omit this. + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + sig do + params( + files: T::Hash[Symbol, String], + type: + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type::OrSymbol, + category: String, + display_name: String + ).returns(T.attached_class) + end + def self.new( + # Upright font files keyed by weight string (e.g. "400" for regular, "500", + # "700"). Values are absolute URLs. + files:, + type:, + # Google Fonts category when type is google (e.g. sans-serif, serif, monospace, + # display, handwriting). Omitted for custom fonts when unknown. + category: nil, + # Present when type is custom: human-readable name derived from the fontLinks key + # (strip build/hash suffixes, split camelCase / PascalCase, normalize separators). + # Google entries omit this. + display_name: nil + ) + end + + sig do + override.returns( + { + files: T::Hash[Symbol, String], + type: + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type::TaggedSymbol, + category: String, + display_name: String + } + ) + end + def to_hash + end + + module Type + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GOOGLE = + T.let( + :google, + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + # The primary color mode of the website design module Mode extend ContextDev::Internal::Type::Enum diff --git a/sig/context_dev/models/style_extract_styleguide_response.rbs b/sig/context_dev/models/style_extract_styleguide_response.rbs index 87b08dd5..eb841450 100644 --- a/sig/context_dev/models/style_extract_styleguide_response.rbs +++ b/sig/context_dev/models/style_extract_styleguide_response.rbs @@ -46,6 +46,7 @@ module ContextDev colors: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors, components: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components, element_spacing: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing, + font_links: ::Hash[Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink], mode: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::mode, shadows: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows, typography: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography @@ -58,6 +59,8 @@ module ContextDev attr_accessor element_spacing: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing + attr_accessor font_links: ::Hash[Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink] + attr_accessor mode: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::mode attr_accessor shadows: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows @@ -68,6 +71,7 @@ module ContextDev colors: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors, components: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components, element_spacing: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing, + font_links: ::Hash[Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink], mode: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::mode, shadows: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows, typography: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography @@ -77,6 +81,7 @@ module ContextDev colors: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors, components: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components, element_spacing: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing, + font_links: ::Hash[Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink], mode: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::mode, shadows: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows, typography: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography @@ -562,6 +567,53 @@ module ContextDev } end + type font_link = + { + files: ::Hash[Symbol, String], + type: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::type_, + category: String, + display_name: String + } + + class FontLink < ContextDev::Internal::Type::BaseModel + attr_accessor files: ::Hash[Symbol, String] + + attr_accessor type: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::type_ + + attr_reader category: String? + + def category=: (String) -> String + + attr_reader display_name: String? + + def display_name=: (String) -> String + + def initialize: ( + files: ::Hash[Symbol, String], + type: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::type_, + ?category: String, + ?display_name: String + ) -> void + + def to_hash: -> { + files: ::Hash[Symbol, String], + type: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::type_, + category: String, + display_name: String + } + + type type_ = :google | :custom + + module Type + extend ContextDev::Internal::Type::Enum + + GOOGLE: :google + CUSTOM: :custom + + def self?.values: -> ::Array[ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::type_] + end + end + type mode = :light | :dark module Mode From b09024fa19c7aecafaf4fe4bd211bfc3738484ed Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 01:20:43 +0000 Subject: [PATCH 06/25] feat(api): api update --- .stats.yml | 4 ++-- .../models/web_web_scrape_html_params.rb | 15 +++++++++++++- .../models/web_web_scrape_md_params.rb | 12 ++++++++++- lib/context_dev/resources/web.rb | 14 ++++++++++--- .../models/web_web_scrape_html_params.rbi | 20 ++++++++++++++++++- .../models/web_web_scrape_md_params.rbi | 15 ++++++++++++++ rbi/context_dev/resources/web.rbi | 10 ++++++++++ .../models/web_web_scrape_html_params.rbs | 9 ++++++++- .../models/web_web_scrape_md_params.rbs | 7 +++++++ sig/context_dev/resources/web.rbs | 2 ++ 10 files changed, 99 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index c6a749e7..1cbf4b78 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-86caee6743259bcab1e72868d17acdfc8a515d51b6d9b1e9a1dca49cdd3bd8da.yml -openapi_spec_hash: c0855025a8590139f57db43dd3e1bad1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-955fa0d672331fb3f8b40547895bfdd1e490add254ca13db769289d3bef2ed44.yml +openapi_spec_hash: 32eca3166fb8f369c9241faf4cee3077 config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce diff --git a/lib/context_dev/models/web_web_scrape_html_params.rb b/lib/context_dev/models/web_web_scrape_html_params.rb index 837e5cbe..96b5e303 100644 --- a/lib/context_dev/models/web_web_scrape_html_params.rb +++ b/lib/context_dev/models/web_web_scrape_html_params.rb @@ -13,9 +13,22 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # @return [String] required :url, String - # @!method initialize(url:, request_options: {}) + # @!attribute max_age_ms + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Set to 0 to always scrape fresh. + # + # @return [Integer, nil] + optional :max_age_ms, Integer + + # @!method initialize(url:, max_age_ms: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebWebScrapeHTMLParams} for more details. + # # @param url [String] Full URL to scrape (must include http:// or https:// protocol) # + # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/context_dev/models/web_web_scrape_md_params.rb b/lib/context_dev/models/web_web_scrape_md_params.rb index c483a3ff..fc13e308 100644 --- a/lib/context_dev/models/web_web_scrape_md_params.rb +++ b/lib/context_dev/models/web_web_scrape_md_params.rb @@ -26,6 +26,14 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :include_links, ContextDev::Internal::Type::Boolean + # @!attribute max_age_ms + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Set to 0 to always scrape fresh. + # + # @return [Integer, nil] + optional :max_age_ms, Integer + # @!attribute shorten_base64_images # Shorten base64-encoded image data in the Markdown output # @@ -39,7 +47,7 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :use_main_content_only, ContextDev::Internal::Type::Boolean - # @!method initialize(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {}) + # @!method initialize(url:, include_images: nil, include_links: nil, max_age_ms: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeMdParams} for more details. # @@ -49,6 +57,8 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # # @param include_links [Boolean] Preserve hyperlinks in Markdown output # + # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y + # # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output # # @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars, diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index 80d8e966..f246a131 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -84,12 +84,17 @@ def web_crawl_md(params) ) end + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebWebScrapeHTMLParams} for more details. + # # Scrapes the given URL and returns the raw HTML content of the page. # - # @overload web_scrape_html(url:, request_options: {}) + # @overload web_scrape_html(url:, max_age_ms: nil, request_options: {}) # # @param url [String] Full URL to scrape (must include http:// or https:// protocol) # + # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [ContextDev::Models::WebWebScrapeHTMLResponse] @@ -101,7 +106,7 @@ def web_scrape_html(params) @client.request( method: :get, path: "web/scrape/html", - query: query, + query: query.transform_keys(max_age_ms: "maxAgeMs"), model: ContextDev::Models::WebWebScrapeHTMLResponse, options: options ) @@ -138,7 +143,7 @@ def web_scrape_images(params) # Scrapes the given URL, converts the HTML content to Markdown, and returns the # result. # - # @overload web_scrape_md(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {}) + # @overload web_scrape_md(url:, include_images: nil, include_links: nil, max_age_ms: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {}) # # @param url [String] Full URL to scrape and convert to markdown (must include http:// or https:// pro # @@ -146,6 +151,8 @@ def web_scrape_images(params) # # @param include_links [Boolean] Preserve hyperlinks in Markdown output # + # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y + # # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output # # @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars, @@ -164,6 +171,7 @@ def web_scrape_md(params) query: query.transform_keys( include_images: "includeImages", include_links: "includeLinks", + max_age_ms: "maxAgeMs", shorten_base64_images: "shortenBase64Images", use_main_content_only: "useMainContentOnly" ), diff --git a/rbi/context_dev/models/web_web_scrape_html_params.rbi b/rbi/context_dev/models/web_web_scrape_html_params.rbi index 87d62926..7067d492 100644 --- a/rbi/context_dev/models/web_web_scrape_html_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_html_params.rbi @@ -18,22 +18,40 @@ module ContextDev sig { returns(String) } attr_accessor :url + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Set to 0 to always scrape fresh. + sig { returns(T.nilable(Integer)) } + attr_reader :max_age_ms + + sig { params(max_age_ms: Integer).void } + attr_writer :max_age_ms + sig do params( url: String, + max_age_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( # Full URL to scrape (must include http:// or https:// protocol) url:, + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Set to 0 to always scrape fresh. + max_age_ms: nil, request_options: {} ) end sig do override.returns( - { url: String, request_options: ContextDev::RequestOptions } + { + url: String, + max_age_ms: Integer, + request_options: ContextDev::RequestOptions + } ) end def to_hash diff --git a/rbi/context_dev/models/web_web_scrape_md_params.rbi b/rbi/context_dev/models/web_web_scrape_md_params.rbi index 7f086479..67d3387a 100644 --- a/rbi/context_dev/models/web_web_scrape_md_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_md_params.rbi @@ -30,6 +30,15 @@ module ContextDev sig { params(include_links: T::Boolean).void } attr_writer :include_links + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Set to 0 to always scrape fresh. + sig { returns(T.nilable(Integer)) } + attr_reader :max_age_ms + + sig { params(max_age_ms: Integer).void } + attr_writer :max_age_ms + # Shorten base64-encoded image data in the Markdown output sig { returns(T.nilable(T::Boolean)) } attr_reader :shorten_base64_images @@ -50,6 +59,7 @@ module ContextDev url: String, include_images: T::Boolean, include_links: T::Boolean, + max_age_ms: Integer, shorten_base64_images: T::Boolean, use_main_content_only: T::Boolean, request_options: ContextDev::RequestOptions::OrHash @@ -63,6 +73,10 @@ module ContextDev include_images: nil, # Preserve hyperlinks in Markdown output include_links: nil, + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Set to 0 to always scrape fresh. + max_age_ms: nil, # Shorten base64-encoded image data in the Markdown output shorten_base64_images: nil, # Extract only the main content of the page, excluding headers, footers, sidebars, @@ -78,6 +92,7 @@ module ContextDev url: String, include_images: T::Boolean, include_links: T::Boolean, + max_age_ms: Integer, shorten_base64_images: T::Boolean, use_main_content_only: T::Boolean, request_options: ContextDev::RequestOptions diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index 80ce6522..fca9ba85 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -92,12 +92,17 @@ module ContextDev sig do params( url: String, + max_age_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeHTMLResponse) end def web_scrape_html( # Full URL to scrape (must include http:// or https:// protocol) url:, + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Set to 0 to always scrape fresh. + max_age_ms: nil, request_options: {} ) end @@ -125,6 +130,7 @@ module ContextDev url: String, include_images: T::Boolean, include_links: T::Boolean, + max_age_ms: Integer, shorten_base64_images: T::Boolean, use_main_content_only: T::Boolean, request_options: ContextDev::RequestOptions::OrHash @@ -138,6 +144,10 @@ module ContextDev include_images: nil, # Preserve hyperlinks in Markdown output include_links: nil, + # Return a cached result if a prior scrape for the same parameters exists and is + # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + # omitted. Set to 0 to always scrape fresh. + max_age_ms: nil, # Shorten base64-encoded image data in the Markdown output shorten_base64_images: nil, # Extract only the main content of the page, excluding headers, footers, sidebars, diff --git a/sig/context_dev/models/web_web_scrape_html_params.rbs b/sig/context_dev/models/web_web_scrape_html_params.rbs index 343dc814..6140c451 100644 --- a/sig/context_dev/models/web_web_scrape_html_params.rbs +++ b/sig/context_dev/models/web_web_scrape_html_params.rbs @@ -1,7 +1,8 @@ module ContextDev module Models type web_web_scrape_html_params = - { url: String } & ContextDev::Internal::Type::request_parameters + { url: String, max_age_ms: Integer } + & ContextDev::Internal::Type::request_parameters class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel extend ContextDev::Internal::Type::RequestParameters::Converter @@ -9,13 +10,19 @@ module ContextDev attr_accessor url: String + attr_reader max_age_ms: Integer? + + def max_age_ms=: (Integer) -> Integer + def initialize: ( url: String, + ?max_age_ms: Integer, ?request_options: ContextDev::request_opts ) -> void def to_hash: -> { url: String, + max_age_ms: Integer, request_options: ContextDev::RequestOptions } end diff --git a/sig/context_dev/models/web_web_scrape_md_params.rbs b/sig/context_dev/models/web_web_scrape_md_params.rbs index 1d1c2d41..c9fe083f 100644 --- a/sig/context_dev/models/web_web_scrape_md_params.rbs +++ b/sig/context_dev/models/web_web_scrape_md_params.rbs @@ -5,6 +5,7 @@ module ContextDev url: String, include_images: bool, include_links: bool, + max_age_ms: Integer, :shorten_base64_images => bool, use_main_content_only: bool } @@ -24,6 +25,10 @@ module ContextDev def include_links=: (bool) -> bool + attr_reader max_age_ms: Integer? + + def max_age_ms=: (Integer) -> Integer + attr_reader shorten_base64_images: bool? def shorten_base64_images=: (bool) -> bool @@ -36,6 +41,7 @@ module ContextDev url: String, ?include_images: bool, ?include_links: bool, + ?max_age_ms: Integer, ?shorten_base64_images: bool, ?use_main_content_only: bool, ?request_options: ContextDev::request_opts @@ -45,6 +51,7 @@ module ContextDev url: String, include_images: bool, include_links: bool, + max_age_ms: Integer, :shorten_base64_images => bool, use_main_content_only: bool, request_options: ContextDev::RequestOptions diff --git a/sig/context_dev/resources/web.rbs b/sig/context_dev/resources/web.rbs index 46e42e0d..a309c3b9 100644 --- a/sig/context_dev/resources/web.rbs +++ b/sig/context_dev/resources/web.rbs @@ -25,6 +25,7 @@ module ContextDev def web_scrape_html: ( url: String, + ?max_age_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeHTMLResponse @@ -37,6 +38,7 @@ module ContextDev url: String, ?include_images: bool, ?include_links: bool, + ?max_age_ms: Integer, ?shorten_base64_images: bool, ?use_main_content_only: bool, ?request_options: ContextDev::request_opts From 7b5ddec0b8e306df34a72ccd39e8d731168a62ea Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 01:37:03 +0000 Subject: [PATCH 07/25] feat(api): api update --- .stats.yml | 4 ++-- lib/context_dev/models/web_web_scrape_html_params.rb | 2 +- rbi/context_dev/models/web_web_scrape_html_params.rbi | 4 ++-- rbi/context_dev/resources/web.rbi | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1cbf4b78..7be40e14 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-955fa0d672331fb3f8b40547895bfdd1e490add254ca13db769289d3bef2ed44.yml -openapi_spec_hash: 32eca3166fb8f369c9241faf4cee3077 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-c023cdf4ae403e8c32724869eff157cb24d4436b7c048809571c41f08dd20e03.yml +openapi_spec_hash: b92878e27bdb184e1506f4baf3280118 config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce diff --git a/lib/context_dev/models/web_web_scrape_html_params.rb b/lib/context_dev/models/web_web_scrape_html_params.rb index 96b5e303..de82101e 100644 --- a/lib/context_dev/models/web_web_scrape_html_params.rb +++ b/lib/context_dev/models/web_web_scrape_html_params.rb @@ -16,7 +16,7 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # @!attribute max_age_ms # Return a cached result if a prior scrape for the same parameters exists and is # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - # omitted. Set to 0 to always scrape fresh. + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. # # @return [Integer, nil] optional :max_age_ms, Integer diff --git a/rbi/context_dev/models/web_web_scrape_html_params.rbi b/rbi/context_dev/models/web_web_scrape_html_params.rbi index 7067d492..781570fd 100644 --- a/rbi/context_dev/models/web_web_scrape_html_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_html_params.rbi @@ -20,7 +20,7 @@ module ContextDev # Return a cached result if a prior scrape for the same parameters exists and is # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - # omitted. Set to 0 to always scrape fresh. + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. sig { returns(T.nilable(Integer)) } attr_reader :max_age_ms @@ -39,7 +39,7 @@ module ContextDev url:, # Return a cached result if a prior scrape for the same parameters exists and is # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - # omitted. Set to 0 to always scrape fresh. + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. max_age_ms: nil, request_options: {} ) diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index fca9ba85..90f142b6 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -101,7 +101,7 @@ module ContextDev url:, # Return a cached result if a prior scrape for the same parameters exists and is # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - # omitted. Set to 0 to always scrape fresh. + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. max_age_ms: nil, request_options: {} ) From 8b33b1ee26acc8314d9c285ea53e3531ba390a16 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 01:45:25 +0000 Subject: [PATCH 08/25] feat(api): api update --- .stats.yml | 4 ++-- lib/context_dev/models/web_web_scrape_md_params.rb | 6 +++--- lib/context_dev/resources/web.rb | 5 ++--- rbi/context_dev/models/web_web_scrape_md_params.rbi | 8 ++++---- rbi/context_dev/resources/web.rbi | 7 +++---- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7be40e14..2ddea68e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-c023cdf4ae403e8c32724869eff157cb24d4436b7c048809571c41f08dd20e03.yml -openapi_spec_hash: b92878e27bdb184e1506f4baf3280118 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-8ef1d8ed8ceacb8e8e73a5b6069c63adc9c0fd74d9b9aa9dee8b218cf94eac41.yml +openapi_spec_hash: 5271c711707ccf1deb2a47e0fb1119b7 config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce diff --git a/lib/context_dev/models/web_web_scrape_md_params.rb b/lib/context_dev/models/web_web_scrape_md_params.rb index fc13e308..3303725d 100644 --- a/lib/context_dev/models/web_web_scrape_md_params.rb +++ b/lib/context_dev/models/web_web_scrape_md_params.rb @@ -8,7 +8,7 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel include ContextDev::Internal::Type::RequestParameters # @!attribute url - # Full URL to scrape and convert to markdown (must include http:// or https:// + # Full URL to scrape into LLM usable Markdown (must include http:// or https:// # protocol) # # @return [String] @@ -29,7 +29,7 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # @!attribute max_age_ms # Return a cached result if a prior scrape for the same parameters exists and is # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - # omitted. Set to 0 to always scrape fresh. + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. # # @return [Integer, nil] optional :max_age_ms, Integer @@ -51,7 +51,7 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeMdParams} for more details. # - # @param url [String] Full URL to scrape and convert to markdown (must include http:// or https:// pro + # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr # # @param include_images [Boolean] Include image references in Markdown output # diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index f246a131..64b5cf0c 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -140,12 +140,11 @@ def web_scrape_images(params) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeMdParams} for more details. # - # Scrapes the given URL, converts the HTML content to Markdown, and returns the - # result. + # Scrapes the given URL into LLM usable Markdown. # # @overload web_scrape_md(url:, include_images: nil, include_links: nil, max_age_ms: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {}) # - # @param url [String] Full URL to scrape and convert to markdown (must include http:// or https:// pro + # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr # # @param include_images [Boolean] Include image references in Markdown output # diff --git a/rbi/context_dev/models/web_web_scrape_md_params.rbi b/rbi/context_dev/models/web_web_scrape_md_params.rbi index 67d3387a..3439d5c2 100644 --- a/rbi/context_dev/models/web_web_scrape_md_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_md_params.rbi @@ -11,7 +11,7 @@ module ContextDev T.any(ContextDev::WebWebScrapeMdParams, ContextDev::Internal::AnyHash) end - # Full URL to scrape and convert to markdown (must include http:// or https:// + # Full URL to scrape into LLM usable Markdown (must include http:// or https:// # protocol) sig { returns(String) } attr_accessor :url @@ -32,7 +32,7 @@ module ContextDev # Return a cached result if a prior scrape for the same parameters exists and is # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - # omitted. Set to 0 to always scrape fresh. + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. sig { returns(T.nilable(Integer)) } attr_reader :max_age_ms @@ -66,7 +66,7 @@ module ContextDev ).returns(T.attached_class) end def self.new( - # Full URL to scrape and convert to markdown (must include http:// or https:// + # Full URL to scrape into LLM usable Markdown (must include http:// or https:// # protocol) url:, # Include image references in Markdown output @@ -75,7 +75,7 @@ module ContextDev include_links: nil, # Return a cached result if a prior scrape for the same parameters exists and is # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - # omitted. Set to 0 to always scrape fresh. + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. max_age_ms: nil, # Shorten base64-encoded image data in the Markdown output shorten_base64_images: nil, diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index 90f142b6..566809e0 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -123,8 +123,7 @@ module ContextDev ) end - # Scrapes the given URL, converts the HTML content to Markdown, and returns the - # result. + # Scrapes the given URL into LLM usable Markdown. sig do params( url: String, @@ -137,7 +136,7 @@ module ContextDev ).returns(ContextDev::Models::WebWebScrapeMdResponse) end def web_scrape_md( - # Full URL to scrape and convert to markdown (must include http:// or https:// + # Full URL to scrape into LLM usable Markdown (must include http:// or https:// # protocol) url:, # Include image references in Markdown output @@ -146,7 +145,7 @@ module ContextDev include_links: nil, # Return a cached result if a prior scrape for the same parameters exists and is # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - # omitted. Set to 0 to always scrape fresh. + # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. max_age_ms: nil, # Shorten base64-encoded image data in the Markdown output shorten_base64_images: nil, From f359256efa5fb0086193d38587c17a626cf9a79d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 01:57:06 +0000 Subject: [PATCH 09/25] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2ddea68e..88a619f3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-8ef1d8ed8ceacb8e8e73a5b6069c63adc9c0fd74d9b9aa9dee8b218cf94eac41.yml -openapi_spec_hash: 5271c711707ccf1deb2a47e0fb1119b7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-6358650aa8bbd5ba9a423f2c146607c43c09ce92e455e7905a94ce64c032551b.yml +openapi_spec_hash: a6734ff6462155d6d2f0be39185dcfdc config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce From 2d439b9814f0e3be9efead3d2e70e3e5d7e3a1f0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 02:06:16 +0000 Subject: [PATCH 10/25] feat(api): api update --- .stats.yml | 4 ++-- lib/context_dev/models/web_web_scrape_sitemap_params.rb | 5 ++--- lib/context_dev/resources/web.rb | 6 ++---- rbi/context_dev/models/web_web_scrape_sitemap_params.rbi | 6 ++---- rbi/context_dev/resources/web.rbi | 7 ++----- 5 files changed, 10 insertions(+), 18 deletions(-) diff --git a/.stats.yml b/.stats.yml index 88a619f3..2f7dc9ac 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-6358650aa8bbd5ba9a423f2c146607c43c09ce92e455e7905a94ce64c032551b.yml -openapi_spec_hash: a6734ff6462155d6d2f0be39185dcfdc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-710f2543cb3ae7b29cf20a527e5fcca5f3aa518c7435ecb2b84fb9f8fe61506c.yml +openapi_spec_hash: 219f0884a214dba75a2e971dc5962804 config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce diff --git a/lib/context_dev/models/web_web_scrape_sitemap_params.rb b/lib/context_dev/models/web_web_scrape_sitemap_params.rb index 0d1c8564..adfd2848 100644 --- a/lib/context_dev/models/web_web_scrape_sitemap_params.rb +++ b/lib/context_dev/models/web_web_scrape_sitemap_params.rb @@ -8,8 +8,7 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel include ContextDev::Internal::Type::RequestParameters # @!attribute domain - # Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be - # automatically normalized and validated. + # Domain to build a sitemap for # # @return [String] required :domain, String @@ -25,7 +24,7 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeSitemapParams} for more details. # - # @param domain [String] Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be auto + # @param domain [String] Domain to build a sitemap for # # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi # diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index 64b5cf0c..0f42ea62 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -182,13 +182,11 @@ def web_scrape_md(params) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeSitemapParams} 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.). + # Crawl an entire website's sitemap and return all discovered page URLs # # @overload web_scrape_sitemap(domain:, max_links: nil, request_options: {}) # - # @param domain [String] Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be auto + # @param domain [String] Domain to build a sitemap for # # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi # diff --git a/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi b/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi index e892cc87..c741628b 100644 --- a/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi @@ -14,8 +14,7 @@ module ContextDev ) end - # Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be - # automatically normalized and validated. + # Domain to build a sitemap for sig { returns(String) } attr_accessor :domain @@ -35,8 +34,7 @@ module ContextDev ).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 to build a sitemap for domain:, # Maximum number of links to return from the sitemap crawl. Defaults to 10,000. # Minimum is 1, maximum is 100,000. diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index 566809e0..f876b060 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -156,9 +156,7 @@ module ContextDev ) 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.). + # Crawl an entire website's sitemap and return all discovered page URLs sig do params( domain: String, @@ -167,8 +165,7 @@ module ContextDev ).returns(ContextDev::Models::WebWebScrapeSitemapResponse) end def web_scrape_sitemap( - # Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be - # automatically normalized and validated. + # Domain to build a sitemap for domain:, # Maximum number of links to return from the sitemap crawl. Defaults to 10,000. # Minimum is 1, maximum is 100,000. From aa9cdea8c33225f5ca95ca16bd914adf1e034d98 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 02:19:08 +0000 Subject: [PATCH 11/25] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2f7dc9ac..de8e2b58 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-710f2543cb3ae7b29cf20a527e5fcca5f3aa518c7435ecb2b84fb9f8fe61506c.yml -openapi_spec_hash: 219f0884a214dba75a2e971dc5962804 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-e8d8a7fcb448cc026cb7afe7f0d0d927cdb8bc86ae841ed14377107ce2c0e039.yml +openapi_spec_hash: 40ff2ba6f9f52e728b790acd2c85af8c config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce From 7d186faf849e20bcd958beb5f46b71f6440b8358 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 02:24:08 +0000 Subject: [PATCH 12/25] feat(api): api update --- .stats.yml | 4 ++-- lib/context_dev/resources/web.rb | 3 +-- rbi/context_dev/resources/web.rbi | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index de8e2b58..354168ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-e8d8a7fcb448cc026cb7afe7f0d0d927cdb8bc86ae841ed14377107ce2c0e039.yml -openapi_spec_hash: 40ff2ba6f9f52e728b790acd2c85af8c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-93024db99e0ac34b761b052b495751dddc318c87b9492cf88d8c1b03c7163277.yml +openapi_spec_hash: bae5518ec851fa744b0025676df65ec6 config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index 0f42ea62..cfa2486b 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -45,8 +45,7 @@ def screenshot(params = {}) # {ContextDev::Models::WebWebCrawlMdParams} for more details. # # Performs a crawl starting from a given URL, extracts page content as Markdown, - # and returns results for all crawled pages. Only follows links within the same - # domain as the starting URL. Costs 1 credit per successful page crawled. + # and returns results for all crawled pages. # # @overload web_crawl_md(url:, follow_subdomains: nil, include_images: nil, include_links: nil, max_depth: nil, max_pages: nil, shorten_base64_images: nil, url_regex: nil, use_main_content_only: nil, request_options: {}) # diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index f876b060..c6be25ed 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -46,8 +46,7 @@ module ContextDev end # Performs a crawl starting from a given URL, extracts page content as Markdown, - # and returns results for all crawled pages. Only follows links within the same - # domain as the starting URL. Costs 1 credit per successful page crawled. + # and returns results for all crawled pages. sig do params( url: String, From 5a69904d89cc873614e8320308eecac9304992d2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 21:55:21 +0000 Subject: [PATCH 13/25] feat(api): api update --- .stats.yml | 6 +- lib/context_dev.rb | 2 - lib/context_dev/models.rb | 2 - .../models/style_extract_fonts_params.rb | 36 ----- .../models/style_extract_fonts_response.rb | 101 ------------ lib/context_dev/resources/style.rb | 29 ---- rbi/context_dev/models.rbi | 2 - .../models/style_extract_fonts_params.rbi | 63 -------- .../models/style_extract_fonts_response.rbi | 153 ------------------ rbi/context_dev/resources/style.rbi | 21 --- sig/context_dev/models.rbs | 2 - .../models/style_extract_fonts_params.rbs | 30 ---- .../models/style_extract_fonts_response.rbs | 82 ---------- sig/context_dev/resources/style.rbs | 6 - test/context_dev/resources/style_test.rb | 19 --- 15 files changed, 3 insertions(+), 551 deletions(-) delete mode 100644 lib/context_dev/models/style_extract_fonts_params.rb delete mode 100644 lib/context_dev/models/style_extract_fonts_response.rb delete mode 100644 rbi/context_dev/models/style_extract_fonts_params.rbi delete mode 100644 rbi/context_dev/models/style_extract_fonts_response.rbi delete mode 100644 sig/context_dev/models/style_extract_fonts_params.rbs delete mode 100644 sig/context_dev/models/style_extract_fonts_response.rbs diff --git a/.stats.yml b/.stats.yml index 354168ef..4f702fae 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-93024db99e0ac34b761b052b495751dddc318c87b9492cf88d8c1b03c7163277.yml -openapi_spec_hash: bae5518ec851fa744b0025676df65ec6 +configured_endpoints: 20 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-fabb017ff3666dbd9571166423c32c9567f9c09448fd7189d147c06666bf0f39.yml +openapi_spec_hash: 2175516001dec1c8c45a1c8416c6fe53 config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce diff --git a/lib/context_dev.rb b/lib/context_dev.rb index 3358e6ee..64102cf7 100644 --- a/lib/context_dev.rb +++ b/lib/context_dev.rb @@ -74,8 +74,6 @@ require_relative "context_dev/models/brand_retrieve_simplified_response" require_relative "context_dev/models/industry_retrieve_naics_params" require_relative "context_dev/models/industry_retrieve_naics_response" -require_relative "context_dev/models/style_extract_fonts_params" -require_relative "context_dev/models/style_extract_fonts_response" require_relative "context_dev/models/style_extract_styleguide_params" require_relative "context_dev/models/style_extract_styleguide_response" require_relative "context_dev/models/utility_prefetch_by_email_params" diff --git a/lib/context_dev/models.rb b/lib/context_dev/models.rb index 9be91f2b..c02d6f0f 100644 --- a/lib/context_dev/models.rb +++ b/lib/context_dev/models.rb @@ -61,8 +61,6 @@ module ContextDev IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams - StyleExtractFontsParams = ContextDev::Models::StyleExtractFontsParams - StyleExtractStyleguideParams = ContextDev::Models::StyleExtractStyleguideParams UtilityPrefetchByEmailParams = ContextDev::Models::UtilityPrefetchByEmailParams diff --git a/lib/context_dev/models/style_extract_fonts_params.rb b/lib/context_dev/models/style_extract_fonts_params.rb deleted file mode 100644 index a38e4d4a..00000000 --- a/lib/context_dev/models/style_extract_fonts_params.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -module ContextDev - module Models - # @see ContextDev::Resources::Style#extract_fonts - class StyleExtractFontsParams < ContextDev::Internal::Type::BaseModel - extend ContextDev::Internal::Type::RequestParameters::Converter - include ContextDev::Internal::Type::RequestParameters - - # @!attribute domain - # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. - # - # @return [String] - required :domain, String - - # @!attribute 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). - # - # @return [Integer, nil] - optional :timeout_ms, Integer - - # @!method initialize(domain:, timeout_ms: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {ContextDev::Models::StyleExtractFontsParams} for more details. - # - # @param domain [String] Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The domai - # - # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th - # - # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/context_dev/models/style_extract_fonts_response.rb b/lib/context_dev/models/style_extract_fonts_response.rb deleted file mode 100644 index 8c71a3cb..00000000 --- a/lib/context_dev/models/style_extract_fonts_response.rb +++ /dev/null @@ -1,101 +0,0 @@ -# frozen_string_literal: true - -module ContextDev - module Models - # @see ContextDev::Resources::Style#extract_fonts - class StyleExtractFontsResponse < ContextDev::Internal::Type::BaseModel - # @!attribute code - # HTTP status code, e.g., 200 - # - # @return [Integer] - required :code, Integer - - # @!attribute domain - # The normalized domain that was processed - # - # @return [String] - required :domain, String - - # @!attribute fonts - # Array of font usage information - # - # @return [Array] - required :fonts, - -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::StyleExtractFontsResponse::Font] } - - # @!attribute status - # Status of the response, e.g., 'ok' - # - # @return [String] - required :status, String - - # @!method initialize(code:, domain:, fonts:, status:) - # @param code [Integer] HTTP status code, e.g., 200 - # - # @param domain [String] The normalized domain that was processed - # - # @param fonts [Array] Array of font usage information - # - # @param status [String] Status of the response, e.g., 'ok' - - class Font < ContextDev::Internal::Type::BaseModel - # @!attribute fallbacks - # Array of fallback font families - # - # @return [Array] - required :fallbacks, ContextDev::Internal::Type::ArrayOf[String] - - # @!attribute font - # Font family name - # - # @return [String] - required :font, String - - # @!attribute num_elements - # Number of elements using this font - # - # @return [Float] - required :num_elements, Float - - # @!attribute num_words - # Number of words using this font - # - # @return [Float] - required :num_words, Float - - # @!attribute percent_elements - # Percentage of elements using this font - # - # @return [Float] - required :percent_elements, Float - - # @!attribute percent_words - # Percentage of words using this font - # - # @return [Float] - required :percent_words, Float - - # @!attribute uses - # Array of CSS selectors or element types where this font is used - # - # @return [Array] - required :uses, ContextDev::Internal::Type::ArrayOf[String] - - # @!method initialize(fallbacks:, font:, num_elements:, num_words:, percent_elements:, percent_words:, uses:) - # @param fallbacks [Array] Array of fallback font families - # - # @param font [String] Font family name - # - # @param num_elements [Float] Number of elements using this font - # - # @param num_words [Float] Number of words using this font - # - # @param percent_elements [Float] Percentage of elements using this font - # - # @param percent_words [Float] Percentage of words using this font - # - # @param uses [Array] Array of CSS selectors or element types where this font is used - end - end - end -end diff --git a/lib/context_dev/resources/style.rb b/lib/context_dev/resources/style.rb index 364024b9..6761626b 100644 --- a/lib/context_dev/resources/style.rb +++ b/lib/context_dev/resources/style.rb @@ -3,35 +3,6 @@ module ContextDev module Resources class Style - # Some parameter documentations has been truncated, see - # {ContextDev::Models::StyleExtractFontsParams} for more details. - # - # Extract font information from a brand's website including font families, usage - # statistics, fallbacks, and element/word counts. - # - # @overload extract_fonts(domain:, timeout_ms: nil, request_options: {}) - # - # @param domain [String] Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The domai - # - # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th - # - # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ContextDev::Models::StyleExtractFontsResponse] - # - # @see ContextDev::Models::StyleExtractFontsParams - def extract_fonts(params) - parsed, options = ContextDev::StyleExtractFontsParams.dump_request(params) - query = ContextDev::Internal::Util.encode_query_params(parsed) - @client.request( - method: :get, - path: "brand/fonts", - query: query.transform_keys(timeout_ms: "timeoutMS"), - model: ContextDev::Models::StyleExtractFontsResponse, - options: options - ) - end - # Some parameter documentations has been truncated, see # {ContextDev::Models::StyleExtractStyleguideParams} for more details. # diff --git a/rbi/context_dev/models.rbi b/rbi/context_dev/models.rbi index 3932e7df..b261e127 100644 --- a/rbi/context_dev/models.rbi +++ b/rbi/context_dev/models.rbi @@ -25,8 +25,6 @@ module ContextDev IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams - StyleExtractFontsParams = ContextDev::Models::StyleExtractFontsParams - StyleExtractStyleguideParams = ContextDev::Models::StyleExtractStyleguideParams diff --git a/rbi/context_dev/models/style_extract_fonts_params.rbi b/rbi/context_dev/models/style_extract_fonts_params.rbi deleted file mode 100644 index 22fb658b..00000000 --- a/rbi/context_dev/models/style_extract_fonts_params.rbi +++ /dev/null @@ -1,63 +0,0 @@ -# typed: strong - -module ContextDev - module Models - class StyleExtractFontsParams < ContextDev::Internal::Type::BaseModel - extend ContextDev::Internal::Type::RequestParameters::Converter - include ContextDev::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ContextDev::StyleExtractFontsParams, - ContextDev::Internal::AnyHash - ) - end - - # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. - sig { returns(String) } - attr_accessor :domain - - # 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). - sig { returns(T.nilable(Integer)) } - attr_reader :timeout_ms - - sig { params(timeout_ms: Integer).void } - attr_writer :timeout_ms - - sig do - params( - domain: String, - timeout_ms: Integer, - request_options: ContextDev::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. - domain:, - # 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). - timeout_ms: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - domain: String, - timeout_ms: Integer, - request_options: ContextDev::RequestOptions - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/context_dev/models/style_extract_fonts_response.rbi b/rbi/context_dev/models/style_extract_fonts_response.rbi deleted file mode 100644 index b90b5f22..00000000 --- a/rbi/context_dev/models/style_extract_fonts_response.rbi +++ /dev/null @@ -1,153 +0,0 @@ -# typed: strong - -module ContextDev - module Models - class StyleExtractFontsResponse < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractFontsResponse, - ContextDev::Internal::AnyHash - ) - end - - # HTTP status code, e.g., 200 - sig { returns(Integer) } - attr_accessor :code - - # The normalized domain that was processed - sig { returns(String) } - attr_accessor :domain - - # Array of font usage information - sig do - returns(T::Array[ContextDev::Models::StyleExtractFontsResponse::Font]) - end - attr_accessor :fonts - - # Status of the response, e.g., 'ok' - sig { returns(String) } - attr_accessor :status - - sig do - params( - code: Integer, - domain: String, - fonts: - T::Array[ - ContextDev::Models::StyleExtractFontsResponse::Font::OrHash - ], - status: String - ).returns(T.attached_class) - end - def self.new( - # HTTP status code, e.g., 200 - code:, - # The normalized domain that was processed - domain:, - # Array of font usage information - fonts:, - # Status of the response, e.g., 'ok' - status: - ) - end - - sig do - override.returns( - { - code: Integer, - domain: String, - fonts: - T::Array[ContextDev::Models::StyleExtractFontsResponse::Font], - status: String - } - ) - end - def to_hash - end - - class Font < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractFontsResponse::Font, - ContextDev::Internal::AnyHash - ) - end - - # Array of fallback font families - sig { returns(T::Array[String]) } - attr_accessor :fallbacks - - # Font family name - sig { returns(String) } - attr_accessor :font - - # Number of elements using this font - sig { returns(Float) } - attr_accessor :num_elements - - # Number of words using this font - sig { returns(Float) } - attr_accessor :num_words - - # Percentage of elements using this font - sig { returns(Float) } - attr_accessor :percent_elements - - # Percentage of words using this font - sig { returns(Float) } - attr_accessor :percent_words - - # Array of CSS selectors or element types where this font is used - sig { returns(T::Array[String]) } - attr_accessor :uses - - sig do - params( - fallbacks: T::Array[String], - font: String, - num_elements: Float, - num_words: Float, - percent_elements: Float, - percent_words: Float, - uses: T::Array[String] - ).returns(T.attached_class) - end - def self.new( - # Array of fallback font families - fallbacks:, - # Font family name - font:, - # Number of elements using this font - num_elements:, - # Number of words using this font - num_words:, - # Percentage of elements using this font - percent_elements:, - # Percentage of words using this font - percent_words:, - # Array of CSS selectors or element types where this font is used - uses: - ) - end - - sig do - override.returns( - { - fallbacks: T::Array[String], - font: String, - num_elements: Float, - num_words: Float, - percent_elements: Float, - percent_words: Float, - uses: T::Array[String] - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/context_dev/resources/style.rbi b/rbi/context_dev/resources/style.rbi index f819a058..ea383702 100644 --- a/rbi/context_dev/resources/style.rbi +++ b/rbi/context_dev/resources/style.rbi @@ -3,27 +3,6 @@ module ContextDev module Resources class Style - # Extract font information from a brand's website including font families, usage - # statistics, fallbacks, and element/word counts. - sig do - params( - domain: String, - timeout_ms: Integer, - request_options: ContextDev::RequestOptions::OrHash - ).returns(ContextDev::Models::StyleExtractFontsResponse) - end - def extract_fonts( - # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. - domain:, - # 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). - timeout_ms: nil, - request_options: {} - ) - end - # Automatically extract comprehensive design system information from a brand's # website including colors, typography, spacing, shadows, and UI components. # Either 'domain' or 'directUrl' must be provided as a query parameter, but not diff --git a/sig/context_dev/models.rbs b/sig/context_dev/models.rbs index 537fbf3d..17c7782e 100644 --- a/sig/context_dev/models.rbs +++ b/sig/context_dev/models.rbs @@ -21,8 +21,6 @@ module ContextDev class IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams - class StyleExtractFontsParams = ContextDev::Models::StyleExtractFontsParams - class StyleExtractStyleguideParams = ContextDev::Models::StyleExtractStyleguideParams class UtilityPrefetchByEmailParams = ContextDev::Models::UtilityPrefetchByEmailParams diff --git a/sig/context_dev/models/style_extract_fonts_params.rbs b/sig/context_dev/models/style_extract_fonts_params.rbs deleted file mode 100644 index 20ea7962..00000000 --- a/sig/context_dev/models/style_extract_fonts_params.rbs +++ /dev/null @@ -1,30 +0,0 @@ -module ContextDev - module Models - type style_extract_fonts_params = - { domain: String, timeout_ms: Integer } - & ContextDev::Internal::Type::request_parameters - - class StyleExtractFontsParams < ContextDev::Internal::Type::BaseModel - extend ContextDev::Internal::Type::RequestParameters::Converter - include ContextDev::Internal::Type::RequestParameters - - attr_accessor domain: String - - attr_reader timeout_ms: Integer? - - def timeout_ms=: (Integer) -> Integer - - def initialize: ( - domain: String, - ?timeout_ms: Integer, - ?request_options: ContextDev::request_opts - ) -> void - - def to_hash: -> { - domain: String, - timeout_ms: Integer, - request_options: ContextDev::RequestOptions - } - end - end -end diff --git a/sig/context_dev/models/style_extract_fonts_response.rbs b/sig/context_dev/models/style_extract_fonts_response.rbs deleted file mode 100644 index 1028f587..00000000 --- a/sig/context_dev/models/style_extract_fonts_response.rbs +++ /dev/null @@ -1,82 +0,0 @@ -module ContextDev - module Models - type style_extract_fonts_response = - { - code: Integer, - domain: String, - fonts: ::Array[ContextDev::Models::StyleExtractFontsResponse::Font], - status: String - } - - class StyleExtractFontsResponse < ContextDev::Internal::Type::BaseModel - attr_accessor code: Integer - - attr_accessor domain: String - - attr_accessor fonts: ::Array[ContextDev::Models::StyleExtractFontsResponse::Font] - - attr_accessor status: String - - def initialize: ( - code: Integer, - domain: String, - fonts: ::Array[ContextDev::Models::StyleExtractFontsResponse::Font], - status: String - ) -> void - - def to_hash: -> { - code: Integer, - domain: String, - fonts: ::Array[ContextDev::Models::StyleExtractFontsResponse::Font], - status: String - } - - type font = - { - fallbacks: ::Array[String], - font: String, - num_elements: Float, - num_words: Float, - percent_elements: Float, - percent_words: Float, - uses: ::Array[String] - } - - class Font < ContextDev::Internal::Type::BaseModel - attr_accessor fallbacks: ::Array[String] - - attr_accessor font: String - - attr_accessor num_elements: Float - - attr_accessor num_words: Float - - attr_accessor percent_elements: Float - - attr_accessor percent_words: Float - - attr_accessor uses: ::Array[String] - - def initialize: ( - fallbacks: ::Array[String], - font: String, - num_elements: Float, - num_words: Float, - percent_elements: Float, - percent_words: Float, - uses: ::Array[String] - ) -> void - - def to_hash: -> { - fallbacks: ::Array[String], - font: String, - num_elements: Float, - num_words: Float, - percent_elements: Float, - percent_words: Float, - uses: ::Array[String] - } - end - end - end -end diff --git a/sig/context_dev/resources/style.rbs b/sig/context_dev/resources/style.rbs index 76529051..0429a345 100644 --- a/sig/context_dev/resources/style.rbs +++ b/sig/context_dev/resources/style.rbs @@ -1,12 +1,6 @@ module ContextDev module Resources class Style - def extract_fonts: ( - domain: String, - ?timeout_ms: Integer, - ?request_options: ContextDev::request_opts - ) -> ContextDev::Models::StyleExtractFontsResponse - def extract_styleguide: ( ?direct_url: String, ?domain: String, diff --git a/test/context_dev/resources/style_test.rb b/test/context_dev/resources/style_test.rb index 3300c4b4..61108294 100644 --- a/test/context_dev/resources/style_test.rb +++ b/test/context_dev/resources/style_test.rb @@ -3,25 +3,6 @@ require_relative "../test_helper" class ContextDev::Test::Resources::StyleTest < ContextDev::Test::ResourceTest - def test_extract_fonts_required_params - skip("Mock server tests are disabled") - - response = @context_dev.style.extract_fonts(domain: "domain") - - assert_pattern do - response => ContextDev::Models::StyleExtractFontsResponse - end - - assert_pattern do - response => { - code: Integer, - domain: String, - fonts: ^(ContextDev::Internal::Type::ArrayOf[ContextDev::Models::StyleExtractFontsResponse::Font]), - status: String - } - end - end - def test_extract_styleguide skip("Mock server tests are disabled") From d32eb69f2bafb655156587bfb2daa659dcc3b731 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 22:01:10 +0000 Subject: [PATCH 14/25] feat(api): manual updates --- .stats.yml | 4 +- lib/context_dev.rb | 2 + lib/context_dev/internal/type/base_model.rb | 6 +- lib/context_dev/models.rb | 2 + .../models/web_extract_fonts_params.rb | 45 ++++++ .../models/web_extract_fonts_response.rb | 101 ++++++++++++ lib/context_dev/resources/web.rb | 32 ++++ rbi/context_dev/models.rbi | 2 + .../models/web_extract_fonts_params.rbi | 79 +++++++++ .../models/web_extract_fonts_response.rbi | 150 ++++++++++++++++++ rbi/context_dev/resources/web.rbi | 26 +++ sig/context_dev/models.rbs | 2 + .../models/web_extract_fonts_params.rbs | 38 +++++ .../models/web_extract_fonts_response.rbs | 82 ++++++++++ sig/context_dev/resources/web.rbs | 7 + test/context_dev/resources/web_test.rb | 19 +++ 16 files changed, 592 insertions(+), 5 deletions(-) create mode 100644 lib/context_dev/models/web_extract_fonts_params.rb create mode 100644 lib/context_dev/models/web_extract_fonts_response.rb create mode 100644 rbi/context_dev/models/web_extract_fonts_params.rbi create mode 100644 rbi/context_dev/models/web_extract_fonts_response.rbi create mode 100644 sig/context_dev/models/web_extract_fonts_params.rbs create mode 100644 sig/context_dev/models/web_extract_fonts_response.rbs diff --git a/.stats.yml b/.stats.yml index 4f702fae..c5d0c121 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 20 +configured_endpoints: 21 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-fabb017ff3666dbd9571166423c32c9567f9c09448fd7189d147c06666bf0f39.yml openapi_spec_hash: 2175516001dec1c8c45a1c8416c6fe53 -config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce +config_hash: 859455bbffc8a009cd9b5eed9b3ba2d7 diff --git a/lib/context_dev.rb b/lib/context_dev.rb index 64102cf7..a648f785 100644 --- a/lib/context_dev.rb +++ b/lib/context_dev.rb @@ -80,6 +80,8 @@ require_relative "context_dev/models/utility_prefetch_by_email_response" require_relative "context_dev/models/utility_prefetch_params" require_relative "context_dev/models/utility_prefetch_response" +require_relative "context_dev/models/web_extract_fonts_params" +require_relative "context_dev/models/web_extract_fonts_response" require_relative "context_dev/models/web_screenshot_params" require_relative "context_dev/models/web_screenshot_response" require_relative "context_dev/models/web_web_crawl_md_params" diff --git a/lib/context_dev/internal/type/base_model.rb b/lib/context_dev/internal/type/base_model.rb index 179eff15..41f5ee16 100644 --- a/lib/context_dev/internal/type/base_model.rb +++ b/lib/context_dev/internal/type/base_model.rb @@ -438,11 +438,11 @@ def deep_to_h = self.class.recursively_to_h(@data, convert: false) # @return [Hash{Symbol=>Object}] # # @example - # # `web_screenshot_response` is a `ContextDev::Models::WebScreenshotResponse` - # web_screenshot_response => { + # # `web_extract_fonts_response` is a `ContextDev::Models::WebExtractFontsResponse` + # web_extract_fonts_response => { # code: code, # domain: domain, - # screenshot: screenshot + # fonts: fonts # } def deconstruct_keys(keys) (keys || self.class.known_fields.keys) diff --git a/lib/context_dev/models.rb b/lib/context_dev/models.rb index c02d6f0f..180c7c49 100644 --- a/lib/context_dev/models.rb +++ b/lib/context_dev/models.rb @@ -67,6 +67,8 @@ module ContextDev UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams + WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams + WebScreenshotParams = ContextDev::Models::WebScreenshotParams WebWebCrawlMdParams = ContextDev::Models::WebWebCrawlMdParams diff --git a/lib/context_dev/models/web_extract_fonts_params.rb b/lib/context_dev/models/web_extract_fonts_params.rb new file mode 100644 index 00000000..6dc07e8e --- /dev/null +++ b/lib/context_dev/models/web_extract_fonts_params.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::Web#extract_fonts + class WebExtractFontsParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + # @!attribute direct_url + # A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., + # 'https://example.com/design-system'). + # + # @return [String, nil] + optional :direct_url, String + + # @!attribute domain + # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The + # domain will be automatically normalized and validated. + # + # @return [String, nil] + optional :domain, String + + # @!attribute 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). + # + # @return [Integer, nil] + optional :timeout_ms, Integer + + # @!method initialize(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebExtractFontsParams} for more details. + # + # @param direct_url [String] A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., + # + # @param domain [String] Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The domai + # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/context_dev/models/web_extract_fonts_response.rb b/lib/context_dev/models/web_extract_fonts_response.rb new file mode 100644 index 00000000..0eb7b990 --- /dev/null +++ b/lib/context_dev/models/web_extract_fonts_response.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::Web#extract_fonts + class WebExtractFontsResponse < ContextDev::Internal::Type::BaseModel + # @!attribute code + # HTTP status code, e.g., 200 + # + # @return [Integer] + required :code, Integer + + # @!attribute domain + # The normalized domain that was processed + # + # @return [String] + required :domain, String + + # @!attribute fonts + # Array of font usage information + # + # @return [Array] + required :fonts, + -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::WebExtractFontsResponse::Font] } + + # @!attribute status + # Status of the response, e.g., 'ok' + # + # @return [String] + required :status, String + + # @!method initialize(code:, domain:, fonts:, status:) + # @param code [Integer] HTTP status code, e.g., 200 + # + # @param domain [String] The normalized domain that was processed + # + # @param fonts [Array] Array of font usage information + # + # @param status [String] Status of the response, e.g., 'ok' + + class Font < ContextDev::Internal::Type::BaseModel + # @!attribute fallbacks + # Array of fallback font families + # + # @return [Array] + required :fallbacks, ContextDev::Internal::Type::ArrayOf[String] + + # @!attribute font + # Font family name + # + # @return [String] + required :font, String + + # @!attribute num_elements + # Number of elements using this font + # + # @return [Float] + required :num_elements, Float + + # @!attribute num_words + # Number of words using this font + # + # @return [Float] + required :num_words, Float + + # @!attribute percent_elements + # Percentage of elements using this font + # + # @return [Float] + required :percent_elements, Float + + # @!attribute percent_words + # Percentage of words using this font + # + # @return [Float] + required :percent_words, Float + + # @!attribute uses + # Array of CSS selectors or element types where this font is used + # + # @return [Array] + required :uses, ContextDev::Internal::Type::ArrayOf[String] + + # @!method initialize(fallbacks:, font:, num_elements:, num_words:, percent_elements:, percent_words:, uses:) + # @param fallbacks [Array] Array of fallback font families + # + # @param font [String] Font family name + # + # @param num_elements [Float] Number of elements using this font + # + # @param num_words [Float] Number of words using this font + # + # @param percent_elements [Float] Percentage of elements using this font + # + # @param percent_words [Float] Percentage of words using this font + # + # @param uses [Array] Array of CSS selectors or element types where this font is used + end + end + end +end diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index cfa2486b..633f3d51 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -3,6 +3,38 @@ module ContextDev module Resources class Web + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebExtractFontsParams} for more details. + # + # Scrape font information from a website including font families, usage + # statistics, fallbacks, and element/word counts. Either 'domain' or 'directUrl' + # must be provided as a query parameter, but not both. + # + # @overload extract_fonts(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {}) + # + # @param direct_url [String] A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., + # + # @param domain [String] Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The domai + # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [ContextDev::Models::WebExtractFontsResponse] + # + # @see ContextDev::Models::WebExtractFontsParams + def extract_fonts(params = {}) + parsed, options = ContextDev::WebExtractFontsParams.dump_request(params) + query = ContextDev::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "web/fonts", + query: query.transform_keys(direct_url: "directUrl", timeout_ms: "timeoutMS"), + model: ContextDev::Models::WebExtractFontsResponse, + options: options + ) + end + # Some parameter documentations has been truncated, see # {ContextDev::Models::WebScreenshotParams} for more details. # diff --git a/rbi/context_dev/models.rbi b/rbi/context_dev/models.rbi index b261e127..d58d3549 100644 --- a/rbi/context_dev/models.rbi +++ b/rbi/context_dev/models.rbi @@ -33,6 +33,8 @@ module ContextDev UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams + WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams + WebScreenshotParams = ContextDev::Models::WebScreenshotParams WebWebCrawlMdParams = ContextDev::Models::WebWebCrawlMdParams diff --git a/rbi/context_dev/models/web_extract_fonts_params.rbi b/rbi/context_dev/models/web_extract_fonts_params.rbi new file mode 100644 index 00000000..17ceb20e --- /dev/null +++ b/rbi/context_dev/models/web_extract_fonts_params.rbi @@ -0,0 +1,79 @@ +# typed: strong + +module ContextDev + module Models + class WebExtractFontsParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + ContextDev::WebExtractFontsParams, + ContextDev::Internal::AnyHash + ) + end + + # A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., + # 'https://example.com/design-system'). + sig { returns(T.nilable(String)) } + attr_reader :direct_url + + sig { params(direct_url: String).void } + attr_writer :direct_url + + # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The + # domain will be automatically normalized and validated. + sig { returns(T.nilable(String)) } + attr_reader :domain + + sig { params(domain: String).void } + attr_writer :domain + + # 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). + sig { returns(T.nilable(Integer)) } + attr_reader :timeout_ms + + sig { params(timeout_ms: Integer).void } + attr_writer :timeout_ms + + sig do + params( + direct_url: String, + domain: String, + timeout_ms: Integer, + request_options: ContextDev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., + # 'https://example.com/design-system'). + direct_url: nil, + # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The + # domain will be automatically normalized and validated. + domain: nil, + # 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). + timeout_ms: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + direct_url: String, + domain: String, + timeout_ms: Integer, + request_options: ContextDev::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/context_dev/models/web_extract_fonts_response.rbi b/rbi/context_dev/models/web_extract_fonts_response.rbi new file mode 100644 index 00000000..e14bad9b --- /dev/null +++ b/rbi/context_dev/models/web_extract_fonts_response.rbi @@ -0,0 +1,150 @@ +# typed: strong + +module ContextDev + module Models + class WebExtractFontsResponse < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractFontsResponse, + ContextDev::Internal::AnyHash + ) + end + + # HTTP status code, e.g., 200 + sig { returns(Integer) } + attr_accessor :code + + # The normalized domain that was processed + sig { returns(String) } + attr_accessor :domain + + # Array of font usage information + sig do + returns(T::Array[ContextDev::Models::WebExtractFontsResponse::Font]) + end + attr_accessor :fonts + + # Status of the response, e.g., 'ok' + sig { returns(String) } + attr_accessor :status + + sig do + params( + code: Integer, + domain: String, + fonts: + T::Array[ContextDev::Models::WebExtractFontsResponse::Font::OrHash], + status: String + ).returns(T.attached_class) + end + def self.new( + # HTTP status code, e.g., 200 + code:, + # The normalized domain that was processed + domain:, + # Array of font usage information + fonts:, + # Status of the response, e.g., 'ok' + status: + ) + end + + sig do + override.returns( + { + code: Integer, + domain: String, + fonts: T::Array[ContextDev::Models::WebExtractFontsResponse::Font], + status: String + } + ) + end + def to_hash + end + + class Font < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractFontsResponse::Font, + ContextDev::Internal::AnyHash + ) + end + + # Array of fallback font families + sig { returns(T::Array[String]) } + attr_accessor :fallbacks + + # Font family name + sig { returns(String) } + attr_accessor :font + + # Number of elements using this font + sig { returns(Float) } + attr_accessor :num_elements + + # Number of words using this font + sig { returns(Float) } + attr_accessor :num_words + + # Percentage of elements using this font + sig { returns(Float) } + attr_accessor :percent_elements + + # Percentage of words using this font + sig { returns(Float) } + attr_accessor :percent_words + + # Array of CSS selectors or element types where this font is used + sig { returns(T::Array[String]) } + attr_accessor :uses + + sig do + params( + fallbacks: T::Array[String], + font: String, + num_elements: Float, + num_words: Float, + percent_elements: Float, + percent_words: Float, + uses: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # Array of fallback font families + fallbacks:, + # Font family name + font:, + # Number of elements using this font + num_elements:, + # Number of words using this font + num_words:, + # Percentage of elements using this font + percent_elements:, + # Percentage of words using this font + percent_words:, + # Array of CSS selectors or element types where this font is used + uses: + ) + end + + sig do + override.returns( + { + fallbacks: T::Array[String], + font: String, + num_elements: Float, + num_words: Float, + percent_elements: Float, + percent_words: Float, + uses: T::Array[String] + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index c6be25ed..799d6352 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -3,6 +3,32 @@ module ContextDev module Resources class Web + # Scrape font information from a website including font families, usage + # statistics, fallbacks, and element/word counts. Either 'domain' or 'directUrl' + # must be provided as a query parameter, but not both. + sig do + params( + direct_url: String, + domain: String, + timeout_ms: Integer, + request_options: ContextDev::RequestOptions::OrHash + ).returns(ContextDev::Models::WebExtractFontsResponse) + end + def extract_fonts( + # A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., + # 'https://example.com/design-system'). + direct_url: nil, + # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The + # domain will be automatically normalized and validated. + domain: nil, + # 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). + timeout_ms: nil, + request_options: {} + ) + end + # Capture a screenshot of a website. Supports both viewport (standard browser # view) and full-page screenshots. Can also screenshot specific page types (login, # pricing, etc.) by using heuristics to find the appropriate URL. Either 'domain' diff --git a/sig/context_dev/models.rbs b/sig/context_dev/models.rbs index 17c7782e..dbab011e 100644 --- a/sig/context_dev/models.rbs +++ b/sig/context_dev/models.rbs @@ -27,6 +27,8 @@ module ContextDev class UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams + class WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams + class WebScreenshotParams = ContextDev::Models::WebScreenshotParams class WebWebCrawlMdParams = ContextDev::Models::WebWebCrawlMdParams diff --git a/sig/context_dev/models/web_extract_fonts_params.rbs b/sig/context_dev/models/web_extract_fonts_params.rbs new file mode 100644 index 00000000..f16167a2 --- /dev/null +++ b/sig/context_dev/models/web_extract_fonts_params.rbs @@ -0,0 +1,38 @@ +module ContextDev + module Models + type web_extract_fonts_params = + { direct_url: String, domain: String, timeout_ms: Integer } + & ContextDev::Internal::Type::request_parameters + + class WebExtractFontsParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + attr_reader direct_url: String? + + def direct_url=: (String) -> String + + attr_reader domain: String? + + def domain=: (String) -> String + + attr_reader timeout_ms: Integer? + + def timeout_ms=: (Integer) -> Integer + + def initialize: ( + ?direct_url: String, + ?domain: String, + ?timeout_ms: Integer, + ?request_options: ContextDev::request_opts + ) -> void + + def to_hash: -> { + direct_url: String, + domain: String, + timeout_ms: Integer, + request_options: ContextDev::RequestOptions + } + end + end +end diff --git a/sig/context_dev/models/web_extract_fonts_response.rbs b/sig/context_dev/models/web_extract_fonts_response.rbs new file mode 100644 index 00000000..d62b7905 --- /dev/null +++ b/sig/context_dev/models/web_extract_fonts_response.rbs @@ -0,0 +1,82 @@ +module ContextDev + module Models + type web_extract_fonts_response = + { + code: Integer, + domain: String, + fonts: ::Array[ContextDev::Models::WebExtractFontsResponse::Font], + status: String + } + + class WebExtractFontsResponse < ContextDev::Internal::Type::BaseModel + attr_accessor code: Integer + + attr_accessor domain: String + + attr_accessor fonts: ::Array[ContextDev::Models::WebExtractFontsResponse::Font] + + attr_accessor status: String + + def initialize: ( + code: Integer, + domain: String, + fonts: ::Array[ContextDev::Models::WebExtractFontsResponse::Font], + status: String + ) -> void + + def to_hash: -> { + code: Integer, + domain: String, + fonts: ::Array[ContextDev::Models::WebExtractFontsResponse::Font], + status: String + } + + type font = + { + fallbacks: ::Array[String], + font: String, + num_elements: Float, + num_words: Float, + percent_elements: Float, + percent_words: Float, + uses: ::Array[String] + } + + class Font < ContextDev::Internal::Type::BaseModel + attr_accessor fallbacks: ::Array[String] + + attr_accessor font: String + + attr_accessor num_elements: Float + + attr_accessor num_words: Float + + attr_accessor percent_elements: Float + + attr_accessor percent_words: Float + + attr_accessor uses: ::Array[String] + + def initialize: ( + fallbacks: ::Array[String], + font: String, + num_elements: Float, + num_words: Float, + percent_elements: Float, + percent_words: Float, + uses: ::Array[String] + ) -> void + + def to_hash: -> { + fallbacks: ::Array[String], + font: String, + num_elements: Float, + num_words: Float, + percent_elements: Float, + percent_words: Float, + uses: ::Array[String] + } + end + end + end +end diff --git a/sig/context_dev/resources/web.rbs b/sig/context_dev/resources/web.rbs index a309c3b9..539e896b 100644 --- a/sig/context_dev/resources/web.rbs +++ b/sig/context_dev/resources/web.rbs @@ -1,6 +1,13 @@ module ContextDev module Resources class Web + def extract_fonts: ( + ?direct_url: String, + ?domain: String, + ?timeout_ms: Integer, + ?request_options: ContextDev::request_opts + ) -> ContextDev::Models::WebExtractFontsResponse + def screenshot: ( ?direct_url: String, ?domain: String, diff --git a/test/context_dev/resources/web_test.rb b/test/context_dev/resources/web_test.rb index 3083da7b..4b94839c 100644 --- a/test/context_dev/resources/web_test.rb +++ b/test/context_dev/resources/web_test.rb @@ -3,6 +3,25 @@ require_relative "../test_helper" class ContextDev::Test::Resources::WebTest < ContextDev::Test::ResourceTest + def test_extract_fonts + skip("Mock server tests are disabled") + + response = @context_dev.web.extract_fonts + + assert_pattern do + response => ContextDev::Models::WebExtractFontsResponse + end + + assert_pattern do + response => { + code: Integer, + domain: String, + fonts: ^(ContextDev::Internal::Type::ArrayOf[ContextDev::Models::WebExtractFontsResponse::Font]), + status: String + } + end + end + def test_screenshot skip("Mock server tests are disabled") From 51320a5677298ab231dc417ef3c54d6a75e640ba Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 22:18:43 +0000 Subject: [PATCH 15/25] feat(api): api update --- .stats.yml | 6 +- README.md | 16 +- lib/context_dev.rb | 2 - lib/context_dev/models.rb | 2 - .../models/web_screenshot_params.rb | 115 --------- .../models/web_screenshot_response.rb | 64 ----- lib/context_dev/resources/web.rb | 41 +-- rbi/context_dev/models.rbi | 2 - .../models/web_screenshot_params.rbi | 236 ------------------ .../models/web_screenshot_response.rbi | 135 ---------- rbi/context_dev/resources/web.rbi | 45 +--- sig/context_dev/models.rbs | 2 - .../models/web_screenshot_params.rbs | 109 -------- .../models/web_screenshot_response.rbs | 63 ----- sig/context_dev/resources/web.rbs | 9 - test/context_dev/resources/web_test.rb | 20 -- 16 files changed, 13 insertions(+), 854 deletions(-) delete mode 100644 lib/context_dev/models/web_screenshot_params.rb delete mode 100644 lib/context_dev/models/web_screenshot_response.rb delete mode 100644 rbi/context_dev/models/web_screenshot_params.rbi delete mode 100644 rbi/context_dev/models/web_screenshot_response.rbi delete mode 100644 sig/context_dev/models/web_screenshot_params.rbs delete mode 100644 sig/context_dev/models/web_screenshot_response.rbs diff --git a/.stats.yml b/.stats.yml index c5d0c121..2ed55aea 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-fabb017ff3666dbd9571166423c32c9567f9c09448fd7189d147c06666bf0f39.yml -openapi_spec_hash: 2175516001dec1c8c45a1c8416c6fe53 +configured_endpoints: 20 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-142c1d289d90b82edca3269964fc4fd6595f0e97c36b42a88b6f774fa5e65c10.yml +openapi_spec_hash: 1dc3e05add427f444e7714173c2fe8a9 config_hash: 859455bbffc8a009cd9b5eed9b3ba2d7 diff --git a/README.md b/README.md index bf456143..e657f74d 100644 --- a/README.md +++ b/README.md @@ -206,25 +206,25 @@ context_dev.brand.retrieve(**params) Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime: ```ruby -# :true -puts(ContextDev::WebScreenshotParams::FullScreenshot::TRUE) +# :afrikaans +puts(ContextDev::BrandRetrieveParams::ForceLanguage::AFRIKAANS) -# Revealed type: `T.all(ContextDev::WebScreenshotParams::FullScreenshot, Symbol)` -T.reveal_type(ContextDev::WebScreenshotParams::FullScreenshot::TRUE) +# Revealed type: `T.all(ContextDev::BrandRetrieveParams::ForceLanguage, Symbol)` +T.reveal_type(ContextDev::BrandRetrieveParams::ForceLanguage::AFRIKAANS) ``` Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value: ```ruby # Using the enum constants preserves the tagged type information: -context_dev.web.screenshot( - full_screenshot: ContextDev::WebScreenshotParams::FullScreenshot::TRUE, +context_dev.brand.retrieve( + force_language: ContextDev::BrandRetrieveParams::ForceLanguage::AFRIKAANS, # … ) # Literal values are also permissible: -context_dev.web.screenshot( - full_screenshot: :true, +context_dev.brand.retrieve( + force_language: :afrikaans, # … ) ``` diff --git a/lib/context_dev.rb b/lib/context_dev.rb index a648f785..221c6c91 100644 --- a/lib/context_dev.rb +++ b/lib/context_dev.rb @@ -82,8 +82,6 @@ require_relative "context_dev/models/utility_prefetch_response" require_relative "context_dev/models/web_extract_fonts_params" require_relative "context_dev/models/web_extract_fonts_response" -require_relative "context_dev/models/web_screenshot_params" -require_relative "context_dev/models/web_screenshot_response" require_relative "context_dev/models/web_web_crawl_md_params" require_relative "context_dev/models/web_web_crawl_md_response" require_relative "context_dev/models/web_web_scrape_html_params" diff --git a/lib/context_dev/models.rb b/lib/context_dev/models.rb index 180c7c49..976c5fe5 100644 --- a/lib/context_dev/models.rb +++ b/lib/context_dev/models.rb @@ -69,8 +69,6 @@ module ContextDev WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams - WebScreenshotParams = ContextDev::Models::WebScreenshotParams - WebWebCrawlMdParams = ContextDev::Models::WebWebCrawlMdParams WebWebScrapeHTMLParams = ContextDev::Models::WebWebScrapeHTMLParams diff --git a/lib/context_dev/models/web_screenshot_params.rb b/lib/context_dev/models/web_screenshot_params.rb deleted file mode 100644 index c071ea99..00000000 --- a/lib/context_dev/models/web_screenshot_params.rb +++ /dev/null @@ -1,115 +0,0 @@ -# frozen_string_literal: true - -module ContextDev - module Models - # @see ContextDev::Resources::Web#screenshot - class WebScreenshotParams < ContextDev::Internal::Type::BaseModel - extend ContextDev::Internal::Type::RequestParameters::Converter - include ContextDev::Internal::Type::RequestParameters - - # @!attribute direct_url - # A specific URL to screenshot directly, bypassing domain resolution (e.g., - # 'https://example.com/pricing'). When provided, the screenshot is taken of this - # exact URL. - # - # @return [String, nil] - optional :direct_url, String - - # @!attribute domain - # Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. - # - # @return [String, nil] - optional :domain, String - - # @!attribute full_screenshot - # Optional parameter to determine screenshot type. If 'true', takes a full page - # screenshot capturing all content. If 'false' or not provided, takes a viewport - # screenshot (standard browser view). - # - # @return [Symbol, ContextDev::Models::WebScreenshotParams::FullScreenshot, nil] - optional :full_screenshot, enum: -> { ContextDev::WebScreenshotParams::FullScreenshot } - - # @!attribute 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. Only applicable when using - # 'domain', not 'directUrl'. - # - # @return [Symbol, ContextDev::Models::WebScreenshotParams::Page, nil] - optional :page, enum: -> { ContextDev::WebScreenshotParams::Page } - - # @!attribute 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. - # - # @return [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize, nil] - optional :prioritize, enum: -> { ContextDev::WebScreenshotParams::Prioritize } - - # @!method initialize(direct_url: nil, domain: nil, full_screenshot: nil, page: nil, prioritize: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {ContextDev::Models::WebScreenshotParams} for more details. - # - # @param direct_url [String] A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https - # - # @param domain [String] Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domai - # - # @param full_screenshot [Symbol, ContextDev::Models::WebScreenshotParams::FullScreenshot] Optional parameter to determine screenshot type. If 'true', takes a full page sc - # - # @param page [Symbol, ContextDev::Models::WebScreenshotParams::Page] Optional parameter to specify which page type to screenshot. If provided, the sy - # - # @param prioritize [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize] Optional parameter to prioritize screenshot capture. If 'speed', optimizes for f - # - # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] - - # Optional parameter to determine screenshot type. If 'true', takes a full page - # screenshot capturing all content. If 'false' or not provided, takes a viewport - # screenshot (standard browser view). - module FullScreenshot - extend ContextDev::Internal::Type::Enum - - TRUE = :true - FALSE = :false - - # @!method self.values - # @return [Array] - end - - # 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. Only applicable when using - # 'domain', not 'directUrl'. - module Page - extend ContextDev::Internal::Type::Enum - - LOGIN = :login - SIGNUP = :signup - BLOG = :blog - CAREERS = :careers - PRICING = :pricing - TERMS = :terms - PRIVACY = :privacy - CONTACT = :contact - - # @!method self.values - # @return [Array] - end - - # 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. - module Prioritize - extend ContextDev::Internal::Type::Enum - - SPEED = :speed - QUALITY = :quality - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/context_dev/models/web_screenshot_response.rb b/lib/context_dev/models/web_screenshot_response.rb deleted file mode 100644 index 270820dd..00000000 --- a/lib/context_dev/models/web_screenshot_response.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -module ContextDev - module Models - # @see ContextDev::Resources::Web#screenshot - class WebScreenshotResponse < ContextDev::Internal::Type::BaseModel - # @!attribute code - # HTTP status code - # - # @return [Integer, nil] - optional :code, Integer - - # @!attribute domain - # The normalized domain that was processed - # - # @return [String, nil] - optional :domain, String - - # @!attribute screenshot - # Public URL of the uploaded screenshot image - # - # @return [String, nil] - optional :screenshot, String - - # @!attribute screenshot_type - # Type of screenshot that was captured - # - # @return [Symbol, ContextDev::Models::WebScreenshotResponse::ScreenshotType, nil] - optional :screenshot_type, - enum: -> { ContextDev::Models::WebScreenshotResponse::ScreenshotType }, - api_name: :screenshotType - - # @!attribute status - # Status of the response, e.g., 'ok' - # - # @return [String, nil] - optional :status, String - - # @!method initialize(code: nil, domain: nil, screenshot: nil, screenshot_type: nil, status: nil) - # @param code [Integer] HTTP status code - # - # @param domain [String] The normalized domain that was processed - # - # @param screenshot [String] Public URL of the uploaded screenshot image - # - # @param screenshot_type [Symbol, ContextDev::Models::WebScreenshotResponse::ScreenshotType] Type of screenshot that was captured - # - # @param status [String] Status of the response, e.g., 'ok' - - # Type of screenshot that was captured - # - # @see ContextDev::Models::WebScreenshotResponse#screenshot_type - module ScreenshotType - extend ContextDev::Internal::Type::Enum - - VIEWPORT = :viewport - FULL_PAGE = :fullPage - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index 633f3d51..b63d4d2b 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -7,8 +7,7 @@ class Web # {ContextDev::Models::WebExtractFontsParams} for more details. # # Scrape font information from a website including font families, usage - # statistics, fallbacks, and element/word counts. Either 'domain' or 'directUrl' - # must be provided as a query parameter, but not both. + # statistics, fallbacks, and element/word counts. # # @overload extract_fonts(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {}) # @@ -35,44 +34,6 @@ def extract_fonts(params = {}) ) end - # Some parameter documentations has been truncated, see - # {ContextDev::Models::WebScreenshotParams} for more details. - # - # Capture a screenshot of a website. Supports both viewport (standard browser - # view) and full-page screenshots. Can also screenshot specific page types (login, - # pricing, etc.) by using heuristics to find the appropriate URL. Either 'domain' - # or 'directUrl' must be provided as a query parameter, but not both. Returns a - # URL to the uploaded screenshot image hosted on our CDN. - # - # @overload screenshot(direct_url: nil, domain: nil, full_screenshot: nil, page: nil, prioritize: nil, request_options: {}) - # - # @param direct_url [String] A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https - # - # @param domain [String] Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domai - # - # @param full_screenshot [Symbol, ContextDev::Models::WebScreenshotParams::FullScreenshot] Optional parameter to determine screenshot type. If 'true', takes a full page sc - # - # @param page [Symbol, ContextDev::Models::WebScreenshotParams::Page] Optional parameter to specify which page type to screenshot. If provided, the sy - # - # @param prioritize [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize] Optional parameter to prioritize screenshot capture. If 'speed', optimizes for f - # - # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ContextDev::Models::WebScreenshotResponse] - # - # @see ContextDev::Models::WebScreenshotParams - def screenshot(params = {}) - parsed, options = ContextDev::WebScreenshotParams.dump_request(params) - query = ContextDev::Internal::Util.encode_query_params(parsed) - @client.request( - method: :get, - path: "brand/screenshot", - query: query.transform_keys(direct_url: "directUrl", full_screenshot: "fullScreenshot"), - model: ContextDev::Models::WebScreenshotResponse, - options: options - ) - end - # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebCrawlMdParams} for more details. # diff --git a/rbi/context_dev/models.rbi b/rbi/context_dev/models.rbi index d58d3549..d880d81f 100644 --- a/rbi/context_dev/models.rbi +++ b/rbi/context_dev/models.rbi @@ -35,8 +35,6 @@ module ContextDev WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams - WebScreenshotParams = ContextDev::Models::WebScreenshotParams - WebWebCrawlMdParams = ContextDev::Models::WebWebCrawlMdParams WebWebScrapeHTMLParams = ContextDev::Models::WebWebScrapeHTMLParams diff --git a/rbi/context_dev/models/web_screenshot_params.rbi b/rbi/context_dev/models/web_screenshot_params.rbi deleted file mode 100644 index c9f11b3a..00000000 --- a/rbi/context_dev/models/web_screenshot_params.rbi +++ /dev/null @@ -1,236 +0,0 @@ -# typed: strong - -module ContextDev - module Models - class WebScreenshotParams < ContextDev::Internal::Type::BaseModel - extend ContextDev::Internal::Type::RequestParameters::Converter - include ContextDev::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any(ContextDev::WebScreenshotParams, ContextDev::Internal::AnyHash) - end - - # A specific URL to screenshot directly, bypassing domain resolution (e.g., - # 'https://example.com/pricing'). When provided, the screenshot is taken of this - # exact URL. - sig { returns(T.nilable(String)) } - attr_reader :direct_url - - sig { params(direct_url: String).void } - attr_writer :direct_url - - # Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. - sig { returns(T.nilable(String)) } - attr_reader :domain - - sig { params(domain: String).void } - attr_writer :domain - - # Optional parameter to determine screenshot type. If 'true', takes a full page - # screenshot capturing all content. If 'false' or not provided, takes a viewport - # screenshot (standard browser view). - sig do - returns( - T.nilable(ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol) - ) - end - attr_reader :full_screenshot - - sig do - params( - full_screenshot: - ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol - ).void - end - attr_writer :full_screenshot - - # 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. Only applicable when using - # 'domain', not 'directUrl'. - sig do - returns(T.nilable(ContextDev::WebScreenshotParams::Page::OrSymbol)) - end - attr_reader :page - - sig { params(page: ContextDev::WebScreenshotParams::Page::OrSymbol).void } - attr_writer :page - - # 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. - sig do - returns( - T.nilable(ContextDev::WebScreenshotParams::Prioritize::OrSymbol) - ) - end - attr_reader :prioritize - - sig do - params( - prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol - ).void - end - attr_writer :prioritize - - sig do - params( - direct_url: String, - domain: String, - full_screenshot: - ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol, - page: ContextDev::WebScreenshotParams::Page::OrSymbol, - prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol, - request_options: ContextDev::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # A specific URL to screenshot directly, bypassing domain resolution (e.g., - # 'https://example.com/pricing'). When provided, the screenshot is taken of this - # exact URL. - direct_url: nil, - # Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. - domain: nil, - # Optional parameter to determine screenshot type. If 'true', takes a full page - # screenshot capturing all content. If 'false' or not provided, takes a viewport - # screenshot (standard browser view). - full_screenshot: nil, - # 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. Only applicable when using - # 'domain', not 'directUrl'. - page: nil, - # 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. - prioritize: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - direct_url: String, - domain: String, - full_screenshot: - ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol, - page: ContextDev::WebScreenshotParams::Page::OrSymbol, - prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol, - request_options: ContextDev::RequestOptions - } - ) - end - def to_hash - end - - # Optional parameter to determine screenshot type. If 'true', takes a full page - # screenshot capturing all content. If 'false' or not provided, takes a viewport - # screenshot (standard browser view). - module FullScreenshot - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ContextDev::WebScreenshotParams::FullScreenshot) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TRUE = - T.let( - :true, - ContextDev::WebScreenshotParams::FullScreenshot::TaggedSymbol - ) - FALSE = - T.let( - :false, - ContextDev::WebScreenshotParams::FullScreenshot::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ContextDev::WebScreenshotParams::FullScreenshot::TaggedSymbol - ] - ) - end - def self.values - end - end - - # 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. Only applicable when using - # 'domain', not 'directUrl'. - module Page - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, ContextDev::WebScreenshotParams::Page) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - LOGIN = - T.let(:login, ContextDev::WebScreenshotParams::Page::TaggedSymbol) - SIGNUP = - T.let(:signup, ContextDev::WebScreenshotParams::Page::TaggedSymbol) - BLOG = T.let(:blog, ContextDev::WebScreenshotParams::Page::TaggedSymbol) - CAREERS = - T.let(:careers, ContextDev::WebScreenshotParams::Page::TaggedSymbol) - PRICING = - T.let(:pricing, ContextDev::WebScreenshotParams::Page::TaggedSymbol) - TERMS = - T.let(:terms, ContextDev::WebScreenshotParams::Page::TaggedSymbol) - PRIVACY = - T.let(:privacy, ContextDev::WebScreenshotParams::Page::TaggedSymbol) - CONTACT = - T.let(:contact, ContextDev::WebScreenshotParams::Page::TaggedSymbol) - - sig do - override.returns( - T::Array[ContextDev::WebScreenshotParams::Page::TaggedSymbol] - ) - end - def self.values - end - end - - # 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. - module Prioritize - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ContextDev::WebScreenshotParams::Prioritize) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - SPEED = - T.let( - :speed, - ContextDev::WebScreenshotParams::Prioritize::TaggedSymbol - ) - QUALITY = - T.let( - :quality, - ContextDev::WebScreenshotParams::Prioritize::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ContextDev::WebScreenshotParams::Prioritize::TaggedSymbol] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/context_dev/models/web_screenshot_response.rbi b/rbi/context_dev/models/web_screenshot_response.rbi deleted file mode 100644 index 96777ae1..00000000 --- a/rbi/context_dev/models/web_screenshot_response.rbi +++ /dev/null @@ -1,135 +0,0 @@ -# typed: strong - -module ContextDev - module Models - class WebScreenshotResponse < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::WebScreenshotResponse, - ContextDev::Internal::AnyHash - ) - end - - # HTTP status code - sig { returns(T.nilable(Integer)) } - attr_reader :code - - sig { params(code: Integer).void } - attr_writer :code - - # The normalized domain that was processed - sig { returns(T.nilable(String)) } - attr_reader :domain - - sig { params(domain: String).void } - attr_writer :domain - - # Public URL of the uploaded screenshot image - sig { returns(T.nilable(String)) } - attr_reader :screenshot - - sig { params(screenshot: String).void } - attr_writer :screenshot - - # Type of screenshot that was captured - sig do - returns( - T.nilable( - ContextDev::Models::WebScreenshotResponse::ScreenshotType::TaggedSymbol - ) - ) - end - attr_reader :screenshot_type - - sig do - params( - screenshot_type: - ContextDev::Models::WebScreenshotResponse::ScreenshotType::OrSymbol - ).void - end - attr_writer :screenshot_type - - # Status of the response, e.g., 'ok' - sig { returns(T.nilable(String)) } - attr_reader :status - - sig { params(status: String).void } - attr_writer :status - - sig do - params( - code: Integer, - domain: String, - screenshot: String, - screenshot_type: - ContextDev::Models::WebScreenshotResponse::ScreenshotType::OrSymbol, - status: String - ).returns(T.attached_class) - end - def self.new( - # HTTP status code - code: nil, - # The normalized domain that was processed - domain: nil, - # Public URL of the uploaded screenshot image - screenshot: nil, - # Type of screenshot that was captured - screenshot_type: nil, - # Status of the response, e.g., 'ok' - status: nil - ) - end - - sig do - override.returns( - { - code: Integer, - domain: String, - screenshot: String, - screenshot_type: - ContextDev::Models::WebScreenshotResponse::ScreenshotType::TaggedSymbol, - status: String - } - ) - end - def to_hash - end - - # Type of screenshot that was captured - module ScreenshotType - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ContextDev::Models::WebScreenshotResponse::ScreenshotType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - VIEWPORT = - T.let( - :viewport, - ContextDev::Models::WebScreenshotResponse::ScreenshotType::TaggedSymbol - ) - FULL_PAGE = - T.let( - :fullPage, - ContextDev::Models::WebScreenshotResponse::ScreenshotType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ContextDev::Models::WebScreenshotResponse::ScreenshotType::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index 799d6352..372816b9 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -4,8 +4,7 @@ module ContextDev module Resources class Web # Scrape font information from a website including font families, usage - # statistics, fallbacks, and element/word counts. Either 'domain' or 'directUrl' - # must be provided as a query parameter, but not both. + # statistics, fallbacks, and element/word counts. sig do params( direct_url: String, @@ -29,48 +28,6 @@ module ContextDev ) end - # Capture a screenshot of a website. Supports both viewport (standard browser - # view) and full-page screenshots. Can also screenshot specific page types (login, - # pricing, etc.) by using heuristics to find the appropriate URL. Either 'domain' - # or 'directUrl' must be provided as a query parameter, but not both. Returns a - # URL to the uploaded screenshot image hosted on our CDN. - sig do - params( - direct_url: String, - domain: String, - full_screenshot: - ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol, - page: ContextDev::WebScreenshotParams::Page::OrSymbol, - prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol, - request_options: ContextDev::RequestOptions::OrHash - ).returns(ContextDev::Models::WebScreenshotResponse) - end - def screenshot( - # A specific URL to screenshot directly, bypassing domain resolution (e.g., - # 'https://example.com/pricing'). When provided, the screenshot is taken of this - # exact URL. - direct_url: nil, - # Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. - domain: nil, - # Optional parameter to determine screenshot type. If 'true', takes a full page - # screenshot capturing all content. If 'false' or not provided, takes a viewport - # screenshot (standard browser view). - full_screenshot: nil, - # 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. Only applicable when using - # 'domain', not 'directUrl'. - page: nil, - # 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. - prioritize: nil, - request_options: {} - ) - end - # Performs a crawl starting from a given URL, extracts page content as Markdown, # and returns results for all crawled pages. sig do diff --git a/sig/context_dev/models.rbs b/sig/context_dev/models.rbs index dbab011e..d6ad48df 100644 --- a/sig/context_dev/models.rbs +++ b/sig/context_dev/models.rbs @@ -29,8 +29,6 @@ module ContextDev class WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams - class WebScreenshotParams = ContextDev::Models::WebScreenshotParams - class WebWebCrawlMdParams = ContextDev::Models::WebWebCrawlMdParams class WebWebScrapeHTMLParams = ContextDev::Models::WebWebScrapeHTMLParams diff --git a/sig/context_dev/models/web_screenshot_params.rbs b/sig/context_dev/models/web_screenshot_params.rbs deleted file mode 100644 index dd9f81ea..00000000 --- a/sig/context_dev/models/web_screenshot_params.rbs +++ /dev/null @@ -1,109 +0,0 @@ -module ContextDev - module Models - type web_screenshot_params = - { - direct_url: String, - domain: String, - full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, - page: ContextDev::Models::WebScreenshotParams::page, - prioritize: ContextDev::Models::WebScreenshotParams::prioritize - } - & ContextDev::Internal::Type::request_parameters - - class WebScreenshotParams < ContextDev::Internal::Type::BaseModel - extend ContextDev::Internal::Type::RequestParameters::Converter - include ContextDev::Internal::Type::RequestParameters - - attr_reader direct_url: String? - - def direct_url=: (String) -> String - - attr_reader domain: String? - - def domain=: (String) -> String - - attr_reader full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot? - - def full_screenshot=: ( - ContextDev::Models::WebScreenshotParams::full_screenshot - ) -> ContextDev::Models::WebScreenshotParams::full_screenshot - - attr_reader page: ContextDev::Models::WebScreenshotParams::page? - - def page=: ( - ContextDev::Models::WebScreenshotParams::page - ) -> ContextDev::Models::WebScreenshotParams::page - - attr_reader prioritize: ContextDev::Models::WebScreenshotParams::prioritize? - - def prioritize=: ( - ContextDev::Models::WebScreenshotParams::prioritize - ) -> ContextDev::Models::WebScreenshotParams::prioritize - - def initialize: ( - ?direct_url: String, - ?domain: String, - ?full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, - ?page: ContextDev::Models::WebScreenshotParams::page, - ?prioritize: ContextDev::Models::WebScreenshotParams::prioritize, - ?request_options: ContextDev::request_opts - ) -> void - - def to_hash: -> { - direct_url: String, - domain: String, - full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, - page: ContextDev::Models::WebScreenshotParams::page, - prioritize: ContextDev::Models::WebScreenshotParams::prioritize, - request_options: ContextDev::RequestOptions - } - - type full_screenshot = :true | :false - - module FullScreenshot - extend ContextDev::Internal::Type::Enum - - TRUE: :true - FALSE: :false - - def self?.values: -> ::Array[ContextDev::Models::WebScreenshotParams::full_screenshot] - end - - type page = - :login - | :signup - | :blog - | :careers - | :pricing - | :terms - | :privacy - | :contact - - module Page - extend ContextDev::Internal::Type::Enum - - LOGIN: :login - SIGNUP: :signup - BLOG: :blog - CAREERS: :careers - PRICING: :pricing - TERMS: :terms - PRIVACY: :privacy - CONTACT: :contact - - def self?.values: -> ::Array[ContextDev::Models::WebScreenshotParams::page] - end - - type prioritize = :speed | :quality - - module Prioritize - extend ContextDev::Internal::Type::Enum - - SPEED: :speed - QUALITY: :quality - - def self?.values: -> ::Array[ContextDev::Models::WebScreenshotParams::prioritize] - end - end - end -end diff --git a/sig/context_dev/models/web_screenshot_response.rbs b/sig/context_dev/models/web_screenshot_response.rbs deleted file mode 100644 index eb698c60..00000000 --- a/sig/context_dev/models/web_screenshot_response.rbs +++ /dev/null @@ -1,63 +0,0 @@ -module ContextDev - module Models - type web_screenshot_response = - { - code: Integer, - domain: String, - screenshot: String, - screenshot_type: ContextDev::Models::WebScreenshotResponse::screenshot_type, - status: String - } - - class WebScreenshotResponse < ContextDev::Internal::Type::BaseModel - attr_reader code: Integer? - - def code=: (Integer) -> Integer - - attr_reader domain: String? - - def domain=: (String) -> String - - attr_reader screenshot: String? - - def screenshot=: (String) -> String - - attr_reader screenshot_type: ContextDev::Models::WebScreenshotResponse::screenshot_type? - - def screenshot_type=: ( - ContextDev::Models::WebScreenshotResponse::screenshot_type - ) -> ContextDev::Models::WebScreenshotResponse::screenshot_type - - attr_reader status: String? - - def status=: (String) -> String - - def initialize: ( - ?code: Integer, - ?domain: String, - ?screenshot: String, - ?screenshot_type: ContextDev::Models::WebScreenshotResponse::screenshot_type, - ?status: String - ) -> void - - def to_hash: -> { - code: Integer, - domain: String, - screenshot: String, - screenshot_type: ContextDev::Models::WebScreenshotResponse::screenshot_type, - status: String - } - - type screenshot_type = :viewport | :fullPage - - module ScreenshotType - extend ContextDev::Internal::Type::Enum - - VIEWPORT: :viewport - FULL_PAGE: :fullPage - - def self?.values: -> ::Array[ContextDev::Models::WebScreenshotResponse::screenshot_type] - end - end - end -end diff --git a/sig/context_dev/resources/web.rbs b/sig/context_dev/resources/web.rbs index 539e896b..6487b8e9 100644 --- a/sig/context_dev/resources/web.rbs +++ b/sig/context_dev/resources/web.rbs @@ -8,15 +8,6 @@ module ContextDev ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebExtractFontsResponse - def screenshot: ( - ?direct_url: String, - ?domain: String, - ?full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, - ?page: ContextDev::Models::WebScreenshotParams::page, - ?prioritize: ContextDev::Models::WebScreenshotParams::prioritize, - ?request_options: ContextDev::request_opts - ) -> ContextDev::Models::WebScreenshotResponse - def web_crawl_md: ( url: String, ?follow_subdomains: bool, diff --git a/test/context_dev/resources/web_test.rb b/test/context_dev/resources/web_test.rb index 4b94839c..3a88bcd6 100644 --- a/test/context_dev/resources/web_test.rb +++ b/test/context_dev/resources/web_test.rb @@ -22,26 +22,6 @@ def test_extract_fonts end end - def test_screenshot - skip("Mock server tests are disabled") - - response = @context_dev.web.screenshot - - assert_pattern do - response => ContextDev::Models::WebScreenshotResponse - end - - assert_pattern do - response => { - code: Integer | nil, - domain: String | nil, - screenshot: String | nil, - screenshot_type: ContextDev::Models::WebScreenshotResponse::ScreenshotType | nil, - status: String | nil - } - end - end - def test_web_crawl_md_required_params skip("Mock server tests are disabled") From 55529f63e23cf255645bdb2d0420bf24aaba28b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 23:11:48 +0000 Subject: [PATCH 16/25] feat(api): api update --- .stats.yml | 6 +- lib/context_dev.rb | 2 - lib/context_dev/models.rb | 2 - .../models/style_extract_styleguide_params.rb | 45 - .../style_extract_styleguide_response.rb | 1118 ---------- .../models/web_extract_fonts_params.rb | 6 +- lib/context_dev/resources/style.rb | 33 - rbi/context_dev/models.rbi | 3 - .../style_extract_styleguide_params.rbi | 79 - .../style_extract_styleguide_response.rbi | 1790 ----------------- .../models/web_extract_fonts_params.rbi | 12 +- rbi/context_dev/resources/style.rbi | 27 - rbi/context_dev/resources/web.rbi | 6 +- sig/context_dev/models.rbs | 2 - .../style_extract_styleguide_params.rbs | 38 - .../style_extract_styleguide_response.rbs | 945 --------- sig/context_dev/resources/style.rbs | 7 - test/context_dev/resources/style_test.rb | 18 - 18 files changed, 19 insertions(+), 4120 deletions(-) delete mode 100644 lib/context_dev/models/style_extract_styleguide_params.rb delete mode 100644 lib/context_dev/models/style_extract_styleguide_response.rb delete mode 100644 rbi/context_dev/models/style_extract_styleguide_params.rbi delete mode 100644 rbi/context_dev/models/style_extract_styleguide_response.rbi delete mode 100644 sig/context_dev/models/style_extract_styleguide_params.rbs delete mode 100644 sig/context_dev/models/style_extract_styleguide_response.rbs diff --git a/.stats.yml b/.stats.yml index 2ed55aea..912df3b2 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-142c1d289d90b82edca3269964fc4fd6595f0e97c36b42a88b6f774fa5e65c10.yml -openapi_spec_hash: 1dc3e05add427f444e7714173c2fe8a9 +configured_endpoints: 19 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-3c753cf7c4d04fe467710a51b1a2f6f024b0b6a670704be7340b92e064bcf1a9.yml +openapi_spec_hash: f9b02e6756001e2be87d541d5cc609e5 config_hash: 859455bbffc8a009cd9b5eed9b3ba2d7 diff --git a/lib/context_dev.rb b/lib/context_dev.rb index 221c6c91..f2b74b7a 100644 --- a/lib/context_dev.rb +++ b/lib/context_dev.rb @@ -74,8 +74,6 @@ require_relative "context_dev/models/brand_retrieve_simplified_response" require_relative "context_dev/models/industry_retrieve_naics_params" require_relative "context_dev/models/industry_retrieve_naics_response" -require_relative "context_dev/models/style_extract_styleguide_params" -require_relative "context_dev/models/style_extract_styleguide_response" require_relative "context_dev/models/utility_prefetch_by_email_params" require_relative "context_dev/models/utility_prefetch_by_email_response" require_relative "context_dev/models/utility_prefetch_params" diff --git a/lib/context_dev/models.rb b/lib/context_dev/models.rb index 976c5fe5..780007bf 100644 --- a/lib/context_dev/models.rb +++ b/lib/context_dev/models.rb @@ -61,8 +61,6 @@ module ContextDev IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams - StyleExtractStyleguideParams = ContextDev::Models::StyleExtractStyleguideParams - UtilityPrefetchByEmailParams = ContextDev::Models::UtilityPrefetchByEmailParams UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams diff --git a/lib/context_dev/models/style_extract_styleguide_params.rb b/lib/context_dev/models/style_extract_styleguide_params.rb deleted file mode 100644 index ec82e7ef..00000000 --- a/lib/context_dev/models/style_extract_styleguide_params.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -module ContextDev - module Models - # @see ContextDev::Resources::Style#extract_styleguide - class StyleExtractStyleguideParams < ContextDev::Internal::Type::BaseModel - extend ContextDev::Internal::Type::RequestParameters::Converter - include ContextDev::Internal::Type::RequestParameters - - # @!attribute direct_url - # A specific URL to fetch the styleguide from directly, bypassing domain - # resolution (e.g., 'https://example.com/design-system'). - # - # @return [String, nil] - optional :direct_url, String - - # @!attribute domain - # Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. - # - # @return [String, nil] - optional :domain, String - - # @!attribute 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). - # - # @return [Integer, nil] - optional :timeout_ms, Integer - - # @!method initialize(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {ContextDev::Models::StyleExtractStyleguideParams} for more details. - # - # @param direct_url [String] A specific URL to fetch the styleguide from directly, bypassing domain resolutio - # - # @param domain [String] Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The - # - # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th - # - # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/context_dev/models/style_extract_styleguide_response.rb b/lib/context_dev/models/style_extract_styleguide_response.rb deleted file mode 100644 index 47f3c214..00000000 --- a/lib/context_dev/models/style_extract_styleguide_response.rb +++ /dev/null @@ -1,1118 +0,0 @@ -# frozen_string_literal: true - -module ContextDev - module Models - # @see ContextDev::Resources::Style#extract_styleguide - class StyleExtractStyleguideResponse < ContextDev::Internal::Type::BaseModel - # @!attribute code - # HTTP status code - # - # @return [Integer, nil] - optional :code, Integer - - # @!attribute domain - # The normalized domain that was processed - # - # @return [String, nil] - optional :domain, String - - # @!attribute status - # Status of the response, e.g., 'ok' - # - # @return [String, nil] - optional :status, String - - # @!attribute styleguide - # Comprehensive styleguide data extracted from the website - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide, nil] - optional :styleguide, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide } - - # @!method initialize(code: nil, domain: nil, status: nil, styleguide: nil) - # @param code [Integer] HTTP status code - # - # @param domain [String] The normalized domain that was processed - # - # @param status [String] Status of the response, e.g., 'ok' - # - # @param styleguide [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide] Comprehensive styleguide data extracted from the website - - # @see ContextDev::Models::StyleExtractStyleguideResponse#styleguide - class Styleguide < ContextDev::Internal::Type::BaseModel - # @!attribute colors - # Primary colors used on the website - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors] - required :colors, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors } - - # @!attribute components - # UI component styles - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components] - required :components, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components } - - # @!attribute element_spacing - # Spacing system used on the website - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing] - required :element_spacing, - -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing }, - api_name: :elementSpacing - - # @!attribute font_links - # Font assets keyed by family name as it appears in fontFamily/fontFallbacks - # (non-generic names only). Clients match typography.fontFamily / fontWeight or - # button styles to pick a file URL from files. - # - # @return [Hash{Symbol=>ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink}] - required :font_links, - -> { ContextDev::Internal::Type::HashOf[ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink] }, - api_name: :fontLinks - - # @!attribute mode - # The primary color mode of the website design - # - # @return [Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode] - required :mode, enum: -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode } - - # @!attribute shadows - # Shadow styles used on the website - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows] - required :shadows, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows } - - # @!attribute typography - # Typography styles used on the website - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography] - required :typography, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography } - - # @!method initialize(colors:, components:, element_spacing:, font_links:, mode:, shadows:, typography:) - # Some parameter documentations has been truncated, see - # {ContextDev::Models::StyleExtractStyleguideResponse::Styleguide} for more - # details. - # - # Comprehensive styleguide data extracted from the website - # - # @param colors [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors] Primary colors used on the website - # - # @param components [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components] UI component styles - # - # @param element_spacing [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing] Spacing system used on the website - # - # @param font_links [Hash{Symbol=>ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink}] Font assets keyed by family name as it appears in fontFamily/fontFallbacks (non- - # - # @param mode [Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode] The primary color mode of the website design - # - # @param shadows [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows] Shadow styles used on the website - # - # @param typography [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography] Typography styles used on the website - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide#colors - class Colors < ContextDev::Internal::Type::BaseModel - # @!attribute accent - # Accent color (hex format) - # - # @return [String] - required :accent, String - - # @!attribute background - # Background color (hex format) - # - # @return [String] - required :background, String - - # @!attribute text - # Text color (hex format) - # - # @return [String] - required :text, String - - # @!method initialize(accent:, background:, text:) - # Primary colors used on the website - # - # @param accent [String] Accent color (hex format) - # - # @param background [String] Background color (hex format) - # - # @param text [String] Text color (hex format) - end - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide#components - class Components < ContextDev::Internal::Type::BaseModel - # @!attribute button - # Button component styles - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button] - required :button, - -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button } - - # @!attribute card - # Card component style - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card, nil] - optional :card, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card } - - # @!method initialize(button:, card: nil) - # UI component styles - # - # @param button [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button] Button component styles - # - # @param card [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card] Card component style - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components#button - class Button < ContextDev::Internal::Type::BaseModel - # @!attribute link - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link, nil] - optional :link, - -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link } - - # @!attribute primary - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary, nil] - optional :primary, - -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary } - - # @!attribute secondary - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary, nil] - optional :secondary, - -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary } - - # @!method initialize(link: nil, primary: nil, secondary: nil) - # Button component styles - # - # @param link [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link] - # @param primary [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary] - # @param secondary [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary] - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button#link - class Link < ContextDev::Internal::Type::BaseModel - # @!attribute background_color - # - # @return [String] - required :background_color, String, api_name: :backgroundColor - - # @!attribute border_color - # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has - # alpha) - # - # @return [String] - required :border_color, String, api_name: :borderColor - - # @!attribute border_radius - # - # @return [String] - required :border_radius, String, api_name: :borderRadius - - # @!attribute border_style - # - # @return [String] - required :border_style, String, api_name: :borderStyle - - # @!attribute border_width - # - # @return [String] - required :border_width, String, api_name: :borderWidth - - # @!attribute box_shadow - # Computed box-shadow (comma-separated layers when present) - # - # @return [String] - required :box_shadow, String, api_name: :boxShadow - - # @!attribute color - # - # @return [String] - required :color, String - - # @!attribute css - # Ready-to-use CSS declaration block for this component style - # - # @return [String] - required :css, String - - # @!attribute font_size - # - # @return [String] - required :font_size, String, api_name: :fontSize - - # @!attribute font_weight - # - # @return [Float] - required :font_weight, Float, api_name: :fontWeight - - # @!attribute min_height - # Sampled minimum height of the button box (typically px) - # - # @return [String] - required :min_height, String, api_name: :minHeight - - # @!attribute min_width - # Sampled minimum width of the button box (typically px) - # - # @return [String] - required :min_width, String, api_name: :minWidth - - # @!attribute padding - # - # @return [String] - required :padding, String - - # @!attribute text_decoration - # - # @return [String] - required :text_decoration, String, api_name: :textDecoration - - # @!attribute font_fallbacks - # Full ordered font list from computed font-family - # - # @return [Array, nil] - optional :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks - - # @!attribute font_family - # Primary button typeface (first in fontFallbacks) - # - # @return [String, nil] - optional :font_family, String, api_name: :fontFamily - - # @!attribute text_decoration_color - # Hex color of the underline when it differs from the text color - # - # @return [String, nil] - optional :text_decoration_color, String, api_name: :textDecorationColor - - # @!method initialize(background_color:, border_color:, border_radius:, border_style:, border_width:, box_shadow:, color:, css:, font_size:, font_weight:, min_height:, min_width:, padding:, text_decoration:, font_fallbacks: nil, font_family: nil, text_decoration_color: nil) - # Some parameter documentations has been truncated, see - # {ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link} - # for more details. - # - # @param background_color [String] - # - # @param border_color [String] Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alp - # - # @param border_radius [String] - # - # @param border_style [String] - # - # @param border_width [String] - # - # @param box_shadow [String] Computed box-shadow (comma-separated layers when present) - # - # @param color [String] - # - # @param css [String] Ready-to-use CSS declaration block for this component style - # - # @param font_size [String] - # - # @param font_weight [Float] - # - # @param min_height [String] Sampled minimum height of the button box (typically px) - # - # @param min_width [String] Sampled minimum width of the button box (typically px) - # - # @param padding [String] - # - # @param text_decoration [String] - # - # @param font_fallbacks [Array] Full ordered font list from computed font-family - # - # @param font_family [String] Primary button typeface (first in fontFallbacks) - # - # @param text_decoration_color [String] Hex color of the underline when it differs from the text color - end - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button#primary - class Primary < ContextDev::Internal::Type::BaseModel - # @!attribute background_color - # - # @return [String] - required :background_color, String, api_name: :backgroundColor - - # @!attribute border_color - # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has - # alpha) - # - # @return [String] - required :border_color, String, api_name: :borderColor - - # @!attribute border_radius - # - # @return [String] - required :border_radius, String, api_name: :borderRadius - - # @!attribute border_style - # - # @return [String] - required :border_style, String, api_name: :borderStyle - - # @!attribute border_width - # - # @return [String] - required :border_width, String, api_name: :borderWidth - - # @!attribute box_shadow - # Computed box-shadow (comma-separated layers when present) - # - # @return [String] - required :box_shadow, String, api_name: :boxShadow - - # @!attribute color - # - # @return [String] - required :color, String - - # @!attribute css - # Ready-to-use CSS declaration block for this component style - # - # @return [String] - required :css, String - - # @!attribute font_size - # - # @return [String] - required :font_size, String, api_name: :fontSize - - # @!attribute font_weight - # - # @return [Float] - required :font_weight, Float, api_name: :fontWeight - - # @!attribute min_height - # Sampled minimum height of the button box (typically px) - # - # @return [String] - required :min_height, String, api_name: :minHeight - - # @!attribute min_width - # Sampled minimum width of the button box (typically px) - # - # @return [String] - required :min_width, String, api_name: :minWidth - - # @!attribute padding - # - # @return [String] - required :padding, String - - # @!attribute text_decoration - # - # @return [String] - required :text_decoration, String, api_name: :textDecoration - - # @!attribute font_fallbacks - # Full ordered font list from computed font-family - # - # @return [Array, nil] - optional :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks - - # @!attribute font_family - # Primary button typeface (first in fontFallbacks) - # - # @return [String, nil] - optional :font_family, String, api_name: :fontFamily - - # @!attribute text_decoration_color - # Hex color of the underline when it differs from the text color - # - # @return [String, nil] - optional :text_decoration_color, String, api_name: :textDecorationColor - - # @!method initialize(background_color:, border_color:, border_radius:, border_style:, border_width:, box_shadow:, color:, css:, font_size:, font_weight:, min_height:, min_width:, padding:, text_decoration:, font_fallbacks: nil, font_family: nil, text_decoration_color: nil) - # Some parameter documentations has been truncated, see - # {ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary} - # for more details. - # - # @param background_color [String] - # - # @param border_color [String] Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alp - # - # @param border_radius [String] - # - # @param border_style [String] - # - # @param border_width [String] - # - # @param box_shadow [String] Computed box-shadow (comma-separated layers when present) - # - # @param color [String] - # - # @param css [String] Ready-to-use CSS declaration block for this component style - # - # @param font_size [String] - # - # @param font_weight [Float] - # - # @param min_height [String] Sampled minimum height of the button box (typically px) - # - # @param min_width [String] Sampled minimum width of the button box (typically px) - # - # @param padding [String] - # - # @param text_decoration [String] - # - # @param font_fallbacks [Array] Full ordered font list from computed font-family - # - # @param font_family [String] Primary button typeface (first in fontFallbacks) - # - # @param text_decoration_color [String] Hex color of the underline when it differs from the text color - end - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button#secondary - class Secondary < ContextDev::Internal::Type::BaseModel - # @!attribute background_color - # - # @return [String] - required :background_color, String, api_name: :backgroundColor - - # @!attribute border_color - # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has - # alpha) - # - # @return [String] - required :border_color, String, api_name: :borderColor - - # @!attribute border_radius - # - # @return [String] - required :border_radius, String, api_name: :borderRadius - - # @!attribute border_style - # - # @return [String] - required :border_style, String, api_name: :borderStyle - - # @!attribute border_width - # - # @return [String] - required :border_width, String, api_name: :borderWidth - - # @!attribute box_shadow - # Computed box-shadow (comma-separated layers when present) - # - # @return [String] - required :box_shadow, String, api_name: :boxShadow - - # @!attribute color - # - # @return [String] - required :color, String - - # @!attribute css - # Ready-to-use CSS declaration block for this component style - # - # @return [String] - required :css, String - - # @!attribute font_size - # - # @return [String] - required :font_size, String, api_name: :fontSize - - # @!attribute font_weight - # - # @return [Float] - required :font_weight, Float, api_name: :fontWeight - - # @!attribute min_height - # Sampled minimum height of the button box (typically px) - # - # @return [String] - required :min_height, String, api_name: :minHeight - - # @!attribute min_width - # Sampled minimum width of the button box (typically px) - # - # @return [String] - required :min_width, String, api_name: :minWidth - - # @!attribute padding - # - # @return [String] - required :padding, String - - # @!attribute text_decoration - # - # @return [String] - required :text_decoration, String, api_name: :textDecoration - - # @!attribute font_fallbacks - # Full ordered font list from computed font-family - # - # @return [Array, nil] - optional :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks - - # @!attribute font_family - # Primary button typeface (first in fontFallbacks) - # - # @return [String, nil] - optional :font_family, String, api_name: :fontFamily - - # @!attribute text_decoration_color - # Hex color of the underline when it differs from the text color - # - # @return [String, nil] - optional :text_decoration_color, String, api_name: :textDecorationColor - - # @!method initialize(background_color:, border_color:, border_radius:, border_style:, border_width:, box_shadow:, color:, css:, font_size:, font_weight:, min_height:, min_width:, padding:, text_decoration:, font_fallbacks: nil, font_family: nil, text_decoration_color: nil) - # Some parameter documentations has been truncated, see - # {ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary} - # for more details. - # - # @param background_color [String] - # - # @param border_color [String] Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alp - # - # @param border_radius [String] - # - # @param border_style [String] - # - # @param border_width [String] - # - # @param box_shadow [String] Computed box-shadow (comma-separated layers when present) - # - # @param color [String] - # - # @param css [String] Ready-to-use CSS declaration block for this component style - # - # @param font_size [String] - # - # @param font_weight [Float] - # - # @param min_height [String] Sampled minimum height of the button box (typically px) - # - # @param min_width [String] Sampled minimum width of the button box (typically px) - # - # @param padding [String] - # - # @param text_decoration [String] - # - # @param font_fallbacks [Array] Full ordered font list from computed font-family - # - # @param font_family [String] Primary button typeface (first in fontFallbacks) - # - # @param text_decoration_color [String] Hex color of the underline when it differs from the text color - end - end - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components#card - class Card < ContextDev::Internal::Type::BaseModel - # @!attribute background_color - # - # @return [String] - required :background_color, String, api_name: :backgroundColor - - # @!attribute border_color - # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has - # alpha) - # - # @return [String] - required :border_color, String, api_name: :borderColor - - # @!attribute border_radius - # - # @return [String] - required :border_radius, String, api_name: :borderRadius - - # @!attribute border_style - # - # @return [String] - required :border_style, String, api_name: :borderStyle - - # @!attribute border_width - # - # @return [String] - required :border_width, String, api_name: :borderWidth - - # @!attribute box_shadow - # - # @return [String] - required :box_shadow, String, api_name: :boxShadow - - # @!attribute css - # Ready-to-use CSS declaration block for this component style - # - # @return [String] - required :css, String - - # @!attribute padding - # - # @return [String] - required :padding, String - - # @!attribute text_color - # - # @return [String] - required :text_color, String, api_name: :textColor - - # @!method initialize(background_color:, border_color:, border_radius:, border_style:, border_width:, box_shadow:, css:, padding:, text_color:) - # Some parameter documentations has been truncated, see - # {ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card} - # for more details. - # - # Card component style - # - # @param background_color [String] - # - # @param border_color [String] Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alp - # - # @param border_radius [String] - # - # @param border_style [String] - # - # @param border_width [String] - # - # @param box_shadow [String] - # - # @param css [String] Ready-to-use CSS declaration block for this component style - # - # @param padding [String] - # - # @param text_color [String] - end - end - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide#element_spacing - class ElementSpacing < ContextDev::Internal::Type::BaseModel - # @!attribute lg - # - # @return [String] - required :lg, String - - # @!attribute md - # - # @return [String] - required :md, String - - # @!attribute sm - # - # @return [String] - required :sm, String - - # @!attribute xl - # - # @return [String] - required :xl, String - - # @!attribute xs - # - # @return [String] - required :xs, String - - # @!method initialize(lg:, md:, sm:, xl:, xs:) - # Spacing system used on the website - # - # @param lg [String] - # @param md [String] - # @param sm [String] - # @param xl [String] - # @param xs [String] - end - - class FontLink < ContextDev::Internal::Type::BaseModel - # @!attribute files - # Upright font files keyed by weight string (e.g. "400" for regular, "500", - # "700"). Values are absolute URLs. - # - # @return [Hash{Symbol=>String}] - required :files, ContextDev::Internal::Type::HashOf[String] - - # @!attribute type - # - # @return [Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type] - required :type, - enum: -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type } - - # @!attribute category - # Google Fonts category when type is google (e.g. sans-serif, serif, monospace, - # display, handwriting). Omitted for custom fonts when unknown. - # - # @return [String, nil] - optional :category, String - - # @!attribute display_name - # Present when type is custom: human-readable name derived from the fontLinks key - # (strip build/hash suffixes, split camelCase / PascalCase, normalize separators). - # Google entries omit this. - # - # @return [String, nil] - optional :display_name, String, api_name: :displayName - - # @!method initialize(files:, type:, category: nil, display_name: nil) - # Some parameter documentations has been truncated, see - # {ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink} for - # more details. - # - # @param files [Hash{Symbol=>String}] Upright font files keyed by weight string (e.g. "400" for regular, "500", "700") - # - # @param type [Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type] - # - # @param category [String] Google Fonts category when type is google (e.g. sans-serif, serif, monospace, di - # - # @param display_name [String] Present when type is custom: human-readable name derived from the fontLinks key - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink#type - module Type - extend ContextDev::Internal::Type::Enum - - GOOGLE = :google - CUSTOM = :custom - - # @!method self.values - # @return [Array] - end - end - - # The primary color mode of the website design - # - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide#mode - module Mode - extend ContextDev::Internal::Type::Enum - - LIGHT = :light - DARK = :dark - - # @!method self.values - # @return [Array] - end - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide#shadows - class Shadows < ContextDev::Internal::Type::BaseModel - # @!attribute inner - # - # @return [String] - required :inner, String - - # @!attribute lg - # - # @return [String] - required :lg, String - - # @!attribute md - # - # @return [String] - required :md, String - - # @!attribute sm - # - # @return [String] - required :sm, String - - # @!attribute xl - # - # @return [String] - required :xl, String - - # @!method initialize(inner:, lg:, md:, sm:, xl:) - # Shadow styles used on the website - # - # @param inner [String] - # @param lg [String] - # @param md [String] - # @param sm [String] - # @param xl [String] - end - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide#typography - class Typography < ContextDev::Internal::Type::BaseModel - # @!attribute headings - # Heading styles - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings] - required :headings, - -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings } - - # @!attribute p_ - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P, nil] - optional :p_, - -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P }, - api_name: :p - - # @!method initialize(headings:, p_: nil) - # Typography styles used on the website - # - # @param headings [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings] Heading styles - # - # @param p_ [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P] - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography#headings - class Headings < ContextDev::Internal::Type::BaseModel - # @!attribute h1 - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H1, nil] - optional :h1, - -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H1 } - - # @!attribute h2 - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H2, nil] - optional :h2, - -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H2 } - - # @!attribute h3 - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H3, nil] - optional :h3, - -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H3 } - - # @!attribute h4 - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H4, nil] - optional :h4, - -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H4 } - - # @!method initialize(h1: nil, h2: nil, h3: nil, h4: nil) - # Heading styles - # - # @param h1 [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H1] - # @param h2 [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H2] - # @param h3 [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H3] - # @param h4 [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H4] - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings#h1 - class H1 < ContextDev::Internal::Type::BaseModel - # @!attribute font_fallbacks - # Full ordered font list from resolved computed font-family - # - # @return [Array] - required :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks - - # @!attribute font_family - # Primary face (first family in the computed stack) - # - # @return [String] - required :font_family, String, api_name: :fontFamily - - # @!attribute font_size - # - # @return [String] - required :font_size, String, api_name: :fontSize - - # @!attribute font_weight - # - # @return [Float] - required :font_weight, Float, api_name: :fontWeight - - # @!attribute letter_spacing - # - # @return [String] - required :letter_spacing, String, api_name: :letterSpacing - - # @!attribute line_height - # - # @return [String] - required :line_height, String, api_name: :lineHeight - - # @!method initialize(font_fallbacks:, font_family:, font_size:, font_weight:, letter_spacing:, line_height:) - # @param font_fallbacks [Array] Full ordered font list from resolved computed font-family - # - # @param font_family [String] Primary face (first family in the computed stack) - # - # @param font_size [String] - # - # @param font_weight [Float] - # - # @param letter_spacing [String] - # - # @param line_height [String] - end - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings#h2 - class H2 < ContextDev::Internal::Type::BaseModel - # @!attribute font_fallbacks - # Full ordered font list from resolved computed font-family - # - # @return [Array] - required :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks - - # @!attribute font_family - # Primary face (first family in the computed stack) - # - # @return [String] - required :font_family, String, api_name: :fontFamily - - # @!attribute font_size - # - # @return [String] - required :font_size, String, api_name: :fontSize - - # @!attribute font_weight - # - # @return [Float] - required :font_weight, Float, api_name: :fontWeight - - # @!attribute letter_spacing - # - # @return [String] - required :letter_spacing, String, api_name: :letterSpacing - - # @!attribute line_height - # - # @return [String] - required :line_height, String, api_name: :lineHeight - - # @!method initialize(font_fallbacks:, font_family:, font_size:, font_weight:, letter_spacing:, line_height:) - # @param font_fallbacks [Array] Full ordered font list from resolved computed font-family - # - # @param font_family [String] Primary face (first family in the computed stack) - # - # @param font_size [String] - # - # @param font_weight [Float] - # - # @param letter_spacing [String] - # - # @param line_height [String] - end - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings#h3 - class H3 < ContextDev::Internal::Type::BaseModel - # @!attribute font_fallbacks - # Full ordered font list from resolved computed font-family - # - # @return [Array] - required :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks - - # @!attribute font_family - # Primary face (first family in the computed stack) - # - # @return [String] - required :font_family, String, api_name: :fontFamily - - # @!attribute font_size - # - # @return [String] - required :font_size, String, api_name: :fontSize - - # @!attribute font_weight - # - # @return [Float] - required :font_weight, Float, api_name: :fontWeight - - # @!attribute letter_spacing - # - # @return [String] - required :letter_spacing, String, api_name: :letterSpacing - - # @!attribute line_height - # - # @return [String] - required :line_height, String, api_name: :lineHeight - - # @!method initialize(font_fallbacks:, font_family:, font_size:, font_weight:, letter_spacing:, line_height:) - # @param font_fallbacks [Array] Full ordered font list from resolved computed font-family - # - # @param font_family [String] Primary face (first family in the computed stack) - # - # @param font_size [String] - # - # @param font_weight [Float] - # - # @param letter_spacing [String] - # - # @param line_height [String] - end - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings#h4 - class H4 < ContextDev::Internal::Type::BaseModel - # @!attribute font_fallbacks - # Full ordered font list from resolved computed font-family - # - # @return [Array] - required :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks - - # @!attribute font_family - # Primary face (first family in the computed stack) - # - # @return [String] - required :font_family, String, api_name: :fontFamily - - # @!attribute font_size - # - # @return [String] - required :font_size, String, api_name: :fontSize - - # @!attribute font_weight - # - # @return [Float] - required :font_weight, Float, api_name: :fontWeight - - # @!attribute letter_spacing - # - # @return [String] - required :letter_spacing, String, api_name: :letterSpacing - - # @!attribute line_height - # - # @return [String] - required :line_height, String, api_name: :lineHeight - - # @!method initialize(font_fallbacks:, font_family:, font_size:, font_weight:, letter_spacing:, line_height:) - # @param font_fallbacks [Array] Full ordered font list from resolved computed font-family - # - # @param font_family [String] Primary face (first family in the computed stack) - # - # @param font_size [String] - # - # @param font_weight [Float] - # - # @param letter_spacing [String] - # - # @param line_height [String] - end - end - - # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography#p_ - class P < ContextDev::Internal::Type::BaseModel - # @!attribute font_fallbacks - # Full ordered font list from resolved computed font-family - # - # @return [Array] - required :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks - - # @!attribute font_family - # Primary face (first family in the computed stack) - # - # @return [String] - required :font_family, String, api_name: :fontFamily - - # @!attribute font_size - # - # @return [String] - required :font_size, String, api_name: :fontSize - - # @!attribute font_weight - # - # @return [Float] - required :font_weight, Float, api_name: :fontWeight - - # @!attribute letter_spacing - # - # @return [String] - required :letter_spacing, String, api_name: :letterSpacing - - # @!attribute line_height - # - # @return [String] - required :line_height, String, api_name: :lineHeight - - # @!method initialize(font_fallbacks:, font_family:, font_size:, font_weight:, letter_spacing:, line_height:) - # @param font_fallbacks [Array] Full ordered font list from resolved computed font-family - # - # @param font_family [String] Primary face (first family in the computed stack) - # - # @param font_size [String] - # - # @param font_weight [Float] - # - # @param letter_spacing [String] - # - # @param line_height [String] - end - end - end - end - end -end diff --git a/lib/context_dev/models/web_extract_fonts_params.rb b/lib/context_dev/models/web_extract_fonts_params.rb index 6dc07e8e..7a7a23d9 100644 --- a/lib/context_dev/models/web_extract_fonts_params.rb +++ b/lib/context_dev/models/web_extract_fonts_params.rb @@ -9,14 +9,16 @@ class WebExtractFontsParams < ContextDev::Internal::Type::BaseModel # @!attribute direct_url # A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., - # 'https://example.com/design-system'). + # 'https://example.com/design-system'). When provided, fonts are extracted from + # this exact URL. You must provide either 'domain' or 'directUrl', but not both. # # @return [String, nil] optional :direct_url, String # @!attribute domain # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. + # domain will be automatically normalized and validated. You must provide either + # 'domain' or 'directUrl', but not both. # # @return [String, nil] optional :domain, String diff --git a/lib/context_dev/resources/style.rb b/lib/context_dev/resources/style.rb index 6761626b..ea8601eb 100644 --- a/lib/context_dev/resources/style.rb +++ b/lib/context_dev/resources/style.rb @@ -3,39 +3,6 @@ module ContextDev module Resources class Style - # Some parameter documentations has been truncated, see - # {ContextDev::Models::StyleExtractStyleguideParams} for more details. - # - # Automatically extract comprehensive design system information from a brand's - # website including colors, typography, spacing, shadows, and UI components. - # Either 'domain' or 'directUrl' must be provided as a query parameter, but not - # both. - # - # @overload extract_styleguide(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {}) - # - # @param direct_url [String] A specific URL to fetch the styleguide from directly, bypassing domain resolutio - # - # @param domain [String] Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The - # - # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th - # - # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ContextDev::Models::StyleExtractStyleguideResponse] - # - # @see ContextDev::Models::StyleExtractStyleguideParams - def extract_styleguide(params = {}) - parsed, options = ContextDev::StyleExtractStyleguideParams.dump_request(params) - query = ContextDev::Internal::Util.encode_query_params(parsed) - @client.request( - method: :get, - path: "brand/styleguide", - query: query.transform_keys(direct_url: "directUrl", timeout_ms: "timeoutMS"), - model: ContextDev::Models::StyleExtractStyleguideResponse, - options: options - ) - end - # @api private # # @param client [ContextDev::Client] diff --git a/rbi/context_dev/models.rbi b/rbi/context_dev/models.rbi index d880d81f..884df958 100644 --- a/rbi/context_dev/models.rbi +++ b/rbi/context_dev/models.rbi @@ -25,9 +25,6 @@ module ContextDev IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams - StyleExtractStyleguideParams = - ContextDev::Models::StyleExtractStyleguideParams - UtilityPrefetchByEmailParams = ContextDev::Models::UtilityPrefetchByEmailParams diff --git a/rbi/context_dev/models/style_extract_styleguide_params.rbi b/rbi/context_dev/models/style_extract_styleguide_params.rbi deleted file mode 100644 index 6b43ec8c..00000000 --- a/rbi/context_dev/models/style_extract_styleguide_params.rbi +++ /dev/null @@ -1,79 +0,0 @@ -# typed: strong - -module ContextDev - module Models - class StyleExtractStyleguideParams < ContextDev::Internal::Type::BaseModel - extend ContextDev::Internal::Type::RequestParameters::Converter - include ContextDev::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ContextDev::StyleExtractStyleguideParams, - ContextDev::Internal::AnyHash - ) - end - - # A specific URL to fetch the styleguide from directly, bypassing domain - # resolution (e.g., 'https://example.com/design-system'). - sig { returns(T.nilable(String)) } - attr_reader :direct_url - - sig { params(direct_url: String).void } - attr_writer :direct_url - - # Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. - sig { returns(T.nilable(String)) } - attr_reader :domain - - sig { params(domain: String).void } - attr_writer :domain - - # 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). - sig { returns(T.nilable(Integer)) } - attr_reader :timeout_ms - - sig { params(timeout_ms: Integer).void } - attr_writer :timeout_ms - - sig do - params( - direct_url: String, - domain: String, - timeout_ms: Integer, - request_options: ContextDev::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # A specific URL to fetch the styleguide from directly, bypassing domain - # resolution (e.g., 'https://example.com/design-system'). - direct_url: nil, - # Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. - domain: nil, - # 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). - timeout_ms: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - direct_url: String, - domain: String, - timeout_ms: Integer, - request_options: ContextDev::RequestOptions - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/context_dev/models/style_extract_styleguide_response.rbi b/rbi/context_dev/models/style_extract_styleguide_response.rbi deleted file mode 100644 index 8608e338..00000000 --- a/rbi/context_dev/models/style_extract_styleguide_response.rbi +++ /dev/null @@ -1,1790 +0,0 @@ -# typed: strong - -module ContextDev - module Models - class StyleExtractStyleguideResponse < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse, - ContextDev::Internal::AnyHash - ) - end - - # HTTP status code - sig { returns(T.nilable(Integer)) } - attr_reader :code - - sig { params(code: Integer).void } - attr_writer :code - - # The normalized domain that was processed - sig { returns(T.nilable(String)) } - attr_reader :domain - - sig { params(domain: String).void } - attr_writer :domain - - # Status of the response, e.g., 'ok' - sig { returns(T.nilable(String)) } - attr_reader :status - - sig { params(status: String).void } - attr_writer :status - - # Comprehensive styleguide data extracted from the website - sig do - returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide - ) - ) - end - attr_reader :styleguide - - sig do - params( - styleguide: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::OrHash - ).void - end - attr_writer :styleguide - - sig do - params( - code: Integer, - domain: String, - status: String, - styleguide: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::OrHash - ).returns(T.attached_class) - end - def self.new( - # HTTP status code - code: nil, - # The normalized domain that was processed - domain: nil, - # Status of the response, e.g., 'ok' - status: nil, - # Comprehensive styleguide data extracted from the website - styleguide: nil - ) - end - - sig do - override.returns( - { - code: Integer, - domain: String, - status: String, - styleguide: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide - } - ) - end - def to_hash - end - - class Styleguide < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide, - ContextDev::Internal::AnyHash - ) - end - - # Primary colors used on the website - sig do - returns( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors - ) - end - attr_reader :colors - - sig do - params( - colors: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors::OrHash - ).void - end - attr_writer :colors - - # UI component styles - sig do - returns( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components - ) - end - attr_reader :components - - sig do - params( - components: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::OrHash - ).void - end - attr_writer :components - - # Spacing system used on the website - sig do - returns( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing - ) - end - attr_reader :element_spacing - - sig do - params( - element_spacing: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing::OrHash - ).void - end - attr_writer :element_spacing - - # Font assets keyed by family name as it appears in fontFamily/fontFallbacks - # (non-generic names only). Clients match typography.fontFamily / fontWeight or - # button styles to pick a file URL from files. - sig do - returns( - T::Hash[ - Symbol, - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink - ] - ) - end - attr_accessor :font_links - - # The primary color mode of the website design - sig do - returns( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode::TaggedSymbol - ) - end - attr_accessor :mode - - # Shadow styles used on the website - sig do - returns( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows - ) - end - attr_reader :shadows - - sig do - params( - shadows: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows::OrHash - ).void - end - attr_writer :shadows - - # Typography styles used on the website - sig do - returns( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography - ) - end - attr_reader :typography - - sig do - params( - typography: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::OrHash - ).void - end - attr_writer :typography - - # Comprehensive styleguide data extracted from the website - sig do - params( - colors: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors::OrHash, - components: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::OrHash, - element_spacing: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing::OrHash, - font_links: - T::Hash[ - Symbol, - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::OrHash - ], - mode: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode::OrSymbol, - shadows: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows::OrHash, - typography: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::OrHash - ).returns(T.attached_class) - end - def self.new( - # Primary colors used on the website - colors:, - # UI component styles - components:, - # Spacing system used on the website - element_spacing:, - # Font assets keyed by family name as it appears in fontFamily/fontFallbacks - # (non-generic names only). Clients match typography.fontFamily / fontWeight or - # button styles to pick a file URL from files. - font_links:, - # The primary color mode of the website design - mode:, - # Shadow styles used on the website - shadows:, - # Typography styles used on the website - typography: - ) - end - - sig do - override.returns( - { - colors: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors, - components: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components, - element_spacing: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing, - font_links: - T::Hash[ - Symbol, - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink - ], - mode: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode::TaggedSymbol, - shadows: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows, - typography: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography - } - ) - end - def to_hash - end - - class Colors < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors, - ContextDev::Internal::AnyHash - ) - end - - # Accent color (hex format) - sig { returns(String) } - attr_accessor :accent - - # Background color (hex format) - sig { returns(String) } - attr_accessor :background - - # Text color (hex format) - sig { returns(String) } - attr_accessor :text - - # Primary colors used on the website - sig do - params(accent: String, background: String, text: String).returns( - T.attached_class - ) - end - def self.new( - # Accent color (hex format) - accent:, - # Background color (hex format) - background:, - # Text color (hex format) - text: - ) - end - - sig do - override.returns( - { accent: String, background: String, text: String } - ) - end - def to_hash - end - end - - class Components < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components, - ContextDev::Internal::AnyHash - ) - end - - # Button component styles - sig do - returns( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button - ) - end - attr_reader :button - - sig do - params( - button: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::OrHash - ).void - end - attr_writer :button - - # Card component style - sig do - returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card - ) - ) - end - attr_reader :card - - sig do - params( - card: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card::OrHash - ).void - end - attr_writer :card - - # UI component styles - sig do - params( - button: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::OrHash, - card: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card::OrHash - ).returns(T.attached_class) - end - def self.new( - # Button component styles - button:, - # Card component style - card: nil - ) - end - - sig do - override.returns( - { - button: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button, - card: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card - } - ) - end - def to_hash - end - - class Button < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button, - ContextDev::Internal::AnyHash - ) - end - - sig do - returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link - ) - ) - end - attr_reader :link - - sig do - params( - link: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link::OrHash - ).void - end - attr_writer :link - - sig do - returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary - ) - ) - end - attr_reader :primary - - sig do - params( - primary: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary::OrHash - ).void - end - attr_writer :primary - - sig do - returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary - ) - ) - end - attr_reader :secondary - - sig do - params( - secondary: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary::OrHash - ).void - end - attr_writer :secondary - - # Button component styles - sig do - params( - link: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link::OrHash, - primary: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary::OrHash, - secondary: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary::OrHash - ).returns(T.attached_class) - end - def self.new(link: nil, primary: nil, secondary: nil) - end - - sig do - override.returns( - { - link: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link, - primary: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary, - secondary: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary - } - ) - end - def to_hash - end - - class Link < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link, - ContextDev::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :background_color - - # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has - # alpha) - sig { returns(String) } - attr_accessor :border_color - - sig { returns(String) } - attr_accessor :border_radius - - sig { returns(String) } - attr_accessor :border_style - - sig { returns(String) } - attr_accessor :border_width - - # Computed box-shadow (comma-separated layers when present) - sig { returns(String) } - attr_accessor :box_shadow - - sig { returns(String) } - attr_accessor :color - - # Ready-to-use CSS declaration block for this component style - sig { returns(String) } - attr_accessor :css - - sig { returns(String) } - attr_accessor :font_size - - sig { returns(Float) } - attr_accessor :font_weight - - # Sampled minimum height of the button box (typically px) - sig { returns(String) } - attr_accessor :min_height - - # Sampled minimum width of the button box (typically px) - sig { returns(String) } - attr_accessor :min_width - - sig { returns(String) } - attr_accessor :padding - - sig { returns(String) } - attr_accessor :text_decoration - - # Full ordered font list from computed font-family - sig { returns(T.nilable(T::Array[String])) } - attr_reader :font_fallbacks - - sig { params(font_fallbacks: T::Array[String]).void } - attr_writer :font_fallbacks - - # Primary button typeface (first in fontFallbacks) - sig { returns(T.nilable(String)) } - attr_reader :font_family - - sig { params(font_family: String).void } - attr_writer :font_family - - # Hex color of the underline when it differs from the text color - sig { returns(T.nilable(String)) } - attr_reader :text_decoration_color - - sig { params(text_decoration_color: String).void } - attr_writer :text_decoration_color - - sig do - params( - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - color: String, - css: String, - font_size: String, - font_weight: Float, - min_height: String, - min_width: String, - padding: String, - text_decoration: String, - font_fallbacks: T::Array[String], - font_family: String, - text_decoration_color: String - ).returns(T.attached_class) - end - def self.new( - background_color:, - # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has - # alpha) - border_color:, - border_radius:, - border_style:, - border_width:, - # Computed box-shadow (comma-separated layers when present) - box_shadow:, - color:, - # Ready-to-use CSS declaration block for this component style - css:, - font_size:, - font_weight:, - # Sampled minimum height of the button box (typically px) - min_height:, - # Sampled minimum width of the button box (typically px) - min_width:, - padding:, - text_decoration:, - # Full ordered font list from computed font-family - font_fallbacks: nil, - # Primary button typeface (first in fontFallbacks) - font_family: nil, - # Hex color of the underline when it differs from the text color - text_decoration_color: nil - ) - end - - sig do - override.returns( - { - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - color: String, - css: String, - font_size: String, - font_weight: Float, - min_height: String, - min_width: String, - padding: String, - text_decoration: String, - font_fallbacks: T::Array[String], - font_family: String, - text_decoration_color: String - } - ) - end - def to_hash - end - end - - class Primary < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary, - ContextDev::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :background_color - - # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has - # alpha) - sig { returns(String) } - attr_accessor :border_color - - sig { returns(String) } - attr_accessor :border_radius - - sig { returns(String) } - attr_accessor :border_style - - sig { returns(String) } - attr_accessor :border_width - - # Computed box-shadow (comma-separated layers when present) - sig { returns(String) } - attr_accessor :box_shadow - - sig { returns(String) } - attr_accessor :color - - # Ready-to-use CSS declaration block for this component style - sig { returns(String) } - attr_accessor :css - - sig { returns(String) } - attr_accessor :font_size - - sig { returns(Float) } - attr_accessor :font_weight - - # Sampled minimum height of the button box (typically px) - sig { returns(String) } - attr_accessor :min_height - - # Sampled minimum width of the button box (typically px) - sig { returns(String) } - attr_accessor :min_width - - sig { returns(String) } - attr_accessor :padding - - sig { returns(String) } - attr_accessor :text_decoration - - # Full ordered font list from computed font-family - sig { returns(T.nilable(T::Array[String])) } - attr_reader :font_fallbacks - - sig { params(font_fallbacks: T::Array[String]).void } - attr_writer :font_fallbacks - - # Primary button typeface (first in fontFallbacks) - sig { returns(T.nilable(String)) } - attr_reader :font_family - - sig { params(font_family: String).void } - attr_writer :font_family - - # Hex color of the underline when it differs from the text color - sig { returns(T.nilable(String)) } - attr_reader :text_decoration_color - - sig { params(text_decoration_color: String).void } - attr_writer :text_decoration_color - - sig do - params( - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - color: String, - css: String, - font_size: String, - font_weight: Float, - min_height: String, - min_width: String, - padding: String, - text_decoration: String, - font_fallbacks: T::Array[String], - font_family: String, - text_decoration_color: String - ).returns(T.attached_class) - end - def self.new( - background_color:, - # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has - # alpha) - border_color:, - border_radius:, - border_style:, - border_width:, - # Computed box-shadow (comma-separated layers when present) - box_shadow:, - color:, - # Ready-to-use CSS declaration block for this component style - css:, - font_size:, - font_weight:, - # Sampled minimum height of the button box (typically px) - min_height:, - # Sampled minimum width of the button box (typically px) - min_width:, - padding:, - text_decoration:, - # Full ordered font list from computed font-family - font_fallbacks: nil, - # Primary button typeface (first in fontFallbacks) - font_family: nil, - # Hex color of the underline when it differs from the text color - text_decoration_color: nil - ) - end - - sig do - override.returns( - { - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - color: String, - css: String, - font_size: String, - font_weight: Float, - min_height: String, - min_width: String, - padding: String, - text_decoration: String, - font_fallbacks: T::Array[String], - font_family: String, - text_decoration_color: String - } - ) - end - def to_hash - end - end - - class Secondary < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary, - ContextDev::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :background_color - - # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has - # alpha) - sig { returns(String) } - attr_accessor :border_color - - sig { returns(String) } - attr_accessor :border_radius - - sig { returns(String) } - attr_accessor :border_style - - sig { returns(String) } - attr_accessor :border_width - - # Computed box-shadow (comma-separated layers when present) - sig { returns(String) } - attr_accessor :box_shadow - - sig { returns(String) } - attr_accessor :color - - # Ready-to-use CSS declaration block for this component style - sig { returns(String) } - attr_accessor :css - - sig { returns(String) } - attr_accessor :font_size - - sig { returns(Float) } - attr_accessor :font_weight - - # Sampled minimum height of the button box (typically px) - sig { returns(String) } - attr_accessor :min_height - - # Sampled minimum width of the button box (typically px) - sig { returns(String) } - attr_accessor :min_width - - sig { returns(String) } - attr_accessor :padding - - sig { returns(String) } - attr_accessor :text_decoration - - # Full ordered font list from computed font-family - sig { returns(T.nilable(T::Array[String])) } - attr_reader :font_fallbacks - - sig { params(font_fallbacks: T::Array[String]).void } - attr_writer :font_fallbacks - - # Primary button typeface (first in fontFallbacks) - sig { returns(T.nilable(String)) } - attr_reader :font_family - - sig { params(font_family: String).void } - attr_writer :font_family - - # Hex color of the underline when it differs from the text color - sig { returns(T.nilable(String)) } - attr_reader :text_decoration_color - - sig { params(text_decoration_color: String).void } - attr_writer :text_decoration_color - - sig do - params( - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - color: String, - css: String, - font_size: String, - font_weight: Float, - min_height: String, - min_width: String, - padding: String, - text_decoration: String, - font_fallbacks: T::Array[String], - font_family: String, - text_decoration_color: String - ).returns(T.attached_class) - end - def self.new( - background_color:, - # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has - # alpha) - border_color:, - border_radius:, - border_style:, - border_width:, - # Computed box-shadow (comma-separated layers when present) - box_shadow:, - color:, - # Ready-to-use CSS declaration block for this component style - css:, - font_size:, - font_weight:, - # Sampled minimum height of the button box (typically px) - min_height:, - # Sampled minimum width of the button box (typically px) - min_width:, - padding:, - text_decoration:, - # Full ordered font list from computed font-family - font_fallbacks: nil, - # Primary button typeface (first in fontFallbacks) - font_family: nil, - # Hex color of the underline when it differs from the text color - text_decoration_color: nil - ) - end - - sig do - override.returns( - { - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - color: String, - css: String, - font_size: String, - font_weight: Float, - min_height: String, - min_width: String, - padding: String, - text_decoration: String, - font_fallbacks: T::Array[String], - font_family: String, - text_decoration_color: String - } - ) - end - def to_hash - end - end - end - - class Card < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card, - ContextDev::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :background_color - - # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has - # alpha) - sig { returns(String) } - attr_accessor :border_color - - sig { returns(String) } - attr_accessor :border_radius - - sig { returns(String) } - attr_accessor :border_style - - sig { returns(String) } - attr_accessor :border_width - - sig { returns(String) } - attr_accessor :box_shadow - - # Ready-to-use CSS declaration block for this component style - sig { returns(String) } - attr_accessor :css - - sig { returns(String) } - attr_accessor :padding - - sig { returns(String) } - attr_accessor :text_color - - # Card component style - sig do - params( - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - css: String, - padding: String, - text_color: String - ).returns(T.attached_class) - end - def self.new( - background_color:, - # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has - # alpha) - border_color:, - border_radius:, - border_style:, - border_width:, - box_shadow:, - # Ready-to-use CSS declaration block for this component style - css:, - padding:, - text_color: - ) - end - - sig do - override.returns( - { - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - css: String, - padding: String, - text_color: String - } - ) - end - def to_hash - end - end - end - - class ElementSpacing < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing, - ContextDev::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :lg - - sig { returns(String) } - attr_accessor :md - - sig { returns(String) } - attr_accessor :sm - - sig { returns(String) } - attr_accessor :xl - - sig { returns(String) } - attr_accessor :xs - - # Spacing system used on the website - sig do - params( - lg: String, - md: String, - sm: String, - xl: String, - xs: String - ).returns(T.attached_class) - end - def self.new(lg:, md:, sm:, xl:, xs:) - end - - sig do - override.returns( - { lg: String, md: String, sm: String, xl: String, xs: String } - ) - end - def to_hash - end - end - - class FontLink < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink, - ContextDev::Internal::AnyHash - ) - end - - # Upright font files keyed by weight string (e.g. "400" for regular, "500", - # "700"). Values are absolute URLs. - sig { returns(T::Hash[Symbol, String]) } - attr_accessor :files - - sig do - returns( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type::TaggedSymbol - ) - end - attr_accessor :type - - # Google Fonts category when type is google (e.g. sans-serif, serif, monospace, - # display, handwriting). Omitted for custom fonts when unknown. - sig { returns(T.nilable(String)) } - attr_reader :category - - sig { params(category: String).void } - attr_writer :category - - # Present when type is custom: human-readable name derived from the fontLinks key - # (strip build/hash suffixes, split camelCase / PascalCase, normalize separators). - # Google entries omit this. - sig { returns(T.nilable(String)) } - attr_reader :display_name - - sig { params(display_name: String).void } - attr_writer :display_name - - sig do - params( - files: T::Hash[Symbol, String], - type: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type::OrSymbol, - category: String, - display_name: String - ).returns(T.attached_class) - end - def self.new( - # Upright font files keyed by weight string (e.g. "400" for regular, "500", - # "700"). Values are absolute URLs. - files:, - type:, - # Google Fonts category when type is google (e.g. sans-serif, serif, monospace, - # display, handwriting). Omitted for custom fonts when unknown. - category: nil, - # Present when type is custom: human-readable name derived from the fontLinks key - # (strip build/hash suffixes, split camelCase / PascalCase, normalize separators). - # Google entries omit this. - display_name: nil - ) - end - - sig do - override.returns( - { - files: T::Hash[Symbol, String], - type: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type::TaggedSymbol, - category: String, - display_name: String - } - ) - end - def to_hash - end - - module Type - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - GOOGLE = - T.let( - :google, - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type::TaggedSymbol - ) - CUSTOM = - T.let( - :custom, - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::Type::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - # The primary color mode of the website design - module Mode - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - LIGHT = - T.let( - :light, - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode::TaggedSymbol - ) - DARK = - T.let( - :dark, - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode::TaggedSymbol - ] - ) - end - def self.values - end - end - - class Shadows < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows, - ContextDev::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :inner - - sig { returns(String) } - attr_accessor :lg - - sig { returns(String) } - attr_accessor :md - - sig { returns(String) } - attr_accessor :sm - - sig { returns(String) } - attr_accessor :xl - - # Shadow styles used on the website - sig do - params( - inner: String, - lg: String, - md: String, - sm: String, - xl: String - ).returns(T.attached_class) - end - def self.new(inner:, lg:, md:, sm:, xl:) - end - - sig do - override.returns( - { inner: String, lg: String, md: String, sm: String, xl: String } - ) - end - def to_hash - end - end - - class Typography < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography, - ContextDev::Internal::AnyHash - ) - end - - # Heading styles - sig do - returns( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings - ) - end - attr_reader :headings - - sig do - params( - headings: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::OrHash - ).void - end - attr_writer :headings - - sig do - returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P - ) - ) - end - attr_reader :p_ - - sig do - params( - p_: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P::OrHash - ).void - end - attr_writer :p_ - - # Typography styles used on the website - sig do - params( - headings: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::OrHash, - p_: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P::OrHash - ).returns(T.attached_class) - end - def self.new( - # Heading styles - headings:, - p_: nil - ) - end - - sig do - override.returns( - { - headings: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings, - p_: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P - } - ) - end - def to_hash - end - - class Headings < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings, - ContextDev::Internal::AnyHash - ) - end - - sig do - returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H1 - ) - ) - end - attr_reader :h1 - - sig do - params( - h1: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H1::OrHash - ).void - end - attr_writer :h1 - - sig do - returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H2 - ) - ) - end - attr_reader :h2 - - sig do - params( - h2: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H2::OrHash - ).void - end - attr_writer :h2 - - sig do - returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H3 - ) - ) - end - attr_reader :h3 - - sig do - params( - h3: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H3::OrHash - ).void - end - attr_writer :h3 - - sig do - returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H4 - ) - ) - end - attr_reader :h4 - - sig do - params( - h4: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H4::OrHash - ).void - end - attr_writer :h4 - - # Heading styles - sig do - params( - h1: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H1::OrHash, - h2: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H2::OrHash, - h3: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H3::OrHash, - h4: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H4::OrHash - ).returns(T.attached_class) - end - def self.new(h1: nil, h2: nil, h3: nil, h4: nil) - end - - sig do - override.returns( - { - h1: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H1, - h2: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H2, - h3: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H3, - h4: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H4 - } - ) - end - def to_hash - end - - class H1 < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H1, - ContextDev::Internal::AnyHash - ) - end - - # Full ordered font list from resolved computed font-family - sig { returns(T::Array[String]) } - attr_accessor :font_fallbacks - - # Primary face (first family in the computed stack) - sig { returns(String) } - attr_accessor :font_family - - sig { returns(String) } - attr_accessor :font_size - - sig { returns(Float) } - attr_accessor :font_weight - - sig { returns(String) } - attr_accessor :letter_spacing - - sig { returns(String) } - attr_accessor :line_height - - sig do - params( - font_fallbacks: T::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - ).returns(T.attached_class) - end - def self.new( - # Full ordered font list from resolved computed font-family - font_fallbacks:, - # Primary face (first family in the computed stack) - font_family:, - font_size:, - font_weight:, - letter_spacing:, - line_height: - ) - end - - sig do - override.returns( - { - font_fallbacks: T::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - } - ) - end - def to_hash - end - end - - class H2 < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H2, - ContextDev::Internal::AnyHash - ) - end - - # Full ordered font list from resolved computed font-family - sig { returns(T::Array[String]) } - attr_accessor :font_fallbacks - - # Primary face (first family in the computed stack) - sig { returns(String) } - attr_accessor :font_family - - sig { returns(String) } - attr_accessor :font_size - - sig { returns(Float) } - attr_accessor :font_weight - - sig { returns(String) } - attr_accessor :letter_spacing - - sig { returns(String) } - attr_accessor :line_height - - sig do - params( - font_fallbacks: T::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - ).returns(T.attached_class) - end - def self.new( - # Full ordered font list from resolved computed font-family - font_fallbacks:, - # Primary face (first family in the computed stack) - font_family:, - font_size:, - font_weight:, - letter_spacing:, - line_height: - ) - end - - sig do - override.returns( - { - font_fallbacks: T::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - } - ) - end - def to_hash - end - end - - class H3 < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H3, - ContextDev::Internal::AnyHash - ) - end - - # Full ordered font list from resolved computed font-family - sig { returns(T::Array[String]) } - attr_accessor :font_fallbacks - - # Primary face (first family in the computed stack) - sig { returns(String) } - attr_accessor :font_family - - sig { returns(String) } - attr_accessor :font_size - - sig { returns(Float) } - attr_accessor :font_weight - - sig { returns(String) } - attr_accessor :letter_spacing - - sig { returns(String) } - attr_accessor :line_height - - sig do - params( - font_fallbacks: T::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - ).returns(T.attached_class) - end - def self.new( - # Full ordered font list from resolved computed font-family - font_fallbacks:, - # Primary face (first family in the computed stack) - font_family:, - font_size:, - font_weight:, - letter_spacing:, - line_height: - ) - end - - sig do - override.returns( - { - font_fallbacks: T::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - } - ) - end - def to_hash - end - end - - class H4 < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H4, - ContextDev::Internal::AnyHash - ) - end - - # Full ordered font list from resolved computed font-family - sig { returns(T::Array[String]) } - attr_accessor :font_fallbacks - - # Primary face (first family in the computed stack) - sig { returns(String) } - attr_accessor :font_family - - sig { returns(String) } - attr_accessor :font_size - - sig { returns(Float) } - attr_accessor :font_weight - - sig { returns(String) } - attr_accessor :letter_spacing - - sig { returns(String) } - attr_accessor :line_height - - sig do - params( - font_fallbacks: T::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - ).returns(T.attached_class) - end - def self.new( - # Full ordered font list from resolved computed font-family - font_fallbacks:, - # Primary face (first family in the computed stack) - font_family:, - font_size:, - font_weight:, - letter_spacing:, - line_height: - ) - end - - sig do - override.returns( - { - font_fallbacks: T::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - } - ) - end - def to_hash - end - end - end - - class P < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P, - ContextDev::Internal::AnyHash - ) - end - - # Full ordered font list from resolved computed font-family - sig { returns(T::Array[String]) } - attr_accessor :font_fallbacks - - # Primary face (first family in the computed stack) - sig { returns(String) } - attr_accessor :font_family - - sig { returns(String) } - attr_accessor :font_size - - sig { returns(Float) } - attr_accessor :font_weight - - sig { returns(String) } - attr_accessor :letter_spacing - - sig { returns(String) } - attr_accessor :line_height - - sig do - params( - font_fallbacks: T::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - ).returns(T.attached_class) - end - def self.new( - # Full ordered font list from resolved computed font-family - font_fallbacks:, - # Primary face (first family in the computed stack) - font_family:, - font_size:, - font_weight:, - letter_spacing:, - line_height: - ) - end - - sig do - override.returns( - { - font_fallbacks: T::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - } - ) - end - def to_hash - end - end - end - end - end - end -end diff --git a/rbi/context_dev/models/web_extract_fonts_params.rbi b/rbi/context_dev/models/web_extract_fonts_params.rbi index 17ceb20e..7817e2d5 100644 --- a/rbi/context_dev/models/web_extract_fonts_params.rbi +++ b/rbi/context_dev/models/web_extract_fonts_params.rbi @@ -15,7 +15,8 @@ module ContextDev end # A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., - # 'https://example.com/design-system'). + # 'https://example.com/design-system'). When provided, fonts are extracted from + # this exact URL. You must provide either 'domain' or 'directUrl', but not both. sig { returns(T.nilable(String)) } attr_reader :direct_url @@ -23,7 +24,8 @@ module ContextDev attr_writer :direct_url # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. + # domain will be automatically normalized and validated. You must provide either + # 'domain' or 'directUrl', but not both. sig { returns(T.nilable(String)) } attr_reader :domain @@ -49,10 +51,12 @@ module ContextDev end def self.new( # A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., - # 'https://example.com/design-system'). + # 'https://example.com/design-system'). When provided, fonts are extracted from + # this exact URL. You must provide either 'domain' or 'directUrl', but not both. direct_url: nil, # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. + # domain will be automatically normalized and validated. You must provide either + # 'domain' or 'directUrl', but not both. domain: nil, # 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 diff --git a/rbi/context_dev/resources/style.rbi b/rbi/context_dev/resources/style.rbi index ea383702..ab7a8533 100644 --- a/rbi/context_dev/resources/style.rbi +++ b/rbi/context_dev/resources/style.rbi @@ -3,33 +3,6 @@ module ContextDev module Resources class Style - # Automatically extract comprehensive design system information from a brand's - # website including colors, typography, spacing, shadows, and UI components. - # Either 'domain' or 'directUrl' must be provided as a query parameter, but not - # both. - sig do - params( - direct_url: String, - domain: String, - timeout_ms: Integer, - request_options: ContextDev::RequestOptions::OrHash - ).returns(ContextDev::Models::StyleExtractStyleguideResponse) - end - def extract_styleguide( - # A specific URL to fetch the styleguide from directly, bypassing domain - # resolution (e.g., 'https://example.com/design-system'). - direct_url: nil, - # Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. - domain: nil, - # 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). - timeout_ms: nil, - request_options: {} - ) - end - # @api private sig { params(client: ContextDev::Client).returns(T.attached_class) } def self.new(client:) diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index 372816b9..0575204c 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -15,10 +15,12 @@ module ContextDev end def extract_fonts( # A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., - # 'https://example.com/design-system'). + # 'https://example.com/design-system'). When provided, fonts are extracted from + # this exact URL. You must provide either 'domain' or 'directUrl', but not both. direct_url: nil, # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The - # domain will be automatically normalized and validated. + # domain will be automatically normalized and validated. You must provide either + # 'domain' or 'directUrl', but not both. domain: nil, # 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 diff --git a/sig/context_dev/models.rbs b/sig/context_dev/models.rbs index d6ad48df..99a6155e 100644 --- a/sig/context_dev/models.rbs +++ b/sig/context_dev/models.rbs @@ -21,8 +21,6 @@ module ContextDev class IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams - class StyleExtractStyleguideParams = ContextDev::Models::StyleExtractStyleguideParams - class UtilityPrefetchByEmailParams = ContextDev::Models::UtilityPrefetchByEmailParams class UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams diff --git a/sig/context_dev/models/style_extract_styleguide_params.rbs b/sig/context_dev/models/style_extract_styleguide_params.rbs deleted file mode 100644 index 10140f24..00000000 --- a/sig/context_dev/models/style_extract_styleguide_params.rbs +++ /dev/null @@ -1,38 +0,0 @@ -module ContextDev - module Models - type style_extract_styleguide_params = - { direct_url: String, domain: String, timeout_ms: Integer } - & ContextDev::Internal::Type::request_parameters - - class StyleExtractStyleguideParams < ContextDev::Internal::Type::BaseModel - extend ContextDev::Internal::Type::RequestParameters::Converter - include ContextDev::Internal::Type::RequestParameters - - attr_reader direct_url: String? - - def direct_url=: (String) -> String - - attr_reader domain: String? - - def domain=: (String) -> String - - attr_reader timeout_ms: Integer? - - def timeout_ms=: (Integer) -> Integer - - def initialize: ( - ?direct_url: String, - ?domain: String, - ?timeout_ms: Integer, - ?request_options: ContextDev::request_opts - ) -> void - - def to_hash: -> { - direct_url: String, - domain: String, - timeout_ms: Integer, - request_options: ContextDev::RequestOptions - } - end - end -end diff --git a/sig/context_dev/models/style_extract_styleguide_response.rbs b/sig/context_dev/models/style_extract_styleguide_response.rbs deleted file mode 100644 index eb841450..00000000 --- a/sig/context_dev/models/style_extract_styleguide_response.rbs +++ /dev/null @@ -1,945 +0,0 @@ -module ContextDev - module Models - type style_extract_styleguide_response = - { - code: Integer, - domain: String, - status: String, - styleguide: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide - } - - class StyleExtractStyleguideResponse < ContextDev::Internal::Type::BaseModel - attr_reader code: Integer? - - def code=: (Integer) -> Integer - - attr_reader domain: String? - - def domain=: (String) -> String - - attr_reader status: String? - - def status=: (String) -> String - - attr_reader styleguide: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide? - - def styleguide=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide - - def initialize: ( - ?code: Integer, - ?domain: String, - ?status: String, - ?styleguide: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide - ) -> void - - def to_hash: -> { - code: Integer, - domain: String, - status: String, - styleguide: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide - } - - type styleguide = - { - colors: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors, - components: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components, - element_spacing: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing, - font_links: ::Hash[Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink], - mode: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::mode, - shadows: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows, - typography: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography - } - - class Styleguide < ContextDev::Internal::Type::BaseModel - attr_accessor colors: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors - - attr_accessor components: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components - - attr_accessor element_spacing: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing - - attr_accessor font_links: ::Hash[Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink] - - attr_accessor mode: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::mode - - attr_accessor shadows: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows - - attr_accessor typography: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography - - def initialize: ( - colors: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors, - components: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components, - element_spacing: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing, - font_links: ::Hash[Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink], - mode: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::mode, - shadows: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows, - typography: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography - ) -> void - - def to_hash: -> { - colors: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors, - components: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components, - element_spacing: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing, - font_links: ::Hash[Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink], - mode: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::mode, - shadows: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows, - typography: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography - } - - type colors = { accent: String, background: String, text: String } - - class Colors < ContextDev::Internal::Type::BaseModel - attr_accessor accent: String - - attr_accessor background: String - - attr_accessor text: String - - def initialize: ( - accent: String, - background: String, - text: String - ) -> void - - def to_hash: -> { accent: String, background: String, text: String } - end - - type components = - { - button: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button, - card: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card - } - - class Components < ContextDev::Internal::Type::BaseModel - attr_accessor button: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button - - attr_reader card: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card? - - def card=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card - - def initialize: ( - button: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button, - ?card: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card - ) -> void - - def to_hash: -> { - button: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button, - card: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card - } - - type button = - { - link: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link, - primary: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary, - secondary: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary - } - - class Button < ContextDev::Internal::Type::BaseModel - attr_reader link: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link? - - def link=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link - - attr_reader primary: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary? - - def primary=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary - - attr_reader secondary: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary? - - def secondary=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary - - def initialize: ( - ?link: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link, - ?primary: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary, - ?secondary: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary - ) -> void - - def to_hash: -> { - link: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link, - primary: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary, - secondary: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary - } - - type link = - { - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - color: String, - css: String, - font_size: String, - font_weight: Float, - min_height: String, - min_width: String, - padding: String, - text_decoration: String, - font_fallbacks: ::Array[String], - font_family: String, - text_decoration_color: String - } - - class Link < ContextDev::Internal::Type::BaseModel - attr_accessor background_color: String - - attr_accessor border_color: String - - attr_accessor border_radius: String - - attr_accessor border_style: String - - attr_accessor border_width: String - - attr_accessor box_shadow: String - - attr_accessor color: String - - attr_accessor css: String - - attr_accessor font_size: String - - attr_accessor font_weight: Float - - attr_accessor min_height: String - - attr_accessor min_width: String - - attr_accessor padding: String - - attr_accessor text_decoration: String - - attr_reader font_fallbacks: ::Array[String]? - - def font_fallbacks=: (::Array[String]) -> ::Array[String] - - attr_reader font_family: String? - - def font_family=: (String) -> String - - attr_reader text_decoration_color: String? - - def text_decoration_color=: (String) -> String - - def initialize: ( - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - color: String, - css: String, - font_size: String, - font_weight: Float, - min_height: String, - min_width: String, - padding: String, - text_decoration: String, - ?font_fallbacks: ::Array[String], - ?font_family: String, - ?text_decoration_color: String - ) -> void - - def to_hash: -> { - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - color: String, - css: String, - font_size: String, - font_weight: Float, - min_height: String, - min_width: String, - padding: String, - text_decoration: String, - font_fallbacks: ::Array[String], - font_family: String, - text_decoration_color: String - } - end - - type primary = - { - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - color: String, - css: String, - font_size: String, - font_weight: Float, - min_height: String, - min_width: String, - padding: String, - text_decoration: String, - font_fallbacks: ::Array[String], - font_family: String, - text_decoration_color: String - } - - class Primary < ContextDev::Internal::Type::BaseModel - attr_accessor background_color: String - - attr_accessor border_color: String - - attr_accessor border_radius: String - - attr_accessor border_style: String - - attr_accessor border_width: String - - attr_accessor box_shadow: String - - attr_accessor color: String - - attr_accessor css: String - - attr_accessor font_size: String - - attr_accessor font_weight: Float - - attr_accessor min_height: String - - attr_accessor min_width: String - - attr_accessor padding: String - - attr_accessor text_decoration: String - - attr_reader font_fallbacks: ::Array[String]? - - def font_fallbacks=: (::Array[String]) -> ::Array[String] - - attr_reader font_family: String? - - def font_family=: (String) -> String - - attr_reader text_decoration_color: String? - - def text_decoration_color=: (String) -> String - - def initialize: ( - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - color: String, - css: String, - font_size: String, - font_weight: Float, - min_height: String, - min_width: String, - padding: String, - text_decoration: String, - ?font_fallbacks: ::Array[String], - ?font_family: String, - ?text_decoration_color: String - ) -> void - - def to_hash: -> { - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - color: String, - css: String, - font_size: String, - font_weight: Float, - min_height: String, - min_width: String, - padding: String, - text_decoration: String, - font_fallbacks: ::Array[String], - font_family: String, - text_decoration_color: String - } - end - - type secondary = - { - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - color: String, - css: String, - font_size: String, - font_weight: Float, - min_height: String, - min_width: String, - padding: String, - text_decoration: String, - font_fallbacks: ::Array[String], - font_family: String, - text_decoration_color: String - } - - class Secondary < ContextDev::Internal::Type::BaseModel - attr_accessor background_color: String - - attr_accessor border_color: String - - attr_accessor border_radius: String - - attr_accessor border_style: String - - attr_accessor border_width: String - - attr_accessor box_shadow: String - - attr_accessor color: String - - attr_accessor css: String - - attr_accessor font_size: String - - attr_accessor font_weight: Float - - attr_accessor min_height: String - - attr_accessor min_width: String - - attr_accessor padding: String - - attr_accessor text_decoration: String - - attr_reader font_fallbacks: ::Array[String]? - - def font_fallbacks=: (::Array[String]) -> ::Array[String] - - attr_reader font_family: String? - - def font_family=: (String) -> String - - attr_reader text_decoration_color: String? - - def text_decoration_color=: (String) -> String - - def initialize: ( - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - color: String, - css: String, - font_size: String, - font_weight: Float, - min_height: String, - min_width: String, - padding: String, - text_decoration: String, - ?font_fallbacks: ::Array[String], - ?font_family: String, - ?text_decoration_color: String - ) -> void - - def to_hash: -> { - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - color: String, - css: String, - font_size: String, - font_weight: Float, - min_height: String, - min_width: String, - padding: String, - text_decoration: String, - font_fallbacks: ::Array[String], - font_family: String, - text_decoration_color: String - } - end - end - - type card = - { - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - css: String, - padding: String, - text_color: String - } - - class Card < ContextDev::Internal::Type::BaseModel - attr_accessor background_color: String - - attr_accessor border_color: String - - attr_accessor border_radius: String - - attr_accessor border_style: String - - attr_accessor border_width: String - - attr_accessor box_shadow: String - - attr_accessor css: String - - attr_accessor padding: String - - attr_accessor text_color: String - - def initialize: ( - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - css: String, - padding: String, - text_color: String - ) -> void - - def to_hash: -> { - background_color: String, - border_color: String, - border_radius: String, - border_style: String, - border_width: String, - box_shadow: String, - css: String, - padding: String, - text_color: String - } - end - end - - type element_spacing = - { lg: String, md: String, sm: String, xl: String, xs: String } - - class ElementSpacing < ContextDev::Internal::Type::BaseModel - attr_accessor lg: String - - attr_accessor md: String - - attr_accessor sm: String - - attr_accessor xl: String - - attr_accessor xs: String - - def initialize: ( - lg: String, - md: String, - sm: String, - xl: String, - xs: String - ) -> void - - def to_hash: -> { - lg: String, - md: String, - sm: String, - xl: String, - xs: String - } - end - - type font_link = - { - files: ::Hash[Symbol, String], - type: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::type_, - category: String, - display_name: String - } - - class FontLink < ContextDev::Internal::Type::BaseModel - attr_accessor files: ::Hash[Symbol, String] - - attr_accessor type: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::type_ - - attr_reader category: String? - - def category=: (String) -> String - - attr_reader display_name: String? - - def display_name=: (String) -> String - - def initialize: ( - files: ::Hash[Symbol, String], - type: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::type_, - ?category: String, - ?display_name: String - ) -> void - - def to_hash: -> { - files: ::Hash[Symbol, String], - type: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::type_, - category: String, - display_name: String - } - - type type_ = :google | :custom - - module Type - extend ContextDev::Internal::Type::Enum - - GOOGLE: :google - CUSTOM: :custom - - def self?.values: -> ::Array[ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::FontLink::type_] - end - end - - type mode = :light | :dark - - module Mode - extend ContextDev::Internal::Type::Enum - - LIGHT: :light - DARK: :dark - - def self?.values: -> ::Array[ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::mode] - end - - type shadows = - { inner: String, lg: String, md: String, sm: String, xl: String } - - class Shadows < ContextDev::Internal::Type::BaseModel - attr_accessor inner: String - - attr_accessor lg: String - - attr_accessor md: String - - attr_accessor sm: String - - attr_accessor xl: String - - def initialize: ( - inner: String, - lg: String, - md: String, - sm: String, - xl: String - ) -> void - - def to_hash: -> { - inner: String, - lg: String, - md: String, - sm: String, - xl: String - } - end - - type typography = - { - headings: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings, - p_: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P - } - - class Typography < ContextDev::Internal::Type::BaseModel - attr_accessor headings: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings - - attr_reader p_: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P? - - def p_=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P - - def initialize: ( - headings: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings, - ?p_: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P - ) -> void - - def to_hash: -> { - headings: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings, - p_: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P - } - - type headings = - { - :h1 => ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H1, - :h2 => ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H2, - :h3 => ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H3, - :h4 => ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H4 - } - - class Headings < ContextDev::Internal::Type::BaseModel - attr_reader h1: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H1? - - def h1=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H1 - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H1 - - attr_reader h2: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H2? - - def h2=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H2 - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H2 - - attr_reader h3: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H3? - - def h3=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H3 - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H3 - - attr_reader h4: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H4? - - def h4=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H4 - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H4 - - def initialize: ( - ?h1: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H1, - ?h2: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H2, - ?h3: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H3, - ?h4: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H4 - ) -> void - - def to_hash: -> { - :h1 => ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H1, - :h2 => ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H2, - :h3 => ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H3, - :h4 => ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings::H4 - } - - type h1 = - { - font_fallbacks: ::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - } - - class H1 < ContextDev::Internal::Type::BaseModel - attr_accessor font_fallbacks: ::Array[String] - - attr_accessor font_family: String - - attr_accessor font_size: String - - attr_accessor font_weight: Float - - attr_accessor letter_spacing: String - - attr_accessor line_height: String - - def initialize: ( - font_fallbacks: ::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - ) -> void - - def to_hash: -> { - font_fallbacks: ::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - } - end - - type h2 = - { - font_fallbacks: ::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - } - - class H2 < ContextDev::Internal::Type::BaseModel - attr_accessor font_fallbacks: ::Array[String] - - attr_accessor font_family: String - - attr_accessor font_size: String - - attr_accessor font_weight: Float - - attr_accessor letter_spacing: String - - attr_accessor line_height: String - - def initialize: ( - font_fallbacks: ::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - ) -> void - - def to_hash: -> { - font_fallbacks: ::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - } - end - - type h3 = - { - font_fallbacks: ::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - } - - class H3 < ContextDev::Internal::Type::BaseModel - attr_accessor font_fallbacks: ::Array[String] - - attr_accessor font_family: String - - attr_accessor font_size: String - - attr_accessor font_weight: Float - - attr_accessor letter_spacing: String - - attr_accessor line_height: String - - def initialize: ( - font_fallbacks: ::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - ) -> void - - def to_hash: -> { - font_fallbacks: ::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - } - end - - type h4 = - { - font_fallbacks: ::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - } - - class H4 < ContextDev::Internal::Type::BaseModel - attr_accessor font_fallbacks: ::Array[String] - - attr_accessor font_family: String - - attr_accessor font_size: String - - attr_accessor font_weight: Float - - attr_accessor letter_spacing: String - - attr_accessor line_height: String - - def initialize: ( - font_fallbacks: ::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - ) -> void - - def to_hash: -> { - font_fallbacks: ::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - } - end - end - - type p_ = - { - font_fallbacks: ::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - } - - class P < ContextDev::Internal::Type::BaseModel - attr_accessor font_fallbacks: ::Array[String] - - attr_accessor font_family: String - - attr_accessor font_size: String - - attr_accessor font_weight: Float - - attr_accessor letter_spacing: String - - attr_accessor line_height: String - - def initialize: ( - font_fallbacks: ::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - ) -> void - - def to_hash: -> { - font_fallbacks: ::Array[String], - font_family: String, - font_size: String, - font_weight: Float, - letter_spacing: String, - line_height: String - } - end - end - end - end - end -end diff --git a/sig/context_dev/resources/style.rbs b/sig/context_dev/resources/style.rbs index 0429a345..4ac57dff 100644 --- a/sig/context_dev/resources/style.rbs +++ b/sig/context_dev/resources/style.rbs @@ -1,13 +1,6 @@ module ContextDev module Resources class Style - def extract_styleguide: ( - ?direct_url: String, - ?domain: String, - ?timeout_ms: Integer, - ?request_options: ContextDev::request_opts - ) -> ContextDev::Models::StyleExtractStyleguideResponse - def initialize: (client: ContextDev::Client) -> void end end diff --git a/test/context_dev/resources/style_test.rb b/test/context_dev/resources/style_test.rb index 61108294..ec8b4c5c 100644 --- a/test/context_dev/resources/style_test.rb +++ b/test/context_dev/resources/style_test.rb @@ -3,22 +3,4 @@ require_relative "../test_helper" class ContextDev::Test::Resources::StyleTest < ContextDev::Test::ResourceTest - def test_extract_styleguide - skip("Mock server tests are disabled") - - response = @context_dev.style.extract_styleguide - - assert_pattern do - response => ContextDev::Models::StyleExtractStyleguideResponse - end - - assert_pattern do - response => { - code: Integer | nil, - domain: String | nil, - status: String | nil, - styleguide: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide | nil - } - end - end end From 739b99fddcd745960b3cf390cc9bff4220941ee8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 23:13:26 +0000 Subject: [PATCH 17/25] feat(api): manual updates --- .stats.yml | 2 +- lib/context_dev.rb | 1 - lib/context_dev/client.rb | 4 ---- lib/context_dev/resources/style.rb | 14 -------------- rbi/context_dev/client.rbi | 3 --- rbi/context_dev/resources/style.rbi | 12 ------------ sig/context_dev/client.rbs | 2 -- sig/context_dev/resources/style.rbs | 7 ------- test/context_dev/resources/style_test.rb | 6 ------ 9 files changed, 1 insertion(+), 50 deletions(-) delete mode 100644 lib/context_dev/resources/style.rb delete mode 100644 rbi/context_dev/resources/style.rbi delete mode 100644 sig/context_dev/resources/style.rbs delete mode 100644 test/context_dev/resources/style_test.rb diff --git a/.stats.yml b/.stats.yml index 912df3b2..d8c4ba81 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 19 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-3c753cf7c4d04fe467710a51b1a2f6f024b0b6a670704be7340b92e064bcf1a9.yml openapi_spec_hash: f9b02e6756001e2be87d541d5cc609e5 -config_hash: 859455bbffc8a009cd9b5eed9b3ba2d7 +config_hash: d039d212bed1d71e6d015ca71ea4d0f9 diff --git a/lib/context_dev.rb b/lib/context_dev.rb index f2b74b7a..06eb2902 100644 --- a/lib/context_dev.rb +++ b/lib/context_dev.rb @@ -94,6 +94,5 @@ require_relative "context_dev/resources/ai" require_relative "context_dev/resources/brand" require_relative "context_dev/resources/industry" -require_relative "context_dev/resources/style" require_relative "context_dev/resources/utility" require_relative "context_dev/resources/web" diff --git a/lib/context_dev/client.rb b/lib/context_dev/client.rb index 5015189f..b16831f8 100644 --- a/lib/context_dev/client.rb +++ b/lib/context_dev/client.rb @@ -24,9 +24,6 @@ class Client < ContextDev::Internal::Transport::BaseClient # @return [ContextDev::Resources::AI] attr_reader :ai - # @return [ContextDev::Resources::Style] - attr_reader :style - # @return [ContextDev::Resources::Brand] attr_reader :brand @@ -85,7 +82,6 @@ def initialize( @web = ContextDev::Resources::Web.new(client: self) @ai = ContextDev::Resources::AI.new(client: self) - @style = ContextDev::Resources::Style.new(client: self) @brand = ContextDev::Resources::Brand.new(client: self) @industry = ContextDev::Resources::Industry.new(client: self) @utility = ContextDev::Resources::Utility.new(client: self) diff --git a/lib/context_dev/resources/style.rb b/lib/context_dev/resources/style.rb deleted file mode 100644 index ea8601eb..00000000 --- a/lib/context_dev/resources/style.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -module ContextDev - module Resources - class Style - # @api private - # - # @param client [ContextDev::Client] - def initialize(client:) - @client = client - end - end - end -end diff --git a/rbi/context_dev/client.rbi b/rbi/context_dev/client.rbi index e54985c8..f4c93b5a 100644 --- a/rbi/context_dev/client.rbi +++ b/rbi/context_dev/client.rbi @@ -19,9 +19,6 @@ module ContextDev sig { returns(ContextDev::Resources::AI) } attr_reader :ai - sig { returns(ContextDev::Resources::Style) } - attr_reader :style - sig { returns(ContextDev::Resources::Brand) } attr_reader :brand diff --git a/rbi/context_dev/resources/style.rbi b/rbi/context_dev/resources/style.rbi deleted file mode 100644 index ab7a8533..00000000 --- a/rbi/context_dev/resources/style.rbi +++ /dev/null @@ -1,12 +0,0 @@ -# typed: strong - -module ContextDev - module Resources - class Style - # @api private - sig { params(client: ContextDev::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/sig/context_dev/client.rbs b/sig/context_dev/client.rbs index 1e3fd4de..dbaa7969 100644 --- a/sig/context_dev/client.rbs +++ b/sig/context_dev/client.rbs @@ -14,8 +14,6 @@ module ContextDev attr_reader ai: ContextDev::Resources::AI - attr_reader style: ContextDev::Resources::Style - attr_reader brand: ContextDev::Resources::Brand attr_reader industry: ContextDev::Resources::Industry diff --git a/sig/context_dev/resources/style.rbs b/sig/context_dev/resources/style.rbs deleted file mode 100644 index 4ac57dff..00000000 --- a/sig/context_dev/resources/style.rbs +++ /dev/null @@ -1,7 +0,0 @@ -module ContextDev - module Resources - class Style - def initialize: (client: ContextDev::Client) -> void - end - end -end diff --git a/test/context_dev/resources/style_test.rb b/test/context_dev/resources/style_test.rb deleted file mode 100644 index ec8b4c5c..00000000 --- a/test/context_dev/resources/style_test.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class ContextDev::Test::Resources::StyleTest < ContextDev::Test::ResourceTest -end From a4d1c57c01a0e9354fe132d52bbb2fe82796451b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 23:22:13 +0000 Subject: [PATCH 18/25] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d8c4ba81..8b923f5d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 19 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-3c753cf7c4d04fe467710a51b1a2f6f024b0b6a670704be7340b92e064bcf1a9.yml openapi_spec_hash: f9b02e6756001e2be87d541d5cc609e5 -config_hash: d039d212bed1d71e6d015ca71ea4d0f9 +config_hash: ca7ca57332b7ae61763f08dd7a022601 From 11ea49fac95ca680db1f9880b8b8590aa650b00a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 23:41:35 +0000 Subject: [PATCH 19/25] feat(api): manual updates --- .stats.yml | 4 +- README.md | 16 +- lib/context_dev.rb | 4 + lib/context_dev/models.rb | 4 + .../models/web_extract_styleguide_params.rb | 48 + .../models/web_extract_styleguide_response.rb | 1115 ++++++++++ .../models/web_screenshot_params.rb | 116 ++ .../models/web_screenshot_response.rb | 64 + lib/context_dev/resources/web.rb | 65 + rbi/context_dev/models.rbi | 4 + .../models/web_extract_styleguide_params.rbi | 85 + .../web_extract_styleguide_response.rbi | 1790 +++++++++++++++++ .../models/web_screenshot_params.rbi | 238 +++ .../models/web_screenshot_response.rbi | 135 ++ rbi/context_dev/resources/web.rbi | 67 + sig/context_dev/models.rbs | 4 + .../models/web_extract_styleguide_params.rbs | 38 + .../web_extract_styleguide_response.rbs | 945 +++++++++ .../models/web_screenshot_params.rbs | 109 + .../models/web_screenshot_response.rbs | 63 + sig/context_dev/resources/web.rbs | 16 + test/context_dev/resources/web_test.rb | 39 + 22 files changed, 4959 insertions(+), 10 deletions(-) create mode 100644 lib/context_dev/models/web_extract_styleguide_params.rb create mode 100644 lib/context_dev/models/web_extract_styleguide_response.rb create mode 100644 lib/context_dev/models/web_screenshot_params.rb create mode 100644 lib/context_dev/models/web_screenshot_response.rb create mode 100644 rbi/context_dev/models/web_extract_styleguide_params.rbi create mode 100644 rbi/context_dev/models/web_extract_styleguide_response.rbi create mode 100644 rbi/context_dev/models/web_screenshot_params.rbi create mode 100644 rbi/context_dev/models/web_screenshot_response.rbi create mode 100644 sig/context_dev/models/web_extract_styleguide_params.rbs create mode 100644 sig/context_dev/models/web_extract_styleguide_response.rbs create mode 100644 sig/context_dev/models/web_screenshot_params.rbs create mode 100644 sig/context_dev/models/web_screenshot_response.rbs diff --git a/.stats.yml b/.stats.yml index 8b923f5d..d51d6f74 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 19 +configured_endpoints: 21 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-3c753cf7c4d04fe467710a51b1a2f6f024b0b6a670704be7340b92e064bcf1a9.yml openapi_spec_hash: f9b02e6756001e2be87d541d5cc609e5 -config_hash: ca7ca57332b7ae61763f08dd7a022601 +config_hash: 85e90b8fda2e1f326ca60f8ab3e53704 diff --git a/README.md b/README.md index e657f74d..bf456143 100644 --- a/README.md +++ b/README.md @@ -206,25 +206,25 @@ context_dev.brand.retrieve(**params) Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime: ```ruby -# :afrikaans -puts(ContextDev::BrandRetrieveParams::ForceLanguage::AFRIKAANS) +# :true +puts(ContextDev::WebScreenshotParams::FullScreenshot::TRUE) -# Revealed type: `T.all(ContextDev::BrandRetrieveParams::ForceLanguage, Symbol)` -T.reveal_type(ContextDev::BrandRetrieveParams::ForceLanguage::AFRIKAANS) +# Revealed type: `T.all(ContextDev::WebScreenshotParams::FullScreenshot, Symbol)` +T.reveal_type(ContextDev::WebScreenshotParams::FullScreenshot::TRUE) ``` Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value: ```ruby # Using the enum constants preserves the tagged type information: -context_dev.brand.retrieve( - force_language: ContextDev::BrandRetrieveParams::ForceLanguage::AFRIKAANS, +context_dev.web.screenshot( + full_screenshot: ContextDev::WebScreenshotParams::FullScreenshot::TRUE, # … ) # Literal values are also permissible: -context_dev.brand.retrieve( - force_language: :afrikaans, +context_dev.web.screenshot( + full_screenshot: :true, # … ) ``` diff --git a/lib/context_dev.rb b/lib/context_dev.rb index 06eb2902..6d616a84 100644 --- a/lib/context_dev.rb +++ b/lib/context_dev.rb @@ -80,6 +80,10 @@ require_relative "context_dev/models/utility_prefetch_response" require_relative "context_dev/models/web_extract_fonts_params" require_relative "context_dev/models/web_extract_fonts_response" +require_relative "context_dev/models/web_extract_styleguide_params" +require_relative "context_dev/models/web_extract_styleguide_response" +require_relative "context_dev/models/web_screenshot_params" +require_relative "context_dev/models/web_screenshot_response" require_relative "context_dev/models/web_web_crawl_md_params" require_relative "context_dev/models/web_web_crawl_md_response" require_relative "context_dev/models/web_web_scrape_html_params" diff --git a/lib/context_dev/models.rb b/lib/context_dev/models.rb index 780007bf..9049afe5 100644 --- a/lib/context_dev/models.rb +++ b/lib/context_dev/models.rb @@ -67,6 +67,10 @@ module ContextDev WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams + WebExtractStyleguideParams = ContextDev::Models::WebExtractStyleguideParams + + WebScreenshotParams = ContextDev::Models::WebScreenshotParams + WebWebCrawlMdParams = ContextDev::Models::WebWebCrawlMdParams WebWebScrapeHTMLParams = ContextDev::Models::WebWebScrapeHTMLParams diff --git a/lib/context_dev/models/web_extract_styleguide_params.rb b/lib/context_dev/models/web_extract_styleguide_params.rb new file mode 100644 index 00000000..d11adaed --- /dev/null +++ b/lib/context_dev/models/web_extract_styleguide_params.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::Web#extract_styleguide + class WebExtractStyleguideParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + # @!attribute direct_url + # A specific URL to fetch the styleguide from directly, bypassing domain + # resolution (e.g., 'https://example.com/design-system'). When provided, the + # styleguide is extracted from this exact URL. You must provide either 'domain' or + # 'directUrl', but not both. + # + # @return [String, nil] + optional :direct_url, String + + # @!attribute domain + # Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The + # domain will be automatically normalized and validated. You must provide either + # 'domain' or 'directUrl', but not both. + # + # @return [String, nil] + optional :domain, String + + # @!attribute 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). + # + # @return [Integer, nil] + optional :timeout_ms, Integer + + # @!method initialize(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebExtractStyleguideParams} for more details. + # + # @param direct_url [String] A specific URL to fetch the styleguide from directly, bypassing domain resolutio + # + # @param domain [String] Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The + # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/context_dev/models/web_extract_styleguide_response.rb b/lib/context_dev/models/web_extract_styleguide_response.rb new file mode 100644 index 00000000..1752746b --- /dev/null +++ b/lib/context_dev/models/web_extract_styleguide_response.rb @@ -0,0 +1,1115 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::Web#extract_styleguide + class WebExtractStyleguideResponse < ContextDev::Internal::Type::BaseModel + # @!attribute code + # HTTP status code + # + # @return [Integer, nil] + optional :code, Integer + + # @!attribute domain + # The normalized domain that was processed + # + # @return [String, nil] + optional :domain, String + + # @!attribute status + # Status of the response, e.g., 'ok' + # + # @return [String, nil] + optional :status, String + + # @!attribute styleguide + # Comprehensive styleguide data extracted from the website + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide, nil] + optional :styleguide, -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide } + + # @!method initialize(code: nil, domain: nil, status: nil, styleguide: nil) + # @param code [Integer] HTTP status code + # + # @param domain [String] The normalized domain that was processed + # + # @param status [String] Status of the response, e.g., 'ok' + # + # @param styleguide [ContextDev::Models::WebExtractStyleguideResponse::Styleguide] Comprehensive styleguide data extracted from the website + + # @see ContextDev::Models::WebExtractStyleguideResponse#styleguide + class Styleguide < ContextDev::Internal::Type::BaseModel + # @!attribute colors + # Primary colors used on the website + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Colors] + required :colors, -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Colors } + + # @!attribute components + # UI component styles + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components] + required :components, -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components } + + # @!attribute element_spacing + # Spacing system used on the website + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::ElementSpacing] + required :element_spacing, + -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::ElementSpacing }, + api_name: :elementSpacing + + # @!attribute font_links + # Font assets keyed by family name as it appears in fontFamily/fontFallbacks + # (non-generic names only). Clients match typography.fontFamily / fontWeight or + # button styles to pick a file URL from files. + # + # @return [Hash{Symbol=>ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink}] + required :font_links, + -> { ContextDev::Internal::Type::HashOf[ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink] }, + api_name: :fontLinks + + # @!attribute mode + # The primary color mode of the website design + # + # @return [Symbol, ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Mode] + required :mode, enum: -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Mode } + + # @!attribute shadows + # Shadow styles used on the website + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Shadows] + required :shadows, -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Shadows } + + # @!attribute typography + # Typography styles used on the website + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography] + required :typography, -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography } + + # @!method initialize(colors:, components:, element_spacing:, font_links:, mode:, shadows:, typography:) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebExtractStyleguideResponse::Styleguide} for more details. + # + # Comprehensive styleguide data extracted from the website + # + # @param colors [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Colors] Primary colors used on the website + # + # @param components [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components] UI component styles + # + # @param element_spacing [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::ElementSpacing] Spacing system used on the website + # + # @param font_links [Hash{Symbol=>ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink}] Font assets keyed by family name as it appears in fontFamily/fontFallbacks (non- + # + # @param mode [Symbol, ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Mode] The primary color mode of the website design + # + # @param shadows [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Shadows] Shadow styles used on the website + # + # @param typography [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography] Typography styles used on the website + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide#colors + class Colors < ContextDev::Internal::Type::BaseModel + # @!attribute accent + # Accent color (hex format) + # + # @return [String] + required :accent, String + + # @!attribute background + # Background color (hex format) + # + # @return [String] + required :background, String + + # @!attribute text + # Text color (hex format) + # + # @return [String] + required :text, String + + # @!method initialize(accent:, background:, text:) + # Primary colors used on the website + # + # @param accent [String] Accent color (hex format) + # + # @param background [String] Background color (hex format) + # + # @param text [String] Text color (hex format) + end + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide#components + class Components < ContextDev::Internal::Type::BaseModel + # @!attribute button + # Button component styles + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button] + required :button, -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button } + + # @!attribute card + # Card component style + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Card, nil] + optional :card, -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Card } + + # @!method initialize(button:, card: nil) + # UI component styles + # + # @param button [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button] Button component styles + # + # @param card [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Card] Card component style + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components#button + class Button < ContextDev::Internal::Type::BaseModel + # @!attribute link + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Link, nil] + optional :link, + -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Link } + + # @!attribute primary + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Primary, nil] + optional :primary, + -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Primary } + + # @!attribute secondary + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Secondary, nil] + optional :secondary, + -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Secondary } + + # @!method initialize(link: nil, primary: nil, secondary: nil) + # Button component styles + # + # @param link [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Link] + # @param primary [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Primary] + # @param secondary [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Secondary] + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button#link + class Link < ContextDev::Internal::Type::BaseModel + # @!attribute background_color + # + # @return [String] + required :background_color, String, api_name: :backgroundColor + + # @!attribute border_color + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + # + # @return [String] + required :border_color, String, api_name: :borderColor + + # @!attribute border_radius + # + # @return [String] + required :border_radius, String, api_name: :borderRadius + + # @!attribute border_style + # + # @return [String] + required :border_style, String, api_name: :borderStyle + + # @!attribute border_width + # + # @return [String] + required :border_width, String, api_name: :borderWidth + + # @!attribute box_shadow + # Computed box-shadow (comma-separated layers when present) + # + # @return [String] + required :box_shadow, String, api_name: :boxShadow + + # @!attribute color + # + # @return [String] + required :color, String + + # @!attribute css + # Ready-to-use CSS declaration block for this component style + # + # @return [String] + required :css, String + + # @!attribute font_size + # + # @return [String] + required :font_size, String, api_name: :fontSize + + # @!attribute font_weight + # + # @return [Float] + required :font_weight, Float, api_name: :fontWeight + + # @!attribute min_height + # Sampled minimum height of the button box (typically px) + # + # @return [String] + required :min_height, String, api_name: :minHeight + + # @!attribute min_width + # Sampled minimum width of the button box (typically px) + # + # @return [String] + required :min_width, String, api_name: :minWidth + + # @!attribute padding + # + # @return [String] + required :padding, String + + # @!attribute text_decoration + # + # @return [String] + required :text_decoration, String, api_name: :textDecoration + + # @!attribute font_fallbacks + # Full ordered font list from computed font-family + # + # @return [Array, nil] + optional :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + + # @!attribute font_family + # Primary button typeface (first in fontFallbacks) + # + # @return [String, nil] + optional :font_family, String, api_name: :fontFamily + + # @!attribute text_decoration_color + # Hex color of the underline when it differs from the text color + # + # @return [String, nil] + optional :text_decoration_color, String, api_name: :textDecorationColor + + # @!method initialize(background_color:, border_color:, border_radius:, border_style:, border_width:, box_shadow:, color:, css:, font_size:, font_weight:, min_height:, min_width:, padding:, text_decoration:, font_fallbacks: nil, font_family: nil, text_decoration_color: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Link} + # for more details. + # + # @param background_color [String] + # + # @param border_color [String] Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alp + # + # @param border_radius [String] + # + # @param border_style [String] + # + # @param border_width [String] + # + # @param box_shadow [String] Computed box-shadow (comma-separated layers when present) + # + # @param color [String] + # + # @param css [String] Ready-to-use CSS declaration block for this component style + # + # @param font_size [String] + # + # @param font_weight [Float] + # + # @param min_height [String] Sampled minimum height of the button box (typically px) + # + # @param min_width [String] Sampled minimum width of the button box (typically px) + # + # @param padding [String] + # + # @param text_decoration [String] + # + # @param font_fallbacks [Array] Full ordered font list from computed font-family + # + # @param font_family [String] Primary button typeface (first in fontFallbacks) + # + # @param text_decoration_color [String] Hex color of the underline when it differs from the text color + end + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button#primary + class Primary < ContextDev::Internal::Type::BaseModel + # @!attribute background_color + # + # @return [String] + required :background_color, String, api_name: :backgroundColor + + # @!attribute border_color + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + # + # @return [String] + required :border_color, String, api_name: :borderColor + + # @!attribute border_radius + # + # @return [String] + required :border_radius, String, api_name: :borderRadius + + # @!attribute border_style + # + # @return [String] + required :border_style, String, api_name: :borderStyle + + # @!attribute border_width + # + # @return [String] + required :border_width, String, api_name: :borderWidth + + # @!attribute box_shadow + # Computed box-shadow (comma-separated layers when present) + # + # @return [String] + required :box_shadow, String, api_name: :boxShadow + + # @!attribute color + # + # @return [String] + required :color, String + + # @!attribute css + # Ready-to-use CSS declaration block for this component style + # + # @return [String] + required :css, String + + # @!attribute font_size + # + # @return [String] + required :font_size, String, api_name: :fontSize + + # @!attribute font_weight + # + # @return [Float] + required :font_weight, Float, api_name: :fontWeight + + # @!attribute min_height + # Sampled minimum height of the button box (typically px) + # + # @return [String] + required :min_height, String, api_name: :minHeight + + # @!attribute min_width + # Sampled minimum width of the button box (typically px) + # + # @return [String] + required :min_width, String, api_name: :minWidth + + # @!attribute padding + # + # @return [String] + required :padding, String + + # @!attribute text_decoration + # + # @return [String] + required :text_decoration, String, api_name: :textDecoration + + # @!attribute font_fallbacks + # Full ordered font list from computed font-family + # + # @return [Array, nil] + optional :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + + # @!attribute font_family + # Primary button typeface (first in fontFallbacks) + # + # @return [String, nil] + optional :font_family, String, api_name: :fontFamily + + # @!attribute text_decoration_color + # Hex color of the underline when it differs from the text color + # + # @return [String, nil] + optional :text_decoration_color, String, api_name: :textDecorationColor + + # @!method initialize(background_color:, border_color:, border_radius:, border_style:, border_width:, box_shadow:, color:, css:, font_size:, font_weight:, min_height:, min_width:, padding:, text_decoration:, font_fallbacks: nil, font_family: nil, text_decoration_color: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Primary} + # for more details. + # + # @param background_color [String] + # + # @param border_color [String] Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alp + # + # @param border_radius [String] + # + # @param border_style [String] + # + # @param border_width [String] + # + # @param box_shadow [String] Computed box-shadow (comma-separated layers when present) + # + # @param color [String] + # + # @param css [String] Ready-to-use CSS declaration block for this component style + # + # @param font_size [String] + # + # @param font_weight [Float] + # + # @param min_height [String] Sampled minimum height of the button box (typically px) + # + # @param min_width [String] Sampled minimum width of the button box (typically px) + # + # @param padding [String] + # + # @param text_decoration [String] + # + # @param font_fallbacks [Array] Full ordered font list from computed font-family + # + # @param font_family [String] Primary button typeface (first in fontFallbacks) + # + # @param text_decoration_color [String] Hex color of the underline when it differs from the text color + end + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button#secondary + class Secondary < ContextDev::Internal::Type::BaseModel + # @!attribute background_color + # + # @return [String] + required :background_color, String, api_name: :backgroundColor + + # @!attribute border_color + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + # + # @return [String] + required :border_color, String, api_name: :borderColor + + # @!attribute border_radius + # + # @return [String] + required :border_radius, String, api_name: :borderRadius + + # @!attribute border_style + # + # @return [String] + required :border_style, String, api_name: :borderStyle + + # @!attribute border_width + # + # @return [String] + required :border_width, String, api_name: :borderWidth + + # @!attribute box_shadow + # Computed box-shadow (comma-separated layers when present) + # + # @return [String] + required :box_shadow, String, api_name: :boxShadow + + # @!attribute color + # + # @return [String] + required :color, String + + # @!attribute css + # Ready-to-use CSS declaration block for this component style + # + # @return [String] + required :css, String + + # @!attribute font_size + # + # @return [String] + required :font_size, String, api_name: :fontSize + + # @!attribute font_weight + # + # @return [Float] + required :font_weight, Float, api_name: :fontWeight + + # @!attribute min_height + # Sampled minimum height of the button box (typically px) + # + # @return [String] + required :min_height, String, api_name: :minHeight + + # @!attribute min_width + # Sampled minimum width of the button box (typically px) + # + # @return [String] + required :min_width, String, api_name: :minWidth + + # @!attribute padding + # + # @return [String] + required :padding, String + + # @!attribute text_decoration + # + # @return [String] + required :text_decoration, String, api_name: :textDecoration + + # @!attribute font_fallbacks + # Full ordered font list from computed font-family + # + # @return [Array, nil] + optional :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + + # @!attribute font_family + # Primary button typeface (first in fontFallbacks) + # + # @return [String, nil] + optional :font_family, String, api_name: :fontFamily + + # @!attribute text_decoration_color + # Hex color of the underline when it differs from the text color + # + # @return [String, nil] + optional :text_decoration_color, String, api_name: :textDecorationColor + + # @!method initialize(background_color:, border_color:, border_radius:, border_style:, border_width:, box_shadow:, color:, css:, font_size:, font_weight:, min_height:, min_width:, padding:, text_decoration:, font_fallbacks: nil, font_family: nil, text_decoration_color: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Secondary} + # for more details. + # + # @param background_color [String] + # + # @param border_color [String] Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alp + # + # @param border_radius [String] + # + # @param border_style [String] + # + # @param border_width [String] + # + # @param box_shadow [String] Computed box-shadow (comma-separated layers when present) + # + # @param color [String] + # + # @param css [String] Ready-to-use CSS declaration block for this component style + # + # @param font_size [String] + # + # @param font_weight [Float] + # + # @param min_height [String] Sampled minimum height of the button box (typically px) + # + # @param min_width [String] Sampled minimum width of the button box (typically px) + # + # @param padding [String] + # + # @param text_decoration [String] + # + # @param font_fallbacks [Array] Full ordered font list from computed font-family + # + # @param font_family [String] Primary button typeface (first in fontFallbacks) + # + # @param text_decoration_color [String] Hex color of the underline when it differs from the text color + end + end + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components#card + class Card < ContextDev::Internal::Type::BaseModel + # @!attribute background_color + # + # @return [String] + required :background_color, String, api_name: :backgroundColor + + # @!attribute border_color + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + # + # @return [String] + required :border_color, String, api_name: :borderColor + + # @!attribute border_radius + # + # @return [String] + required :border_radius, String, api_name: :borderRadius + + # @!attribute border_style + # + # @return [String] + required :border_style, String, api_name: :borderStyle + + # @!attribute border_width + # + # @return [String] + required :border_width, String, api_name: :borderWidth + + # @!attribute box_shadow + # + # @return [String] + required :box_shadow, String, api_name: :boxShadow + + # @!attribute css + # Ready-to-use CSS declaration block for this component style + # + # @return [String] + required :css, String + + # @!attribute padding + # + # @return [String] + required :padding, String + + # @!attribute text_color + # + # @return [String] + required :text_color, String, api_name: :textColor + + # @!method initialize(background_color:, border_color:, border_radius:, border_style:, border_width:, box_shadow:, css:, padding:, text_color:) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Card} + # for more details. + # + # Card component style + # + # @param background_color [String] + # + # @param border_color [String] Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alp + # + # @param border_radius [String] + # + # @param border_style [String] + # + # @param border_width [String] + # + # @param box_shadow [String] + # + # @param css [String] Ready-to-use CSS declaration block for this component style + # + # @param padding [String] + # + # @param text_color [String] + end + end + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide#element_spacing + class ElementSpacing < ContextDev::Internal::Type::BaseModel + # @!attribute lg + # + # @return [String] + required :lg, String + + # @!attribute md + # + # @return [String] + required :md, String + + # @!attribute sm + # + # @return [String] + required :sm, String + + # @!attribute xl + # + # @return [String] + required :xl, String + + # @!attribute xs + # + # @return [String] + required :xs, String + + # @!method initialize(lg:, md:, sm:, xl:, xs:) + # Spacing system used on the website + # + # @param lg [String] + # @param md [String] + # @param sm [String] + # @param xl [String] + # @param xs [String] + end + + class FontLink < ContextDev::Internal::Type::BaseModel + # @!attribute files + # Upright font files keyed by weight string (e.g. "400" for regular, "500", + # "700"). Values are absolute URLs. + # + # @return [Hash{Symbol=>String}] + required :files, ContextDev::Internal::Type::HashOf[String] + + # @!attribute type + # + # @return [Symbol, ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::Type] + required :type, enum: -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::Type } + + # @!attribute category + # Google Fonts category when type is google (e.g. sans-serif, serif, monospace, + # display, handwriting). Omitted for custom fonts when unknown. + # + # @return [String, nil] + optional :category, String + + # @!attribute display_name + # Present when type is custom: human-readable name derived from the fontLinks key + # (strip build/hash suffixes, split camelCase / PascalCase, normalize separators). + # Google entries omit this. + # + # @return [String, nil] + optional :display_name, String, api_name: :displayName + + # @!method initialize(files:, type:, category: nil, display_name: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink} for + # more details. + # + # @param files [Hash{Symbol=>String}] Upright font files keyed by weight string (e.g. "400" for regular, "500", "700") + # + # @param type [Symbol, ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::Type] + # + # @param category [String] Google Fonts category when type is google (e.g. sans-serif, serif, monospace, di + # + # @param display_name [String] Present when type is custom: human-readable name derived from the fontLinks key + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink#type + module Type + extend ContextDev::Internal::Type::Enum + + GOOGLE = :google + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + end + + # The primary color mode of the website design + # + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide#mode + module Mode + extend ContextDev::Internal::Type::Enum + + LIGHT = :light + DARK = :dark + + # @!method self.values + # @return [Array] + end + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide#shadows + class Shadows < ContextDev::Internal::Type::BaseModel + # @!attribute inner + # + # @return [String] + required :inner, String + + # @!attribute lg + # + # @return [String] + required :lg, String + + # @!attribute md + # + # @return [String] + required :md, String + + # @!attribute sm + # + # @return [String] + required :sm, String + + # @!attribute xl + # + # @return [String] + required :xl, String + + # @!method initialize(inner:, lg:, md:, sm:, xl:) + # Shadow styles used on the website + # + # @param inner [String] + # @param lg [String] + # @param md [String] + # @param sm [String] + # @param xl [String] + end + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide#typography + class Typography < ContextDev::Internal::Type::BaseModel + # @!attribute headings + # Heading styles + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings] + required :headings, + -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings } + + # @!attribute p_ + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::P, nil] + optional :p_, + -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::P }, + api_name: :p + + # @!method initialize(headings:, p_: nil) + # Typography styles used on the website + # + # @param headings [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings] Heading styles + # + # @param p_ [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::P] + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography#headings + class Headings < ContextDev::Internal::Type::BaseModel + # @!attribute h1 + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H1, nil] + optional :h1, + -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H1 } + + # @!attribute h2 + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H2, nil] + optional :h2, + -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H2 } + + # @!attribute h3 + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H3, nil] + optional :h3, + -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H3 } + + # @!attribute h4 + # + # @return [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H4, nil] + optional :h4, + -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H4 } + + # @!method initialize(h1: nil, h2: nil, h3: nil, h4: nil) + # Heading styles + # + # @param h1 [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H1] + # @param h2 [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H2] + # @param h3 [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H3] + # @param h4 [ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H4] + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings#h1 + class H1 < ContextDev::Internal::Type::BaseModel + # @!attribute font_fallbacks + # Full ordered font list from resolved computed font-family + # + # @return [Array] + required :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + + # @!attribute font_family + # Primary face (first family in the computed stack) + # + # @return [String] + required :font_family, String, api_name: :fontFamily + + # @!attribute font_size + # + # @return [String] + required :font_size, String, api_name: :fontSize + + # @!attribute font_weight + # + # @return [Float] + required :font_weight, Float, api_name: :fontWeight + + # @!attribute letter_spacing + # + # @return [String] + required :letter_spacing, String, api_name: :letterSpacing + + # @!attribute line_height + # + # @return [String] + required :line_height, String, api_name: :lineHeight + + # @!method initialize(font_fallbacks:, font_family:, font_size:, font_weight:, letter_spacing:, line_height:) + # @param font_fallbacks [Array] Full ordered font list from resolved computed font-family + # + # @param font_family [String] Primary face (first family in the computed stack) + # + # @param font_size [String] + # + # @param font_weight [Float] + # + # @param letter_spacing [String] + # + # @param line_height [String] + end + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings#h2 + class H2 < ContextDev::Internal::Type::BaseModel + # @!attribute font_fallbacks + # Full ordered font list from resolved computed font-family + # + # @return [Array] + required :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + + # @!attribute font_family + # Primary face (first family in the computed stack) + # + # @return [String] + required :font_family, String, api_name: :fontFamily + + # @!attribute font_size + # + # @return [String] + required :font_size, String, api_name: :fontSize + + # @!attribute font_weight + # + # @return [Float] + required :font_weight, Float, api_name: :fontWeight + + # @!attribute letter_spacing + # + # @return [String] + required :letter_spacing, String, api_name: :letterSpacing + + # @!attribute line_height + # + # @return [String] + required :line_height, String, api_name: :lineHeight + + # @!method initialize(font_fallbacks:, font_family:, font_size:, font_weight:, letter_spacing:, line_height:) + # @param font_fallbacks [Array] Full ordered font list from resolved computed font-family + # + # @param font_family [String] Primary face (first family in the computed stack) + # + # @param font_size [String] + # + # @param font_weight [Float] + # + # @param letter_spacing [String] + # + # @param line_height [String] + end + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings#h3 + class H3 < ContextDev::Internal::Type::BaseModel + # @!attribute font_fallbacks + # Full ordered font list from resolved computed font-family + # + # @return [Array] + required :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + + # @!attribute font_family + # Primary face (first family in the computed stack) + # + # @return [String] + required :font_family, String, api_name: :fontFamily + + # @!attribute font_size + # + # @return [String] + required :font_size, String, api_name: :fontSize + + # @!attribute font_weight + # + # @return [Float] + required :font_weight, Float, api_name: :fontWeight + + # @!attribute letter_spacing + # + # @return [String] + required :letter_spacing, String, api_name: :letterSpacing + + # @!attribute line_height + # + # @return [String] + required :line_height, String, api_name: :lineHeight + + # @!method initialize(font_fallbacks:, font_family:, font_size:, font_weight:, letter_spacing:, line_height:) + # @param font_fallbacks [Array] Full ordered font list from resolved computed font-family + # + # @param font_family [String] Primary face (first family in the computed stack) + # + # @param font_size [String] + # + # @param font_weight [Float] + # + # @param letter_spacing [String] + # + # @param line_height [String] + end + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings#h4 + class H4 < ContextDev::Internal::Type::BaseModel + # @!attribute font_fallbacks + # Full ordered font list from resolved computed font-family + # + # @return [Array] + required :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + + # @!attribute font_family + # Primary face (first family in the computed stack) + # + # @return [String] + required :font_family, String, api_name: :fontFamily + + # @!attribute font_size + # + # @return [String] + required :font_size, String, api_name: :fontSize + + # @!attribute font_weight + # + # @return [Float] + required :font_weight, Float, api_name: :fontWeight + + # @!attribute letter_spacing + # + # @return [String] + required :letter_spacing, String, api_name: :letterSpacing + + # @!attribute line_height + # + # @return [String] + required :line_height, String, api_name: :lineHeight + + # @!method initialize(font_fallbacks:, font_family:, font_size:, font_weight:, letter_spacing:, line_height:) + # @param font_fallbacks [Array] Full ordered font list from resolved computed font-family + # + # @param font_family [String] Primary face (first family in the computed stack) + # + # @param font_size [String] + # + # @param font_weight [Float] + # + # @param letter_spacing [String] + # + # @param line_height [String] + end + end + + # @see ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography#p_ + class P < ContextDev::Internal::Type::BaseModel + # @!attribute font_fallbacks + # Full ordered font list from resolved computed font-family + # + # @return [Array] + required :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + + # @!attribute font_family + # Primary face (first family in the computed stack) + # + # @return [String] + required :font_family, String, api_name: :fontFamily + + # @!attribute font_size + # + # @return [String] + required :font_size, String, api_name: :fontSize + + # @!attribute font_weight + # + # @return [Float] + required :font_weight, Float, api_name: :fontWeight + + # @!attribute letter_spacing + # + # @return [String] + required :letter_spacing, String, api_name: :letterSpacing + + # @!attribute line_height + # + # @return [String] + required :line_height, String, api_name: :lineHeight + + # @!method initialize(font_fallbacks:, font_family:, font_size:, font_weight:, letter_spacing:, line_height:) + # @param font_fallbacks [Array] Full ordered font list from resolved computed font-family + # + # @param font_family [String] Primary face (first family in the computed stack) + # + # @param font_size [String] + # + # @param font_weight [Float] + # + # @param letter_spacing [String] + # + # @param line_height [String] + end + end + end + end + end +end diff --git a/lib/context_dev/models/web_screenshot_params.rb b/lib/context_dev/models/web_screenshot_params.rb new file mode 100644 index 00000000..ba31f61c --- /dev/null +++ b/lib/context_dev/models/web_screenshot_params.rb @@ -0,0 +1,116 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::Web#screenshot + class WebScreenshotParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + # @!attribute direct_url + # A specific URL to screenshot directly, bypassing domain resolution (e.g., + # 'https://example.com/pricing'). When provided, the screenshot is taken of this + # exact URL. You must provide either 'domain' or 'directUrl', but not both. + # + # @return [String, nil] + optional :direct_url, String + + # @!attribute domain + # Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The + # domain will be automatically normalized and validated. You must provide either + # 'domain' or 'directUrl', but not both. + # + # @return [String, nil] + optional :domain, String + + # @!attribute full_screenshot + # Optional parameter to determine screenshot type. If 'true', takes a full page + # screenshot capturing all content. If 'false' or not provided, takes a viewport + # screenshot (standard browser view). + # + # @return [Symbol, ContextDev::Models::WebScreenshotParams::FullScreenshot, nil] + optional :full_screenshot, enum: -> { ContextDev::WebScreenshotParams::FullScreenshot } + + # @!attribute 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. Only applicable when using + # 'domain', not 'directUrl'. + # + # @return [Symbol, ContextDev::Models::WebScreenshotParams::Page, nil] + optional :page, enum: -> { ContextDev::WebScreenshotParams::Page } + + # @!attribute 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. + # + # @return [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize, nil] + optional :prioritize, enum: -> { ContextDev::WebScreenshotParams::Prioritize } + + # @!method initialize(direct_url: nil, domain: nil, full_screenshot: nil, page: nil, prioritize: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebScreenshotParams} for more details. + # + # @param direct_url [String] A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https + # + # @param domain [String] Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domai + # + # @param full_screenshot [Symbol, ContextDev::Models::WebScreenshotParams::FullScreenshot] Optional parameter to determine screenshot type. If 'true', takes a full page sc + # + # @param page [Symbol, ContextDev::Models::WebScreenshotParams::Page] Optional parameter to specify which page type to screenshot. If provided, the sy + # + # @param prioritize [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize] Optional parameter to prioritize screenshot capture. If 'speed', optimizes for f + # + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + + # Optional parameter to determine screenshot type. If 'true', takes a full page + # screenshot capturing all content. If 'false' or not provided, takes a viewport + # screenshot (standard browser view). + module FullScreenshot + extend ContextDev::Internal::Type::Enum + + TRUE = :true + FALSE = :false + + # @!method self.values + # @return [Array] + end + + # 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. Only applicable when using + # 'domain', not 'directUrl'. + module Page + extend ContextDev::Internal::Type::Enum + + LOGIN = :login + SIGNUP = :signup + BLOG = :blog + CAREERS = :careers + PRICING = :pricing + TERMS = :terms + PRIVACY = :privacy + CONTACT = :contact + + # @!method self.values + # @return [Array] + end + + # 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. + module Prioritize + extend ContextDev::Internal::Type::Enum + + SPEED = :speed + QUALITY = :quality + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/context_dev/models/web_screenshot_response.rb b/lib/context_dev/models/web_screenshot_response.rb new file mode 100644 index 00000000..270820dd --- /dev/null +++ b/lib/context_dev/models/web_screenshot_response.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::Web#screenshot + class WebScreenshotResponse < ContextDev::Internal::Type::BaseModel + # @!attribute code + # HTTP status code + # + # @return [Integer, nil] + optional :code, Integer + + # @!attribute domain + # The normalized domain that was processed + # + # @return [String, nil] + optional :domain, String + + # @!attribute screenshot + # Public URL of the uploaded screenshot image + # + # @return [String, nil] + optional :screenshot, String + + # @!attribute screenshot_type + # Type of screenshot that was captured + # + # @return [Symbol, ContextDev::Models::WebScreenshotResponse::ScreenshotType, nil] + optional :screenshot_type, + enum: -> { ContextDev::Models::WebScreenshotResponse::ScreenshotType }, + api_name: :screenshotType + + # @!attribute status + # Status of the response, e.g., 'ok' + # + # @return [String, nil] + optional :status, String + + # @!method initialize(code: nil, domain: nil, screenshot: nil, screenshot_type: nil, status: nil) + # @param code [Integer] HTTP status code + # + # @param domain [String] The normalized domain that was processed + # + # @param screenshot [String] Public URL of the uploaded screenshot image + # + # @param screenshot_type [Symbol, ContextDev::Models::WebScreenshotResponse::ScreenshotType] Type of screenshot that was captured + # + # @param status [String] Status of the response, e.g., 'ok' + + # Type of screenshot that was captured + # + # @see ContextDev::Models::WebScreenshotResponse#screenshot_type + module ScreenshotType + extend ContextDev::Internal::Type::Enum + + VIEWPORT = :viewport + FULL_PAGE = :fullPage + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index b63d4d2b..cfb13bba 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -34,6 +34,71 @@ def extract_fonts(params = {}) ) end + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebExtractStyleguideParams} for more details. + # + # Extract a comprehensive design system from a website including colors, + # typography, spacing, shadows, and UI components. + # + # @overload extract_styleguide(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {}) + # + # @param direct_url [String] A specific URL to fetch the styleguide from directly, bypassing domain resolutio + # + # @param domain [String] Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The + # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [ContextDev::Models::WebExtractStyleguideResponse] + # + # @see ContextDev::Models::WebExtractStyleguideParams + def extract_styleguide(params = {}) + parsed, options = ContextDev::WebExtractStyleguideParams.dump_request(params) + query = ContextDev::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "web/styleguide", + query: query.transform_keys(direct_url: "directUrl", timeout_ms: "timeoutMS"), + model: ContextDev::Models::WebExtractStyleguideResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebScreenshotParams} for more details. + # + # Capture a screenshot of a website. + # + # @overload screenshot(direct_url: nil, domain: nil, full_screenshot: nil, page: nil, prioritize: nil, request_options: {}) + # + # @param direct_url [String] A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https + # + # @param domain [String] Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domai + # + # @param full_screenshot [Symbol, ContextDev::Models::WebScreenshotParams::FullScreenshot] Optional parameter to determine screenshot type. If 'true', takes a full page sc + # + # @param page [Symbol, ContextDev::Models::WebScreenshotParams::Page] Optional parameter to specify which page type to screenshot. If provided, the sy + # + # @param prioritize [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize] Optional parameter to prioritize screenshot capture. If 'speed', optimizes for f + # + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [ContextDev::Models::WebScreenshotResponse] + # + # @see ContextDev::Models::WebScreenshotParams + def screenshot(params = {}) + parsed, options = ContextDev::WebScreenshotParams.dump_request(params) + query = ContextDev::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "web/screenshot", + query: query.transform_keys(direct_url: "directUrl", full_screenshot: "fullScreenshot"), + model: ContextDev::Models::WebScreenshotResponse, + options: options + ) + end + # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebCrawlMdParams} for more details. # diff --git a/rbi/context_dev/models.rbi b/rbi/context_dev/models.rbi index 884df958..43142d69 100644 --- a/rbi/context_dev/models.rbi +++ b/rbi/context_dev/models.rbi @@ -32,6 +32,10 @@ module ContextDev WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams + WebExtractStyleguideParams = ContextDev::Models::WebExtractStyleguideParams + + WebScreenshotParams = ContextDev::Models::WebScreenshotParams + WebWebCrawlMdParams = ContextDev::Models::WebWebCrawlMdParams WebWebScrapeHTMLParams = ContextDev::Models::WebWebScrapeHTMLParams diff --git a/rbi/context_dev/models/web_extract_styleguide_params.rbi b/rbi/context_dev/models/web_extract_styleguide_params.rbi new file mode 100644 index 00000000..d704be66 --- /dev/null +++ b/rbi/context_dev/models/web_extract_styleguide_params.rbi @@ -0,0 +1,85 @@ +# typed: strong + +module ContextDev + module Models + class WebExtractStyleguideParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + ContextDev::WebExtractStyleguideParams, + ContextDev::Internal::AnyHash + ) + end + + # A specific URL to fetch the styleguide from directly, bypassing domain + # resolution (e.g., 'https://example.com/design-system'). When provided, the + # styleguide is extracted from this exact URL. You must provide either 'domain' or + # 'directUrl', but not both. + sig { returns(T.nilable(String)) } + attr_reader :direct_url + + sig { params(direct_url: String).void } + attr_writer :direct_url + + # Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The + # domain will be automatically normalized and validated. You must provide either + # 'domain' or 'directUrl', but not both. + sig { returns(T.nilable(String)) } + attr_reader :domain + + sig { params(domain: String).void } + attr_writer :domain + + # 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). + sig { returns(T.nilable(Integer)) } + attr_reader :timeout_ms + + sig { params(timeout_ms: Integer).void } + attr_writer :timeout_ms + + sig do + params( + direct_url: String, + domain: String, + timeout_ms: Integer, + request_options: ContextDev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # A specific URL to fetch the styleguide from directly, bypassing domain + # resolution (e.g., 'https://example.com/design-system'). When provided, the + # styleguide is extracted from this exact URL. You must provide either 'domain' or + # 'directUrl', but not both. + direct_url: nil, + # Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The + # domain will be automatically normalized and validated. You must provide either + # 'domain' or 'directUrl', but not both. + domain: nil, + # 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). + timeout_ms: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + direct_url: String, + domain: String, + timeout_ms: Integer, + request_options: ContextDev::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/context_dev/models/web_extract_styleguide_response.rbi b/rbi/context_dev/models/web_extract_styleguide_response.rbi new file mode 100644 index 00000000..1ef1b2f3 --- /dev/null +++ b/rbi/context_dev/models/web_extract_styleguide_response.rbi @@ -0,0 +1,1790 @@ +# typed: strong + +module ContextDev + module Models + class WebExtractStyleguideResponse < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse, + ContextDev::Internal::AnyHash + ) + end + + # HTTP status code + sig { returns(T.nilable(Integer)) } + attr_reader :code + + sig { params(code: Integer).void } + attr_writer :code + + # The normalized domain that was processed + sig { returns(T.nilable(String)) } + attr_reader :domain + + sig { params(domain: String).void } + attr_writer :domain + + # Status of the response, e.g., 'ok' + sig { returns(T.nilable(String)) } + attr_reader :status + + sig { params(status: String).void } + attr_writer :status + + # Comprehensive styleguide data extracted from the website + sig do + returns( + T.nilable( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide + ) + ) + end + attr_reader :styleguide + + sig do + params( + styleguide: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::OrHash + ).void + end + attr_writer :styleguide + + sig do + params( + code: Integer, + domain: String, + status: String, + styleguide: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::OrHash + ).returns(T.attached_class) + end + def self.new( + # HTTP status code + code: nil, + # The normalized domain that was processed + domain: nil, + # Status of the response, e.g., 'ok' + status: nil, + # Comprehensive styleguide data extracted from the website + styleguide: nil + ) + end + + sig do + override.returns( + { + code: Integer, + domain: String, + status: String, + styleguide: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide + } + ) + end + def to_hash + end + + class Styleguide < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide, + ContextDev::Internal::AnyHash + ) + end + + # Primary colors used on the website + sig do + returns( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Colors + ) + end + attr_reader :colors + + sig do + params( + colors: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Colors::OrHash + ).void + end + attr_writer :colors + + # UI component styles + sig do + returns( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components + ) + end + attr_reader :components + + sig do + params( + components: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::OrHash + ).void + end + attr_writer :components + + # Spacing system used on the website + sig do + returns( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::ElementSpacing + ) + end + attr_reader :element_spacing + + sig do + params( + element_spacing: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::ElementSpacing::OrHash + ).void + end + attr_writer :element_spacing + + # Font assets keyed by family name as it appears in fontFamily/fontFallbacks + # (non-generic names only). Clients match typography.fontFamily / fontWeight or + # button styles to pick a file URL from files. + sig do + returns( + T::Hash[ + Symbol, + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink + ] + ) + end + attr_accessor :font_links + + # The primary color mode of the website design + sig do + returns( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Mode::TaggedSymbol + ) + end + attr_accessor :mode + + # Shadow styles used on the website + sig do + returns( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Shadows + ) + end + attr_reader :shadows + + sig do + params( + shadows: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Shadows::OrHash + ).void + end + attr_writer :shadows + + # Typography styles used on the website + sig do + returns( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography + ) + end + attr_reader :typography + + sig do + params( + typography: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::OrHash + ).void + end + attr_writer :typography + + # Comprehensive styleguide data extracted from the website + sig do + params( + colors: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Colors::OrHash, + components: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::OrHash, + element_spacing: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::ElementSpacing::OrHash, + font_links: + T::Hash[ + Symbol, + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::OrHash + ], + mode: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Mode::OrSymbol, + shadows: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Shadows::OrHash, + typography: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::OrHash + ).returns(T.attached_class) + end + def self.new( + # Primary colors used on the website + colors:, + # UI component styles + components:, + # Spacing system used on the website + element_spacing:, + # Font assets keyed by family name as it appears in fontFamily/fontFallbacks + # (non-generic names only). Clients match typography.fontFamily / fontWeight or + # button styles to pick a file URL from files. + font_links:, + # The primary color mode of the website design + mode:, + # Shadow styles used on the website + shadows:, + # Typography styles used on the website + typography: + ) + end + + sig do + override.returns( + { + colors: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Colors, + components: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components, + element_spacing: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::ElementSpacing, + font_links: + T::Hash[ + Symbol, + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink + ], + mode: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Mode::TaggedSymbol, + shadows: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Shadows, + typography: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography + } + ) + end + def to_hash + end + + class Colors < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Colors, + ContextDev::Internal::AnyHash + ) + end + + # Accent color (hex format) + sig { returns(String) } + attr_accessor :accent + + # Background color (hex format) + sig { returns(String) } + attr_accessor :background + + # Text color (hex format) + sig { returns(String) } + attr_accessor :text + + # Primary colors used on the website + sig do + params(accent: String, background: String, text: String).returns( + T.attached_class + ) + end + def self.new( + # Accent color (hex format) + accent:, + # Background color (hex format) + background:, + # Text color (hex format) + text: + ) + end + + sig do + override.returns( + { accent: String, background: String, text: String } + ) + end + def to_hash + end + end + + class Components < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components, + ContextDev::Internal::AnyHash + ) + end + + # Button component styles + sig do + returns( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button + ) + end + attr_reader :button + + sig do + params( + button: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::OrHash + ).void + end + attr_writer :button + + # Card component style + sig do + returns( + T.nilable( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Card + ) + ) + end + attr_reader :card + + sig do + params( + card: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Card::OrHash + ).void + end + attr_writer :card + + # UI component styles + sig do + params( + button: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::OrHash, + card: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Card::OrHash + ).returns(T.attached_class) + end + def self.new( + # Button component styles + button:, + # Card component style + card: nil + ) + end + + sig do + override.returns( + { + button: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button, + card: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Card + } + ) + end + def to_hash + end + + class Button < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button, + ContextDev::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Link + ) + ) + end + attr_reader :link + + sig do + params( + link: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Link::OrHash + ).void + end + attr_writer :link + + sig do + returns( + T.nilable( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Primary + ) + ) + end + attr_reader :primary + + sig do + params( + primary: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Primary::OrHash + ).void + end + attr_writer :primary + + sig do + returns( + T.nilable( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Secondary + ) + ) + end + attr_reader :secondary + + sig do + params( + secondary: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Secondary::OrHash + ).void + end + attr_writer :secondary + + # Button component styles + sig do + params( + link: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Link::OrHash, + primary: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Primary::OrHash, + secondary: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Secondary::OrHash + ).returns(T.attached_class) + end + def self.new(link: nil, primary: nil, secondary: nil) + end + + sig do + override.returns( + { + link: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Link, + primary: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Primary, + secondary: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Secondary + } + ) + end + def to_hash + end + + class Link < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Link, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :background_color + + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + sig { returns(String) } + attr_accessor :border_color + + sig { returns(String) } + attr_accessor :border_radius + + sig { returns(String) } + attr_accessor :border_style + + sig { returns(String) } + attr_accessor :border_width + + # Computed box-shadow (comma-separated layers when present) + sig { returns(String) } + attr_accessor :box_shadow + + sig { returns(String) } + attr_accessor :color + + # Ready-to-use CSS declaration block for this component style + sig { returns(String) } + attr_accessor :css + + sig { returns(String) } + attr_accessor :font_size + + sig { returns(Float) } + attr_accessor :font_weight + + # Sampled minimum height of the button box (typically px) + sig { returns(String) } + attr_accessor :min_height + + # Sampled minimum width of the button box (typically px) + sig { returns(String) } + attr_accessor :min_width + + sig { returns(String) } + attr_accessor :padding + + sig { returns(String) } + attr_accessor :text_decoration + + # Full ordered font list from computed font-family + sig { returns(T.nilable(T::Array[String])) } + attr_reader :font_fallbacks + + sig { params(font_fallbacks: T::Array[String]).void } + attr_writer :font_fallbacks + + # Primary button typeface (first in fontFallbacks) + sig { returns(T.nilable(String)) } + attr_reader :font_family + + sig { params(font_family: String).void } + attr_writer :font_family + + # Hex color of the underline when it differs from the text color + sig { returns(T.nilable(String)) } + attr_reader :text_decoration_color + + sig { params(text_decoration_color: String).void } + attr_writer :text_decoration_color + + sig do + params( + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + font_fallbacks: T::Array[String], + font_family: String, + text_decoration_color: String + ).returns(T.attached_class) + end + def self.new( + background_color:, + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + border_color:, + border_radius:, + border_style:, + border_width:, + # Computed box-shadow (comma-separated layers when present) + box_shadow:, + color:, + # Ready-to-use CSS declaration block for this component style + css:, + font_size:, + font_weight:, + # Sampled minimum height of the button box (typically px) + min_height:, + # Sampled minimum width of the button box (typically px) + min_width:, + padding:, + text_decoration:, + # Full ordered font list from computed font-family + font_fallbacks: nil, + # Primary button typeface (first in fontFallbacks) + font_family: nil, + # Hex color of the underline when it differs from the text color + text_decoration_color: nil + ) + end + + sig do + override.returns( + { + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + font_fallbacks: T::Array[String], + font_family: String, + text_decoration_color: String + } + ) + end + def to_hash + end + end + + class Primary < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Primary, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :background_color + + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + sig { returns(String) } + attr_accessor :border_color + + sig { returns(String) } + attr_accessor :border_radius + + sig { returns(String) } + attr_accessor :border_style + + sig { returns(String) } + attr_accessor :border_width + + # Computed box-shadow (comma-separated layers when present) + sig { returns(String) } + attr_accessor :box_shadow + + sig { returns(String) } + attr_accessor :color + + # Ready-to-use CSS declaration block for this component style + sig { returns(String) } + attr_accessor :css + + sig { returns(String) } + attr_accessor :font_size + + sig { returns(Float) } + attr_accessor :font_weight + + # Sampled minimum height of the button box (typically px) + sig { returns(String) } + attr_accessor :min_height + + # Sampled minimum width of the button box (typically px) + sig { returns(String) } + attr_accessor :min_width + + sig { returns(String) } + attr_accessor :padding + + sig { returns(String) } + attr_accessor :text_decoration + + # Full ordered font list from computed font-family + sig { returns(T.nilable(T::Array[String])) } + attr_reader :font_fallbacks + + sig { params(font_fallbacks: T::Array[String]).void } + attr_writer :font_fallbacks + + # Primary button typeface (first in fontFallbacks) + sig { returns(T.nilable(String)) } + attr_reader :font_family + + sig { params(font_family: String).void } + attr_writer :font_family + + # Hex color of the underline when it differs from the text color + sig { returns(T.nilable(String)) } + attr_reader :text_decoration_color + + sig { params(text_decoration_color: String).void } + attr_writer :text_decoration_color + + sig do + params( + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + font_fallbacks: T::Array[String], + font_family: String, + text_decoration_color: String + ).returns(T.attached_class) + end + def self.new( + background_color:, + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + border_color:, + border_radius:, + border_style:, + border_width:, + # Computed box-shadow (comma-separated layers when present) + box_shadow:, + color:, + # Ready-to-use CSS declaration block for this component style + css:, + font_size:, + font_weight:, + # Sampled minimum height of the button box (typically px) + min_height:, + # Sampled minimum width of the button box (typically px) + min_width:, + padding:, + text_decoration:, + # Full ordered font list from computed font-family + font_fallbacks: nil, + # Primary button typeface (first in fontFallbacks) + font_family: nil, + # Hex color of the underline when it differs from the text color + text_decoration_color: nil + ) + end + + sig do + override.returns( + { + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + font_fallbacks: T::Array[String], + font_family: String, + text_decoration_color: String + } + ) + end + def to_hash + end + end + + class Secondary < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Secondary, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :background_color + + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + sig { returns(String) } + attr_accessor :border_color + + sig { returns(String) } + attr_accessor :border_radius + + sig { returns(String) } + attr_accessor :border_style + + sig { returns(String) } + attr_accessor :border_width + + # Computed box-shadow (comma-separated layers when present) + sig { returns(String) } + attr_accessor :box_shadow + + sig { returns(String) } + attr_accessor :color + + # Ready-to-use CSS declaration block for this component style + sig { returns(String) } + attr_accessor :css + + sig { returns(String) } + attr_accessor :font_size + + sig { returns(Float) } + attr_accessor :font_weight + + # Sampled minimum height of the button box (typically px) + sig { returns(String) } + attr_accessor :min_height + + # Sampled minimum width of the button box (typically px) + sig { returns(String) } + attr_accessor :min_width + + sig { returns(String) } + attr_accessor :padding + + sig { returns(String) } + attr_accessor :text_decoration + + # Full ordered font list from computed font-family + sig { returns(T.nilable(T::Array[String])) } + attr_reader :font_fallbacks + + sig { params(font_fallbacks: T::Array[String]).void } + attr_writer :font_fallbacks + + # Primary button typeface (first in fontFallbacks) + sig { returns(T.nilable(String)) } + attr_reader :font_family + + sig { params(font_family: String).void } + attr_writer :font_family + + # Hex color of the underline when it differs from the text color + sig { returns(T.nilable(String)) } + attr_reader :text_decoration_color + + sig { params(text_decoration_color: String).void } + attr_writer :text_decoration_color + + sig do + params( + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + font_fallbacks: T::Array[String], + font_family: String, + text_decoration_color: String + ).returns(T.attached_class) + end + def self.new( + background_color:, + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + border_color:, + border_radius:, + border_style:, + border_width:, + # Computed box-shadow (comma-separated layers when present) + box_shadow:, + color:, + # Ready-to-use CSS declaration block for this component style + css:, + font_size:, + font_weight:, + # Sampled minimum height of the button box (typically px) + min_height:, + # Sampled minimum width of the button box (typically px) + min_width:, + padding:, + text_decoration:, + # Full ordered font list from computed font-family + font_fallbacks: nil, + # Primary button typeface (first in fontFallbacks) + font_family: nil, + # Hex color of the underline when it differs from the text color + text_decoration_color: nil + ) + end + + sig do + override.returns( + { + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + font_fallbacks: T::Array[String], + font_family: String, + text_decoration_color: String + } + ) + end + def to_hash + end + end + end + + class Card < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Card, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :background_color + + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + sig { returns(String) } + attr_accessor :border_color + + sig { returns(String) } + attr_accessor :border_radius + + sig { returns(String) } + attr_accessor :border_style + + sig { returns(String) } + attr_accessor :border_width + + sig { returns(String) } + attr_accessor :box_shadow + + # Ready-to-use CSS declaration block for this component style + sig { returns(String) } + attr_accessor :css + + sig { returns(String) } + attr_accessor :padding + + sig { returns(String) } + attr_accessor :text_color + + # Card component style + sig do + params( + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + css: String, + padding: String, + text_color: String + ).returns(T.attached_class) + end + def self.new( + background_color:, + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + border_color:, + border_radius:, + border_style:, + border_width:, + box_shadow:, + # Ready-to-use CSS declaration block for this component style + css:, + padding:, + text_color: + ) + end + + sig do + override.returns( + { + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + css: String, + padding: String, + text_color: String + } + ) + end + def to_hash + end + end + end + + class ElementSpacing < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::ElementSpacing, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :lg + + sig { returns(String) } + attr_accessor :md + + sig { returns(String) } + attr_accessor :sm + + sig { returns(String) } + attr_accessor :xl + + sig { returns(String) } + attr_accessor :xs + + # Spacing system used on the website + sig do + params( + lg: String, + md: String, + sm: String, + xl: String, + xs: String + ).returns(T.attached_class) + end + def self.new(lg:, md:, sm:, xl:, xs:) + end + + sig do + override.returns( + { lg: String, md: String, sm: String, xl: String, xs: String } + ) + end + def to_hash + end + end + + class FontLink < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink, + ContextDev::Internal::AnyHash + ) + end + + # Upright font files keyed by weight string (e.g. "400" for regular, "500", + # "700"). Values are absolute URLs. + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :files + + sig do + returns( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Google Fonts category when type is google (e.g. sans-serif, serif, monospace, + # display, handwriting). Omitted for custom fonts when unknown. + sig { returns(T.nilable(String)) } + attr_reader :category + + sig { params(category: String).void } + attr_writer :category + + # Present when type is custom: human-readable name derived from the fontLinks key + # (strip build/hash suffixes, split camelCase / PascalCase, normalize separators). + # Google entries omit this. + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + sig do + params( + files: T::Hash[Symbol, String], + type: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::Type::OrSymbol, + category: String, + display_name: String + ).returns(T.attached_class) + end + def self.new( + # Upright font files keyed by weight string (e.g. "400" for regular, "500", + # "700"). Values are absolute URLs. + files:, + type:, + # Google Fonts category when type is google (e.g. sans-serif, serif, monospace, + # display, handwriting). Omitted for custom fonts when unknown. + category: nil, + # Present when type is custom: human-readable name derived from the fontLinks key + # (strip build/hash suffixes, split camelCase / PascalCase, normalize separators). + # Google entries omit this. + display_name: nil + ) + end + + sig do + override.returns( + { + files: T::Hash[Symbol, String], + type: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::Type::TaggedSymbol, + category: String, + display_name: String + } + ) + end + def to_hash + end + + module Type + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GOOGLE = + T.let( + :google, + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::Type::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # The primary color mode of the website design + module Mode + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Mode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LIGHT = + T.let( + :light, + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Mode::TaggedSymbol + ) + DARK = + T.let( + :dark, + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Mode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Mode::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Shadows < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Shadows, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :inner + + sig { returns(String) } + attr_accessor :lg + + sig { returns(String) } + attr_accessor :md + + sig { returns(String) } + attr_accessor :sm + + sig { returns(String) } + attr_accessor :xl + + # Shadow styles used on the website + sig do + params( + inner: String, + lg: String, + md: String, + sm: String, + xl: String + ).returns(T.attached_class) + end + def self.new(inner:, lg:, md:, sm:, xl:) + end + + sig do + override.returns( + { inner: String, lg: String, md: String, sm: String, xl: String } + ) + end + def to_hash + end + end + + class Typography < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography, + ContextDev::Internal::AnyHash + ) + end + + # Heading styles + sig do + returns( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings + ) + end + attr_reader :headings + + sig do + params( + headings: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::OrHash + ).void + end + attr_writer :headings + + sig do + returns( + T.nilable( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::P + ) + ) + end + attr_reader :p_ + + sig do + params( + p_: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::P::OrHash + ).void + end + attr_writer :p_ + + # Typography styles used on the website + sig do + params( + headings: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::OrHash, + p_: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::P::OrHash + ).returns(T.attached_class) + end + def self.new( + # Heading styles + headings:, + p_: nil + ) + end + + sig do + override.returns( + { + headings: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings, + p_: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::P + } + ) + end + def to_hash + end + + class Headings < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings, + ContextDev::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H1 + ) + ) + end + attr_reader :h1 + + sig do + params( + h1: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H1::OrHash + ).void + end + attr_writer :h1 + + sig do + returns( + T.nilable( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H2 + ) + ) + end + attr_reader :h2 + + sig do + params( + h2: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H2::OrHash + ).void + end + attr_writer :h2 + + sig do + returns( + T.nilable( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H3 + ) + ) + end + attr_reader :h3 + + sig do + params( + h3: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H3::OrHash + ).void + end + attr_writer :h3 + + sig do + returns( + T.nilable( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H4 + ) + ) + end + attr_reader :h4 + + sig do + params( + h4: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H4::OrHash + ).void + end + attr_writer :h4 + + # Heading styles + sig do + params( + h1: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H1::OrHash, + h2: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H2::OrHash, + h3: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H3::OrHash, + h4: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H4::OrHash + ).returns(T.attached_class) + end + def self.new(h1: nil, h2: nil, h3: nil, h4: nil) + end + + sig do + override.returns( + { + h1: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H1, + h2: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H2, + h3: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H3, + h4: + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H4 + } + ) + end + def to_hash + end + + class H1 < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H1, + ContextDev::Internal::AnyHash + ) + end + + # Full ordered font list from resolved computed font-family + sig { returns(T::Array[String]) } + attr_accessor :font_fallbacks + + # Primary face (first family in the computed stack) + sig { returns(String) } + attr_accessor :font_family + + sig { returns(String) } + attr_accessor :font_size + + sig { returns(Float) } + attr_accessor :font_weight + + sig { returns(String) } + attr_accessor :letter_spacing + + sig { returns(String) } + attr_accessor :line_height + + sig do + params( + font_fallbacks: T::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + ).returns(T.attached_class) + end + def self.new( + # Full ordered font list from resolved computed font-family + font_fallbacks:, + # Primary face (first family in the computed stack) + font_family:, + font_size:, + font_weight:, + letter_spacing:, + line_height: + ) + end + + sig do + override.returns( + { + font_fallbacks: T::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + } + ) + end + def to_hash + end + end + + class H2 < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H2, + ContextDev::Internal::AnyHash + ) + end + + # Full ordered font list from resolved computed font-family + sig { returns(T::Array[String]) } + attr_accessor :font_fallbacks + + # Primary face (first family in the computed stack) + sig { returns(String) } + attr_accessor :font_family + + sig { returns(String) } + attr_accessor :font_size + + sig { returns(Float) } + attr_accessor :font_weight + + sig { returns(String) } + attr_accessor :letter_spacing + + sig { returns(String) } + attr_accessor :line_height + + sig do + params( + font_fallbacks: T::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + ).returns(T.attached_class) + end + def self.new( + # Full ordered font list from resolved computed font-family + font_fallbacks:, + # Primary face (first family in the computed stack) + font_family:, + font_size:, + font_weight:, + letter_spacing:, + line_height: + ) + end + + sig do + override.returns( + { + font_fallbacks: T::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + } + ) + end + def to_hash + end + end + + class H3 < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H3, + ContextDev::Internal::AnyHash + ) + end + + # Full ordered font list from resolved computed font-family + sig { returns(T::Array[String]) } + attr_accessor :font_fallbacks + + # Primary face (first family in the computed stack) + sig { returns(String) } + attr_accessor :font_family + + sig { returns(String) } + attr_accessor :font_size + + sig { returns(Float) } + attr_accessor :font_weight + + sig { returns(String) } + attr_accessor :letter_spacing + + sig { returns(String) } + attr_accessor :line_height + + sig do + params( + font_fallbacks: T::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + ).returns(T.attached_class) + end + def self.new( + # Full ordered font list from resolved computed font-family + font_fallbacks:, + # Primary face (first family in the computed stack) + font_family:, + font_size:, + font_weight:, + letter_spacing:, + line_height: + ) + end + + sig do + override.returns( + { + font_fallbacks: T::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + } + ) + end + def to_hash + end + end + + class H4 < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H4, + ContextDev::Internal::AnyHash + ) + end + + # Full ordered font list from resolved computed font-family + sig { returns(T::Array[String]) } + attr_accessor :font_fallbacks + + # Primary face (first family in the computed stack) + sig { returns(String) } + attr_accessor :font_family + + sig { returns(String) } + attr_accessor :font_size + + sig { returns(Float) } + attr_accessor :font_weight + + sig { returns(String) } + attr_accessor :letter_spacing + + sig { returns(String) } + attr_accessor :line_height + + sig do + params( + font_fallbacks: T::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + ).returns(T.attached_class) + end + def self.new( + # Full ordered font list from resolved computed font-family + font_fallbacks:, + # Primary face (first family in the computed stack) + font_family:, + font_size:, + font_weight:, + letter_spacing:, + line_height: + ) + end + + sig do + override.returns( + { + font_fallbacks: T::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + } + ) + end + def to_hash + end + end + end + + class P < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::P, + ContextDev::Internal::AnyHash + ) + end + + # Full ordered font list from resolved computed font-family + sig { returns(T::Array[String]) } + attr_accessor :font_fallbacks + + # Primary face (first family in the computed stack) + sig { returns(String) } + attr_accessor :font_family + + sig { returns(String) } + attr_accessor :font_size + + sig { returns(Float) } + attr_accessor :font_weight + + sig { returns(String) } + attr_accessor :letter_spacing + + sig { returns(String) } + attr_accessor :line_height + + sig do + params( + font_fallbacks: T::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + ).returns(T.attached_class) + end + def self.new( + # Full ordered font list from resolved computed font-family + font_fallbacks:, + # Primary face (first family in the computed stack) + font_family:, + font_size:, + font_weight:, + letter_spacing:, + line_height: + ) + end + + sig do + override.returns( + { + font_fallbacks: T::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + } + ) + end + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/context_dev/models/web_screenshot_params.rbi b/rbi/context_dev/models/web_screenshot_params.rbi new file mode 100644 index 00000000..c0098221 --- /dev/null +++ b/rbi/context_dev/models/web_screenshot_params.rbi @@ -0,0 +1,238 @@ +# typed: strong + +module ContextDev + module Models + class WebScreenshotParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(ContextDev::WebScreenshotParams, ContextDev::Internal::AnyHash) + end + + # A specific URL to screenshot directly, bypassing domain resolution (e.g., + # 'https://example.com/pricing'). When provided, the screenshot is taken of this + # exact URL. You must provide either 'domain' or 'directUrl', but not both. + sig { returns(T.nilable(String)) } + attr_reader :direct_url + + sig { params(direct_url: String).void } + attr_writer :direct_url + + # Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The + # domain will be automatically normalized and validated. You must provide either + # 'domain' or 'directUrl', but not both. + sig { returns(T.nilable(String)) } + attr_reader :domain + + sig { params(domain: String).void } + attr_writer :domain + + # Optional parameter to determine screenshot type. If 'true', takes a full page + # screenshot capturing all content. If 'false' or not provided, takes a viewport + # screenshot (standard browser view). + sig do + returns( + T.nilable(ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol) + ) + end + attr_reader :full_screenshot + + sig do + params( + full_screenshot: + ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol + ).void + end + attr_writer :full_screenshot + + # 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. Only applicable when using + # 'domain', not 'directUrl'. + sig do + returns(T.nilable(ContextDev::WebScreenshotParams::Page::OrSymbol)) + end + attr_reader :page + + sig { params(page: ContextDev::WebScreenshotParams::Page::OrSymbol).void } + attr_writer :page + + # 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. + sig do + returns( + T.nilable(ContextDev::WebScreenshotParams::Prioritize::OrSymbol) + ) + end + attr_reader :prioritize + + sig do + params( + prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol + ).void + end + attr_writer :prioritize + + sig do + params( + direct_url: String, + domain: String, + full_screenshot: + ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol, + page: ContextDev::WebScreenshotParams::Page::OrSymbol, + prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol, + request_options: ContextDev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # A specific URL to screenshot directly, bypassing domain resolution (e.g., + # 'https://example.com/pricing'). When provided, the screenshot is taken of this + # exact URL. You must provide either 'domain' or 'directUrl', but not both. + direct_url: nil, + # Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The + # domain will be automatically normalized and validated. You must provide either + # 'domain' or 'directUrl', but not both. + domain: nil, + # Optional parameter to determine screenshot type. If 'true', takes a full page + # screenshot capturing all content. If 'false' or not provided, takes a viewport + # screenshot (standard browser view). + full_screenshot: nil, + # 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. Only applicable when using + # 'domain', not 'directUrl'. + page: nil, + # 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. + prioritize: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + direct_url: String, + domain: String, + full_screenshot: + ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol, + page: ContextDev::WebScreenshotParams::Page::OrSymbol, + prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol, + request_options: ContextDev::RequestOptions + } + ) + end + def to_hash + end + + # Optional parameter to determine screenshot type. If 'true', takes a full page + # screenshot capturing all content. If 'false' or not provided, takes a viewport + # screenshot (standard browser view). + module FullScreenshot + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebScreenshotParams::FullScreenshot) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebScreenshotParams::FullScreenshot::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebScreenshotParams::FullScreenshot::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::WebScreenshotParams::FullScreenshot::TaggedSymbol + ] + ) + end + def self.values + end + end + + # 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. Only applicable when using + # 'domain', not 'directUrl'. + module Page + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, ContextDev::WebScreenshotParams::Page) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOGIN = + T.let(:login, ContextDev::WebScreenshotParams::Page::TaggedSymbol) + SIGNUP = + T.let(:signup, ContextDev::WebScreenshotParams::Page::TaggedSymbol) + BLOG = T.let(:blog, ContextDev::WebScreenshotParams::Page::TaggedSymbol) + CAREERS = + T.let(:careers, ContextDev::WebScreenshotParams::Page::TaggedSymbol) + PRICING = + T.let(:pricing, ContextDev::WebScreenshotParams::Page::TaggedSymbol) + TERMS = + T.let(:terms, ContextDev::WebScreenshotParams::Page::TaggedSymbol) + PRIVACY = + T.let(:privacy, ContextDev::WebScreenshotParams::Page::TaggedSymbol) + CONTACT = + T.let(:contact, ContextDev::WebScreenshotParams::Page::TaggedSymbol) + + sig do + override.returns( + T::Array[ContextDev::WebScreenshotParams::Page::TaggedSymbol] + ) + end + def self.values + end + end + + # 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. + module Prioritize + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebScreenshotParams::Prioritize) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SPEED = + T.let( + :speed, + ContextDev::WebScreenshotParams::Prioritize::TaggedSymbol + ) + QUALITY = + T.let( + :quality, + ContextDev::WebScreenshotParams::Prioritize::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ContextDev::WebScreenshotParams::Prioritize::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/context_dev/models/web_screenshot_response.rbi b/rbi/context_dev/models/web_screenshot_response.rbi new file mode 100644 index 00000000..96777ae1 --- /dev/null +++ b/rbi/context_dev/models/web_screenshot_response.rbi @@ -0,0 +1,135 @@ +# typed: strong + +module ContextDev + module Models + class WebScreenshotResponse < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebScreenshotResponse, + ContextDev::Internal::AnyHash + ) + end + + # HTTP status code + sig { returns(T.nilable(Integer)) } + attr_reader :code + + sig { params(code: Integer).void } + attr_writer :code + + # The normalized domain that was processed + sig { returns(T.nilable(String)) } + attr_reader :domain + + sig { params(domain: String).void } + attr_writer :domain + + # Public URL of the uploaded screenshot image + sig { returns(T.nilable(String)) } + attr_reader :screenshot + + sig { params(screenshot: String).void } + attr_writer :screenshot + + # Type of screenshot that was captured + sig do + returns( + T.nilable( + ContextDev::Models::WebScreenshotResponse::ScreenshotType::TaggedSymbol + ) + ) + end + attr_reader :screenshot_type + + sig do + params( + screenshot_type: + ContextDev::Models::WebScreenshotResponse::ScreenshotType::OrSymbol + ).void + end + attr_writer :screenshot_type + + # Status of the response, e.g., 'ok' + sig { returns(T.nilable(String)) } + attr_reader :status + + sig { params(status: String).void } + attr_writer :status + + sig do + params( + code: Integer, + domain: String, + screenshot: String, + screenshot_type: + ContextDev::Models::WebScreenshotResponse::ScreenshotType::OrSymbol, + status: String + ).returns(T.attached_class) + end + def self.new( + # HTTP status code + code: nil, + # The normalized domain that was processed + domain: nil, + # Public URL of the uploaded screenshot image + screenshot: nil, + # Type of screenshot that was captured + screenshot_type: nil, + # Status of the response, e.g., 'ok' + status: nil + ) + end + + sig do + override.returns( + { + code: Integer, + domain: String, + screenshot: String, + screenshot_type: + ContextDev::Models::WebScreenshotResponse::ScreenshotType::TaggedSymbol, + status: String + } + ) + end + def to_hash + end + + # Type of screenshot that was captured + module ScreenshotType + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::Models::WebScreenshotResponse::ScreenshotType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VIEWPORT = + T.let( + :viewport, + ContextDev::Models::WebScreenshotResponse::ScreenshotType::TaggedSymbol + ) + FULL_PAGE = + T.let( + :fullPage, + ContextDev::Models::WebScreenshotResponse::ScreenshotType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::Models::WebScreenshotResponse::ScreenshotType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index 0575204c..a002c007 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -30,6 +30,73 @@ module ContextDev ) end + # Extract a comprehensive design system from a website including colors, + # typography, spacing, shadows, and UI components. + sig do + params( + direct_url: String, + domain: String, + timeout_ms: Integer, + request_options: ContextDev::RequestOptions::OrHash + ).returns(ContextDev::Models::WebExtractStyleguideResponse) + end + def extract_styleguide( + # A specific URL to fetch the styleguide from directly, bypassing domain + # resolution (e.g., 'https://example.com/design-system'). When provided, the + # styleguide is extracted from this exact URL. You must provide either 'domain' or + # 'directUrl', but not both. + direct_url: nil, + # Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The + # domain will be automatically normalized and validated. You must provide either + # 'domain' or 'directUrl', but not both. + domain: nil, + # 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). + timeout_ms: nil, + request_options: {} + ) + end + + # Capture a screenshot of a website. + sig do + params( + direct_url: String, + domain: String, + full_screenshot: + ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol, + page: ContextDev::WebScreenshotParams::Page::OrSymbol, + prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol, + request_options: ContextDev::RequestOptions::OrHash + ).returns(ContextDev::Models::WebScreenshotResponse) + end + def screenshot( + # A specific URL to screenshot directly, bypassing domain resolution (e.g., + # 'https://example.com/pricing'). When provided, the screenshot is taken of this + # exact URL. You must provide either 'domain' or 'directUrl', but not both. + direct_url: nil, + # Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The + # domain will be automatically normalized and validated. You must provide either + # 'domain' or 'directUrl', but not both. + domain: nil, + # Optional parameter to determine screenshot type. If 'true', takes a full page + # screenshot capturing all content. If 'false' or not provided, takes a viewport + # screenshot (standard browser view). + full_screenshot: nil, + # 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. Only applicable when using + # 'domain', not 'directUrl'. + page: nil, + # 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. + prioritize: nil, + request_options: {} + ) + end + # Performs a crawl starting from a given URL, extracts page content as Markdown, # and returns results for all crawled pages. sig do diff --git a/sig/context_dev/models.rbs b/sig/context_dev/models.rbs index 99a6155e..992384f4 100644 --- a/sig/context_dev/models.rbs +++ b/sig/context_dev/models.rbs @@ -27,6 +27,10 @@ module ContextDev class WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams + class WebExtractStyleguideParams = ContextDev::Models::WebExtractStyleguideParams + + class WebScreenshotParams = ContextDev::Models::WebScreenshotParams + class WebWebCrawlMdParams = ContextDev::Models::WebWebCrawlMdParams class WebWebScrapeHTMLParams = ContextDev::Models::WebWebScrapeHTMLParams diff --git a/sig/context_dev/models/web_extract_styleguide_params.rbs b/sig/context_dev/models/web_extract_styleguide_params.rbs new file mode 100644 index 00000000..d8fbc143 --- /dev/null +++ b/sig/context_dev/models/web_extract_styleguide_params.rbs @@ -0,0 +1,38 @@ +module ContextDev + module Models + type web_extract_styleguide_params = + { direct_url: String, domain: String, timeout_ms: Integer } + & ContextDev::Internal::Type::request_parameters + + class WebExtractStyleguideParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + attr_reader direct_url: String? + + def direct_url=: (String) -> String + + attr_reader domain: String? + + def domain=: (String) -> String + + attr_reader timeout_ms: Integer? + + def timeout_ms=: (Integer) -> Integer + + def initialize: ( + ?direct_url: String, + ?domain: String, + ?timeout_ms: Integer, + ?request_options: ContextDev::request_opts + ) -> void + + def to_hash: -> { + direct_url: String, + domain: String, + timeout_ms: Integer, + request_options: ContextDev::RequestOptions + } + end + end +end diff --git a/sig/context_dev/models/web_extract_styleguide_response.rbs b/sig/context_dev/models/web_extract_styleguide_response.rbs new file mode 100644 index 00000000..c6283013 --- /dev/null +++ b/sig/context_dev/models/web_extract_styleguide_response.rbs @@ -0,0 +1,945 @@ +module ContextDev + module Models + type web_extract_styleguide_response = + { + code: Integer, + domain: String, + status: String, + styleguide: ContextDev::Models::WebExtractStyleguideResponse::Styleguide + } + + class WebExtractStyleguideResponse < ContextDev::Internal::Type::BaseModel + attr_reader code: Integer? + + def code=: (Integer) -> Integer + + attr_reader domain: String? + + def domain=: (String) -> String + + attr_reader status: String? + + def status=: (String) -> String + + attr_reader styleguide: ContextDev::Models::WebExtractStyleguideResponse::Styleguide? + + def styleguide=: ( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide + ) -> ContextDev::Models::WebExtractStyleguideResponse::Styleguide + + def initialize: ( + ?code: Integer, + ?domain: String, + ?status: String, + ?styleguide: ContextDev::Models::WebExtractStyleguideResponse::Styleguide + ) -> void + + def to_hash: -> { + code: Integer, + domain: String, + status: String, + styleguide: ContextDev::Models::WebExtractStyleguideResponse::Styleguide + } + + type styleguide = + { + colors: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Colors, + components: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components, + element_spacing: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::ElementSpacing, + font_links: ::Hash[Symbol, ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink], + mode: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::mode, + shadows: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Shadows, + typography: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography + } + + class Styleguide < ContextDev::Internal::Type::BaseModel + attr_accessor colors: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Colors + + attr_accessor components: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components + + attr_accessor element_spacing: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::ElementSpacing + + attr_accessor font_links: ::Hash[Symbol, ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink] + + attr_accessor mode: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::mode + + attr_accessor shadows: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Shadows + + attr_accessor typography: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography + + def initialize: ( + colors: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Colors, + components: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components, + element_spacing: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::ElementSpacing, + font_links: ::Hash[Symbol, ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink], + mode: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::mode, + shadows: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Shadows, + typography: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography + ) -> void + + def to_hash: -> { + colors: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Colors, + components: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components, + element_spacing: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::ElementSpacing, + font_links: ::Hash[Symbol, ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink], + mode: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::mode, + shadows: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Shadows, + typography: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography + } + + type colors = { accent: String, background: String, text: String } + + class Colors < ContextDev::Internal::Type::BaseModel + attr_accessor accent: String + + attr_accessor background: String + + attr_accessor text: String + + def initialize: ( + accent: String, + background: String, + text: String + ) -> void + + def to_hash: -> { accent: String, background: String, text: String } + end + + type components = + { + button: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button, + card: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Card + } + + class Components < ContextDev::Internal::Type::BaseModel + attr_accessor button: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button + + attr_reader card: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Card? + + def card=: ( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Card + ) -> ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Card + + def initialize: ( + button: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button, + ?card: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Card + ) -> void + + def to_hash: -> { + button: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button, + card: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Card + } + + type button = + { + link: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Link, + primary: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Primary, + secondary: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Secondary + } + + class Button < ContextDev::Internal::Type::BaseModel + attr_reader link: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Link? + + def link=: ( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Link + ) -> ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Link + + attr_reader primary: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Primary? + + def primary=: ( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Primary + ) -> ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Primary + + attr_reader secondary: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Secondary? + + def secondary=: ( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Secondary + ) -> ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Secondary + + def initialize: ( + ?link: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Link, + ?primary: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Primary, + ?secondary: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Secondary + ) -> void + + def to_hash: -> { + link: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Link, + primary: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Primary, + secondary: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Components::Button::Secondary + } + + type link = + { + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + font_fallbacks: ::Array[String], + font_family: String, + text_decoration_color: String + } + + class Link < ContextDev::Internal::Type::BaseModel + attr_accessor background_color: String + + attr_accessor border_color: String + + attr_accessor border_radius: String + + attr_accessor border_style: String + + attr_accessor border_width: String + + attr_accessor box_shadow: String + + attr_accessor color: String + + attr_accessor css: String + + attr_accessor font_size: String + + attr_accessor font_weight: Float + + attr_accessor min_height: String + + attr_accessor min_width: String + + attr_accessor padding: String + + attr_accessor text_decoration: String + + attr_reader font_fallbacks: ::Array[String]? + + def font_fallbacks=: (::Array[String]) -> ::Array[String] + + attr_reader font_family: String? + + def font_family=: (String) -> String + + attr_reader text_decoration_color: String? + + def text_decoration_color=: (String) -> String + + def initialize: ( + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + ?font_fallbacks: ::Array[String], + ?font_family: String, + ?text_decoration_color: String + ) -> void + + def to_hash: -> { + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + font_fallbacks: ::Array[String], + font_family: String, + text_decoration_color: String + } + end + + type primary = + { + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + font_fallbacks: ::Array[String], + font_family: String, + text_decoration_color: String + } + + class Primary < ContextDev::Internal::Type::BaseModel + attr_accessor background_color: String + + attr_accessor border_color: String + + attr_accessor border_radius: String + + attr_accessor border_style: String + + attr_accessor border_width: String + + attr_accessor box_shadow: String + + attr_accessor color: String + + attr_accessor css: String + + attr_accessor font_size: String + + attr_accessor font_weight: Float + + attr_accessor min_height: String + + attr_accessor min_width: String + + attr_accessor padding: String + + attr_accessor text_decoration: String + + attr_reader font_fallbacks: ::Array[String]? + + def font_fallbacks=: (::Array[String]) -> ::Array[String] + + attr_reader font_family: String? + + def font_family=: (String) -> String + + attr_reader text_decoration_color: String? + + def text_decoration_color=: (String) -> String + + def initialize: ( + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + ?font_fallbacks: ::Array[String], + ?font_family: String, + ?text_decoration_color: String + ) -> void + + def to_hash: -> { + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + font_fallbacks: ::Array[String], + font_family: String, + text_decoration_color: String + } + end + + type secondary = + { + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + font_fallbacks: ::Array[String], + font_family: String, + text_decoration_color: String + } + + class Secondary < ContextDev::Internal::Type::BaseModel + attr_accessor background_color: String + + attr_accessor border_color: String + + attr_accessor border_radius: String + + attr_accessor border_style: String + + attr_accessor border_width: String + + attr_accessor box_shadow: String + + attr_accessor color: String + + attr_accessor css: String + + attr_accessor font_size: String + + attr_accessor font_weight: Float + + attr_accessor min_height: String + + attr_accessor min_width: String + + attr_accessor padding: String + + attr_accessor text_decoration: String + + attr_reader font_fallbacks: ::Array[String]? + + def font_fallbacks=: (::Array[String]) -> ::Array[String] + + attr_reader font_family: String? + + def font_family=: (String) -> String + + attr_reader text_decoration_color: String? + + def text_decoration_color=: (String) -> String + + def initialize: ( + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + ?font_fallbacks: ::Array[String], + ?font_family: String, + ?text_decoration_color: String + ) -> void + + def to_hash: -> { + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + font_fallbacks: ::Array[String], + font_family: String, + text_decoration_color: String + } + end + end + + type card = + { + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + css: String, + padding: String, + text_color: String + } + + class Card < ContextDev::Internal::Type::BaseModel + attr_accessor background_color: String + + attr_accessor border_color: String + + attr_accessor border_radius: String + + attr_accessor border_style: String + + attr_accessor border_width: String + + attr_accessor box_shadow: String + + attr_accessor css: String + + attr_accessor padding: String + + attr_accessor text_color: String + + def initialize: ( + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + css: String, + padding: String, + text_color: String + ) -> void + + def to_hash: -> { + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + css: String, + padding: String, + text_color: String + } + end + end + + type element_spacing = + { lg: String, md: String, sm: String, xl: String, xs: String } + + class ElementSpacing < ContextDev::Internal::Type::BaseModel + attr_accessor lg: String + + attr_accessor md: String + + attr_accessor sm: String + + attr_accessor xl: String + + attr_accessor xs: String + + def initialize: ( + lg: String, + md: String, + sm: String, + xl: String, + xs: String + ) -> void + + def to_hash: -> { + lg: String, + md: String, + sm: String, + xl: String, + xs: String + } + end + + type font_link = + { + files: ::Hash[Symbol, String], + type: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::type_, + category: String, + display_name: String + } + + class FontLink < ContextDev::Internal::Type::BaseModel + attr_accessor files: ::Hash[Symbol, String] + + attr_accessor type: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::type_ + + attr_reader category: String? + + def category=: (String) -> String + + attr_reader display_name: String? + + def display_name=: (String) -> String + + def initialize: ( + files: ::Hash[Symbol, String], + type: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::type_, + ?category: String, + ?display_name: String + ) -> void + + def to_hash: -> { + files: ::Hash[Symbol, String], + type: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::type_, + category: String, + display_name: String + } + + type type_ = :google | :custom + + module Type + extend ContextDev::Internal::Type::Enum + + GOOGLE: :google + CUSTOM: :custom + + def self?.values: -> ::Array[ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::type_] + end + end + + type mode = :light | :dark + + module Mode + extend ContextDev::Internal::Type::Enum + + LIGHT: :light + DARK: :dark + + def self?.values: -> ::Array[ContextDev::Models::WebExtractStyleguideResponse::Styleguide::mode] + end + + type shadows = + { inner: String, lg: String, md: String, sm: String, xl: String } + + class Shadows < ContextDev::Internal::Type::BaseModel + attr_accessor inner: String + + attr_accessor lg: String + + attr_accessor md: String + + attr_accessor sm: String + + attr_accessor xl: String + + def initialize: ( + inner: String, + lg: String, + md: String, + sm: String, + xl: String + ) -> void + + def to_hash: -> { + inner: String, + lg: String, + md: String, + sm: String, + xl: String + } + end + + type typography = + { + headings: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings, + p_: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::P + } + + class Typography < ContextDev::Internal::Type::BaseModel + attr_accessor headings: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings + + attr_reader p_: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::P? + + def p_=: ( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::P + ) -> ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::P + + def initialize: ( + headings: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings, + ?p_: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::P + ) -> void + + def to_hash: -> { + headings: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings, + p_: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::P + } + + type headings = + { + :h1 => ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H1, + :h2 => ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H2, + :h3 => ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H3, + :h4 => ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H4 + } + + class Headings < ContextDev::Internal::Type::BaseModel + attr_reader h1: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H1? + + def h1=: ( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H1 + ) -> ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H1 + + attr_reader h2: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H2? + + def h2=: ( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H2 + ) -> ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H2 + + attr_reader h3: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H3? + + def h3=: ( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H3 + ) -> ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H3 + + attr_reader h4: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H4? + + def h4=: ( + ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H4 + ) -> ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H4 + + def initialize: ( + ?h1: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H1, + ?h2: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H2, + ?h3: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H3, + ?h4: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H4 + ) -> void + + def to_hash: -> { + :h1 => ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H1, + :h2 => ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H2, + :h3 => ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H3, + :h4 => ContextDev::Models::WebExtractStyleguideResponse::Styleguide::Typography::Headings::H4 + } + + type h1 = + { + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + } + + class H1 < ContextDev::Internal::Type::BaseModel + attr_accessor font_fallbacks: ::Array[String] + + attr_accessor font_family: String + + attr_accessor font_size: String + + attr_accessor font_weight: Float + + attr_accessor letter_spacing: String + + attr_accessor line_height: String + + def initialize: ( + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + ) -> void + + def to_hash: -> { + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + } + end + + type h2 = + { + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + } + + class H2 < ContextDev::Internal::Type::BaseModel + attr_accessor font_fallbacks: ::Array[String] + + attr_accessor font_family: String + + attr_accessor font_size: String + + attr_accessor font_weight: Float + + attr_accessor letter_spacing: String + + attr_accessor line_height: String + + def initialize: ( + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + ) -> void + + def to_hash: -> { + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + } + end + + type h3 = + { + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + } + + class H3 < ContextDev::Internal::Type::BaseModel + attr_accessor font_fallbacks: ::Array[String] + + attr_accessor font_family: String + + attr_accessor font_size: String + + attr_accessor font_weight: Float + + attr_accessor letter_spacing: String + + attr_accessor line_height: String + + def initialize: ( + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + ) -> void + + def to_hash: -> { + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + } + end + + type h4 = + { + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + } + + class H4 < ContextDev::Internal::Type::BaseModel + attr_accessor font_fallbacks: ::Array[String] + + attr_accessor font_family: String + + attr_accessor font_size: String + + attr_accessor font_weight: Float + + attr_accessor letter_spacing: String + + attr_accessor line_height: String + + def initialize: ( + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + ) -> void + + def to_hash: -> { + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + } + end + end + + type p_ = + { + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + } + + class P < ContextDev::Internal::Type::BaseModel + attr_accessor font_fallbacks: ::Array[String] + + attr_accessor font_family: String + + attr_accessor font_size: String + + attr_accessor font_weight: Float + + attr_accessor letter_spacing: String + + attr_accessor line_height: String + + def initialize: ( + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + ) -> void + + def to_hash: -> { + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String + } + end + end + end + end + end +end diff --git a/sig/context_dev/models/web_screenshot_params.rbs b/sig/context_dev/models/web_screenshot_params.rbs new file mode 100644 index 00000000..dd9f81ea --- /dev/null +++ b/sig/context_dev/models/web_screenshot_params.rbs @@ -0,0 +1,109 @@ +module ContextDev + module Models + type web_screenshot_params = + { + direct_url: String, + domain: String, + full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, + page: ContextDev::Models::WebScreenshotParams::page, + prioritize: ContextDev::Models::WebScreenshotParams::prioritize + } + & ContextDev::Internal::Type::request_parameters + + class WebScreenshotParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + attr_reader direct_url: String? + + def direct_url=: (String) -> String + + attr_reader domain: String? + + def domain=: (String) -> String + + attr_reader full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot? + + def full_screenshot=: ( + ContextDev::Models::WebScreenshotParams::full_screenshot + ) -> ContextDev::Models::WebScreenshotParams::full_screenshot + + attr_reader page: ContextDev::Models::WebScreenshotParams::page? + + def page=: ( + ContextDev::Models::WebScreenshotParams::page + ) -> ContextDev::Models::WebScreenshotParams::page + + attr_reader prioritize: ContextDev::Models::WebScreenshotParams::prioritize? + + def prioritize=: ( + ContextDev::Models::WebScreenshotParams::prioritize + ) -> ContextDev::Models::WebScreenshotParams::prioritize + + def initialize: ( + ?direct_url: String, + ?domain: String, + ?full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, + ?page: ContextDev::Models::WebScreenshotParams::page, + ?prioritize: ContextDev::Models::WebScreenshotParams::prioritize, + ?request_options: ContextDev::request_opts + ) -> void + + def to_hash: -> { + direct_url: String, + domain: String, + full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, + page: ContextDev::Models::WebScreenshotParams::page, + prioritize: ContextDev::Models::WebScreenshotParams::prioritize, + request_options: ContextDev::RequestOptions + } + + type full_screenshot = :true | :false + + module FullScreenshot + extend ContextDev::Internal::Type::Enum + + TRUE: :true + FALSE: :false + + def self?.values: -> ::Array[ContextDev::Models::WebScreenshotParams::full_screenshot] + end + + type page = + :login + | :signup + | :blog + | :careers + | :pricing + | :terms + | :privacy + | :contact + + module Page + extend ContextDev::Internal::Type::Enum + + LOGIN: :login + SIGNUP: :signup + BLOG: :blog + CAREERS: :careers + PRICING: :pricing + TERMS: :terms + PRIVACY: :privacy + CONTACT: :contact + + def self?.values: -> ::Array[ContextDev::Models::WebScreenshotParams::page] + end + + type prioritize = :speed | :quality + + module Prioritize + extend ContextDev::Internal::Type::Enum + + SPEED: :speed + QUALITY: :quality + + def self?.values: -> ::Array[ContextDev::Models::WebScreenshotParams::prioritize] + end + end + end +end diff --git a/sig/context_dev/models/web_screenshot_response.rbs b/sig/context_dev/models/web_screenshot_response.rbs new file mode 100644 index 00000000..eb698c60 --- /dev/null +++ b/sig/context_dev/models/web_screenshot_response.rbs @@ -0,0 +1,63 @@ +module ContextDev + module Models + type web_screenshot_response = + { + code: Integer, + domain: String, + screenshot: String, + screenshot_type: ContextDev::Models::WebScreenshotResponse::screenshot_type, + status: String + } + + class WebScreenshotResponse < ContextDev::Internal::Type::BaseModel + attr_reader code: Integer? + + def code=: (Integer) -> Integer + + attr_reader domain: String? + + def domain=: (String) -> String + + attr_reader screenshot: String? + + def screenshot=: (String) -> String + + attr_reader screenshot_type: ContextDev::Models::WebScreenshotResponse::screenshot_type? + + def screenshot_type=: ( + ContextDev::Models::WebScreenshotResponse::screenshot_type + ) -> ContextDev::Models::WebScreenshotResponse::screenshot_type + + attr_reader status: String? + + def status=: (String) -> String + + def initialize: ( + ?code: Integer, + ?domain: String, + ?screenshot: String, + ?screenshot_type: ContextDev::Models::WebScreenshotResponse::screenshot_type, + ?status: String + ) -> void + + def to_hash: -> { + code: Integer, + domain: String, + screenshot: String, + screenshot_type: ContextDev::Models::WebScreenshotResponse::screenshot_type, + status: String + } + + type screenshot_type = :viewport | :fullPage + + module ScreenshotType + extend ContextDev::Internal::Type::Enum + + VIEWPORT: :viewport + FULL_PAGE: :fullPage + + def self?.values: -> ::Array[ContextDev::Models::WebScreenshotResponse::screenshot_type] + end + end + end +end diff --git a/sig/context_dev/resources/web.rbs b/sig/context_dev/resources/web.rbs index 6487b8e9..1854e57d 100644 --- a/sig/context_dev/resources/web.rbs +++ b/sig/context_dev/resources/web.rbs @@ -8,6 +8,22 @@ module ContextDev ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebExtractFontsResponse + def extract_styleguide: ( + ?direct_url: String, + ?domain: String, + ?timeout_ms: Integer, + ?request_options: ContextDev::request_opts + ) -> ContextDev::Models::WebExtractStyleguideResponse + + def screenshot: ( + ?direct_url: String, + ?domain: String, + ?full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, + ?page: ContextDev::Models::WebScreenshotParams::page, + ?prioritize: ContextDev::Models::WebScreenshotParams::prioritize, + ?request_options: ContextDev::request_opts + ) -> ContextDev::Models::WebScreenshotResponse + def web_crawl_md: ( url: String, ?follow_subdomains: bool, diff --git a/test/context_dev/resources/web_test.rb b/test/context_dev/resources/web_test.rb index 3a88bcd6..b0d8c39d 100644 --- a/test/context_dev/resources/web_test.rb +++ b/test/context_dev/resources/web_test.rb @@ -22,6 +22,45 @@ def test_extract_fonts end end + def test_extract_styleguide + skip("Mock server tests are disabled") + + response = @context_dev.web.extract_styleguide + + assert_pattern do + response => ContextDev::Models::WebExtractStyleguideResponse + end + + assert_pattern do + response => { + code: Integer | nil, + domain: String | nil, + status: String | nil, + styleguide: ContextDev::Models::WebExtractStyleguideResponse::Styleguide | nil + } + end + end + + def test_screenshot + skip("Mock server tests are disabled") + + response = @context_dev.web.screenshot + + assert_pattern do + response => ContextDev::Models::WebScreenshotResponse + end + + assert_pattern do + response => { + code: Integer | nil, + domain: String | nil, + screenshot: String | nil, + screenshot_type: ContextDev::Models::WebScreenshotResponse::ScreenshotType | nil, + status: String | nil + } + end + end + def test_web_crawl_md_required_params skip("Mock server tests are disabled") From c9851ebc0618d7433ed88f7062902fcec575b229 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 23:46:45 +0000 Subject: [PATCH 20/25] feat(api): api update --- .stats.yml | 4 ++-- .../brand_identify_from_transaction_params.rb | 1 - .../models/brand_retrieve_by_name_params.rb | 10 ++++---- lib/context_dev/resources/brand.rb | 20 +++++++--------- lib/context_dev/resources/web.rb | 2 +- ...brand_identify_from_transaction_params.rbi | 2 -- .../models/brand_retrieve_by_name_params.rbi | 12 +++++----- rbi/context_dev/resources/brand.rbi | 23 ++++++++----------- rbi/context_dev/resources/web.rbi | 2 +- 9 files changed, 32 insertions(+), 44 deletions(-) diff --git a/.stats.yml b/.stats.yml index d51d6f74..7833f48d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-3c753cf7c4d04fe467710a51b1a2f6f024b0b6a670704be7340b92e064bcf1a9.yml -openapi_spec_hash: f9b02e6756001e2be87d541d5cc609e5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-3a604b0c9775298072e70890d369d21d38422553a8fe23d9d081b0dc06035ee2.yml +openapi_spec_hash: f94db2839851fb192f013b3ca258c39f config_hash: 85e90b8fda2e1f326ca60f8ab3e53704 diff --git a/lib/context_dev/models/brand_identify_from_transaction_params.rb b/lib/context_dev/models/brand_identify_from_transaction_params.rb index 00564f74..71657bb8 100644 --- a/lib/context_dev/models/brand_identify_from_transaction_params.rb +++ b/lib/context_dev/models/brand_identify_from_transaction_params.rb @@ -35,7 +35,6 @@ class BrandIdentifyFromTransactionParams < ContextDev::Internal::Type::BaseModel # @!attribute high_confidence_only # When set to true, the API will perform an additional verification steps to # ensure the identified brand matches the transaction with high confidence. - # Defaults to false. # # @return [Boolean, nil] optional :high_confidence_only, ContextDev::Internal::Type::Boolean diff --git a/lib/context_dev/models/brand_retrieve_by_name_params.rb b/lib/context_dev/models/brand_retrieve_by_name_params.rb index e4c8b269..d8eb14fa 100644 --- a/lib/context_dev/models/brand_retrieve_by_name_params.rb +++ b/lib/context_dev/models/brand_retrieve_by_name_params.rb @@ -15,8 +15,8 @@ class BrandRetrieveByNameParams < ContextDev::Internal::Type::BaseModel required :name, String # @!attribute country_gl - # Optional country code (GL parameter) to specify the country. This affects the - # geographic location used for search queries. + # Optional country code hint (GL parameter) to specify the country for the company + # name. # # @return [Symbol, ContextDev::Models::BrandRetrieveByNameParams::CountryGl, nil] optional :country_gl, enum: -> { ContextDev::BrandRetrieveByNameParams::CountryGl } @@ -49,7 +49,7 @@ class BrandRetrieveByNameParams < ContextDev::Internal::Type::BaseModel # # @param name [String] Company name to retrieve brand data for (e.g., 'Apple Inc', 'Microsoft Corporati # - # @param country_gl [Symbol, ContextDev::Models::BrandRetrieveByNameParams::CountryGl] Optional country code (GL parameter) to specify the country. This affects the ge + # @param country_gl [Symbol, ContextDev::Models::BrandRetrieveByNameParams::CountryGl] Optional country code hint (GL parameter) to specify the country for the company # # @param force_language [Symbol, ContextDev::Models::BrandRetrieveByNameParams::ForceLanguage] Optional parameter to force the language of the retrieved brand data. # @@ -59,8 +59,8 @@ class BrandRetrieveByNameParams < ContextDev::Internal::Type::BaseModel # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] - # Optional country code (GL parameter) to specify the country. This affects the - # geographic location used for search queries. + # Optional country code hint (GL parameter) to specify the country for the company + # name. module CountryGl extend ContextDev::Internal::Type::Enum diff --git a/lib/context_dev/resources/brand.rb b/lib/context_dev/resources/brand.rb index 4a48f900..a1b889f1 100644 --- a/lib/context_dev/resources/brand.rb +++ b/lib/context_dev/resources/brand.rb @@ -83,9 +83,8 @@ def identify_from_transaction(params) # {ContextDev::Models::BrandRetrieveByEmailParams} for more details. # # Retrieve brand information using an email address while detecting disposable and - # free email addresses. This endpoint extracts the domain from the email address - # and returns brand data for that domain. Disposable and free email addresses - # (like gmail.com, yahoo.com) will throw a 422 error. + # free email addresses. Disposable and free email addresses (like gmail.com, + # yahoo.com) will throw a 422 error. # # @overload retrieve_by_email(email:, force_language: nil, max_speed: nil, timeout_ms: nil, request_options: {}) # @@ -118,8 +117,7 @@ def retrieve_by_email(params) # {ContextDev::Models::BrandRetrieveByIsinParams} for more details. # # Retrieve brand information using an ISIN (International Securities - # Identification Number). This endpoint looks up the company associated with the - # ISIN and returns its brand data. + # Identification Number). # # @overload retrieve_by_isin(isin:, force_language: nil, max_speed: nil, timeout_ms: nil, request_options: {}) # @@ -151,14 +149,13 @@ def retrieve_by_isin(params) # Some parameter documentations has been truncated, see # {ContextDev::Models::BrandRetrieveByNameParams} for more details. # - # Retrieve brand information using a company name. This endpoint searches for the - # company by name and returns its brand data. + # Retrieve brand information using a company name. # # @overload retrieve_by_name(name:, country_gl: nil, force_language: nil, max_speed: nil, timeout_ms: nil, request_options: {}) # # @param name [String] Company name to retrieve brand data for (e.g., 'Apple Inc', 'Microsoft Corporati # - # @param country_gl [Symbol, ContextDev::Models::BrandRetrieveByNameParams::CountryGl] Optional country code (GL parameter) to specify the country. This affects the ge + # @param country_gl [Symbol, ContextDev::Models::BrandRetrieveByNameParams::CountryGl] Optional country code hint (GL parameter) to specify the country for the company # # @param force_language [Symbol, ContextDev::Models::BrandRetrieveByNameParams::ForceLanguage] Optional parameter to force the language of the retrieved brand data. # @@ -186,8 +183,7 @@ def retrieve_by_name(params) # Some parameter documentations has been truncated, see # {ContextDev::Models::BrandRetrieveByTickerParams} for more details. # - # Retrieve brand information using a stock ticker symbol. This endpoint looks up - # the company associated with the ticker and returns its brand data. + # Retrieve brand information using a stock ticker symbol. # # @overload retrieve_by_ticker(ticker:, force_language: nil, max_speed: nil, ticker_exchange: nil, timeout_ms: nil, request_options: {}) # @@ -222,8 +218,8 @@ def retrieve_by_ticker(params) # {ContextDev::Models::BrandRetrieveSimplifiedParams} for more details. # # Returns a simplified version of brand data containing only essential - # information: domain, title, colors, logos, and backdrops. This endpoint is - # optimized for faster responses and reduced data transfer. + # information: domain, title, colors, logos, and backdrops. Optimized for faster + # responses and reduced data transfer. # # @overload retrieve_simplified(domain:, timeout_ms: nil, request_options: {}) # diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index cfb13bba..77f6610b 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -239,7 +239,7 @@ def web_scrape_md(params) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeSitemapParams} for more details. # - # Crawl an entire website's sitemap and return all discovered page URLs + # Crawl an entire website's sitemap and return all discovered page URLs. # # @overload web_scrape_sitemap(domain:, max_links: nil, request_options: {}) # diff --git a/rbi/context_dev/models/brand_identify_from_transaction_params.rbi b/rbi/context_dev/models/brand_identify_from_transaction_params.rbi index b824a650..bb349bf9 100644 --- a/rbi/context_dev/models/brand_identify_from_transaction_params.rbi +++ b/rbi/context_dev/models/brand_identify_from_transaction_params.rbi @@ -64,7 +64,6 @@ module ContextDev # When set to true, the API will perform an additional verification steps to # ensure the identified brand matches the transaction with high confidence. - # Defaults to false. sig { returns(T.nilable(T::Boolean)) } attr_reader :high_confidence_only @@ -132,7 +131,6 @@ module ContextDev force_language: nil, # When set to true, the API will perform an additional verification steps to # ensure the identified brand matches the transaction with high confidence. - # Defaults to false. high_confidence_only: nil, # Optional parameter to optimize the API call for maximum speed. When set to true, # the API will skip time-consuming operations for faster response at the cost of diff --git a/rbi/context_dev/models/brand_retrieve_by_name_params.rbi b/rbi/context_dev/models/brand_retrieve_by_name_params.rbi index 62249d86..078e0859 100644 --- a/rbi/context_dev/models/brand_retrieve_by_name_params.rbi +++ b/rbi/context_dev/models/brand_retrieve_by_name_params.rbi @@ -19,8 +19,8 @@ module ContextDev sig { returns(String) } attr_accessor :name - # Optional country code (GL parameter) to specify the country. This affects the - # geographic location used for search queries. + # Optional country code hint (GL parameter) to specify the country for the company + # name. sig do returns( T.nilable(ContextDev::BrandRetrieveByNameParams::CountryGl::OrSymbol) @@ -87,8 +87,8 @@ module ContextDev # Company name to retrieve brand data for (e.g., 'Apple Inc', 'Microsoft # Corporation'). Must be 3-30 characters. name:, - # Optional country code (GL parameter) to specify the country. This affects the - # geographic location used for search queries. + # Optional country code hint (GL parameter) to specify the country for the company + # name. country_gl: nil, # Optional parameter to force the language of the retrieved brand data. force_language: nil, @@ -121,8 +121,8 @@ module ContextDev def to_hash end - # Optional country code (GL parameter) to specify the country. This affects the - # geographic location used for search queries. + # Optional country code hint (GL parameter) to specify the country for the company + # name. module CountryGl extend ContextDev::Internal::Type::Enum diff --git a/rbi/context_dev/resources/brand.rbi b/rbi/context_dev/resources/brand.rbi index ed28b4e0..7e9f8f49 100644 --- a/rbi/context_dev/resources/brand.rbi +++ b/rbi/context_dev/resources/brand.rbi @@ -63,7 +63,6 @@ module ContextDev force_language: nil, # When set to true, the API will perform an additional verification steps to # ensure the identified brand matches the transaction with high confidence. - # Defaults to false. high_confidence_only: nil, # Optional parameter to optimize the API call for maximum speed. When set to true, # the API will skip time-consuming operations for faster response at the cost of @@ -83,9 +82,8 @@ module ContextDev end # Retrieve brand information using an email address while detecting disposable and - # free email addresses. This endpoint extracts the domain from the email address - # and returns brand data for that domain. Disposable and free email addresses - # (like gmail.com, yahoo.com) will throw a 422 error. + # free email addresses. Disposable and free email addresses (like gmail.com, + # yahoo.com) will throw a 422 error. sig do params( email: String, @@ -116,8 +114,7 @@ module ContextDev end # Retrieve brand information using an ISIN (International Securities - # Identification Number). This endpoint looks up the company associated with the - # ISIN and returns its brand data. + # Identification Number). sig do params( isin: String, @@ -147,8 +144,7 @@ module ContextDev ) end - # Retrieve brand information using a company name. This endpoint searches for the - # company by name and returns its brand data. + # Retrieve brand information using a company name. sig do params( name: String, @@ -165,8 +161,8 @@ module ContextDev # Company name to retrieve brand data for (e.g., 'Apple Inc', 'Microsoft # Corporation'). Must be 3-30 characters. name:, - # Optional country code (GL parameter) to specify the country. This affects the - # geographic location used for search queries. + # Optional country code hint (GL parameter) to specify the country for the company + # name. country_gl: nil, # Optional parameter to force the language of the retrieved brand data. force_language: nil, @@ -182,8 +178,7 @@ module ContextDev ) end - # Retrieve brand information using a stock ticker symbol. This endpoint looks up - # the company associated with the ticker and returns its brand data. + # Retrieve brand information using a stock ticker symbol. sig do params( ticker: String, @@ -217,8 +212,8 @@ module ContextDev end # Returns a simplified version of brand data containing only essential - # information: domain, title, colors, logos, and backdrops. This endpoint is - # optimized for faster responses and reduced data transfer. + # information: domain, title, colors, logos, and backdrops. Optimized for faster + # responses and reduced data transfer. sig do params( domain: String, diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index a002c007..96ed71db 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -207,7 +207,7 @@ module ContextDev ) end - # Crawl an entire website's sitemap and return all discovered page URLs + # Crawl an entire website's sitemap and return all discovered page URLs. sig do params( domain: String, From 30ef99f9a0d61f6528aed16b080f376753b3447a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 00:08:37 +0000 Subject: [PATCH 21/25] feat(api): api update --- .stats.yml | 6 +- lib/context_dev.rb | 2 - lib/context_dev/models.rb | 2 - .../models/industry_retrieve_naics_params.rb | 54 ----- .../industry_retrieve_naics_response.rb | 83 -------- lib/context_dev/resources/industry.rb | 36 ---- rbi/context_dev/models.rbi | 2 - .../models/industry_retrieve_naics_params.rbi | 89 -------- .../industry_retrieve_naics_response.rbi | 190 ------------------ rbi/context_dev/resources/industry.rbi | 28 --- sig/context_dev/models.rbs | 2 - .../models/industry_retrieve_naics_params.rbs | 47 ----- .../industry_retrieve_naics_response.rbs | 84 -------- sig/context_dev/resources/industry.rbs | 8 - test/context_dev/resources/industry_test.rb | 18 -- 15 files changed, 3 insertions(+), 648 deletions(-) delete mode 100644 lib/context_dev/models/industry_retrieve_naics_params.rb delete mode 100644 lib/context_dev/models/industry_retrieve_naics_response.rb delete mode 100644 rbi/context_dev/models/industry_retrieve_naics_params.rbi delete mode 100644 rbi/context_dev/models/industry_retrieve_naics_response.rbi delete mode 100644 sig/context_dev/models/industry_retrieve_naics_params.rbs delete mode 100644 sig/context_dev/models/industry_retrieve_naics_response.rbs diff --git a/.stats.yml b/.stats.yml index 7833f48d..a30858ec 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-3a604b0c9775298072e70890d369d21d38422553a8fe23d9d081b0dc06035ee2.yml -openapi_spec_hash: f94db2839851fb192f013b3ca258c39f +configured_endpoints: 20 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-7e43493a842618882d9d7d4f33c51d4b6a1e99c960f8be0996bd544864a5e79f.yml +openapi_spec_hash: 44bc5177ca909b32a1617ce637f5d704 config_hash: 85e90b8fda2e1f326ca60f8ab3e53704 diff --git a/lib/context_dev.rb b/lib/context_dev.rb index 6d616a84..3915d2f9 100644 --- a/lib/context_dev.rb +++ b/lib/context_dev.rb @@ -72,8 +72,6 @@ require_relative "context_dev/models/brand_retrieve_response" require_relative "context_dev/models/brand_retrieve_simplified_params" require_relative "context_dev/models/brand_retrieve_simplified_response" -require_relative "context_dev/models/industry_retrieve_naics_params" -require_relative "context_dev/models/industry_retrieve_naics_response" require_relative "context_dev/models/utility_prefetch_by_email_params" require_relative "context_dev/models/utility_prefetch_by_email_response" require_relative "context_dev/models/utility_prefetch_params" diff --git a/lib/context_dev/models.rb b/lib/context_dev/models.rb index 9049afe5..bd9de1c8 100644 --- a/lib/context_dev/models.rb +++ b/lib/context_dev/models.rb @@ -59,8 +59,6 @@ module ContextDev BrandRetrieveSimplifiedParams = ContextDev::Models::BrandRetrieveSimplifiedParams - IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams - UtilityPrefetchByEmailParams = ContextDev::Models::UtilityPrefetchByEmailParams UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams diff --git a/lib/context_dev/models/industry_retrieve_naics_params.rb b/lib/context_dev/models/industry_retrieve_naics_params.rb deleted file mode 100644 index 4863d92c..00000000 --- a/lib/context_dev/models/industry_retrieve_naics_params.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -module ContextDev - module Models - # @see ContextDev::Resources::Industry#retrieve_naics - class IndustryRetrieveNaicsParams < ContextDev::Internal::Type::BaseModel - extend ContextDev::Internal::Type::RequestParameters::Converter - include ContextDev::Internal::Type::RequestParameters - - # @!attribute input - # Brand domain or title to retrieve NAICS code for. If a valid domain is provided - # in `input`, it will be used for classification, otherwise, we will search for - # the brand using the provided title. - # - # @return [String] - required :input, String - - # @!attribute max_results - # Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults - # to 5. - # - # @return [Integer, nil] - optional :max_results, Integer - - # @!attribute min_results - # Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. - # - # @return [Integer, nil] - optional :min_results, Integer - - # @!attribute 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). - # - # @return [Integer, nil] - optional :timeout_ms, Integer - - # @!method initialize(input:, max_results: nil, min_results: nil, timeout_ms: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {ContextDev::Models::IndustryRetrieveNaicsParams} for more details. - # - # @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided - # - # @param max_results [Integer] Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults to 5 - # - # @param min_results [Integer] Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. - # - # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th - # - # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/context_dev/models/industry_retrieve_naics_response.rb b/lib/context_dev/models/industry_retrieve_naics_response.rb deleted file mode 100644 index a41ac3a7..00000000 --- a/lib/context_dev/models/industry_retrieve_naics_response.rb +++ /dev/null @@ -1,83 +0,0 @@ -# frozen_string_literal: true - -module ContextDev - module Models - # @see ContextDev::Resources::Industry#retrieve_naics - class IndustryRetrieveNaicsResponse < ContextDev::Internal::Type::BaseModel - # @!attribute codes - # Array of NAICS codes and titles. - # - # @return [Array, nil] - optional :codes, - -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::IndustryRetrieveNaicsResponse::Code] } - - # @!attribute domain - # Domain found for the brand - # - # @return [String, nil] - optional :domain, String - - # @!attribute status - # Status of the response, e.g., 'ok' - # - # @return [String, nil] - optional :status, String - - # @!attribute type - # Industry classification type, for naics api it will be `naics` - # - # @return [String, nil] - optional :type, String - - # @!method initialize(codes: nil, domain: nil, status: nil, type: nil) - # @param codes [Array] Array of NAICS codes and titles. - # - # @param domain [String] Domain found for the brand - # - # @param status [String] Status of the response, e.g., 'ok' - # - # @param type [String] Industry classification type, for naics api it will be `naics` - - class Code < ContextDev::Internal::Type::BaseModel - # @!attribute code - # NAICS code - # - # @return [String] - required :code, String - - # @!attribute confidence - # Confidence level for how well this NAICS code matches the company description - # - # @return [Symbol, ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence] - required :confidence, enum: -> { ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence } - - # @!attribute name - # NAICS title - # - # @return [String] - required :name, String - - # @!method initialize(code:, confidence:, name:) - # @param code [String] NAICS code - # - # @param confidence [Symbol, ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence] Confidence level for how well this NAICS code matches the company description - # - # @param name [String] NAICS title - - # Confidence level for how well this NAICS code matches the company description - # - # @see ContextDev::Models::IndustryRetrieveNaicsResponse::Code#confidence - module Confidence - extend ContextDev::Internal::Type::Enum - - HIGH = :high - MEDIUM = :medium - LOW = :low - - # @!method self.values - # @return [Array] - end - end - end - end -end diff --git a/lib/context_dev/resources/industry.rb b/lib/context_dev/resources/industry.rb index fc0d4171..4c319433 100644 --- a/lib/context_dev/resources/industry.rb +++ b/lib/context_dev/resources/industry.rb @@ -3,42 +3,6 @@ module ContextDev module Resources class Industry - # Some parameter documentations has been truncated, see - # {ContextDev::Models::IndustryRetrieveNaicsParams} for more details. - # - # Endpoint to classify any brand into a 2022 NAICS code. - # - # @overload retrieve_naics(input:, max_results: nil, min_results: nil, timeout_ms: nil, request_options: {}) - # - # @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided - # - # @param max_results [Integer] Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults to 5 - # - # @param min_results [Integer] Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. - # - # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th - # - # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ContextDev::Models::IndustryRetrieveNaicsResponse] - # - # @see ContextDev::Models::IndustryRetrieveNaicsParams - def retrieve_naics(params) - parsed, options = ContextDev::IndustryRetrieveNaicsParams.dump_request(params) - query = ContextDev::Internal::Util.encode_query_params(parsed) - @client.request( - method: :get, - path: "brand/naics", - query: query.transform_keys( - max_results: "maxResults", - min_results: "minResults", - timeout_ms: "timeoutMS" - ), - model: ContextDev::Models::IndustryRetrieveNaicsResponse, - options: options - ) - end - # @api private # # @param client [ContextDev::Client] diff --git a/rbi/context_dev/models.rbi b/rbi/context_dev/models.rbi index 43142d69..9e5e3c7c 100644 --- a/rbi/context_dev/models.rbi +++ b/rbi/context_dev/models.rbi @@ -23,8 +23,6 @@ module ContextDev BrandRetrieveSimplifiedParams = ContextDev::Models::BrandRetrieveSimplifiedParams - IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams - UtilityPrefetchByEmailParams = ContextDev::Models::UtilityPrefetchByEmailParams diff --git a/rbi/context_dev/models/industry_retrieve_naics_params.rbi b/rbi/context_dev/models/industry_retrieve_naics_params.rbi deleted file mode 100644 index a8590228..00000000 --- a/rbi/context_dev/models/industry_retrieve_naics_params.rbi +++ /dev/null @@ -1,89 +0,0 @@ -# typed: strong - -module ContextDev - module Models - class IndustryRetrieveNaicsParams < ContextDev::Internal::Type::BaseModel - extend ContextDev::Internal::Type::RequestParameters::Converter - include ContextDev::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ContextDev::IndustryRetrieveNaicsParams, - ContextDev::Internal::AnyHash - ) - end - - # Brand domain or title to retrieve NAICS code for. If a valid domain is provided - # in `input`, it will be used for classification, otherwise, we will search for - # the brand using the provided title. - sig { returns(String) } - attr_accessor :input - - # Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults - # to 5. - sig { returns(T.nilable(Integer)) } - attr_reader :max_results - - sig { params(max_results: Integer).void } - attr_writer :max_results - - # Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. - sig { returns(T.nilable(Integer)) } - attr_reader :min_results - - sig { params(min_results: Integer).void } - attr_writer :min_results - - # 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). - sig { returns(T.nilable(Integer)) } - attr_reader :timeout_ms - - sig { params(timeout_ms: Integer).void } - attr_writer :timeout_ms - - sig do - params( - input: String, - max_results: Integer, - min_results: Integer, - timeout_ms: Integer, - request_options: ContextDev::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # Brand domain or title to retrieve NAICS code for. If a valid domain is provided - # in `input`, it will be used for classification, otherwise, we will search for - # the brand using the provided title. - input:, - # Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults - # to 5. - max_results: nil, - # Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. - min_results: nil, - # 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). - timeout_ms: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - input: String, - max_results: Integer, - min_results: Integer, - timeout_ms: Integer, - request_options: ContextDev::RequestOptions - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/context_dev/models/industry_retrieve_naics_response.rbi b/rbi/context_dev/models/industry_retrieve_naics_response.rbi deleted file mode 100644 index 4434e141..00000000 --- a/rbi/context_dev/models/industry_retrieve_naics_response.rbi +++ /dev/null @@ -1,190 +0,0 @@ -# typed: strong - -module ContextDev - module Models - class IndustryRetrieveNaicsResponse < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::IndustryRetrieveNaicsResponse, - ContextDev::Internal::AnyHash - ) - end - - # Array of NAICS codes and titles. - sig do - returns( - T.nilable( - T::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code] - ) - ) - end - attr_reader :codes - - sig do - params( - codes: - T::Array[ - ContextDev::Models::IndustryRetrieveNaicsResponse::Code::OrHash - ] - ).void - end - attr_writer :codes - - # Domain found for the brand - sig { returns(T.nilable(String)) } - attr_reader :domain - - sig { params(domain: String).void } - attr_writer :domain - - # Status of the response, e.g., 'ok' - sig { returns(T.nilable(String)) } - attr_reader :status - - sig { params(status: String).void } - attr_writer :status - - # Industry classification type, for naics api it will be `naics` - sig { returns(T.nilable(String)) } - attr_reader :type - - sig { params(type: String).void } - attr_writer :type - - sig do - params( - codes: - T::Array[ - ContextDev::Models::IndustryRetrieveNaicsResponse::Code::OrHash - ], - domain: String, - status: String, - type: String - ).returns(T.attached_class) - end - def self.new( - # Array of NAICS codes and titles. - codes: nil, - # Domain found for the brand - domain: nil, - # Status of the response, e.g., 'ok' - status: nil, - # Industry classification type, for naics api it will be `naics` - type: nil - ) - end - - sig do - override.returns( - { - codes: - T::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code], - domain: String, - status: String, - type: String - } - ) - end - def to_hash - end - - class Code < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::IndustryRetrieveNaicsResponse::Code, - ContextDev::Internal::AnyHash - ) - end - - # NAICS code - sig { returns(String) } - attr_accessor :code - - # Confidence level for how well this NAICS code matches the company description - sig do - returns( - ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence::TaggedSymbol - ) - end - attr_accessor :confidence - - # NAICS title - sig { returns(String) } - attr_accessor :name - - sig do - params( - code: String, - confidence: - ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence::OrSymbol, - name: String - ).returns(T.attached_class) - end - def self.new( - # NAICS code - code:, - # Confidence level for how well this NAICS code matches the company description - confidence:, - # NAICS title - name: - ) - end - - sig do - override.returns( - { - code: String, - confidence: - ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence::TaggedSymbol, - name: String - } - ) - end - def to_hash - end - - # Confidence level for how well this NAICS code matches the company description - module Confidence - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - HIGH = - T.let( - :high, - ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence::TaggedSymbol - ) - MEDIUM = - T.let( - :medium, - ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence::TaggedSymbol - ) - LOW = - T.let( - :low, - ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end - end -end diff --git a/rbi/context_dev/resources/industry.rbi b/rbi/context_dev/resources/industry.rbi index 563db4dd..69667354 100644 --- a/rbi/context_dev/resources/industry.rbi +++ b/rbi/context_dev/resources/industry.rbi @@ -3,34 +3,6 @@ module ContextDev module Resources class Industry - # Endpoint to classify any brand into a 2022 NAICS code. - sig do - params( - input: String, - max_results: Integer, - min_results: Integer, - timeout_ms: Integer, - request_options: ContextDev::RequestOptions::OrHash - ).returns(ContextDev::Models::IndustryRetrieveNaicsResponse) - end - def retrieve_naics( - # Brand domain or title to retrieve NAICS code for. If a valid domain is provided - # in `input`, it will be used for classification, otherwise, we will search for - # the brand using the provided title. - input:, - # Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults - # to 5. - max_results: nil, - # Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. - min_results: nil, - # 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). - timeout_ms: nil, - request_options: {} - ) - end - # @api private sig { params(client: ContextDev::Client).returns(T.attached_class) } def self.new(client:) diff --git a/sig/context_dev/models.rbs b/sig/context_dev/models.rbs index 992384f4..1090a628 100644 --- a/sig/context_dev/models.rbs +++ b/sig/context_dev/models.rbs @@ -19,8 +19,6 @@ module ContextDev class BrandRetrieveSimplifiedParams = ContextDev::Models::BrandRetrieveSimplifiedParams - class IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams - class UtilityPrefetchByEmailParams = ContextDev::Models::UtilityPrefetchByEmailParams class UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams diff --git a/sig/context_dev/models/industry_retrieve_naics_params.rbs b/sig/context_dev/models/industry_retrieve_naics_params.rbs deleted file mode 100644 index 2d963c28..00000000 --- a/sig/context_dev/models/industry_retrieve_naics_params.rbs +++ /dev/null @@ -1,47 +0,0 @@ -module ContextDev - module Models - type industry_retrieve_naics_params = - { - input: String, - max_results: Integer, - min_results: Integer, - timeout_ms: Integer - } - & ContextDev::Internal::Type::request_parameters - - class IndustryRetrieveNaicsParams < ContextDev::Internal::Type::BaseModel - extend ContextDev::Internal::Type::RequestParameters::Converter - include ContextDev::Internal::Type::RequestParameters - - attr_accessor input: String - - attr_reader max_results: Integer? - - def max_results=: (Integer) -> Integer - - attr_reader min_results: Integer? - - def min_results=: (Integer) -> Integer - - attr_reader timeout_ms: Integer? - - def timeout_ms=: (Integer) -> Integer - - def initialize: ( - input: String, - ?max_results: Integer, - ?min_results: Integer, - ?timeout_ms: Integer, - ?request_options: ContextDev::request_opts - ) -> void - - def to_hash: -> { - input: String, - max_results: Integer, - min_results: Integer, - timeout_ms: Integer, - request_options: ContextDev::RequestOptions - } - end - end -end diff --git a/sig/context_dev/models/industry_retrieve_naics_response.rbs b/sig/context_dev/models/industry_retrieve_naics_response.rbs deleted file mode 100644 index 3cdc639d..00000000 --- a/sig/context_dev/models/industry_retrieve_naics_response.rbs +++ /dev/null @@ -1,84 +0,0 @@ -module ContextDev - module Models - type industry_retrieve_naics_response = - { - codes: ::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code], - domain: String, - status: String, - type: String - } - - class IndustryRetrieveNaicsResponse < ContextDev::Internal::Type::BaseModel - attr_reader codes: ::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code]? - - def codes=: ( - ::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code] - ) -> ::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code] - - attr_reader domain: String? - - def domain=: (String) -> String - - attr_reader status: String? - - def status=: (String) -> String - - attr_reader type: String? - - def type=: (String) -> String - - def initialize: ( - ?codes: ::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code], - ?domain: String, - ?status: String, - ?type: String - ) -> void - - def to_hash: -> { - codes: ::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code], - domain: String, - status: String, - type: String - } - - type code = - { - code: String, - confidence: ContextDev::Models::IndustryRetrieveNaicsResponse::Code::confidence, - name: String - } - - class Code < ContextDev::Internal::Type::BaseModel - attr_accessor code: String - - attr_accessor confidence: ContextDev::Models::IndustryRetrieveNaicsResponse::Code::confidence - - attr_accessor name: String - - def initialize: ( - code: String, - confidence: ContextDev::Models::IndustryRetrieveNaicsResponse::Code::confidence, - name: String - ) -> void - - def to_hash: -> { - code: String, - confidence: ContextDev::Models::IndustryRetrieveNaicsResponse::Code::confidence, - name: String - } - - type confidence = :high | :medium | :low - - module Confidence - extend ContextDev::Internal::Type::Enum - - HIGH: :high - MEDIUM: :medium - LOW: :low - - def self?.values: -> ::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code::confidence] - end - end - end - end -end diff --git a/sig/context_dev/resources/industry.rbs b/sig/context_dev/resources/industry.rbs index c0568529..a277cbf2 100644 --- a/sig/context_dev/resources/industry.rbs +++ b/sig/context_dev/resources/industry.rbs @@ -1,14 +1,6 @@ module ContextDev module Resources class Industry - def retrieve_naics: ( - input: String, - ?max_results: Integer, - ?min_results: Integer, - ?timeout_ms: Integer, - ?request_options: ContextDev::request_opts - ) -> ContextDev::Models::IndustryRetrieveNaicsResponse - def initialize: (client: ContextDev::Client) -> void end end diff --git a/test/context_dev/resources/industry_test.rb b/test/context_dev/resources/industry_test.rb index 78099a13..55dedbba 100644 --- a/test/context_dev/resources/industry_test.rb +++ b/test/context_dev/resources/industry_test.rb @@ -3,22 +3,4 @@ require_relative "../test_helper" class ContextDev::Test::Resources::IndustryTest < ContextDev::Test::ResourceTest - def test_retrieve_naics_required_params - skip("Mock server tests are disabled") - - response = @context_dev.industry.retrieve_naics(input: "input") - - assert_pattern do - response => ContextDev::Models::IndustryRetrieveNaicsResponse - end - - assert_pattern do - response => { - codes: ^(ContextDev::Internal::Type::ArrayOf[ContextDev::Models::IndustryRetrieveNaicsResponse::Code]) | nil, - domain: String | nil, - status: String | nil, - type: String | nil - } - end - end end From f451afea50625bba49a808a4b193c451c7019571 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 00:10:23 +0000 Subject: [PATCH 22/25] feat(api): manual updates --- .stats.yml | 4 +- lib/context_dev.rb | 2 + lib/context_dev/models.rb | 2 + .../models/industry_retrieve_naics_params.rb | 54 +++++ .../industry_retrieve_naics_response.rb | 83 ++++++++ lib/context_dev/resources/industry.rb | 36 ++++ rbi/context_dev/models.rbi | 2 + .../models/industry_retrieve_naics_params.rbi | 89 ++++++++ .../industry_retrieve_naics_response.rbi | 190 ++++++++++++++++++ rbi/context_dev/resources/industry.rbi | 28 +++ sig/context_dev/models.rbs | 2 + .../models/industry_retrieve_naics_params.rbs | 47 +++++ .../industry_retrieve_naics_response.rbs | 84 ++++++++ sig/context_dev/resources/industry.rbs | 8 + test/context_dev/resources/industry_test.rb | 18 ++ 15 files changed, 647 insertions(+), 2 deletions(-) create mode 100644 lib/context_dev/models/industry_retrieve_naics_params.rb create mode 100644 lib/context_dev/models/industry_retrieve_naics_response.rb create mode 100644 rbi/context_dev/models/industry_retrieve_naics_params.rbi create mode 100644 rbi/context_dev/models/industry_retrieve_naics_response.rbi create mode 100644 sig/context_dev/models/industry_retrieve_naics_params.rbs create mode 100644 sig/context_dev/models/industry_retrieve_naics_response.rbs diff --git a/.stats.yml b/.stats.yml index a30858ec..cdd1e871 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 20 +configured_endpoints: 21 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-7e43493a842618882d9d7d4f33c51d4b6a1e99c960f8be0996bd544864a5e79f.yml openapi_spec_hash: 44bc5177ca909b32a1617ce637f5d704 -config_hash: 85e90b8fda2e1f326ca60f8ab3e53704 +config_hash: 7d13dca2b2c6f71fc463cb6062efa5ea diff --git a/lib/context_dev.rb b/lib/context_dev.rb index 3915d2f9..6d616a84 100644 --- a/lib/context_dev.rb +++ b/lib/context_dev.rb @@ -72,6 +72,8 @@ require_relative "context_dev/models/brand_retrieve_response" require_relative "context_dev/models/brand_retrieve_simplified_params" require_relative "context_dev/models/brand_retrieve_simplified_response" +require_relative "context_dev/models/industry_retrieve_naics_params" +require_relative "context_dev/models/industry_retrieve_naics_response" require_relative "context_dev/models/utility_prefetch_by_email_params" require_relative "context_dev/models/utility_prefetch_by_email_response" require_relative "context_dev/models/utility_prefetch_params" diff --git a/lib/context_dev/models.rb b/lib/context_dev/models.rb index bd9de1c8..9049afe5 100644 --- a/lib/context_dev/models.rb +++ b/lib/context_dev/models.rb @@ -59,6 +59,8 @@ module ContextDev BrandRetrieveSimplifiedParams = ContextDev::Models::BrandRetrieveSimplifiedParams + IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams + UtilityPrefetchByEmailParams = ContextDev::Models::UtilityPrefetchByEmailParams UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams diff --git a/lib/context_dev/models/industry_retrieve_naics_params.rb b/lib/context_dev/models/industry_retrieve_naics_params.rb new file mode 100644 index 00000000..3738a90c --- /dev/null +++ b/lib/context_dev/models/industry_retrieve_naics_params.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::Industry#retrieve_naics + class IndustryRetrieveNaicsParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + # @!attribute input + # Brand domain or title to retrieve NAICS code for. If a valid domain is provided, + # it will be used for classification, otherwise, we will search for the brand + # using the provided title. + # + # @return [String] + required :input, String + + # @!attribute max_results + # Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults + # to 5. + # + # @return [Integer, nil] + optional :max_results, Integer + + # @!attribute min_results + # Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. + # + # @return [Integer, nil] + optional :min_results, Integer + + # @!attribute 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). + # + # @return [Integer, nil] + optional :timeout_ms, Integer + + # @!method initialize(input:, max_results: nil, min_results: nil, timeout_ms: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::IndustryRetrieveNaicsParams} for more details. + # + # @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided, + # + # @param max_results [Integer] Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults to 5 + # + # @param min_results [Integer] Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. + # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/context_dev/models/industry_retrieve_naics_response.rb b/lib/context_dev/models/industry_retrieve_naics_response.rb new file mode 100644 index 00000000..a41ac3a7 --- /dev/null +++ b/lib/context_dev/models/industry_retrieve_naics_response.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::Industry#retrieve_naics + class IndustryRetrieveNaicsResponse < ContextDev::Internal::Type::BaseModel + # @!attribute codes + # Array of NAICS codes and titles. + # + # @return [Array, nil] + optional :codes, + -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::IndustryRetrieveNaicsResponse::Code] } + + # @!attribute domain + # Domain found for the brand + # + # @return [String, nil] + optional :domain, String + + # @!attribute status + # Status of the response, e.g., 'ok' + # + # @return [String, nil] + optional :status, String + + # @!attribute type + # Industry classification type, for naics api it will be `naics` + # + # @return [String, nil] + optional :type, String + + # @!method initialize(codes: nil, domain: nil, status: nil, type: nil) + # @param codes [Array] Array of NAICS codes and titles. + # + # @param domain [String] Domain found for the brand + # + # @param status [String] Status of the response, e.g., 'ok' + # + # @param type [String] Industry classification type, for naics api it will be `naics` + + class Code < ContextDev::Internal::Type::BaseModel + # @!attribute code + # NAICS code + # + # @return [String] + required :code, String + + # @!attribute confidence + # Confidence level for how well this NAICS code matches the company description + # + # @return [Symbol, ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence] + required :confidence, enum: -> { ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence } + + # @!attribute name + # NAICS title + # + # @return [String] + required :name, String + + # @!method initialize(code:, confidence:, name:) + # @param code [String] NAICS code + # + # @param confidence [Symbol, ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence] Confidence level for how well this NAICS code matches the company description + # + # @param name [String] NAICS title + + # Confidence level for how well this NAICS code matches the company description + # + # @see ContextDev::Models::IndustryRetrieveNaicsResponse::Code#confidence + module Confidence + extend ContextDev::Internal::Type::Enum + + HIGH = :high + MEDIUM = :medium + LOW = :low + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/context_dev/resources/industry.rb b/lib/context_dev/resources/industry.rb index 4c319433..47f27fa5 100644 --- a/lib/context_dev/resources/industry.rb +++ b/lib/context_dev/resources/industry.rb @@ -3,6 +3,42 @@ module ContextDev module Resources class Industry + # Some parameter documentations has been truncated, see + # {ContextDev::Models::IndustryRetrieveNaicsParams} for more details. + # + # Classify any brand into 2022 NAICS industry codes from its domain or name. + # + # @overload retrieve_naics(input:, max_results: nil, min_results: nil, timeout_ms: nil, request_options: {}) + # + # @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided, + # + # @param max_results [Integer] Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults to 5 + # + # @param min_results [Integer] Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. + # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [ContextDev::Models::IndustryRetrieveNaicsResponse] + # + # @see ContextDev::Models::IndustryRetrieveNaicsParams + def retrieve_naics(params) + parsed, options = ContextDev::IndustryRetrieveNaicsParams.dump_request(params) + query = ContextDev::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "web/naics", + query: query.transform_keys( + max_results: "maxResults", + min_results: "minResults", + timeout_ms: "timeoutMS" + ), + model: ContextDev::Models::IndustryRetrieveNaicsResponse, + options: options + ) + end + # @api private # # @param client [ContextDev::Client] diff --git a/rbi/context_dev/models.rbi b/rbi/context_dev/models.rbi index 9e5e3c7c..43142d69 100644 --- a/rbi/context_dev/models.rbi +++ b/rbi/context_dev/models.rbi @@ -23,6 +23,8 @@ module ContextDev BrandRetrieveSimplifiedParams = ContextDev::Models::BrandRetrieveSimplifiedParams + IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams + UtilityPrefetchByEmailParams = ContextDev::Models::UtilityPrefetchByEmailParams diff --git a/rbi/context_dev/models/industry_retrieve_naics_params.rbi b/rbi/context_dev/models/industry_retrieve_naics_params.rbi new file mode 100644 index 00000000..eaf0e28f --- /dev/null +++ b/rbi/context_dev/models/industry_retrieve_naics_params.rbi @@ -0,0 +1,89 @@ +# typed: strong + +module ContextDev + module Models + class IndustryRetrieveNaicsParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + ContextDev::IndustryRetrieveNaicsParams, + ContextDev::Internal::AnyHash + ) + end + + # Brand domain or title to retrieve NAICS code for. If a valid domain is provided, + # it will be used for classification, otherwise, we will search for the brand + # using the provided title. + sig { returns(String) } + attr_accessor :input + + # Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults + # to 5. + sig { returns(T.nilable(Integer)) } + attr_reader :max_results + + sig { params(max_results: Integer).void } + attr_writer :max_results + + # Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. + sig { returns(T.nilable(Integer)) } + attr_reader :min_results + + sig { params(min_results: Integer).void } + attr_writer :min_results + + # 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). + sig { returns(T.nilable(Integer)) } + attr_reader :timeout_ms + + sig { params(timeout_ms: Integer).void } + attr_writer :timeout_ms + + sig do + params( + input: String, + max_results: Integer, + min_results: Integer, + timeout_ms: Integer, + request_options: ContextDev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Brand domain or title to retrieve NAICS code for. If a valid domain is provided, + # it will be used for classification, otherwise, we will search for the brand + # using the provided title. + input:, + # Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults + # to 5. + max_results: nil, + # Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. + min_results: nil, + # 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). + timeout_ms: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + input: String, + max_results: Integer, + min_results: Integer, + timeout_ms: Integer, + request_options: ContextDev::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/context_dev/models/industry_retrieve_naics_response.rbi b/rbi/context_dev/models/industry_retrieve_naics_response.rbi new file mode 100644 index 00000000..4434e141 --- /dev/null +++ b/rbi/context_dev/models/industry_retrieve_naics_response.rbi @@ -0,0 +1,190 @@ +# typed: strong + +module ContextDev + module Models + class IndustryRetrieveNaicsResponse < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::IndustryRetrieveNaicsResponse, + ContextDev::Internal::AnyHash + ) + end + + # Array of NAICS codes and titles. + sig do + returns( + T.nilable( + T::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code] + ) + ) + end + attr_reader :codes + + sig do + params( + codes: + T::Array[ + ContextDev::Models::IndustryRetrieveNaicsResponse::Code::OrHash + ] + ).void + end + attr_writer :codes + + # Domain found for the brand + sig { returns(T.nilable(String)) } + attr_reader :domain + + sig { params(domain: String).void } + attr_writer :domain + + # Status of the response, e.g., 'ok' + sig { returns(T.nilable(String)) } + attr_reader :status + + sig { params(status: String).void } + attr_writer :status + + # Industry classification type, for naics api it will be `naics` + sig { returns(T.nilable(String)) } + attr_reader :type + + sig { params(type: String).void } + attr_writer :type + + sig do + params( + codes: + T::Array[ + ContextDev::Models::IndustryRetrieveNaicsResponse::Code::OrHash + ], + domain: String, + status: String, + type: String + ).returns(T.attached_class) + end + def self.new( + # Array of NAICS codes and titles. + codes: nil, + # Domain found for the brand + domain: nil, + # Status of the response, e.g., 'ok' + status: nil, + # Industry classification type, for naics api it will be `naics` + type: nil + ) + end + + sig do + override.returns( + { + codes: + T::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code], + domain: String, + status: String, + type: String + } + ) + end + def to_hash + end + + class Code < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::IndustryRetrieveNaicsResponse::Code, + ContextDev::Internal::AnyHash + ) + end + + # NAICS code + sig { returns(String) } + attr_accessor :code + + # Confidence level for how well this NAICS code matches the company description + sig do + returns( + ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence::TaggedSymbol + ) + end + attr_accessor :confidence + + # NAICS title + sig { returns(String) } + attr_accessor :name + + sig do + params( + code: String, + confidence: + ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence::OrSymbol, + name: String + ).returns(T.attached_class) + end + def self.new( + # NAICS code + code:, + # Confidence level for how well this NAICS code matches the company description + confidence:, + # NAICS title + name: + ) + end + + sig do + override.returns( + { + code: String, + confidence: + ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence::TaggedSymbol, + name: String + } + ) + end + def to_hash + end + + # Confidence level for how well this NAICS code matches the company description + module Confidence + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HIGH = + T.let( + :high, + ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence::TaggedSymbol + ) + MEDIUM = + T.let( + :medium, + ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence::TaggedSymbol + ) + LOW = + T.let( + :low, + ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::Models::IndustryRetrieveNaicsResponse::Code::Confidence::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/context_dev/resources/industry.rbi b/rbi/context_dev/resources/industry.rbi index 69667354..97516941 100644 --- a/rbi/context_dev/resources/industry.rbi +++ b/rbi/context_dev/resources/industry.rbi @@ -3,6 +3,34 @@ module ContextDev module Resources class Industry + # Classify any brand into 2022 NAICS industry codes from its domain or name. + sig do + params( + input: String, + max_results: Integer, + min_results: Integer, + timeout_ms: Integer, + request_options: ContextDev::RequestOptions::OrHash + ).returns(ContextDev::Models::IndustryRetrieveNaicsResponse) + end + def retrieve_naics( + # Brand domain or title to retrieve NAICS code for. If a valid domain is provided, + # it will be used for classification, otherwise, we will search for the brand + # using the provided title. + input:, + # Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults + # to 5. + max_results: nil, + # Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. + min_results: nil, + # 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). + timeout_ms: nil, + request_options: {} + ) + end + # @api private sig { params(client: ContextDev::Client).returns(T.attached_class) } def self.new(client:) diff --git a/sig/context_dev/models.rbs b/sig/context_dev/models.rbs index 1090a628..992384f4 100644 --- a/sig/context_dev/models.rbs +++ b/sig/context_dev/models.rbs @@ -19,6 +19,8 @@ module ContextDev class BrandRetrieveSimplifiedParams = ContextDev::Models::BrandRetrieveSimplifiedParams + class IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams + class UtilityPrefetchByEmailParams = ContextDev::Models::UtilityPrefetchByEmailParams class UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams diff --git a/sig/context_dev/models/industry_retrieve_naics_params.rbs b/sig/context_dev/models/industry_retrieve_naics_params.rbs new file mode 100644 index 00000000..2d963c28 --- /dev/null +++ b/sig/context_dev/models/industry_retrieve_naics_params.rbs @@ -0,0 +1,47 @@ +module ContextDev + module Models + type industry_retrieve_naics_params = + { + input: String, + max_results: Integer, + min_results: Integer, + timeout_ms: Integer + } + & ContextDev::Internal::Type::request_parameters + + class IndustryRetrieveNaicsParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + attr_accessor input: String + + attr_reader max_results: Integer? + + def max_results=: (Integer) -> Integer + + attr_reader min_results: Integer? + + def min_results=: (Integer) -> Integer + + attr_reader timeout_ms: Integer? + + def timeout_ms=: (Integer) -> Integer + + def initialize: ( + input: String, + ?max_results: Integer, + ?min_results: Integer, + ?timeout_ms: Integer, + ?request_options: ContextDev::request_opts + ) -> void + + def to_hash: -> { + input: String, + max_results: Integer, + min_results: Integer, + timeout_ms: Integer, + request_options: ContextDev::RequestOptions + } + end + end +end diff --git a/sig/context_dev/models/industry_retrieve_naics_response.rbs b/sig/context_dev/models/industry_retrieve_naics_response.rbs new file mode 100644 index 00000000..3cdc639d --- /dev/null +++ b/sig/context_dev/models/industry_retrieve_naics_response.rbs @@ -0,0 +1,84 @@ +module ContextDev + module Models + type industry_retrieve_naics_response = + { + codes: ::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code], + domain: String, + status: String, + type: String + } + + class IndustryRetrieveNaicsResponse < ContextDev::Internal::Type::BaseModel + attr_reader codes: ::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code]? + + def codes=: ( + ::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code] + ) -> ::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code] + + attr_reader domain: String? + + def domain=: (String) -> String + + attr_reader status: String? + + def status=: (String) -> String + + attr_reader type: String? + + def type=: (String) -> String + + def initialize: ( + ?codes: ::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code], + ?domain: String, + ?status: String, + ?type: String + ) -> void + + def to_hash: -> { + codes: ::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code], + domain: String, + status: String, + type: String + } + + type code = + { + code: String, + confidence: ContextDev::Models::IndustryRetrieveNaicsResponse::Code::confidence, + name: String + } + + class Code < ContextDev::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor confidence: ContextDev::Models::IndustryRetrieveNaicsResponse::Code::confidence + + attr_accessor name: String + + def initialize: ( + code: String, + confidence: ContextDev::Models::IndustryRetrieveNaicsResponse::Code::confidence, + name: String + ) -> void + + def to_hash: -> { + code: String, + confidence: ContextDev::Models::IndustryRetrieveNaicsResponse::Code::confidence, + name: String + } + + type confidence = :high | :medium | :low + + module Confidence + extend ContextDev::Internal::Type::Enum + + HIGH: :high + MEDIUM: :medium + LOW: :low + + def self?.values: -> ::Array[ContextDev::Models::IndustryRetrieveNaicsResponse::Code::confidence] + end + end + end + end +end diff --git a/sig/context_dev/resources/industry.rbs b/sig/context_dev/resources/industry.rbs index a277cbf2..c0568529 100644 --- a/sig/context_dev/resources/industry.rbs +++ b/sig/context_dev/resources/industry.rbs @@ -1,6 +1,14 @@ module ContextDev module Resources class Industry + def retrieve_naics: ( + input: String, + ?max_results: Integer, + ?min_results: Integer, + ?timeout_ms: Integer, + ?request_options: ContextDev::request_opts + ) -> ContextDev::Models::IndustryRetrieveNaicsResponse + def initialize: (client: ContextDev::Client) -> void end end diff --git a/test/context_dev/resources/industry_test.rb b/test/context_dev/resources/industry_test.rb index 55dedbba..78099a13 100644 --- a/test/context_dev/resources/industry_test.rb +++ b/test/context_dev/resources/industry_test.rb @@ -3,4 +3,22 @@ require_relative "../test_helper" class ContextDev::Test::Resources::IndustryTest < ContextDev::Test::ResourceTest + def test_retrieve_naics_required_params + skip("Mock server tests are disabled") + + response = @context_dev.industry.retrieve_naics(input: "input") + + assert_pattern do + response => ContextDev::Models::IndustryRetrieveNaicsResponse + end + + assert_pattern do + response => { + codes: ^(ContextDev::Internal::Type::ArrayOf[ContextDev::Models::IndustryRetrieveNaicsResponse::Code]) | nil, + domain: String | nil, + status: String | nil, + type: String | nil + } + end + end end From 3b0140e82057e0de0612a34420acad8d430cc37e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 00:19:44 +0000 Subject: [PATCH 23/25] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cdd1e871..08ffe175 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-7e43493a842618882d9d7d4f33c51d4b6a1e99c960f8be0996bd544864a5e79f.yml -openapi_spec_hash: 44bc5177ca909b32a1617ce637f5d704 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-8ac1b9ffd4276c038dac4e0bd15ce55bd98bbfab12c552bb40da4a0c08e04f5c.yml +openapi_spec_hash: abf54ec56c7f443c31018b325b351118 config_hash: 7d13dca2b2c6f71fc463cb6062efa5ea From 33d128fe578654a3911672e623a92f1f04d91b77 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 17:37:22 +0000 Subject: [PATCH 24/25] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 08ffe175..6d316e10 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-8ac1b9ffd4276c038dac4e0bd15ce55bd98bbfab12c552bb40da4a0c08e04f5c.yml -openapi_spec_hash: abf54ec56c7f443c31018b325b351118 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-5afee68d7308a77a9ef51fb53917080746f96327c6d745fc029363a7d1494c3c.yml +openapi_spec_hash: b2e32bb58d92a00f6ede04c4f7bf1a34 config_hash: 7d13dca2b2c6f71fc463cb6062efa5ea From 4fa1dc51f24a1635e95909db79a025c06c2224e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 17:37:43 +0000 Subject: [PATCH 25/25] release: 1.5.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 22 ++++++++++++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/context_dev/version.rb | 2 +- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3e9af1b3..fbd9082d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.4.0" + ".": "1.5.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 84598849..c62d748b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## 1.5.0 (2026-04-19) + +Full Changelog: [v1.4.0...v1.5.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.4.0...v1.5.0) + +### Features + +* **api:** api update ([30ef99f](https://github.com/context-dot-dev/context-ruby-sdk/commit/30ef99f9a0d61f6528aed16b080f376753b3447a)) +* **api:** api update ([c9851eb](https://github.com/context-dot-dev/context-ruby-sdk/commit/c9851ebc0618d7433ed88f7062902fcec575b229)) +* **api:** api update ([55529f6](https://github.com/context-dot-dev/context-ruby-sdk/commit/55529f63e23cf255645bdb2d0420bf24aaba28b1)) +* **api:** api update ([51320a5](https://github.com/context-dot-dev/context-ruby-sdk/commit/51320a5677298ab231dc417ef3c54d6a75e640ba)) +* **api:** api update ([5a69904](https://github.com/context-dot-dev/context-ruby-sdk/commit/5a69904d89cc873614e8320308eecac9304992d2)) +* **api:** api update ([7d186fa](https://github.com/context-dot-dev/context-ruby-sdk/commit/7d186faf849e20bcd958beb5f46b71f6440b8358)) +* **api:** api update ([2d439b9](https://github.com/context-dot-dev/context-ruby-sdk/commit/2d439b9814f0e3be9efead3d2e70e3e5d7e3a1f0)) +* **api:** api update ([8b33b1e](https://github.com/context-dot-dev/context-ruby-sdk/commit/8b33b1ee26acc8314d9c285ea53e3531ba390a16)) +* **api:** api update ([7b5ddec](https://github.com/context-dot-dev/context-ruby-sdk/commit/7b5ddec0b8e306df34a72ccd39e8d731168a62ea)) +* **api:** api update ([b09024f](https://github.com/context-dot-dev/context-ruby-sdk/commit/b09024fa19c7aecafaf4fe4bd211bfc3738484ed)) +* **api:** api update ([4e74fe3](https://github.com/context-dot-dev/context-ruby-sdk/commit/4e74fe3f395778efb1ca3f1e752f2f71e21a3191)) +* **api:** manual updates ([f451afe](https://github.com/context-dot-dev/context-ruby-sdk/commit/f451afea50625bba49a808a4b193c451c7019571)) +* **api:** manual updates ([11ea49f](https://github.com/context-dot-dev/context-ruby-sdk/commit/11ea49fac95ca680db1f9880b8b8590aa650b00a)) +* **api:** manual updates ([739b99f](https://github.com/context-dot-dev/context-ruby-sdk/commit/739b99fddcd745960b3cf390cc9bff4220941ee8)) +* **api:** manual updates ([d32eb69](https://github.com/context-dot-dev/context-ruby-sdk/commit/d32eb69f2bafb655156587bfb2daa659dcc3b731)) + ## 1.4.0 (2026-04-09) Full Changelog: [v1.3.0...v1.4.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.3.0...v1.4.0) diff --git a/Gemfile.lock b/Gemfile.lock index b5778922..e4709ebe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - context.dev (1.4.0) + context.dev (1.5.0) cgi connection_pool diff --git a/README.md b/README.md index bf456143..0eea9ec9 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 "context.dev", "~> 1.4.0" +gem "context.dev", "~> 1.5.0" ``` diff --git a/lib/context_dev/version.rb b/lib/context_dev/version.rb index 55f99422..687a8828 100644 --- a/lib/context_dev/version.rb +++ b/lib/context_dev/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ContextDev - VERSION = "1.4.0" + VERSION = "1.5.0" end