context.dev 2.17.0 → 2.18.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 (90) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/models/ai_extract_product_params.rb +28 -1
  5. data/lib/context_dev/models/ai_extract_product_response.rb +51 -1
  6. data/lib/context_dev/models/ai_extract_products_response.rb +51 -1
  7. data/lib/context_dev/models/brand_retrieve_response.rb +65 -65
  8. data/lib/context_dev/models/brand_retrieve_simplified_response.rb +66 -66
  9. data/lib/context_dev/models/industry_retrieve_naics_params.rb +28 -1
  10. data/lib/context_dev/models/industry_retrieve_sic_params.rb +28 -1
  11. data/lib/context_dev/models/parse_handle_params.rb +8 -6
  12. data/lib/context_dev/models/person_enrich_params.rb +28 -1
  13. data/lib/context_dev/models/web_answers_params.rb +28 -1
  14. data/lib/context_dev/models/web_extract_competitors_params.rb +28 -1
  15. data/lib/context_dev/models/web_extract_fonts_params.rb +2 -2
  16. data/lib/context_dev/models/web_extract_params.rb +28 -1
  17. data/lib/context_dev/models/web_extract_styleguide_params.rb +30 -3
  18. data/lib/context_dev/models/web_screenshot_params.rb +10 -8
  19. data/lib/context_dev/models/web_search_params.rb +30 -3
  20. data/lib/context_dev/models/web_search_response.rb +6 -2
  21. data/lib/context_dev/models/web_web_scrape_bytes_params.rb +8 -6
  22. data/lib/context_dev/models/web_web_scrape_html_params.rb +188 -9
  23. data/lib/context_dev/models/web_web_scrape_html_response.rb +41 -1
  24. data/lib/context_dev/models/web_web_scrape_images_params.rb +31 -4
  25. data/lib/context_dev/models/web_web_scrape_md_params.rb +10 -8
  26. data/lib/context_dev/models/web_web_scrape_screenshot_params.rb +471 -0
  27. data/lib/context_dev/models/web_web_scrape_screenshot_response.rb +169 -0
  28. data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +8 -6
  29. data/lib/context_dev/models.rb +2 -0
  30. data/lib/context_dev/resources/ai.rb +3 -1
  31. data/lib/context_dev/resources/industry.rb +6 -2
  32. data/lib/context_dev/resources/people.rb +3 -1
  33. data/lib/context_dev/resources/web.rb +96 -13
  34. data/lib/context_dev/version.rb +1 -1
  35. data/lib/context_dev.rb +2 -0
  36. data/rbi/context_dev/models/ai_extract_product_params.rbi +54 -0
  37. data/rbi/context_dev/models/ai_extract_product_response.rbi +98 -3
  38. data/rbi/context_dev/models/ai_extract_products_response.rbi +98 -3
  39. data/rbi/context_dev/models/brand_retrieve_response.rbi +128 -136
  40. data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +132 -140
  41. data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +59 -0
  42. data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +57 -0
  43. data/rbi/context_dev/models/parse_handle_params.rbi +12 -9
  44. data/rbi/context_dev/models/person_enrich_params.rbi +45 -0
  45. data/rbi/context_dev/models/web_answers_params.rbi +45 -0
  46. data/rbi/context_dev/models/web_extract_competitors_params.rbi +59 -0
  47. data/rbi/context_dev/models/web_extract_fonts_params.rbi +3 -3
  48. data/rbi/context_dev/models/web_extract_params.rbi +45 -0
  49. data/rbi/context_dev/models/web_extract_styleguide_params.rbi +62 -3
  50. data/rbi/context_dev/models/web_screenshot_params.rbi +15 -12
  51. data/rbi/context_dev/models/web_search_params.rbi +48 -3
  52. data/rbi/context_dev/models/web_search_response.rbi +4 -2
  53. data/rbi/context_dev/models/web_web_scrape_bytes_params.rbi +12 -9
  54. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +485 -12
  55. data/rbi/context_dev/models/web_web_scrape_html_response.rbi +103 -0
  56. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +62 -5
  57. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +15 -12
  58. data/rbi/context_dev/models/web_web_scrape_screenshot_params.rbi +1580 -0
  59. data/rbi/context_dev/models/web_web_scrape_screenshot_response.rbi +332 -0
  60. data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +12 -9
  61. data/rbi/context_dev/models.rbi +3 -0
  62. data/rbi/context_dev/resources/ai.rbi +7 -0
  63. data/rbi/context_dev/resources/industry.rbi +14 -0
  64. data/rbi/context_dev/resources/parse.rbi +4 -4
  65. data/rbi/context_dev/resources/people.rbi +7 -0
  66. data/rbi/context_dev/resources/web.rbi +173 -21
  67. data/sig/context_dev/models/ai_extract_product_params.rbs +21 -1
  68. data/sig/context_dev/models/ai_extract_product_response.rbs +44 -3
  69. data/sig/context_dev/models/ai_extract_products_response.rbs +44 -3
  70. data/sig/context_dev/models/brand_retrieve_response.rbs +51 -59
  71. data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +51 -59
  72. data/sig/context_dev/models/industry_retrieve_naics_params.rbs +21 -1
  73. data/sig/context_dev/models/industry_retrieve_sic_params.rbs +21 -1
  74. data/sig/context_dev/models/person_enrich_params.rbs +21 -1
  75. data/sig/context_dev/models/web_answers_params.rbs +21 -1
  76. data/sig/context_dev/models/web_extract_competitors_params.rbs +21 -1
  77. data/sig/context_dev/models/web_extract_params.rbs +21 -1
  78. data/sig/context_dev/models/web_extract_styleguide_params.rbs +21 -1
  79. data/sig/context_dev/models/web_search_params.rbs +21 -1
  80. data/sig/context_dev/models/web_web_scrape_html_params.rbs +148 -0
  81. data/sig/context_dev/models/web_web_scrape_html_response.rbs +30 -0
  82. data/sig/context_dev/models/web_web_scrape_images_params.rbs +21 -1
  83. data/sig/context_dev/models/web_web_scrape_screenshot_params.rbs +619 -0
  84. data/sig/context_dev/models/web_web_scrape_screenshot_response.rbs +127 -0
  85. data/sig/context_dev/models.rbs +2 -0
  86. data/sig/context_dev/resources/ai.rbs +1 -0
  87. data/sig/context_dev/resources/industry.rbs +2 -0
  88. data/sig/context_dev/resources/people.rbs +1 -0
  89. data/sig/context_dev/resources/web.rbs +24 -0
  90. metadata +8 -2
@@ -8,7 +8,7 @@ module ContextDev
8
8
  #
9
9
  # Classify any brand into 2022 NAICS industry codes from its domain or name.
10
10
  #
11
- # @overload retrieve_naics(input:, max_results: nil, min_results: nil, tags: nil, timeout_opts: nil, request_options: {})
11
+ # @overload retrieve_naics(input:, max_results: nil, min_results: nil, tags: nil, timeout_opts: nil, zdr: nil, request_options: {})
12
12
  #
13
13
  # @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided,
14
14
  #
@@ -20,6 +20,8 @@ module ContextDev
20
20
  #
21
21
  # @param timeout_opts [ContextDev::Models::IndustryRetrieveNaicsParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
22
22
  #
23
+ # @param zdr [Symbol, ContextDev::Models::IndustryRetrieveNaicsParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
24
+ #
23
25
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
24
26
  #
25
27
  # @return [ContextDev::Models::IndustryRetrieveNaicsResponse]
@@ -48,7 +50,7 @@ module ContextDev
48
50
  # domain or name. Choose between the original SIC system (`original_sic`) or the
49
51
  # latest SIC list maintained by the SEC (`latest_sec`).
50
52
  #
51
- # @overload retrieve_sic(input:, max_results: nil, min_results: nil, tags: nil, timeout_opts: nil, type: nil, request_options: {})
53
+ # @overload retrieve_sic(input:, max_results: nil, min_results: nil, tags: nil, timeout_opts: nil, type: nil, zdr: nil, request_options: {})
52
54
  #
53
55
  # @param input [String] Brand domain or title to retrieve SIC code for. If a valid domain is provided, i
54
56
  #
@@ -62,6 +64,8 @@ module ContextDev
62
64
  #
63
65
  # @param type [Symbol, ContextDev::Models::IndustryRetrieveSicParams::Type] Which SIC dataset to classify against. `original_sic` uses the 1987 Standard Ind
64
66
  #
67
+ # @param zdr [Symbol, ContextDev::Models::IndustryRetrieveSicParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
68
+ #
65
69
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
66
70
  #
67
71
  # @return [ContextDev::Models::IndustryRetrieveSicResponse]
@@ -11,7 +11,7 @@ module ContextDev
11
11
  # plans. Successful requests cost 20 credits. Disposable and free email addresses
12
12
  # (like gmail.com, yahoo.com) will throw a 422 error.
13
13
  #
14
- # @overload enrich(company: nil, education: nil, email: nil, location: nil, name: nil, social_urls: nil, tags: nil, timeout_opts: nil, request_options: {})
14
+ # @overload enrich(company: nil, education: nil, email: nil, location: nil, name: nil, social_urls: nil, tags: nil, timeout_opts: nil, zdr: nil, request_options: {})
15
15
  #
16
16
  # @param company [ContextDev::Models::PersonEnrichParams::Company]
17
17
  #
@@ -29,6 +29,8 @@ module ContextDev
29
29
  #
30
30
  # @param timeout_opts [ContextDev::Models::PersonEnrichParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
31
31
  #
32
+ # @param zdr [Symbol, ContextDev::Models::PersonEnrichParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
33
+ #
32
34
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
33
35
  #
34
36
  # @return [ContextDev::Models::PersonEnrichResponse]
@@ -12,7 +12,7 @@ module ContextDev
12
12
  # 30 seconds and ultra to 50 seconds; timeoutOpts.milliseconds can shorten either
13
13
  # deadline.
14
14
  #
15
- # @overload answers(task:, json_format: nil, mode: nil, tags: nil, timeout_opts: nil, request_options: {})
15
+ # @overload answers(task:, json_format: nil, mode: nil, tags: nil, timeout_opts: nil, zdr: nil, request_options: {})
16
16
  #
17
17
  # @param task [String] What to research and answer, in plain language. Naming a domain in the task (for
18
18
  #
@@ -24,6 +24,8 @@ module ContextDev
24
24
  #
25
25
  # @param timeout_opts [ContextDev::Models::WebAnswersParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
26
26
  #
27
+ # @param zdr [Symbol, ContextDev::Models::WebAnswersParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
28
+ #
27
29
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
28
30
  #
29
31
  # @return [ContextDev::Models::WebAnswersResponse]
@@ -46,7 +48,7 @@ module ContextDev
46
48
  # Crawl a website, use the provided JSON Schema and instructions to prioritize
47
49
  # relevant internal links, and extract structured data from the selected pages.
48
50
  #
49
- # @overload extract(schema:, url:, actions: nil, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, stop_after_ms: nil, tags: nil, timeout_opts: nil, wait_for_ms: nil, request_options: {})
51
+ # @overload extract(schema:, url:, actions: nil, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, stop_after_ms: nil, tags: nil, timeout_opts: nil, wait_for_ms: nil, zdr: nil, request_options: {})
50
52
  #
51
53
  # @param schema [Hash{Symbol=>Object}] JSON Schema for the returned data object. Image fields such as `image_urls` or `
52
54
  #
@@ -80,6 +82,8 @@ module ContextDev
80
82
  #
81
83
  # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load for each craw
82
84
  #
85
+ # @param zdr [Symbol, ContextDev::Models::WebExtractParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
86
+ #
83
87
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
84
88
  #
85
89
  # @return [ContextDev::Models::WebExtractResponse]
@@ -102,7 +106,7 @@ module ContextDev
102
106
  # Analyze a company's landing page and web search evidence to return direct
103
107
  # competitors for the same product or market.
104
108
  #
105
- # @overload extract_competitors(domain:, num_competitors: nil, tags: nil, timeout_opts: nil, request_options: {})
109
+ # @overload extract_competitors(domain:, num_competitors: nil, tags: nil, timeout_opts: nil, zdr: nil, request_options: {})
106
110
  #
107
111
  # @param domain [String] Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
108
112
  #
@@ -112,6 +116,8 @@ module ContextDev
112
116
  #
113
117
  # @param timeout_opts [ContextDev::Models::WebExtractCompetitorsParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
114
118
  #
119
+ # @param zdr [Symbol, ContextDev::Models::WebExtractCompetitorsParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
120
+ #
115
121
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
116
122
  #
117
123
  # @return [ContextDev::Models::WebExtractCompetitorsResponse]
@@ -174,7 +180,7 @@ module ContextDev
174
180
  # Extract a comprehensive design system from a website including colors,
175
181
  # typography, spacing, shadows, and UI components.
176
182
  #
177
- # @overload extract_styleguide(color_scheme: nil, direct_url: nil, domain: nil, max_age_ms: nil, tags: nil, timeout_opts: nil, request_options: {})
183
+ # @overload extract_styleguide(color_scheme: nil, direct_url: nil, domain: nil, max_age_ms: nil, tags: nil, timeout_opts: nil, zdr: nil, request_options: {})
178
184
  #
179
185
  # @param color_scheme [Symbol, ContextDev::Models::WebExtractStyleguideParams::ColorScheme] Optional browser color scheme to emulate for websites that respond to prefers-co
180
186
  #
@@ -188,6 +194,8 @@ module ContextDev
188
194
  #
189
195
  # @param timeout_opts [ContextDev::Models::WebExtractStyleguideParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
190
196
  #
197
+ # @param zdr [Symbol, ContextDev::Models::WebExtractStyleguideParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
198
+ #
191
199
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
192
200
  #
193
201
  # @return [ContextDev::Models::WebExtractStyleguideResponse]
@@ -279,7 +287,7 @@ module ContextDev
279
287
  #
280
288
  # Search the web and optionally scrape each result to Markdown in one round-trip.
281
289
  #
282
- # @overload search(query:, country: nil, exclude_domains: nil, freshness: nil, include_domains: nil, markdown_options: nil, num_results: nil, query_fanout: nil, tags: nil, timeout_opts: nil, request_options: {})
290
+ # @overload search(query:, country: nil, exclude_domains: nil, freshness: nil, include_domains: nil, markdown_options: nil, num_results: nil, query_fanout: nil, tags: nil, timeout_opts: nil, zdr: nil, request_options: {})
283
291
  #
284
292
  # @param query [String] Search query. Accepts natural language as well as Google-style search operators
285
293
  #
@@ -301,6 +309,8 @@ module ContextDev
301
309
  #
302
310
  # @param timeout_opts [ContextDev::Models::WebSearchParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
303
311
  #
312
+ # @param zdr [Symbol, ContextDev::Models::WebSearchParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
313
+ #
304
314
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
305
315
  #
306
316
  # @return [ContextDev::Models::WebSearchResponse]
@@ -431,14 +441,18 @@ module ContextDev
431
441
  # Some parameter documentations has been truncated, see
432
442
  # {ContextDev::Models::WebWebScrapeHTMLParams} for more details.
433
443
  #
434
- # Scrapes the given URL and returns the raw HTML content of the page. The base
435
- # request costs 1 credit; requests with browser actions cost 2 credits. A request
436
- # that hits its timeoutOpts.milliseconds deadline fails with 408 and is not
437
- # billed, unless timeoutOpts.behavior=return-partial is set — then the page as
438
- # rendered so far is returned with `finalDOMState: "still-loading"` and billed at
439
- # the base cost of 1 credit.
444
+ # Scrapes the given URL and returns the HTML content of the page. Optional
445
+ # extractRules return deterministic structured data in extracted using CSS
446
+ # selectors, attributes, lists, and nested rules, without an LLM or additional
447
+ # credits. Rules run on the returned HTML after selector and main-content
448
+ # filtering. Send extractRules as a JSON-encoded query parameter. The base request
449
+ # costs 1 credit; requests with browser actions cost 2 credits. A request that
450
+ # hits its timeoutOpts.milliseconds deadline fails with 408 and is not billed,
451
+ # unless timeoutOpts.behavior=return-partial is set — then the page as rendered so
452
+ # far is returned with `finalDOMState: "still-loading"` and billed at the base
453
+ # cost of 1 credit.
440
454
  #
441
- # @overload web_scrape_html(url:, actions: nil, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, tags: nil, timeout_opts: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {})
455
+ # @overload web_scrape_html(url:, actions: nil, country: nil, exclude_selectors: nil, extract_rules: nil, headers: nil, include_frames: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, tags: nil, timeout_opts: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {})
442
456
  #
443
457
  # @param url [String] Full URL to scrape (must include http:// or https:// protocol)
444
458
  #
@@ -448,6 +462,8 @@ module ContextDev
448
462
  #
449
463
  # @param exclude_selectors [Array<String>, nil] CSS selectors to remove from the result. Applied after includeSelectors. Exclusi
450
464
  #
465
+ # @param extract_rules [Hash{Symbol=>String, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1}] Optional CSS extraction rules applied to the returned HTML after selector and ma
466
+ #
451
467
  # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
452
468
  #
453
469
  # @param include_frames [Boolean] When true, iframes are rendered inline into the returned HTML.
@@ -483,6 +499,7 @@ module ContextDev
483
499
  path: "web/scrape/html",
484
500
  query: query.transform_keys(
485
501
  exclude_selectors: "excludeSelectors",
502
+ extract_rules: "extractRules",
486
503
  include_frames: "includeFrames",
487
504
  include_selectors: "includeSelectors",
488
505
  max_age_ms: "maxAgeMs",
@@ -505,7 +522,7 @@ module ContextDev
505
522
  # enrichment is enabled, the entire call costs 5 credits, including requests that
506
523
  # also use actions.
507
524
  #
508
- # @overload web_scrape_images(url:, actions: nil, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, tags: nil, timeout_opts: nil, wait_for_ms: nil, request_options: {})
525
+ # @overload web_scrape_images(url:, actions: nil, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, tags: nil, timeout_opts: nil, wait_for_ms: nil, zdr: nil, request_options: {})
509
526
  #
510
527
  # @param url [String] Page URL to inspect. Must include http:// or https://.
511
528
  #
@@ -525,6 +542,8 @@ module ContextDev
525
542
  #
526
543
  # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before collec
527
544
  #
545
+ # @param zdr [Symbol, ContextDev::Models::WebWebScrapeImagesParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
546
+ #
528
547
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
529
548
  #
530
549
  # @return [ContextDev::Models::WebWebScrapeImagesResponse]
@@ -649,6 +668,70 @@ module ContextDev
649
668
  )
650
669
  end
651
670
 
671
+ # Some parameter documentations has been truncated, see
672
+ # {ContextDev::Models::WebWebScrapeScreenshotParams} for more details.
673
+ #
674
+ # Capture the given HTTP or HTTPS URL with configurable viewport, full-page
675
+ # capture, wait time, popup handling, theme, scroll offset, cache age, country,
676
+ # and request timeout. Defaults to a 1920x1080 viewport, a 3-second wait, and a
677
+ # cache age of 1 day. With timeoutOpts.behavior=return-partial, a screenshot of
678
+ # the page rendered so far may be returned; inspect finalDOMState to identify an
679
+ # incomplete render. Successful requests cost 1 credit; errors are not billed.
680
+ #
681
+ # @overload web_scrape_screenshot(url:, clear_popups: nil, color_scheme: nil, country: nil, full_screenshot: nil, handle_cookie_popup: nil, max_age_ms: nil, scroll_offset: nil, tags: nil, timeout_opts: nil, viewport: nil, wait_for_ms: nil, zdr: nil, request_options: {})
682
+ #
683
+ # @param url [String]
684
+ #
685
+ # @param clear_popups [Boolean] Optional parameter for comprehensive popup cleanup. If 'true', the browser dismi
686
+ #
687
+ # @param color_scheme [Symbol, ContextDev::Models::WebWebScrapeScreenshotParams::ColorScheme] Optional parameter to choose the site's visual theme in the screenshot. Use 'lig
688
+ #
689
+ # @param country [Symbol, ContextDev::Models::WebWebScrapeScreenshotParams::Country] Fetch the target page through a residential proxy in this country (ISO 3166-1 al
690
+ #
691
+ # @param full_screenshot [Symbol, ContextDev::Models::WebWebScrapeScreenshotParams::FullScreenshot] Optional parameter to determine screenshot type. If 'true', takes a full page sc
692
+ #
693
+ # @param handle_cookie_popup [Boolean] Optional parameter to control cookie/consent popup handling. If 'true', we dismi
694
+ #
695
+ # @param max_age_ms [Integer, nil] Return a cached screenshot if a prior screenshot for the same parameters exists
696
+ #
697
+ # @param scroll_offset [Integer, nil] Optional vertical scroll offset in pixels for capturing a long page in viewport-
698
+ #
699
+ # @param tags [Array<String>] Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50 charac
700
+ #
701
+ # @param timeout_opts [ContextDev::Models::WebWebScrapeScreenshotParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
702
+ #
703
+ # @param viewport [ContextDev::Models::WebWebScrapeScreenshotParams::Viewport] Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
704
+ #
705
+ # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before taking
706
+ #
707
+ # @param zdr [Symbol, ContextDev::Models::WebWebScrapeScreenshotParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
708
+ #
709
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
710
+ #
711
+ # @return [ContextDev::Models::WebWebScrapeScreenshotResponse]
712
+ #
713
+ # @see ContextDev::Models::WebWebScrapeScreenshotParams
714
+ def web_scrape_screenshot(params)
715
+ parsed, options = ContextDev::WebWebScrapeScreenshotParams.dump_request(params)
716
+ query = ContextDev::Internal::Util.encode_query_params(parsed)
717
+ @client.request(
718
+ method: :get,
719
+ path: "web/scrape/screenshot",
720
+ query: query.transform_keys(
721
+ clear_popups: "clearPopups",
722
+ color_scheme: "colorScheme",
723
+ full_screenshot: "fullScreenshot",
724
+ handle_cookie_popup: "handleCookiePopup",
725
+ max_age_ms: "maxAgeMs",
726
+ scroll_offset: "scrollOffset",
727
+ timeout_opts: "timeoutOpts",
728
+ wait_for_ms: "waitForMs"
729
+ ),
730
+ model: ContextDev::Models::WebWebScrapeScreenshotResponse,
731
+ options: options
732
+ )
733
+ end
734
+
652
735
  # Some parameter documentations has been truncated, see
653
736
  # {ContextDev::Models::WebWebScrapeSitemapParams} for more details.
654
737
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContextDev
4
- VERSION = "2.17.0"
4
+ VERSION = "2.18.0"
5
5
  end
data/lib/context_dev.rb CHANGED
@@ -157,6 +157,8 @@ require_relative "context_dev/models/web_web_scrape_images_params"
157
157
  require_relative "context_dev/models/web_web_scrape_images_response"
158
158
  require_relative "context_dev/models/web_web_scrape_md_params"
159
159
  require_relative "context_dev/models/web_web_scrape_md_response"
160
+ require_relative "context_dev/models/web_web_scrape_screenshot_params"
161
+ require_relative "context_dev/models/web_web_scrape_screenshot_response"
160
162
  require_relative "context_dev/models/web_web_scrape_sitemap_params"
161
163
  require_relative "context_dev/models/web_web_scrape_sitemap_response"
162
164
  require_relative "context_dev/models"
@@ -49,12 +49,28 @@ module ContextDev
49
49
  end
50
50
  attr_writer :timeout_opts
51
51
 
52
+ # Set to enabled to bypass shared caches and omit request and response content
53
+ # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
54
+ # omitted. Requires zero data retention to be enabled for your organization
55
+ # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
56
+ # Successful ZDR responses include X-Context-ZDR: true.
57
+ sig do
58
+ returns(T.nilable(ContextDev::AIExtractProductParams::Zdr::OrSymbol))
59
+ end
60
+ attr_reader :zdr
61
+
62
+ sig do
63
+ params(zdr: ContextDev::AIExtractProductParams::Zdr::OrSymbol).void
64
+ end
65
+ attr_writer :zdr
66
+
52
67
  sig do
53
68
  params(
54
69
  url: String,
55
70
  max_age_ms: Integer,
56
71
  tags: T::Array[String],
57
72
  timeout_opts: ContextDev::AIExtractProductParams::TimeoutOpts::OrHash,
73
+ zdr: ContextDev::AIExtractProductParams::Zdr::OrSymbol,
58
74
  request_options: ContextDev::RequestOptions::OrHash
59
75
  ).returns(T.attached_class)
60
76
  end
@@ -71,6 +87,12 @@ module ContextDev
71
87
  # timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
72
88
  # timeoutOpts object.
73
89
  timeout_opts: nil,
90
+ # Set to enabled to bypass shared caches and omit request and response content
91
+ # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
92
+ # omitted. Requires zero data retention to be enabled for your organization
93
+ # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
94
+ # Successful ZDR responses include X-Context-ZDR: true.
95
+ zdr: nil,
74
96
  request_options: {}
75
97
  )
76
98
  end
@@ -82,6 +104,7 @@ module ContextDev
82
104
  max_age_ms: Integer,
83
105
  tags: T::Array[String],
84
106
  timeout_opts: ContextDev::AIExtractProductParams::TimeoutOpts,
107
+ zdr: ContextDev::AIExtractProductParams::Zdr::OrSymbol,
85
108
  request_options: ContextDev::RequestOptions
86
109
  }
87
110
  )
@@ -194,6 +217,37 @@ module ContextDev
194
217
  end
195
218
  end
196
219
  end
220
+
221
+ # Set to enabled to bypass shared caches and omit request and response content
222
+ # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
223
+ # omitted. Requires zero data retention to be enabled for your organization
224
+ # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
225
+ # Successful ZDR responses include X-Context-ZDR: true.
226
+ module Zdr
227
+ extend ContextDev::Internal::Type::Enum
228
+
229
+ TaggedSymbol =
230
+ T.type_alias do
231
+ T.all(Symbol, ContextDev::AIExtractProductParams::Zdr)
232
+ end
233
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
234
+
235
+ ENABLED =
236
+ T.let(:enabled, ContextDev::AIExtractProductParams::Zdr::TaggedSymbol)
237
+ DISABLED =
238
+ T.let(
239
+ :disabled,
240
+ ContextDev::AIExtractProductParams::Zdr::TaggedSymbol
241
+ )
242
+
243
+ sig do
244
+ override.returns(
245
+ T::Array[ContextDev::AIExtractProductParams::Zdr::TaggedSymbol]
246
+ )
247
+ end
248
+ def self.values
249
+ end
250
+ end
197
251
  end
198
252
  end
199
253
  end
@@ -432,6 +432,30 @@ module ContextDev
432
432
  sig { returns(T.nilable(String)) }
433
433
  attr_accessor :url
434
434
 
435
+ # Product variations, such as different colors or sizes, with their attributes and
436
+ # images. Empty if none are found. May not include every variation offered by the
437
+ # store.
438
+ sig do
439
+ returns(
440
+ T.nilable(
441
+ T::Array[
442
+ ContextDev::Models::AIExtractProductResponse::Product::Variant
443
+ ]
444
+ )
445
+ )
446
+ end
447
+ attr_reader :variants
448
+
449
+ sig do
450
+ params(
451
+ variants:
452
+ T::Array[
453
+ ContextDev::Models::AIExtractProductResponse::Product::Variant::OrHash
454
+ ]
455
+ ).void
456
+ end
457
+ attr_writer :variants
458
+
435
459
  # The extracted product data, or null if not a product page
436
460
  sig do
437
461
  params(
@@ -460,7 +484,11 @@ module ContextDev
460
484
  ContextDev::Models::AIExtractProductResponse::Product::PricingModel::OrSymbol
461
485
  ),
462
486
  regular_price: T.nilable(Float),
463
- url: T.nilable(String)
487
+ url: T.nilable(String),
488
+ variants:
489
+ T::Array[
490
+ ContextDev::Models::AIExtractProductResponse::Product::Variant::OrHash
491
+ ]
464
492
  ).returns(T.attached_class)
465
493
  end
466
494
  def self.new(
@@ -497,7 +525,11 @@ module ContextDev
497
525
  # Original or regular price before a displayed discount
498
526
  regular_price: nil,
499
527
  # URL to the product page
500
- url: nil
528
+ url: nil,
529
+ # Product variations, such as different colors or sizes, with their attributes and
530
+ # images. Empty if none are found. May not include every variation offered by the
531
+ # store.
532
+ variants: nil
501
533
  )
502
534
  end
503
535
 
@@ -529,7 +561,11 @@ module ContextDev
529
561
  ContextDev::Models::AIExtractProductResponse::Product::PricingModel::TaggedSymbol
530
562
  ),
531
563
  regular_price: T.nilable(Float),
532
- url: T.nilable(String)
564
+ url: T.nilable(String),
565
+ variants:
566
+ T::Array[
567
+ ContextDev::Models::AIExtractProductResponse::Product::Variant
568
+ ]
533
569
  }
534
570
  )
535
571
  end
@@ -690,6 +726,65 @@ module ContextDev
690
726
  def self.values
691
727
  end
692
728
  end
729
+
730
+ class Variant < ContextDev::Internal::Type::BaseModel
731
+ OrHash =
732
+ T.type_alias do
733
+ T.any(
734
+ ContextDev::Models::AIExtractProductResponse::Product::Variant,
735
+ ContextDev::Internal::AnyHash
736
+ )
737
+ end
738
+
739
+ # Explicit variant attributes such as color, size, material, pattern and
740
+ # properties declared by page.
741
+ sig { returns(T::Hash[Symbol, String]) }
742
+ attr_accessor :attributes
743
+
744
+ # Original source image URLs explicitly attached to this variant.
745
+ sig { returns(T::Array[String]) }
746
+ attr_accessor :images
747
+
748
+ sig { returns(T.nilable(String)) }
749
+ attr_accessor :sku
750
+
751
+ # Variant or offer URL when provided by the source. May be shared by variants.
752
+ sig { returns(T.nilable(String)) }
753
+ attr_accessor :url
754
+
755
+ sig do
756
+ params(
757
+ attributes: T::Hash[Symbol, String],
758
+ images: T::Array[String],
759
+ sku: T.nilable(String),
760
+ url: T.nilable(String)
761
+ ).returns(T.attached_class)
762
+ end
763
+ def self.new(
764
+ # Explicit variant attributes such as color, size, material, pattern and
765
+ # properties declared by page.
766
+ attributes:,
767
+ # Original source image URLs explicitly attached to this variant.
768
+ images:,
769
+ sku:,
770
+ # Variant or offer URL when provided by the source. May be shared by variants.
771
+ url:
772
+ )
773
+ end
774
+
775
+ sig do
776
+ override.returns(
777
+ {
778
+ attributes: T::Hash[Symbol, String],
779
+ images: T::Array[String],
780
+ sku: T.nilable(String),
781
+ url: T.nilable(String)
782
+ }
783
+ )
784
+ end
785
+ def to_hash
786
+ end
787
+ end
693
788
  end
694
789
  end
695
790
  end
@@ -360,6 +360,30 @@ module ContextDev
360
360
  sig { returns(T.nilable(String)) }
361
361
  attr_accessor :url
362
362
 
363
+ # Product variations, such as different colors or sizes, with their attributes and
364
+ # images. Empty if none are found. May not include every variation offered by the
365
+ # store.
366
+ sig do
367
+ returns(
368
+ T.nilable(
369
+ T::Array[
370
+ ContextDev::Models::AIExtractProductsResponse::Product::Variant
371
+ ]
372
+ )
373
+ )
374
+ end
375
+ attr_reader :variants
376
+
377
+ sig do
378
+ params(
379
+ variants:
380
+ T::Array[
381
+ ContextDev::Models::AIExtractProductsResponse::Product::Variant::OrHash
382
+ ]
383
+ ).void
384
+ end
385
+ attr_writer :variants
386
+
363
387
  sig do
364
388
  params(
365
389
  description: String,
@@ -387,7 +411,11 @@ module ContextDev
387
411
  ContextDev::Models::AIExtractProductsResponse::Product::PricingModel::OrSymbol
388
412
  ),
389
413
  regular_price: T.nilable(Float),
390
- url: T.nilable(String)
414
+ url: T.nilable(String),
415
+ variants:
416
+ T::Array[
417
+ ContextDev::Models::AIExtractProductsResponse::Product::Variant::OrHash
418
+ ]
391
419
  ).returns(T.attached_class)
392
420
  end
393
421
  def self.new(
@@ -424,7 +452,11 @@ module ContextDev
424
452
  # Original or regular price before a displayed discount
425
453
  regular_price: nil,
426
454
  # URL to the product page
427
- url: nil
455
+ url: nil,
456
+ # Product variations, such as different colors or sizes, with their attributes and
457
+ # images. Empty if none are found. May not include every variation offered by the
458
+ # store.
459
+ variants: nil
428
460
  )
429
461
  end
430
462
 
@@ -456,7 +488,11 @@ module ContextDev
456
488
  ContextDev::Models::AIExtractProductsResponse::Product::PricingModel::TaggedSymbol
457
489
  ),
458
490
  regular_price: T.nilable(Float),
459
- url: T.nilable(String)
491
+ url: T.nilable(String),
492
+ variants:
493
+ T::Array[
494
+ ContextDev::Models::AIExtractProductsResponse::Product::Variant
495
+ ]
460
496
  }
461
497
  )
462
498
  end
@@ -617,6 +653,65 @@ module ContextDev
617
653
  def self.values
618
654
  end
619
655
  end
656
+
657
+ class Variant < ContextDev::Internal::Type::BaseModel
658
+ OrHash =
659
+ T.type_alias do
660
+ T.any(
661
+ ContextDev::Models::AIExtractProductsResponse::Product::Variant,
662
+ ContextDev::Internal::AnyHash
663
+ )
664
+ end
665
+
666
+ # Explicit variant attributes such as color, size, material, pattern and
667
+ # properties declared by page.
668
+ sig { returns(T::Hash[Symbol, String]) }
669
+ attr_accessor :attributes
670
+
671
+ # Original source image URLs explicitly attached to this variant.
672
+ sig { returns(T::Array[String]) }
673
+ attr_accessor :images
674
+
675
+ sig { returns(T.nilable(String)) }
676
+ attr_accessor :sku
677
+
678
+ # Variant or offer URL when provided by the source. May be shared by variants.
679
+ sig { returns(T.nilable(String)) }
680
+ attr_accessor :url
681
+
682
+ sig do
683
+ params(
684
+ attributes: T::Hash[Symbol, String],
685
+ images: T::Array[String],
686
+ sku: T.nilable(String),
687
+ url: T.nilable(String)
688
+ ).returns(T.attached_class)
689
+ end
690
+ def self.new(
691
+ # Explicit variant attributes such as color, size, material, pattern and
692
+ # properties declared by page.
693
+ attributes:,
694
+ # Original source image URLs explicitly attached to this variant.
695
+ images:,
696
+ sku:,
697
+ # Variant or offer URL when provided by the source. May be shared by variants.
698
+ url:
699
+ )
700
+ end
701
+
702
+ sig do
703
+ override.returns(
704
+ {
705
+ attributes: T::Hash[Symbol, String],
706
+ images: T::Array[String],
707
+ sku: T.nilable(String),
708
+ url: T.nilable(String)
709
+ }
710
+ )
711
+ end
712
+ def to_hash
713
+ end
714
+ end
620
715
  end
621
716
  end
622
717
  end