diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fbd9082d..7deae338 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.5.0" + ".": "1.6.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 6d316e10..98e8c8a2 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-5afee68d7308a77a9ef51fb53917080746f96327c6d745fc029363a7d1494c3c.yml -openapi_spec_hash: b2e32bb58d92a00f6ede04c4f7bf1a34 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-ca8e38b0f28a9967dab631b8868f1d59bc035fd994a717e0125c77ca592bd105.yml +openapi_spec_hash: ef0a5df01201a032dcc41f9a25b733e6 config_hash: 7d13dca2b2c6f71fc463cb6062efa5ea diff --git a/CHANGELOG.md b/CHANGELOG.md index c62d748b..5da5a4a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 1.6.0 (2026-04-23) + +Full Changelog: [v1.5.0...v1.6.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.5.0...v1.6.0) + +### Features + +* **api:** api update ([c1543f7](https://github.com/context-dot-dev/context-ruby-sdk/commit/c1543f7513b2d88b0c8ad8e209e62075bd9658bc)) +* **api:** api update ([9c98e20](https://github.com/context-dot-dev/context-ruby-sdk/commit/9c98e20725dcda8466a2274b61be75943d0564d9)) +* **api:** api update ([8ccafd9](https://github.com/context-dot-dev/context-ruby-sdk/commit/8ccafd9625079f40393fe23890958a80d8bdb4e8)) + + +### Chores + +* **internal:** more robust bootstrap script ([57b2d93](https://github.com/context-dot-dev/context-ruby-sdk/commit/57b2d93877e5ceeb388679f239e21c09b087b2a1)) + ## 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) diff --git a/Gemfile.lock b/Gemfile.lock index e4709ebe..423db933 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - context.dev (1.5.0) + context.dev (1.6.0) cgi connection_pool diff --git a/README.md b/README.md index 0eea9ec9..a875fb76 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.5.0" +gem "context.dev", "~> 1.6.0" ``` diff --git a/lib/context_dev/models/web_extract_fonts_response.rb b/lib/context_dev/models/web_extract_fonts_response.rb index 0eb7b990..01465316 100644 --- a/lib/context_dev/models/web_extract_fonts_response.rb +++ b/lib/context_dev/models/web_extract_fonts_response.rb @@ -29,7 +29,20 @@ class WebExtractFontsResponse < ContextDev::Internal::Type::BaseModel # @return [String] required :status, String - # @!method initialize(code:, domain:, fonts:, status:) + # @!attribute font_links + # Font assets keyed by family name as it appears in the fonts array (non-generic + # names only). Clients match entries in fonts to pick a file URL from files. + # Omitted when no families resolve to Google or custom @font-face URLs. + # + # @return [Hash{Symbol=>ContextDev::Models::WebExtractFontsResponse::FontLink}, nil] + optional :font_links, + -> { ContextDev::Internal::Type::HashOf[ContextDev::Models::WebExtractFontsResponse::FontLink] }, + api_name: :fontLinks + + # @!method initialize(code:, domain:, fonts:, status:, font_links: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebExtractFontsResponse} for more details. + # # @param code [Integer] HTTP status code, e.g., 200 # # @param domain [String] The normalized domain that was processed @@ -37,6 +50,8 @@ class WebExtractFontsResponse < ContextDev::Internal::Type::BaseModel # @param fonts [Array] Array of font usage information # # @param status [String] Status of the response, e.g., 'ok' + # + # @param font_links [Hash{Symbol=>ContextDev::Models::WebExtractFontsResponse::FontLink}] Font assets keyed by family name as it appears in the fonts array (non-generic n class Font < ContextDev::Internal::Type::BaseModel # @!attribute fallbacks @@ -96,6 +111,58 @@ class Font < ContextDev::Internal::Type::BaseModel # # @param uses [Array] Array of CSS selectors or element types where this font is used 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::WebExtractFontsResponse::FontLink::Type] + required :type, enum: -> { ContextDev::Models::WebExtractFontsResponse::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::WebExtractFontsResponse::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::WebExtractFontsResponse::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::WebExtractFontsResponse::FontLink#type + module Type + extend ContextDev::Internal::Type::Enum + + GOOGLE = :google + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/context_dev/models/web_web_crawl_md_params.rb b/lib/context_dev/models/web_web_crawl_md_params.rb index 49ea3480..f21f3fe2 100644 --- a/lib/context_dev/models/web_web_crawl_md_params.rb +++ b/lib/context_dev/models/web_web_crawl_md_params.rb @@ -33,6 +33,14 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :include_links, ContextDev::Internal::Type::Boolean, api_name: :includeLinks + # @!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. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + # + # @return [Integer, nil] + optional :max_age_ms, Integer, api_name: :maxAgeMs + # @!attribute max_depth # Maximum link depth from the starting URL (0 = only the starting page) # @@ -64,7 +72,7 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :use_main_content_only, ContextDev::Internal::Type::Boolean, api_name: :useMainContentOnly - # @!method initialize(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: {}) + # @!method initialize(url:, follow_subdomains: nil, include_images: nil, include_links: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, shorten_base64_images: nil, url_regex: nil, use_main_content_only: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebCrawlMdParams} for more details. # @@ -76,6 +84,8 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel # # @param include_links [Boolean] Preserve hyperlinks in the Markdown output # + # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y + # # @param max_depth [Integer] Maximum link depth from the starting URL (0 = only the starting page) # # @param max_pages [Integer] Maximum number of pages to crawl. Hard cap: 500. 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 adfd2848..f6db1719 100644 --- a/lib/context_dev/models/web_web_scrape_sitemap_params.rb +++ b/lib/context_dev/models/web_web_scrape_sitemap_params.rb @@ -20,7 +20,14 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_links, Integer - # @!method initialize(domain:, max_links: nil, request_options: {}) + # @!attribute url_regex + # Optional RE2-compatible regex pattern. Only URLs matching this pattern are + # returned and counted against maxLinks. + # + # @return [String, nil] + optional :url_regex, String + + # @!method initialize(domain:, max_links: nil, url_regex: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeSitemapParams} for more details. # @@ -28,6 +35,8 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi # + # @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index 77f6610b..213403b7 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -105,7 +105,7 @@ def screenshot(params = {}) # Performs a crawl starting from a given URL, extracts page content as Markdown, # 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: {}) + # @overload web_crawl_md(url:, follow_subdomains: nil, include_images: nil, include_links: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, shorten_base64_images: nil, url_regex: nil, use_main_content_only: nil, request_options: {}) # # @param url [String] The starting URL for the crawl (must include http:// or https:// protocol) # @@ -115,6 +115,8 @@ def screenshot(params = {}) # # @param include_links [Boolean] Preserve hyperlinks in the Markdown output # + # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y + # # @param max_depth [Integer] Maximum link depth from the starting URL (0 = only the starting page) # # @param max_pages [Integer] Maximum number of pages to crawl. Hard cap: 500. @@ -241,12 +243,14 @@ def web_scrape_md(params) # # Crawl an entire website's sitemap and return all discovered page URLs. # - # @overload web_scrape_sitemap(domain:, max_links: nil, request_options: {}) + # @overload web_scrape_sitemap(domain:, max_links: nil, url_regex: nil, request_options: {}) # # @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 # + # @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [ContextDev::Models::WebWebScrapeSitemapResponse] @@ -258,7 +262,7 @@ def web_scrape_sitemap(params) @client.request( method: :get, path: "web/scrape/sitemap", - query: query.transform_keys(max_links: "maxLinks"), + query: query.transform_keys(max_links: "maxLinks", url_regex: "urlRegex"), model: ContextDev::Models::WebWebScrapeSitemapResponse, options: options ) diff --git a/lib/context_dev/version.rb b/lib/context_dev/version.rb index 687a8828..cf5ea5c9 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.5.0" + VERSION = "1.6.0" end diff --git a/rbi/context_dev/models/web_extract_fonts_response.rbi b/rbi/context_dev/models/web_extract_fonts_response.rbi index e14bad9b..6d8b0f9a 100644 --- a/rbi/context_dev/models/web_extract_fonts_response.rbi +++ b/rbi/context_dev/models/web_extract_fonts_response.rbi @@ -29,13 +29,44 @@ module ContextDev sig { returns(String) } attr_accessor :status + # Font assets keyed by family name as it appears in the fonts array (non-generic + # names only). Clients match entries in fonts to pick a file URL from files. + # Omitted when no families resolve to Google or custom @font-face URLs. + sig do + returns( + T.nilable( + T::Hash[ + Symbol, + ContextDev::Models::WebExtractFontsResponse::FontLink + ] + ) + ) + end + attr_reader :font_links + + sig do + params( + font_links: + T::Hash[ + Symbol, + ContextDev::Models::WebExtractFontsResponse::FontLink::OrHash + ] + ).void + end + attr_writer :font_links + sig do params( code: Integer, domain: String, fonts: T::Array[ContextDev::Models::WebExtractFontsResponse::Font::OrHash], - status: String + status: String, + font_links: + T::Hash[ + Symbol, + ContextDev::Models::WebExtractFontsResponse::FontLink::OrHash + ] ).returns(T.attached_class) end def self.new( @@ -46,7 +77,11 @@ module ContextDev # Array of font usage information fonts:, # Status of the response, e.g., 'ok' - status: + status:, + # Font assets keyed by family name as it appears in the fonts array (non-generic + # names only). Clients match entries in fonts to pick a file URL from files. + # Omitted when no families resolve to Google or custom @font-face URLs. + font_links: nil ) end @@ -56,7 +91,12 @@ module ContextDev code: Integer, domain: String, fonts: T::Array[ContextDev::Models::WebExtractFontsResponse::Font], - status: String + status: String, + font_links: + T::Hash[ + Symbol, + ContextDev::Models::WebExtractFontsResponse::FontLink + ] } ) end @@ -145,6 +185,117 @@ module ContextDev def to_hash end end + + class FontLink < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::WebExtractFontsResponse::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::WebExtractFontsResponse::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::WebExtractFontsResponse::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::WebExtractFontsResponse::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::WebExtractFontsResponse::FontLink::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GOOGLE = + T.let( + :google, + ContextDev::Models::WebExtractFontsResponse::FontLink::Type::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + ContextDev::Models::WebExtractFontsResponse::FontLink::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::Models::WebExtractFontsResponse::FontLink::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/context_dev/models/web_web_crawl_md_params.rbi b/rbi/context_dev/models/web_web_crawl_md_params.rbi index 4559335d..dd4489d1 100644 --- a/rbi/context_dev/models/web_web_crawl_md_params.rbi +++ b/rbi/context_dev/models/web_web_crawl_md_params.rbi @@ -38,6 +38,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. Max is 30 days (2592000000 ms). 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 + # Maximum link depth from the starting URL (0 = only the starting page) sig { returns(T.nilable(Integer)) } attr_reader :max_depth @@ -80,6 +89,7 @@ module ContextDev follow_subdomains: T::Boolean, include_images: T::Boolean, include_links: T::Boolean, + max_age_ms: Integer, max_depth: Integer, max_pages: Integer, shorten_base64_images: T::Boolean, @@ -99,6 +109,10 @@ module ContextDev include_images: nil, # Preserve hyperlinks in the 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. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + max_age_ms: nil, # Maximum link depth from the starting URL (0 = only the starting page) max_depth: nil, # Maximum number of pages to crawl. Hard cap: 500. @@ -121,6 +135,7 @@ module ContextDev follow_subdomains: T::Boolean, include_images: T::Boolean, include_links: T::Boolean, + max_age_ms: Integer, max_depth: Integer, max_pages: Integer, shorten_base64_images: T::Boolean, 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 c741628b..ad158a45 100644 --- a/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi @@ -26,10 +26,19 @@ module ContextDev sig { params(max_links: Integer).void } attr_writer :max_links + # Optional RE2-compatible regex pattern. Only URLs matching this pattern are + # returned and counted against maxLinks. + sig { returns(T.nilable(String)) } + attr_reader :url_regex + + sig { params(url_regex: String).void } + attr_writer :url_regex + sig do params( domain: String, max_links: Integer, + url_regex: String, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -39,6 +48,9 @@ module ContextDev # Maximum number of links to return from the sitemap crawl. Defaults to 10,000. # Minimum is 1, maximum is 100,000. max_links: nil, + # Optional RE2-compatible regex pattern. Only URLs matching this pattern are + # returned and counted against maxLinks. + url_regex: nil, request_options: {} ) end @@ -48,6 +60,7 @@ module ContextDev { domain: String, max_links: Integer, + url_regex: String, request_options: ContextDev::RequestOptions } ) diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index 96ed71db..243474bb 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -105,6 +105,7 @@ module ContextDev follow_subdomains: T::Boolean, include_images: T::Boolean, include_links: T::Boolean, + max_age_ms: Integer, max_depth: Integer, max_pages: Integer, shorten_base64_images: T::Boolean, @@ -124,6 +125,10 @@ module ContextDev include_images: nil, # Preserve hyperlinks in the 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. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + max_age_ms: nil, # Maximum link depth from the starting URL (0 = only the starting page) max_depth: nil, # Maximum number of pages to crawl. Hard cap: 500. @@ -212,6 +217,7 @@ module ContextDev params( domain: String, max_links: Integer, + url_regex: String, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeSitemapResponse) end @@ -221,6 +227,9 @@ module ContextDev # Maximum number of links to return from the sitemap crawl. Defaults to 10,000. # Minimum is 1, maximum is 100,000. max_links: nil, + # Optional RE2-compatible regex pattern. Only URLs matching this pattern are + # returned and counted against maxLinks. + url_regex: nil, request_options: {} ) end diff --git a/scripts/bootstrap b/scripts/bootstrap index 34878642..a5e1b80a 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd -- "$(dirname -- "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { echo -n "==> Install Homebrew dependencies? (y/N): " read -r response diff --git a/sig/context_dev/models/web_extract_fonts_response.rbs b/sig/context_dev/models/web_extract_fonts_response.rbs index d62b7905..01ba26e1 100644 --- a/sig/context_dev/models/web_extract_fonts_response.rbs +++ b/sig/context_dev/models/web_extract_fonts_response.rbs @@ -5,7 +5,8 @@ module ContextDev code: Integer, domain: String, fonts: ::Array[ContextDev::Models::WebExtractFontsResponse::Font], - status: String + status: String, + font_links: ::Hash[Symbol, ContextDev::Models::WebExtractFontsResponse::FontLink] } class WebExtractFontsResponse < ContextDev::Internal::Type::BaseModel @@ -17,18 +18,26 @@ module ContextDev attr_accessor status: String + attr_reader font_links: ::Hash[Symbol, ContextDev::Models::WebExtractFontsResponse::FontLink]? + + def font_links=: ( + ::Hash[Symbol, ContextDev::Models::WebExtractFontsResponse::FontLink] + ) -> ::Hash[Symbol, ContextDev::Models::WebExtractFontsResponse::FontLink] + def initialize: ( code: Integer, domain: String, fonts: ::Array[ContextDev::Models::WebExtractFontsResponse::Font], - status: String + status: String, + ?font_links: ::Hash[Symbol, ContextDev::Models::WebExtractFontsResponse::FontLink] ) -> void def to_hash: -> { code: Integer, domain: String, fonts: ::Array[ContextDev::Models::WebExtractFontsResponse::Font], - status: String + status: String, + font_links: ::Hash[Symbol, ContextDev::Models::WebExtractFontsResponse::FontLink] } type font = @@ -77,6 +86,53 @@ module ContextDev uses: ::Array[String] } end + + type font_link = + { + files: ::Hash[Symbol, String], + type: ContextDev::Models::WebExtractFontsResponse::FontLink::type_, + category: String, + display_name: String + } + + class FontLink < ContextDev::Internal::Type::BaseModel + attr_accessor files: ::Hash[Symbol, String] + + attr_accessor type: ContextDev::Models::WebExtractFontsResponse::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::WebExtractFontsResponse::FontLink::type_, + ?category: String, + ?display_name: String + ) -> void + + def to_hash: -> { + files: ::Hash[Symbol, String], + type: ContextDev::Models::WebExtractFontsResponse::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::WebExtractFontsResponse::FontLink::type_] + end + end end end end diff --git a/sig/context_dev/models/web_web_crawl_md_params.rbs b/sig/context_dev/models/web_web_crawl_md_params.rbs index 28144efb..258feea1 100644 --- a/sig/context_dev/models/web_web_crawl_md_params.rbs +++ b/sig/context_dev/models/web_web_crawl_md_params.rbs @@ -6,6 +6,7 @@ module ContextDev follow_subdomains: bool, include_images: bool, include_links: bool, + max_age_ms: Integer, max_depth: Integer, max_pages: Integer, :shorten_base64_images => bool, @@ -32,6 +33,10 @@ module ContextDev def include_links=: (bool) -> bool + attr_reader max_age_ms: Integer? + + def max_age_ms=: (Integer) -> Integer + attr_reader max_depth: Integer? def max_depth=: (Integer) -> Integer @@ -57,6 +62,7 @@ module ContextDev ?follow_subdomains: bool, ?include_images: bool, ?include_links: bool, + ?max_age_ms: Integer, ?max_depth: Integer, ?max_pages: Integer, ?shorten_base64_images: bool, @@ -70,6 +76,7 @@ module ContextDev follow_subdomains: bool, include_images: bool, include_links: bool, + max_age_ms: Integer, max_depth: Integer, max_pages: Integer, :shorten_base64_images => bool, diff --git a/sig/context_dev/models/web_web_scrape_sitemap_params.rbs b/sig/context_dev/models/web_web_scrape_sitemap_params.rbs index 4a4a32a7..bc00055c 100644 --- a/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +++ b/sig/context_dev/models/web_web_scrape_sitemap_params.rbs @@ -1,7 +1,7 @@ module ContextDev module Models type web_web_scrape_sitemap_params = - { domain: String, max_links: Integer } + { domain: String, max_links: Integer, url_regex: String } & ContextDev::Internal::Type::request_parameters class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel @@ -14,15 +14,21 @@ module ContextDev def max_links=: (Integer) -> Integer + attr_reader url_regex: String? + + def url_regex=: (String) -> String + def initialize: ( domain: String, ?max_links: Integer, + ?url_regex: String, ?request_options: ContextDev::request_opts ) -> void def to_hash: -> { domain: String, max_links: Integer, + url_regex: String, request_options: ContextDev::RequestOptions } end diff --git a/sig/context_dev/resources/web.rbs b/sig/context_dev/resources/web.rbs index 1854e57d..404f8c78 100644 --- a/sig/context_dev/resources/web.rbs +++ b/sig/context_dev/resources/web.rbs @@ -29,6 +29,7 @@ module ContextDev ?follow_subdomains: bool, ?include_images: bool, ?include_links: bool, + ?max_age_ms: Integer, ?max_depth: Integer, ?max_pages: Integer, ?shorten_base64_images: bool, @@ -61,6 +62,7 @@ module ContextDev def web_scrape_sitemap: ( domain: String, ?max_links: Integer, + ?url_regex: String, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeSitemapResponse diff --git a/test/context_dev/resources/web_test.rb b/test/context_dev/resources/web_test.rb index b0d8c39d..ca30d945 100644 --- a/test/context_dev/resources/web_test.rb +++ b/test/context_dev/resources/web_test.rb @@ -17,7 +17,8 @@ def test_extract_fonts code: Integer, domain: String, fonts: ^(ContextDev::Internal::Type::ArrayOf[ContextDev::Models::WebExtractFontsResponse::Font]), - status: String + status: String, + font_links: ^(ContextDev::Internal::Type::HashOf[ContextDev::Models::WebExtractFontsResponse::FontLink]) | nil } end end