context.dev 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/client.rb +0 -4
  5. data/lib/context_dev/internal/type/base_model.rb +3 -3
  6. data/lib/context_dev/models/brand_identify_from_transaction_params.rb +0 -1
  7. data/lib/context_dev/models/brand_retrieve_by_name_params.rb +5 -5
  8. data/lib/context_dev/models/industry_retrieve_naics_params.rb +4 -4
  9. data/lib/context_dev/models/{style_extract_fonts_params.rb → web_extract_fonts_params.rb} +18 -7
  10. data/lib/context_dev/models/{style_extract_fonts_response.rb → web_extract_fonts_response.rb} +5 -5
  11. data/lib/context_dev/models/{style_extract_styleguide_params.rb → web_extract_styleguide_params.rb} +8 -5
  12. data/lib/context_dev/models/{style_extract_styleguide_response.rb → web_extract_styleguide_response.rb} +147 -80
  13. data/lib/context_dev/models/web_screenshot_params.rb +3 -2
  14. data/lib/context_dev/models/web_web_scrape_html_params.rb +14 -1
  15. data/lib/context_dev/models/web_web_scrape_md_params.rb +13 -3
  16. data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +2 -3
  17. data/lib/context_dev/models.rb +4 -4
  18. data/lib/context_dev/resources/brand.rb +8 -12
  19. data/lib/context_dev/resources/industry.rb +3 -3
  20. data/lib/context_dev/resources/web.rb +80 -18
  21. data/lib/context_dev/version.rb +1 -1
  22. data/lib/context_dev.rb +4 -5
  23. data/rbi/context_dev/client.rbi +0 -3
  24. data/rbi/context_dev/models/brand_identify_from_transaction_params.rbi +0 -2
  25. data/rbi/context_dev/models/brand_retrieve_by_name_params.rbi +6 -6
  26. data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +6 -6
  27. data/rbi/context_dev/models/{style_extract_fonts_params.rbi → web_extract_fonts_params.rbi} +27 -7
  28. data/rbi/context_dev/models/{style_extract_fonts_response.rbi → web_extract_fonts_response.rbi} +6 -9
  29. data/rbi/context_dev/models/{style_extract_styleguide_params.rbi → web_extract_styleguide_params.rbi} +12 -6
  30. data/rbi/context_dev/models/{style_extract_styleguide_response.rbi → web_extract_styleguide_response.rbi} +232 -94
  31. data/rbi/context_dev/models/web_screenshot_params.rbi +6 -4
  32. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +19 -1
  33. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +17 -2
  34. data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +2 -4
  35. data/rbi/context_dev/models.rbi +4 -5
  36. data/rbi/context_dev/resources/brand.rbi +9 -14
  37. data/rbi/context_dev/resources/industry.rbi +4 -4
  38. data/rbi/context_dev/resources/web.rbi +74 -17
  39. data/sig/context_dev/client.rbs +0 -2
  40. data/sig/context_dev/models/{style_extract_styleguide_params.rbs → web_extract_fonts_params.rbs} +2 -2
  41. data/sig/context_dev/models/{style_extract_fonts_response.rbs → web_extract_fonts_response.rbs} +6 -6
  42. data/sig/context_dev/models/{style_extract_fonts_params.rbs → web_extract_styleguide_params.rbs} +13 -5
  43. data/sig/context_dev/models/{style_extract_styleguide_response.rbs → web_extract_styleguide_response.rbs} +147 -95
  44. data/sig/context_dev/models/web_web_scrape_html_params.rbs +8 -1
  45. data/sig/context_dev/models/web_web_scrape_md_params.rbs +7 -0
  46. data/sig/context_dev/models.rbs +4 -4
  47. data/sig/context_dev/resources/web.rbs +16 -0
  48. metadata +14 -17
  49. data/lib/context_dev/resources/style.rb +0 -76
  50. data/rbi/context_dev/resources/style.rbi +0 -60
  51. data/sig/context_dev/resources/style.rbs +0 -20
@@ -83,9 +83,8 @@ module ContextDev
83
83
  # {ContextDev::Models::BrandRetrieveByEmailParams} for more details.
84
84
  #
85
85
  # Retrieve brand information using an email address while detecting disposable and
86
- # free email addresses. This endpoint extracts the domain from the email address
87
- # and returns brand data for that domain. Disposable and free email addresses
88
- # (like gmail.com, yahoo.com) will throw a 422 error.
86
+ # free email addresses. Disposable and free email addresses (like gmail.com,
87
+ # yahoo.com) will throw a 422 error.
89
88
  #
90
89
  # @overload retrieve_by_email(email:, force_language: nil, max_speed: nil, timeout_ms: nil, request_options: {})
91
90
  #
@@ -118,8 +117,7 @@ module ContextDev
118
117
  # {ContextDev::Models::BrandRetrieveByIsinParams} for more details.
119
118
  #
120
119
  # Retrieve brand information using an ISIN (International Securities
121
- # Identification Number). This endpoint looks up the company associated with the
122
- # ISIN and returns its brand data.
120
+ # Identification Number).
123
121
  #
124
122
  # @overload retrieve_by_isin(isin:, force_language: nil, max_speed: nil, timeout_ms: nil, request_options: {})
125
123
  #
@@ -151,14 +149,13 @@ module ContextDev
151
149
  # Some parameter documentations has been truncated, see
152
150
  # {ContextDev::Models::BrandRetrieveByNameParams} for more details.
153
151
  #
154
- # Retrieve brand information using a company name. This endpoint searches for the
155
- # company by name and returns its brand data.
152
+ # Retrieve brand information using a company name.
156
153
  #
157
154
  # @overload retrieve_by_name(name:, country_gl: nil, force_language: nil, max_speed: nil, timeout_ms: nil, request_options: {})
158
155
  #
159
156
  # @param name [String] Company name to retrieve brand data for (e.g., 'Apple Inc', 'Microsoft Corporati
160
157
  #
161
- # @param country_gl [Symbol, ContextDev::Models::BrandRetrieveByNameParams::CountryGl] Optional country code (GL parameter) to specify the country. This affects the ge
158
+ # @param country_gl [Symbol, ContextDev::Models::BrandRetrieveByNameParams::CountryGl] Optional country code hint (GL parameter) to specify the country for the company
162
159
  #
163
160
  # @param force_language [Symbol, ContextDev::Models::BrandRetrieveByNameParams::ForceLanguage] Optional parameter to force the language of the retrieved brand data.
164
161
  #
@@ -186,8 +183,7 @@ module ContextDev
186
183
  # Some parameter documentations has been truncated, see
187
184
  # {ContextDev::Models::BrandRetrieveByTickerParams} for more details.
188
185
  #
189
- # Retrieve brand information using a stock ticker symbol. This endpoint looks up
190
- # the company associated with the ticker and returns its brand data.
186
+ # Retrieve brand information using a stock ticker symbol.
191
187
  #
192
188
  # @overload retrieve_by_ticker(ticker:, force_language: nil, max_speed: nil, ticker_exchange: nil, timeout_ms: nil, request_options: {})
193
189
  #
@@ -222,8 +218,8 @@ module ContextDev
222
218
  # {ContextDev::Models::BrandRetrieveSimplifiedParams} for more details.
223
219
  #
224
220
  # Returns a simplified version of brand data containing only essential
225
- # information: domain, title, colors, logos, and backdrops. This endpoint is
226
- # optimized for faster responses and reduced data transfer.
221
+ # information: domain, title, colors, logos, and backdrops. Optimized for faster
222
+ # responses and reduced data transfer.
227
223
  #
228
224
  # @overload retrieve_simplified(domain:, timeout_ms: nil, request_options: {})
229
225
  #
@@ -6,11 +6,11 @@ module ContextDev
6
6
  # Some parameter documentations has been truncated, see
7
7
  # {ContextDev::Models::IndustryRetrieveNaicsParams} for more details.
8
8
  #
9
- # Endpoint to classify any brand into a 2022 NAICS code.
9
+ # Classify any brand into 2022 NAICS industry codes from its domain or name.
10
10
  #
11
11
  # @overload retrieve_naics(input:, max_results: nil, min_results: nil, timeout_ms: nil, request_options: {})
12
12
  #
13
- # @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided
13
+ # @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided,
14
14
  #
15
15
  # @param max_results [Integer] Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults to 5
16
16
  #
@@ -28,7 +28,7 @@ module ContextDev
28
28
  query = ContextDev::Internal::Util.encode_query_params(parsed)
29
29
  @client.request(
30
30
  method: :get,
31
- path: "brand/naics",
31
+ path: "web/naics",
32
32
  query: query.transform_keys(
33
33
  max_results: "maxResults",
34
34
  min_results: "minResults",
@@ -3,14 +3,72 @@
3
3
  module ContextDev
4
4
  module Resources
5
5
  class Web
6
+ # Some parameter documentations has been truncated, see
7
+ # {ContextDev::Models::WebExtractFontsParams} for more details.
8
+ #
9
+ # Scrape font information from a website including font families, usage
10
+ # statistics, fallbacks, and element/word counts.
11
+ #
12
+ # @overload extract_fonts(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {})
13
+ #
14
+ # @param direct_url [String] A specific URL to fetch fonts from directly, bypassing domain resolution (e.g.,
15
+ #
16
+ # @param domain [String] Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The domai
17
+ #
18
+ # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
19
+ #
20
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
21
+ #
22
+ # @return [ContextDev::Models::WebExtractFontsResponse]
23
+ #
24
+ # @see ContextDev::Models::WebExtractFontsParams
25
+ def extract_fonts(params = {})
26
+ parsed, options = ContextDev::WebExtractFontsParams.dump_request(params)
27
+ query = ContextDev::Internal::Util.encode_query_params(parsed)
28
+ @client.request(
29
+ method: :get,
30
+ path: "web/fonts",
31
+ query: query.transform_keys(direct_url: "directUrl", timeout_ms: "timeoutMS"),
32
+ model: ContextDev::Models::WebExtractFontsResponse,
33
+ options: options
34
+ )
35
+ end
36
+
37
+ # Some parameter documentations has been truncated, see
38
+ # {ContextDev::Models::WebExtractStyleguideParams} for more details.
39
+ #
40
+ # Extract a comprehensive design system from a website including colors,
41
+ # typography, spacing, shadows, and UI components.
42
+ #
43
+ # @overload extract_styleguide(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {})
44
+ #
45
+ # @param direct_url [String] A specific URL to fetch the styleguide from directly, bypassing domain resolutio
46
+ #
47
+ # @param domain [String] Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The
48
+ #
49
+ # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
50
+ #
51
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
52
+ #
53
+ # @return [ContextDev::Models::WebExtractStyleguideResponse]
54
+ #
55
+ # @see ContextDev::Models::WebExtractStyleguideParams
56
+ def extract_styleguide(params = {})
57
+ parsed, options = ContextDev::WebExtractStyleguideParams.dump_request(params)
58
+ query = ContextDev::Internal::Util.encode_query_params(parsed)
59
+ @client.request(
60
+ method: :get,
61
+ path: "web/styleguide",
62
+ query: query.transform_keys(direct_url: "directUrl", timeout_ms: "timeoutMS"),
63
+ model: ContextDev::Models::WebExtractStyleguideResponse,
64
+ options: options
65
+ )
66
+ end
67
+
6
68
  # Some parameter documentations has been truncated, see
7
69
  # {ContextDev::Models::WebScreenshotParams} for more details.
8
70
  #
9
- # Capture a screenshot of a website. Supports both viewport (standard browser
10
- # view) and full-page screenshots. Can also screenshot specific page types (login,
11
- # pricing, etc.) by using heuristics to find the appropriate URL. Either 'domain'
12
- # or 'directUrl' must be provided as a query parameter, but not both. Returns a
13
- # URL to the uploaded screenshot image hosted on our CDN.
71
+ # Capture a screenshot of a website.
14
72
  #
15
73
  # @overload screenshot(direct_url: nil, domain: nil, full_screenshot: nil, page: nil, prioritize: nil, request_options: {})
16
74
  #
@@ -34,7 +92,7 @@ module ContextDev
34
92
  query = ContextDev::Internal::Util.encode_query_params(parsed)
35
93
  @client.request(
36
94
  method: :get,
37
- path: "brand/screenshot",
95
+ path: "web/screenshot",
38
96
  query: query.transform_keys(direct_url: "directUrl", full_screenshot: "fullScreenshot"),
39
97
  model: ContextDev::Models::WebScreenshotResponse,
40
98
  options: options
@@ -45,8 +103,7 @@ module ContextDev
45
103
  # {ContextDev::Models::WebWebCrawlMdParams} for more details.
46
104
  #
47
105
  # Performs a crawl starting from a given URL, extracts page content as Markdown,
48
- # and returns results for all crawled pages. Only follows links within the same
49
- # domain as the starting URL. Costs 1 credit per successful page crawled.
106
+ # and returns results for all crawled pages.
50
107
  #
51
108
  # @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: {})
52
109
  #
@@ -84,12 +141,17 @@ module ContextDev
84
141
  )
85
142
  end
86
143
 
144
+ # Some parameter documentations has been truncated, see
145
+ # {ContextDev::Models::WebWebScrapeHTMLParams} for more details.
146
+ #
87
147
  # Scrapes the given URL and returns the raw HTML content of the page.
88
148
  #
89
- # @overload web_scrape_html(url:, request_options: {})
149
+ # @overload web_scrape_html(url:, max_age_ms: nil, request_options: {})
90
150
  #
91
151
  # @param url [String] Full URL to scrape (must include http:// or https:// protocol)
92
152
  #
153
+ # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
154
+ #
93
155
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
94
156
  #
95
157
  # @return [ContextDev::Models::WebWebScrapeHTMLResponse]
@@ -101,7 +163,7 @@ module ContextDev
101
163
  @client.request(
102
164
  method: :get,
103
165
  path: "web/scrape/html",
104
- query: query,
166
+ query: query.transform_keys(max_age_ms: "maxAgeMs"),
105
167
  model: ContextDev::Models::WebWebScrapeHTMLResponse,
106
168
  options: options
107
169
  )
@@ -135,17 +197,18 @@ module ContextDev
135
197
  # Some parameter documentations has been truncated, see
136
198
  # {ContextDev::Models::WebWebScrapeMdParams} for more details.
137
199
  #
138
- # Scrapes the given URL, converts the HTML content to Markdown, and returns the
139
- # result.
200
+ # Scrapes the given URL into LLM usable Markdown.
140
201
  #
141
- # @overload web_scrape_md(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
202
+ # @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: {})
142
203
  #
143
- # @param url [String] Full URL to scrape and convert to markdown (must include http:// or https:// pro
204
+ # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr
144
205
  #
145
206
  # @param include_images [Boolean] Include image references in Markdown output
146
207
  #
147
208
  # @param include_links [Boolean] Preserve hyperlinks in Markdown output
148
209
  #
210
+ # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
211
+ #
149
212
  # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output
150
213
  #
151
214
  # @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars,
@@ -164,6 +227,7 @@ module ContextDev
164
227
  query: query.transform_keys(
165
228
  include_images: "includeImages",
166
229
  include_links: "includeLinks",
230
+ max_age_ms: "maxAgeMs",
167
231
  shorten_base64_images: "shortenBase64Images",
168
232
  use_main_content_only: "useMainContentOnly"
169
233
  ),
@@ -175,13 +239,11 @@ module ContextDev
175
239
  # Some parameter documentations has been truncated, see
176
240
  # {ContextDev::Models::WebWebScrapeSitemapParams} for more details.
177
241
  #
178
- # Crawls the sitemap of the given domain and returns all discovered page URLs.
179
- # Supports sitemap index files (recursive), parallel fetching with concurrency
180
- # control, deduplication, and filters out non-page resources (images, PDFs, etc.).
242
+ # Crawl an entire website's sitemap and return all discovered page URLs.
181
243
  #
182
244
  # @overload web_scrape_sitemap(domain:, max_links: nil, request_options: {})
183
245
  #
184
- # @param domain [String] Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be auto
246
+ # @param domain [String] Domain to build a sitemap for
185
247
  #
186
248
  # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi
187
249
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContextDev
4
- VERSION = "1.4.0"
4
+ VERSION = "1.5.0"
5
5
  end
data/lib/context_dev.rb CHANGED
@@ -74,14 +74,14 @@ require_relative "context_dev/models/brand_retrieve_simplified_params"
74
74
  require_relative "context_dev/models/brand_retrieve_simplified_response"
75
75
  require_relative "context_dev/models/industry_retrieve_naics_params"
76
76
  require_relative "context_dev/models/industry_retrieve_naics_response"
77
- require_relative "context_dev/models/style_extract_fonts_params"
78
- require_relative "context_dev/models/style_extract_fonts_response"
79
- require_relative "context_dev/models/style_extract_styleguide_params"
80
- require_relative "context_dev/models/style_extract_styleguide_response"
81
77
  require_relative "context_dev/models/utility_prefetch_by_email_params"
82
78
  require_relative "context_dev/models/utility_prefetch_by_email_response"
83
79
  require_relative "context_dev/models/utility_prefetch_params"
84
80
  require_relative "context_dev/models/utility_prefetch_response"
81
+ require_relative "context_dev/models/web_extract_fonts_params"
82
+ require_relative "context_dev/models/web_extract_fonts_response"
83
+ require_relative "context_dev/models/web_extract_styleguide_params"
84
+ require_relative "context_dev/models/web_extract_styleguide_response"
85
85
  require_relative "context_dev/models/web_screenshot_params"
86
86
  require_relative "context_dev/models/web_screenshot_response"
87
87
  require_relative "context_dev/models/web_web_crawl_md_params"
@@ -98,6 +98,5 @@ require_relative "context_dev/models"
98
98
  require_relative "context_dev/resources/ai"
99
99
  require_relative "context_dev/resources/brand"
100
100
  require_relative "context_dev/resources/industry"
101
- require_relative "context_dev/resources/style"
102
101
  require_relative "context_dev/resources/utility"
103
102
  require_relative "context_dev/resources/web"
@@ -19,9 +19,6 @@ module ContextDev
19
19
  sig { returns(ContextDev::Resources::AI) }
20
20
  attr_reader :ai
21
21
 
22
- sig { returns(ContextDev::Resources::Style) }
23
- attr_reader :style
24
-
25
22
  sig { returns(ContextDev::Resources::Brand) }
26
23
  attr_reader :brand
27
24
 
@@ -64,7 +64,6 @@ module ContextDev
64
64
 
65
65
  # When set to true, the API will perform an additional verification steps to
66
66
  # ensure the identified brand matches the transaction with high confidence.
67
- # Defaults to false.
68
67
  sig { returns(T.nilable(T::Boolean)) }
69
68
  attr_reader :high_confidence_only
70
69
 
@@ -132,7 +131,6 @@ module ContextDev
132
131
  force_language: nil,
133
132
  # When set to true, the API will perform an additional verification steps to
134
133
  # ensure the identified brand matches the transaction with high confidence.
135
- # Defaults to false.
136
134
  high_confidence_only: nil,
137
135
  # Optional parameter to optimize the API call for maximum speed. When set to true,
138
136
  # the API will skip time-consuming operations for faster response at the cost of
@@ -19,8 +19,8 @@ module ContextDev
19
19
  sig { returns(String) }
20
20
  attr_accessor :name
21
21
 
22
- # Optional country code (GL parameter) to specify the country. This affects the
23
- # geographic location used for search queries.
22
+ # Optional country code hint (GL parameter) to specify the country for the company
23
+ # name.
24
24
  sig do
25
25
  returns(
26
26
  T.nilable(ContextDev::BrandRetrieveByNameParams::CountryGl::OrSymbol)
@@ -87,8 +87,8 @@ module ContextDev
87
87
  # Company name to retrieve brand data for (e.g., 'Apple Inc', 'Microsoft
88
88
  # Corporation'). Must be 3-30 characters.
89
89
  name:,
90
- # Optional country code (GL parameter) to specify the country. This affects the
91
- # geographic location used for search queries.
90
+ # Optional country code hint (GL parameter) to specify the country for the company
91
+ # name.
92
92
  country_gl: nil,
93
93
  # Optional parameter to force the language of the retrieved brand data.
94
94
  force_language: nil,
@@ -121,8 +121,8 @@ module ContextDev
121
121
  def to_hash
122
122
  end
123
123
 
124
- # Optional country code (GL parameter) to specify the country. This affects the
125
- # geographic location used for search queries.
124
+ # Optional country code hint (GL parameter) to specify the country for the company
125
+ # name.
126
126
  module CountryGl
127
127
  extend ContextDev::Internal::Type::Enum
128
128
 
@@ -14,9 +14,9 @@ module ContextDev
14
14
  )
15
15
  end
16
16
 
17
- # Brand domain or title to retrieve NAICS code for. If a valid domain is provided
18
- # in `input`, it will be used for classification, otherwise, we will search for
19
- # the brand using the provided title.
17
+ # Brand domain or title to retrieve NAICS code for. If a valid domain is provided,
18
+ # it will be used for classification, otherwise, we will search for the brand
19
+ # using the provided title.
20
20
  sig { returns(String) }
21
21
  attr_accessor :input
22
22
 
@@ -54,9 +54,9 @@ module ContextDev
54
54
  ).returns(T.attached_class)
55
55
  end
56
56
  def self.new(
57
- # Brand domain or title to retrieve NAICS code for. If a valid domain is provided
58
- # in `input`, it will be used for classification, otherwise, we will search for
59
- # the brand using the provided title.
57
+ # Brand domain or title to retrieve NAICS code for. If a valid domain is provided,
58
+ # it will be used for classification, otherwise, we will search for the brand
59
+ # using the provided title.
60
60
  input:,
61
61
  # Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults
62
62
  # to 5.
@@ -2,22 +2,35 @@
2
2
 
3
3
  module ContextDev
4
4
  module Models
5
- class StyleExtractFontsParams < ContextDev::Internal::Type::BaseModel
5
+ class WebExtractFontsParams < ContextDev::Internal::Type::BaseModel
6
6
  extend ContextDev::Internal::Type::RequestParameters::Converter
7
7
  include ContextDev::Internal::Type::RequestParameters
8
8
 
9
9
  OrHash =
10
10
  T.type_alias do
11
11
  T.any(
12
- ContextDev::StyleExtractFontsParams,
12
+ ContextDev::WebExtractFontsParams,
13
13
  ContextDev::Internal::AnyHash
14
14
  )
15
15
  end
16
16
 
17
+ # A specific URL to fetch fonts from directly, bypassing domain resolution (e.g.,
18
+ # 'https://example.com/design-system'). When provided, fonts are extracted from
19
+ # this exact URL. You must provide either 'domain' or 'directUrl', but not both.
20
+ sig { returns(T.nilable(String)) }
21
+ attr_reader :direct_url
22
+
23
+ sig { params(direct_url: String).void }
24
+ attr_writer :direct_url
25
+
17
26
  # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The
18
- # domain will be automatically normalized and validated.
19
- sig { returns(String) }
20
- attr_accessor :domain
27
+ # domain will be automatically normalized and validated. You must provide either
28
+ # 'domain' or 'directUrl', but not both.
29
+ sig { returns(T.nilable(String)) }
30
+ attr_reader :domain
31
+
32
+ sig { params(domain: String).void }
33
+ attr_writer :domain
21
34
 
22
35
  # Optional timeout in milliseconds for the request. If the request takes longer
23
36
  # than this value, it will be aborted with a 408 status code. Maximum allowed
@@ -30,15 +43,21 @@ module ContextDev
30
43
 
31
44
  sig do
32
45
  params(
46
+ direct_url: String,
33
47
  domain: String,
34
48
  timeout_ms: Integer,
35
49
  request_options: ContextDev::RequestOptions::OrHash
36
50
  ).returns(T.attached_class)
37
51
  end
38
52
  def self.new(
53
+ # A specific URL to fetch fonts from directly, bypassing domain resolution (e.g.,
54
+ # 'https://example.com/design-system'). When provided, fonts are extracted from
55
+ # this exact URL. You must provide either 'domain' or 'directUrl', but not both.
56
+ direct_url: nil,
39
57
  # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The
40
- # domain will be automatically normalized and validated.
41
- domain:,
58
+ # domain will be automatically normalized and validated. You must provide either
59
+ # 'domain' or 'directUrl', but not both.
60
+ domain: nil,
42
61
  # Optional timeout in milliseconds for the request. If the request takes longer
43
62
  # than this value, it will be aborted with a 408 status code. Maximum allowed
44
63
  # value is 300000ms (5 minutes).
@@ -50,6 +69,7 @@ module ContextDev
50
69
  sig do
51
70
  override.returns(
52
71
  {
72
+ direct_url: String,
53
73
  domain: String,
54
74
  timeout_ms: Integer,
55
75
  request_options: ContextDev::RequestOptions
@@ -2,11 +2,11 @@
2
2
 
3
3
  module ContextDev
4
4
  module Models
5
- class StyleExtractFontsResponse < ContextDev::Internal::Type::BaseModel
5
+ class WebExtractFontsResponse < ContextDev::Internal::Type::BaseModel
6
6
  OrHash =
7
7
  T.type_alias do
8
8
  T.any(
9
- ContextDev::Models::StyleExtractFontsResponse,
9
+ ContextDev::Models::WebExtractFontsResponse,
10
10
  ContextDev::Internal::AnyHash
11
11
  )
12
12
  end
@@ -21,7 +21,7 @@ module ContextDev
21
21
 
22
22
  # Array of font usage information
23
23
  sig do
24
- returns(T::Array[ContextDev::Models::StyleExtractFontsResponse::Font])
24
+ returns(T::Array[ContextDev::Models::WebExtractFontsResponse::Font])
25
25
  end
26
26
  attr_accessor :fonts
27
27
 
@@ -34,9 +34,7 @@ module ContextDev
34
34
  code: Integer,
35
35
  domain: String,
36
36
  fonts:
37
- T::Array[
38
- ContextDev::Models::StyleExtractFontsResponse::Font::OrHash
39
- ],
37
+ T::Array[ContextDev::Models::WebExtractFontsResponse::Font::OrHash],
40
38
  status: String
41
39
  ).returns(T.attached_class)
42
40
  end
@@ -57,8 +55,7 @@ module ContextDev
57
55
  {
58
56
  code: Integer,
59
57
  domain: String,
60
- fonts:
61
- T::Array[ContextDev::Models::StyleExtractFontsResponse::Font],
58
+ fonts: T::Array[ContextDev::Models::WebExtractFontsResponse::Font],
62
59
  status: String
63
60
  }
64
61
  )
@@ -70,7 +67,7 @@ module ContextDev
70
67
  OrHash =
71
68
  T.type_alias do
72
69
  T.any(
73
- ContextDev::Models::StyleExtractFontsResponse::Font,
70
+ ContextDev::Models::WebExtractFontsResponse::Font,
74
71
  ContextDev::Internal::AnyHash
75
72
  )
76
73
  end
@@ -2,20 +2,22 @@
2
2
 
3
3
  module ContextDev
4
4
  module Models
5
- class StyleExtractStyleguideParams < ContextDev::Internal::Type::BaseModel
5
+ class WebExtractStyleguideParams < ContextDev::Internal::Type::BaseModel
6
6
  extend ContextDev::Internal::Type::RequestParameters::Converter
7
7
  include ContextDev::Internal::Type::RequestParameters
8
8
 
9
9
  OrHash =
10
10
  T.type_alias do
11
11
  T.any(
12
- ContextDev::StyleExtractStyleguideParams,
12
+ ContextDev::WebExtractStyleguideParams,
13
13
  ContextDev::Internal::AnyHash
14
14
  )
15
15
  end
16
16
 
17
17
  # A specific URL to fetch the styleguide from directly, bypassing domain
18
- # resolution (e.g., 'https://example.com/design-system').
18
+ # resolution (e.g., 'https://example.com/design-system'). When provided, the
19
+ # styleguide is extracted from this exact URL. You must provide either 'domain' or
20
+ # 'directUrl', but not both.
19
21
  sig { returns(T.nilable(String)) }
20
22
  attr_reader :direct_url
21
23
 
@@ -23,7 +25,8 @@ module ContextDev
23
25
  attr_writer :direct_url
24
26
 
25
27
  # Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The
26
- # domain will be automatically normalized and validated.
28
+ # domain will be automatically normalized and validated. You must provide either
29
+ # 'domain' or 'directUrl', but not both.
27
30
  sig { returns(T.nilable(String)) }
28
31
  attr_reader :domain
29
32
 
@@ -49,10 +52,13 @@ module ContextDev
49
52
  end
50
53
  def self.new(
51
54
  # A specific URL to fetch the styleguide from directly, bypassing domain
52
- # resolution (e.g., 'https://example.com/design-system').
55
+ # resolution (e.g., 'https://example.com/design-system'). When provided, the
56
+ # styleguide is extracted from this exact URL. You must provide either 'domain' or
57
+ # 'directUrl', but not both.
53
58
  direct_url: nil,
54
59
  # Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The
55
- # domain will be automatically normalized and validated.
60
+ # domain will be automatically normalized and validated. You must provide either
61
+ # 'domain' or 'directUrl', but not both.
56
62
  domain: nil,
57
63
  # Optional timeout in milliseconds for the request. If the request takes longer
58
64
  # than this value, it will be aborted with a 408 status code. Maximum allowed