context.dev 2.3.0 → 2.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 (133) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/README.md +9 -9
  4. data/lib/context_dev/models/ai_extract_product_params.rb +9 -1
  5. data/lib/context_dev/models/ai_extract_products_params.rb +18 -2
  6. data/lib/context_dev/models/brand_retrieve_params.rb +109 -22
  7. data/lib/context_dev/models/brand_retrieve_response.rb +4 -6
  8. data/lib/context_dev/models/brand_retrieve_simplified_params.rb +32 -3
  9. data/lib/context_dev/models/industry_retrieve_naics_params.rb +11 -1
  10. data/lib/context_dev/models/industry_retrieve_sic_params.rb +11 -1
  11. data/lib/context_dev/models/monitor_create_params.rb +6 -5
  12. data/lib/context_dev/models/monitor_create_response.rb +6 -5
  13. data/lib/context_dev/models/monitor_get_credit_usage_params.rb +30 -0
  14. data/lib/context_dev/models/monitor_get_credit_usage_response.rb +59 -0
  15. data/lib/context_dev/models/monitor_get_limits_params.rb +14 -0
  16. data/lib/context_dev/models/monitor_get_limits_response.rb +52 -0
  17. data/lib/context_dev/models/monitor_list_account_changes_params.rb +16 -7
  18. data/lib/context_dev/models/monitor_list_account_changes_response.rb +2 -1
  19. data/lib/context_dev/models/monitor_list_account_runs_params.rb +7 -10
  20. data/lib/context_dev/models/monitor_list_changes_params.rb +8 -4
  21. data/lib/context_dev/models/monitor_list_changes_response.rb +2 -1
  22. data/lib/context_dev/models/monitor_list_params.rb +18 -19
  23. data/lib/context_dev/models/monitor_list_response.rb +6 -5
  24. data/lib/context_dev/models/monitor_list_runs_params.rb +7 -10
  25. data/lib/context_dev/models/monitor_retrieve_change_response.rb +2 -1
  26. data/lib/context_dev/models/monitor_retrieve_response.rb +6 -5
  27. data/lib/context_dev/models/monitor_update_params.rb +6 -5
  28. data/lib/context_dev/models/monitor_update_response.rb +6 -5
  29. data/lib/context_dev/models/parse_handle_params.rb +296 -46
  30. data/lib/context_dev/models/utility_prefetch_params.rb +9 -1
  31. data/lib/context_dev/models/web_extract_competitors_params.rb +11 -1
  32. data/lib/context_dev/models/web_extract_fonts_params.rb +14 -4
  33. data/lib/context_dev/models/web_extract_params.rb +19 -1
  34. data/lib/context_dev/models/web_extract_styleguide_params.rb +14 -4
  35. data/lib/context_dev/models/web_screenshot_params.rb +69 -18
  36. data/lib/context_dev/models/web_screenshot_response.rb +3 -2
  37. data/lib/context_dev/models/web_search_params.rb +9 -1
  38. data/lib/context_dev/models/web_web_crawl_md_params.rb +34 -1
  39. data/lib/context_dev/models/web_web_scrape_html_params.rb +268 -29
  40. data/lib/context_dev/models/web_web_scrape_images_params.rb +208 -19
  41. data/lib/context_dev/models/web_web_scrape_md_params.rb +352 -38
  42. data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +45 -1
  43. data/lib/context_dev/models.rb +4 -0
  44. data/lib/context_dev/resources/ai.rb +3 -1
  45. data/lib/context_dev/resources/brand.rb +6 -2
  46. data/lib/context_dev/resources/industry.rb +6 -2
  47. data/lib/context_dev/resources/monitors.rb +70 -32
  48. data/lib/context_dev/resources/parse.rb +11 -11
  49. data/lib/context_dev/resources/utility.rb +3 -1
  50. data/lib/context_dev/resources/web.rb +104 -55
  51. data/lib/context_dev/version.rb +1 -1
  52. data/lib/context_dev.rb +4 -0
  53. data/rbi/context_dev/models/ai_extract_product_params.rbi +11 -0
  54. data/rbi/context_dev/models/ai_extract_products_params.rbi +22 -0
  55. data/rbi/context_dev/models/brand_retrieve_params.rbi +175 -64
  56. data/rbi/context_dev/models/brand_retrieve_response.rbi +8 -11
  57. data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +68 -5
  58. data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +15 -0
  59. data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +15 -0
  60. data/rbi/context_dev/models/monitor_create_params.rbi +6 -4
  61. data/rbi/context_dev/models/monitor_create_response.rbi +6 -4
  62. data/rbi/context_dev/models/monitor_get_credit_usage_params.rbi +60 -0
  63. data/rbi/context_dev/models/monitor_get_credit_usage_response.rbi +111 -0
  64. data/rbi/context_dev/models/monitor_get_limits_params.rbi +30 -0
  65. data/rbi/context_dev/models/monitor_get_limits_response.rbi +105 -0
  66. data/rbi/context_dev/models/monitor_list_account_changes_params.rbi +16 -0
  67. data/rbi/context_dev/models/monitor_list_account_changes_response.rbi +2 -0
  68. data/rbi/context_dev/models/monitor_list_account_runs_params.rbi +7 -6
  69. data/rbi/context_dev/models/monitor_list_changes_params.rbi +8 -0
  70. data/rbi/context_dev/models/monitor_list_changes_response.rbi +2 -0
  71. data/rbi/context_dev/models/monitor_list_params.rbi +23 -31
  72. data/rbi/context_dev/models/monitor_list_response.rbi +6 -4
  73. data/rbi/context_dev/models/monitor_list_runs_params.rbi +7 -6
  74. data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +2 -0
  75. data/rbi/context_dev/models/monitor_retrieve_response.rbi +6 -4
  76. data/rbi/context_dev/models/monitor_update_params.rbi +6 -4
  77. data/rbi/context_dev/models/monitor_update_response.rbi +6 -4
  78. data/rbi/context_dev/models/parse_handle_params.rbi +601 -71
  79. data/rbi/context_dev/models/utility_prefetch_params.rbi +11 -0
  80. data/rbi/context_dev/models/web_extract_competitors_params.rbi +15 -0
  81. data/rbi/context_dev/models/web_extract_fonts_params.rbi +19 -7
  82. data/rbi/context_dev/models/web_extract_params.rbi +26 -0
  83. data/rbi/context_dev/models/web_extract_styleguide_params.rbi +19 -7
  84. data/rbi/context_dev/models/web_screenshot_params.rbi +108 -37
  85. data/rbi/context_dev/models/web_screenshot_response.rbi +4 -2
  86. data/rbi/context_dev/models/web_search_params.rbi +11 -0
  87. data/rbi/context_dev/models/web_web_crawl_md_params.rbi +53 -0
  88. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +554 -49
  89. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +426 -30
  90. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +742 -61
  91. data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +82 -0
  92. data/rbi/context_dev/models.rbi +4 -0
  93. data/rbi/context_dev/resources/ai.rbi +3 -0
  94. data/rbi/context_dev/resources/brand.rbi +9 -1
  95. data/rbi/context_dev/resources/industry.rbi +10 -0
  96. data/rbi/context_dev/resources/monitors.rbi +55 -11
  97. data/rbi/context_dev/resources/parse.rbi +44 -24
  98. data/rbi/context_dev/resources/utility.rbi +3 -0
  99. data/rbi/context_dev/resources/web.rbi +224 -48
  100. data/sig/context_dev/models/ai_extract_product_params.rbs +12 -1
  101. data/sig/context_dev/models/ai_extract_products_params.rbs +14 -0
  102. data/sig/context_dev/models/brand_retrieve_params.rbs +97 -51
  103. data/sig/context_dev/models/brand_retrieve_response.rbs +2 -2
  104. data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +34 -5
  105. data/sig/context_dev/models/industry_retrieve_naics_params.rbs +7 -0
  106. data/sig/context_dev/models/industry_retrieve_sic_params.rbs +7 -0
  107. data/sig/context_dev/models/monitor_get_credit_usage_params.rbs +32 -0
  108. data/sig/context_dev/models/monitor_get_credit_usage_response.rbs +52 -0
  109. data/sig/context_dev/models/monitor_get_limits_params.rbs +15 -0
  110. data/sig/context_dev/models/monitor_get_limits_response.rbs +43 -0
  111. data/sig/context_dev/models/monitor_list_params.rbs +8 -14
  112. data/sig/context_dev/models/parse_handle_params.rbs +297 -50
  113. data/sig/context_dev/models/utility_prefetch_params.rbs +7 -0
  114. data/sig/context_dev/models/web_extract_competitors_params.rbs +12 -1
  115. data/sig/context_dev/models/web_extract_fonts_params.rbs +10 -5
  116. data/sig/context_dev/models/web_extract_params.rbs +14 -0
  117. data/sig/context_dev/models/web_extract_styleguide_params.rbs +10 -5
  118. data/sig/context_dev/models/web_screenshot_params.rbs +41 -20
  119. data/sig/context_dev/models/web_search_params.rbs +7 -0
  120. data/sig/context_dev/models/web_web_crawl_md_params.rbs +28 -1
  121. data/sig/context_dev/models/web_web_scrape_html_params.rbs +175 -47
  122. data/sig/context_dev/models/web_web_scrape_images_params.rbs +128 -38
  123. data/sig/context_dev/models/web_web_scrape_md_params.rbs +229 -62
  124. data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +35 -1
  125. data/sig/context_dev/models.rbs +4 -0
  126. data/sig/context_dev/resources/ai.rbs +1 -0
  127. data/sig/context_dev/resources/brand.rbs +3 -1
  128. data/sig/context_dev/resources/industry.rbs +2 -0
  129. data/sig/context_dev/resources/monitors.rbs +12 -2
  130. data/sig/context_dev/resources/parse.rbs +10 -10
  131. data/sig/context_dev/resources/utility.rbs +1 -0
  132. data/sig/context_dev/resources/web.rbs +47 -26
  133. metadata +14 -2
@@ -13,9 +13,20 @@ module ContextDev
13
13
  # @return [String]
14
14
  required :url, String
15
15
 
16
+ # @!attribute actions
17
+ # Optional browser actions executed in array order after the page loads and before
18
+ # content is captured. Requires a paid plan. Send a JSON array in the query
19
+ # parameter. Maximum: 5 actions.
20
+ #
21
+ # @return [Array<ContextDev::Models::WebWebScrapeHTMLParams::Action::Wait, ContextDev::Models::WebWebScrapeHTMLParams::Action::Perform>, nil]
22
+ optional :actions,
23
+ -> { ContextDev::Internal::Type::ArrayOf[union: ContextDev::WebWebScrapeHTMLParams::Action] },
24
+ nil?: true
25
+
16
26
  # @!attribute country
17
- # Two-letter ISO 3166-1 alpha-2 country code for the website request location.
18
- # When provided, Context.dev fetches the target page from that country.
27
+ # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
28
+ # residential proxy exit location. Must be one of Context.dev's supported
29
+ # countries. When provided, Context.dev fetches the target page from that country.
19
30
  #
20
31
  # @return [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country, nil]
21
32
  optional :country, enum: -> { ContextDev::WebWebScrapeHTMLParams::Country }
@@ -26,7 +37,7 @@ module ContextDev
26
37
  # "nav", "footer", ".ad-banner", "[aria-hidden=true]".
27
38
  #
28
39
  # @return [Array<String>, nil]
29
- optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String]
40
+ optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String], nil?: true
30
41
 
31
42
  # @!attribute headers
32
43
  # Optional outbound HTTP headers forwarded only to the target URL, sent as
@@ -39,8 +50,8 @@ module ContextDev
39
50
  # @!attribute include_frames
40
51
  # When true, iframes are rendered inline into the returned HTML.
41
52
  #
42
- # @return [Boolean, nil]
43
- optional :include_frames, ContextDev::Internal::Type::Boolean
53
+ # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::IncludeFrames, nil]
54
+ optional :include_frames, union: -> { ContextDev::WebWebScrapeHTMLParams::IncludeFrames }
44
55
 
45
56
  # @!attribute include_selectors
46
57
  # CSS selectors. When provided, only matching subtrees (and their descendants) are
@@ -48,7 +59,7 @@ module ContextDev
48
59
  # Examples: "article.main", "#content", "[role=main]".
49
60
  #
50
61
  # @return [Array<String>, nil]
51
- optional :include_selectors, ContextDev::Internal::Type::ArrayOf[String]
62
+ optional :include_selectors, ContextDev::Internal::Type::ArrayOf[String], nil?: true
52
63
 
53
64
  # @!attribute max_age_ms
54
65
  # Return a cached result if a prior scrape for the same parameters exists and is
@@ -56,7 +67,7 @@ module ContextDev
56
67
  # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
57
68
  #
58
69
  # @return [Integer, nil]
59
- optional :max_age_ms, Integer
70
+ optional :max_age_ms, Integer, nil?: true
60
71
 
61
72
  # @!attribute pdf
62
73
  # PDF parsing controls. Use start/end to limit text extraction and embedded-image
@@ -70,8 +81,16 @@ module ContextDev
70
81
  # extracting HTML. Defaults to false. This adds a bit of latency in exchange for
71
82
  # more stable output on animated pages.
72
83
  #
73
- # @return [Boolean, nil]
74
- optional :settle_animations, ContextDev::Internal::Type::Boolean
84
+ # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::SettleAnimations, nil]
85
+ optional :settle_animations, union: -> { ContextDev::WebWebScrapeHTMLParams::SettleAnimations }
86
+
87
+ # @!attribute tags
88
+ # Optional comma-separated caller-defined tags for tracking this request. Tags are
89
+ # recorded on the request's usage log and can be used to filter usage on the
90
+ # dashboard usage page. Up to 20 tags, each 1-50 characters.
91
+ #
92
+ # @return [Array<String>, nil]
93
+ optional :tags, ContextDev::Internal::Type::ArrayOf[String]
75
94
 
76
95
  # @!attribute timeout_ms
77
96
  # Optional timeout in milliseconds for the request. If the request takes longer
@@ -85,48 +104,117 @@ module ContextDev
85
104
  # When true, return only the page's main content in the HTML response, excluding
86
105
  # headers, footers, sidebars, and navigation when detectable.
87
106
  #
88
- # @return [Boolean, nil]
89
- optional :use_main_content_only, ContextDev::Internal::Type::Boolean
107
+ # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::UseMainContentOnly, nil]
108
+ optional :use_main_content_only, union: -> { ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly }
90
109
 
91
110
  # @!attribute wait_for_ms
92
111
  # Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
93
112
  # 30000 (30 seconds).
94
113
  #
95
114
  # @return [Integer, nil]
96
- optional :wait_for_ms, Integer
115
+ optional :wait_for_ms, Integer, nil?: true
97
116
 
98
- # @!method initialize(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
117
+ # @!attribute zdr
118
+ # Set to enabled to bypass shared caches and omit request and response content
119
+ # from retained usage logs. Requires zero data retention to be enabled for your
120
+ # organization (contact support@context.dev), otherwise the request fails with
121
+ # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
122
+ #
123
+ # @return [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Zdr, nil]
124
+ optional :zdr, enum: -> { ContextDev::WebWebScrapeHTMLParams::Zdr }
125
+
126
+ # @!method initialize(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_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {})
99
127
  # Some parameter documentations has been truncated, see
100
128
  # {ContextDev::Models::WebWebScrapeHTMLParams} for more details.
101
129
  #
102
130
  # @param url [String] Full URL to scrape (must include http:// or https:// protocol)
103
131
  #
104
- # @param country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe
132
+ # @param actions [Array<ContextDev::Models::WebWebScrapeHTMLParams::Action::Wait, ContextDev::Models::WebWebScrapeHTMLParams::Action::Perform>, nil] Optional browser actions executed in array order after the page loads and before
133
+ #
134
+ # @param country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r
105
135
  #
106
- # @param exclude_selectors [Array<String>] CSS selectors to remove from the result. Applied after includeSelectors. Exclusi
136
+ # @param exclude_selectors [Array<String>, nil] CSS selectors to remove from the result. Applied after includeSelectors. Exclusi
107
137
  #
108
138
  # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
109
139
  #
110
- # @param include_frames [Boolean] When true, iframes are rendered inline into the returned HTML.
140
+ # @param include_frames [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::IncludeFrames] When true, iframes are rendered inline into the returned HTML.
111
141
  #
112
- # @param include_selectors [Array<String>] CSS selectors. When provided, only matching subtrees (and their descendants) are
142
+ # @param include_selectors [Array<String>, nil] CSS selectors. When provided, only matching subtrees (and their descendants) are
113
143
  #
114
- # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
144
+ # @param max_age_ms [Integer, nil] Return a cached result if a prior scrape for the same parameters exists and is y
115
145
  #
116
146
  # @param pdf [ContextDev::Models::WebWebScrapeHTMLParams::Pdf] PDF parsing controls. Use start/end to limit text extraction and embedded-image
117
147
  #
118
- # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before extr
148
+ # @param settle_animations [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::SettleAnimations] When true, waits briefly for CSS and transition animations to settle before extr
149
+ #
150
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
119
151
  #
120
152
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
121
153
  #
122
- # @param use_main_content_only [Boolean] When true, return only the page's main content in the HTML response, excluding h
154
+ # @param use_main_content_only [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::UseMainContentOnly] When true, return only the page's main content in the HTML response, excluding h
155
+ #
156
+ # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
123
157
  #
124
- # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
158
+ # @param zdr [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
125
159
  #
126
160
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
127
161
 
128
- # Two-letter ISO 3166-1 alpha-2 country code for the website request location.
129
- # When provided, Context.dev fetches the target page from that country.
162
+ # Browser action discriminated by `do`. Each variant exposes only its applicable
163
+ # fields.
164
+ module Action
165
+ extend ContextDev::Internal::Type::Union
166
+
167
+ discriminator :do
168
+
169
+ # Pause for a fixed number of milliseconds before continuing to the next action.
170
+ variant :wait, -> { ContextDev::WebWebScrapeHTMLParams::Action::Wait }
171
+
172
+ # Resolve and perform one natural-language browser action.
173
+ variant :perform, -> { ContextDev::WebWebScrapeHTMLParams::Action::Perform }
174
+
175
+ class Wait < ContextDev::Internal::Type::BaseModel
176
+ # @!attribute do_
177
+ #
178
+ # @return [Symbol, :wait]
179
+ required :do_, const: :wait, api_name: :do
180
+
181
+ # @!attribute time_ms
182
+ #
183
+ # @return [Integer]
184
+ required :time_ms, Integer, api_name: :timeMs
185
+
186
+ # @!method initialize(time_ms:, do_: :wait)
187
+ # Pause for a fixed number of milliseconds before continuing to the next action.
188
+ #
189
+ # @param time_ms [Integer]
190
+ # @param do_ [Symbol, :wait]
191
+ end
192
+
193
+ class Perform < ContextDev::Internal::Type::BaseModel
194
+ # @!attribute action
195
+ #
196
+ # @return [String]
197
+ required :action, String
198
+
199
+ # @!attribute do_
200
+ #
201
+ # @return [Symbol, :perform]
202
+ required :do_, const: :perform, api_name: :do
203
+
204
+ # @!method initialize(action:, do_: :perform)
205
+ # Resolve and perform one natural-language browser action.
206
+ #
207
+ # @param action [String]
208
+ # @param do_ [Symbol, :perform]
209
+ end
210
+
211
+ # @!method self.variants
212
+ # @return [Array(ContextDev::Models::WebWebScrapeHTMLParams::Action::Wait, ContextDev::Models::WebWebScrapeHTMLParams::Action::Perform)]
213
+ end
214
+
215
+ # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
216
+ # residential proxy exit location. Must be one of Context.dev's supported
217
+ # countries. When provided, Context.dev fetches the target page from that country.
130
218
  module Country
131
219
  extend ContextDev::Internal::Type::Enum
132
220
 
@@ -339,6 +427,31 @@ module ContextDev
339
427
  # @return [Array<Symbol>]
340
428
  end
341
429
 
430
+ # When true, iframes are rendered inline into the returned HTML.
431
+ module IncludeFrames
432
+ extend ContextDev::Internal::Type::Union
433
+
434
+ variant ContextDev::Internal::Type::Boolean
435
+
436
+ variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::IncludeFrames::TRUE }
437
+
438
+ variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::IncludeFrames::FALSE }
439
+
440
+ # @!method self.variants
441
+ # @return [Array(Boolean, Symbol)]
442
+
443
+ define_sorbet_constant!(:Variants) do
444
+ T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeHTMLParams::IncludeFrames::TaggedSymbol) }
445
+ end
446
+
447
+ # @!group
448
+
449
+ TRUE = :true
450
+ FALSE = :false
451
+
452
+ # @!endgroup
453
+ end
454
+
342
455
  class Pdf < ContextDev::Internal::Type::BaseModel
343
456
  # @!attribute end_
344
457
  # Last 1-based PDF page to parse. When omitted, parsing ends at the last page.
@@ -352,15 +465,17 @@ module ContextDev
352
465
  # recognized text at each image's position in page reading order while preserving
353
466
  # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback.
354
467
  #
355
- # @return [Boolean, nil]
356
- optional :ocr, ContextDev::Internal::Type::Boolean
468
+ # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::Ocr, nil]
469
+ optional :ocr, union: -> { ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr }
357
470
 
358
471
  # @!attribute should_parse
359
472
  # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
360
473
  # a 400 WEBSITE_ACCESS_ERROR is returned.
361
474
  #
362
- # @return [Boolean, nil]
363
- optional :should_parse, ContextDev::Internal::Type::Boolean, api_name: :shouldParse
475
+ # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ShouldParse, nil]
476
+ optional :should_parse,
477
+ union: -> { ContextDev::WebWebScrapeHTMLParams::Pdf::ShouldParse },
478
+ api_name: :shouldParse
364
479
 
365
480
  # @!attribute start
366
481
  # First 1-based PDF page to parse. When omitted, parsing starts at the first page.
@@ -377,11 +492,135 @@ module ContextDev
377
492
  #
378
493
  # @param end_ [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus
379
494
  #
380
- # @param ocr [Boolean] When true, detect and OCR images embedded in the selected PDF pages, inserting r
495
+ # @param ocr [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::Ocr] When true, detect and OCR images embedded in the selected PDF pages, inserting r
381
496
  #
382
- # @param should_parse [Boolean] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
497
+ # @param should_parse [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ShouldParse] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
383
498
  #
384
499
  # @param start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page.
500
+
501
+ # When true, detect and OCR images embedded in the selected PDF pages, inserting
502
+ # recognized text at each image's position in page reading order while preserving
503
+ # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback.
504
+ #
505
+ # @see ContextDev::Models::WebWebScrapeHTMLParams::Pdf#ocr
506
+ module Ocr
507
+ extend ContextDev::Internal::Type::Union
508
+
509
+ variant ContextDev::Internal::Type::Boolean
510
+
511
+ variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::Pdf::Ocr::TRUE }
512
+
513
+ variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::Pdf::Ocr::FALSE }
514
+
515
+ # @!method self.variants
516
+ # @return [Array(Boolean, Symbol)]
517
+
518
+ define_sorbet_constant!(:Variants) do
519
+ T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr::TaggedSymbol) }
520
+ end
521
+
522
+ # @!group
523
+
524
+ TRUE = :true
525
+ FALSE = :false
526
+
527
+ # @!endgroup
528
+ end
529
+
530
+ # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
531
+ # a 400 WEBSITE_ACCESS_ERROR is returned.
532
+ #
533
+ # @see ContextDev::Models::WebWebScrapeHTMLParams::Pdf#should_parse
534
+ module ShouldParse
535
+ extend ContextDev::Internal::Type::Union
536
+
537
+ variant ContextDev::Internal::Type::Boolean
538
+
539
+ variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ShouldParse::TRUE }
540
+
541
+ variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ShouldParse::FALSE }
542
+
543
+ # @!method self.variants
544
+ # @return [Array(Boolean, Symbol)]
545
+
546
+ define_sorbet_constant!(:Variants) do
547
+ T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeHTMLParams::Pdf::ShouldParse::TaggedSymbol) }
548
+ end
549
+
550
+ # @!group
551
+
552
+ TRUE = :true
553
+ FALSE = :false
554
+
555
+ # @!endgroup
556
+ end
557
+ end
558
+
559
+ # When true, waits briefly for CSS and transition animations to settle before
560
+ # extracting HTML. Defaults to false. This adds a bit of latency in exchange for
561
+ # more stable output on animated pages.
562
+ module SettleAnimations
563
+ extend ContextDev::Internal::Type::Union
564
+
565
+ variant ContextDev::Internal::Type::Boolean
566
+
567
+ variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::SettleAnimations::TRUE }
568
+
569
+ variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::SettleAnimations::FALSE }
570
+
571
+ # @!method self.variants
572
+ # @return [Array(Boolean, Symbol)]
573
+
574
+ define_sorbet_constant!(:Variants) do
575
+ T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeHTMLParams::SettleAnimations::TaggedSymbol) }
576
+ end
577
+
578
+ # @!group
579
+
580
+ TRUE = :true
581
+ FALSE = :false
582
+
583
+ # @!endgroup
584
+ end
585
+
586
+ # When true, return only the page's main content in the HTML response, excluding
587
+ # headers, footers, sidebars, and navigation when detectable.
588
+ module UseMainContentOnly
589
+ extend ContextDev::Internal::Type::Union
590
+
591
+ variant ContextDev::Internal::Type::Boolean
592
+
593
+ variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::UseMainContentOnly::TRUE }
594
+
595
+ variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::UseMainContentOnly::FALSE }
596
+
597
+ # @!method self.variants
598
+ # @return [Array(Boolean, Symbol)]
599
+
600
+ define_sorbet_constant!(:Variants) do
601
+ T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::TaggedSymbol) }
602
+ end
603
+
604
+ # @!group
605
+
606
+ TRUE = :true
607
+ FALSE = :false
608
+
609
+ # @!endgroup
610
+ end
611
+
612
+ # Set to enabled to bypass shared caches and omit request and response content
613
+ # from retained usage logs. Requires zero data retention to be enabled for your
614
+ # organization (contact support@context.dev), otherwise the request fails with
615
+ # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
616
+ module Zdr
617
+ extend ContextDev::Internal::Type::Enum
618
+
619
+ ENABLED = :enabled
620
+ DISABLED = :disabled
621
+
622
+ # @!method self.values
623
+ # @return [Array<Symbol>]
385
624
  end
386
625
  end
387
626
  end