context.dev 1.4.0 → 1.6.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +37 -0
- data/README.md +1 -1
- data/lib/context_dev/client.rb +0 -4
- data/lib/context_dev/internal/type/base_model.rb +3 -3
- data/lib/context_dev/models/brand_identify_from_transaction_params.rb +0 -1
- data/lib/context_dev/models/brand_retrieve_by_name_params.rb +5 -5
- data/lib/context_dev/models/industry_retrieve_naics_params.rb +4 -4
- data/lib/context_dev/models/{style_extract_fonts_params.rb → web_extract_fonts_params.rb} +18 -7
- data/lib/context_dev/models/web_extract_fonts_response.rb +168 -0
- data/lib/context_dev/models/{style_extract_styleguide_params.rb → web_extract_styleguide_params.rb} +8 -5
- data/lib/context_dev/models/{style_extract_styleguide_response.rb → web_extract_styleguide_response.rb} +147 -80
- data/lib/context_dev/models/web_screenshot_params.rb +3 -2
- data/lib/context_dev/models/web_web_crawl_md_params.rb +11 -1
- data/lib/context_dev/models/web_web_scrape_html_params.rb +14 -1
- data/lib/context_dev/models/web_web_scrape_md_params.rb +13 -3
- data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +12 -4
- data/lib/context_dev/models.rb +4 -4
- data/lib/context_dev/resources/brand.rb +8 -12
- data/lib/context_dev/resources/industry.rb +3 -3
- data/lib/context_dev/resources/web.rb +87 -21
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +4 -5
- data/rbi/context_dev/client.rbi +0 -3
- data/rbi/context_dev/models/brand_identify_from_transaction_params.rbi +0 -2
- data/rbi/context_dev/models/brand_retrieve_by_name_params.rbi +6 -6
- data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +6 -6
- data/rbi/context_dev/models/{style_extract_fonts_params.rbi → web_extract_fonts_params.rbi} +27 -7
- data/rbi/context_dev/models/web_extract_fonts_response.rbi +301 -0
- data/rbi/context_dev/models/{style_extract_styleguide_params.rbi → web_extract_styleguide_params.rbi} +12 -6
- data/rbi/context_dev/models/{style_extract_styleguide_response.rbi → web_extract_styleguide_response.rbi} +232 -94
- data/rbi/context_dev/models/web_screenshot_params.rbi +6 -4
- data/rbi/context_dev/models/web_web_crawl_md_params.rbi +15 -0
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +19 -1
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +17 -2
- data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +15 -4
- data/rbi/context_dev/models.rbi +4 -5
- data/rbi/context_dev/resources/brand.rbi +9 -14
- data/rbi/context_dev/resources/industry.rbi +4 -4
- data/rbi/context_dev/resources/web.rbi +83 -17
- data/sig/context_dev/client.rbs +0 -2
- data/sig/context_dev/models/{style_extract_styleguide_params.rbs → web_extract_fonts_params.rbs} +2 -2
- data/sig/context_dev/models/web_extract_fonts_response.rbs +138 -0
- data/sig/context_dev/models/{style_extract_fonts_params.rbs → web_extract_styleguide_params.rbs} +13 -5
- data/sig/context_dev/models/{style_extract_styleguide_response.rbs → web_extract_styleguide_response.rbs} +147 -95
- data/sig/context_dev/models/web_web_crawl_md_params.rbs +7 -0
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +8 -1
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +7 -0
- data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +7 -1
- data/sig/context_dev/models.rbs +4 -4
- data/sig/context_dev/resources/web.rbs +18 -0
- metadata +14 -17
- data/lib/context_dev/models/style_extract_fonts_response.rb +0 -101
- data/lib/context_dev/resources/style.rb +0 -76
- data/rbi/context_dev/models/style_extract_fonts_response.rbi +0 -153
- data/rbi/context_dev/resources/style.rbi +0 -60
- data/sig/context_dev/models/style_extract_fonts_response.rbs +0 -82
- 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.
|
|
87
|
-
#
|
|
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).
|
|
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.
|
|
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
|
|
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.
|
|
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.
|
|
226
|
-
#
|
|
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
|
-
#
|
|
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: "
|
|
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.
|
|
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: "
|
|
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,10 +103,9 @@ 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.
|
|
49
|
-
# domain as the starting URL. Costs 1 credit per successful page crawled.
|
|
106
|
+
# and returns results for all crawled pages.
|
|
50
107
|
#
|
|
51
|
-
# @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: {})
|
|
108
|
+
# @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: {})
|
|
52
109
|
#
|
|
53
110
|
# @param url [String] The starting URL for the crawl (must include http:// or https:// protocol)
|
|
54
111
|
#
|
|
@@ -58,6 +115,8 @@ module ContextDev
|
|
|
58
115
|
#
|
|
59
116
|
# @param include_links [Boolean] Preserve hyperlinks in the Markdown output
|
|
60
117
|
#
|
|
118
|
+
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
|
|
119
|
+
#
|
|
61
120
|
# @param max_depth [Integer] Maximum link depth from the starting URL (0 = only the starting page)
|
|
62
121
|
#
|
|
63
122
|
# @param max_pages [Integer] Maximum number of pages to crawl. Hard cap: 500.
|
|
@@ -84,12 +143,17 @@ module ContextDev
|
|
|
84
143
|
)
|
|
85
144
|
end
|
|
86
145
|
|
|
146
|
+
# Some parameter documentations has been truncated, see
|
|
147
|
+
# {ContextDev::Models::WebWebScrapeHTMLParams} for more details.
|
|
148
|
+
#
|
|
87
149
|
# Scrapes the given URL and returns the raw HTML content of the page.
|
|
88
150
|
#
|
|
89
|
-
# @overload web_scrape_html(url:, request_options: {})
|
|
151
|
+
# @overload web_scrape_html(url:, max_age_ms: nil, request_options: {})
|
|
90
152
|
#
|
|
91
153
|
# @param url [String] Full URL to scrape (must include http:// or https:// protocol)
|
|
92
154
|
#
|
|
155
|
+
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
|
|
156
|
+
#
|
|
93
157
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
94
158
|
#
|
|
95
159
|
# @return [ContextDev::Models::WebWebScrapeHTMLResponse]
|
|
@@ -101,7 +165,7 @@ module ContextDev
|
|
|
101
165
|
@client.request(
|
|
102
166
|
method: :get,
|
|
103
167
|
path: "web/scrape/html",
|
|
104
|
-
query: query,
|
|
168
|
+
query: query.transform_keys(max_age_ms: "maxAgeMs"),
|
|
105
169
|
model: ContextDev::Models::WebWebScrapeHTMLResponse,
|
|
106
170
|
options: options
|
|
107
171
|
)
|
|
@@ -135,17 +199,18 @@ module ContextDev
|
|
|
135
199
|
# Some parameter documentations has been truncated, see
|
|
136
200
|
# {ContextDev::Models::WebWebScrapeMdParams} for more details.
|
|
137
201
|
#
|
|
138
|
-
# Scrapes the given URL
|
|
139
|
-
# result.
|
|
202
|
+
# Scrapes the given URL into LLM usable Markdown.
|
|
140
203
|
#
|
|
141
|
-
# @overload web_scrape_md(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
|
|
204
|
+
# @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
205
|
#
|
|
143
|
-
# @param url [String] Full URL to scrape
|
|
206
|
+
# @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr
|
|
144
207
|
#
|
|
145
208
|
# @param include_images [Boolean] Include image references in Markdown output
|
|
146
209
|
#
|
|
147
210
|
# @param include_links [Boolean] Preserve hyperlinks in Markdown output
|
|
148
211
|
#
|
|
212
|
+
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
|
|
213
|
+
#
|
|
149
214
|
# @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output
|
|
150
215
|
#
|
|
151
216
|
# @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars,
|
|
@@ -164,6 +229,7 @@ module ContextDev
|
|
|
164
229
|
query: query.transform_keys(
|
|
165
230
|
include_images: "includeImages",
|
|
166
231
|
include_links: "includeLinks",
|
|
232
|
+
max_age_ms: "maxAgeMs",
|
|
167
233
|
shorten_base64_images: "shortenBase64Images",
|
|
168
234
|
use_main_content_only: "useMainContentOnly"
|
|
169
235
|
),
|
|
@@ -175,16 +241,16 @@ module ContextDev
|
|
|
175
241
|
# Some parameter documentations has been truncated, see
|
|
176
242
|
# {ContextDev::Models::WebWebScrapeSitemapParams} for more details.
|
|
177
243
|
#
|
|
178
|
-
#
|
|
179
|
-
# Supports sitemap index files (recursive), parallel fetching with concurrency
|
|
180
|
-
# control, deduplication, and filters out non-page resources (images, PDFs, etc.).
|
|
244
|
+
# Crawl an entire website's sitemap and return all discovered page URLs.
|
|
181
245
|
#
|
|
182
|
-
# @overload web_scrape_sitemap(domain:, max_links: nil, request_options: {})
|
|
246
|
+
# @overload web_scrape_sitemap(domain:, max_links: nil, url_regex: nil, request_options: {})
|
|
183
247
|
#
|
|
184
|
-
# @param domain [String] Domain
|
|
248
|
+
# @param domain [String] Domain to build a sitemap for
|
|
185
249
|
#
|
|
186
250
|
# @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi
|
|
187
251
|
#
|
|
252
|
+
# @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur
|
|
253
|
+
#
|
|
188
254
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
189
255
|
#
|
|
190
256
|
# @return [ContextDev::Models::WebWebScrapeSitemapResponse]
|
|
@@ -196,7 +262,7 @@ module ContextDev
|
|
|
196
262
|
@client.request(
|
|
197
263
|
method: :get,
|
|
198
264
|
path: "web/scrape/sitemap",
|
|
199
|
-
query: query.transform_keys(max_links: "maxLinks"),
|
|
265
|
+
query: query.transform_keys(max_links: "maxLinks", url_regex: "urlRegex"),
|
|
200
266
|
model: ContextDev::Models::WebWebScrapeSitemapResponse,
|
|
201
267
|
options: options
|
|
202
268
|
)
|
data/lib/context_dev/version.rb
CHANGED
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"
|
data/rbi/context_dev/client.rbi
CHANGED
|
@@ -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
|
|
23
|
-
#
|
|
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
|
|
91
|
-
#
|
|
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
|
|
125
|
-
#
|
|
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
|
-
#
|
|
19
|
-
#
|
|
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
|
-
#
|
|
59
|
-
#
|
|
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
|
|
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::
|
|
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
|
-
|
|
20
|
-
|
|
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
|