context.dev 2.17.1 → 2.19.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 (139) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/client.rb +0 -4
  5. data/lib/context_dev/models/industry_retrieve_naics_params.rb +28 -1
  6. data/lib/context_dev/models/industry_retrieve_sic_params.rb +28 -1
  7. data/lib/context_dev/models/monitor_retrieve_run_params.rb +26 -0
  8. data/lib/context_dev/models/monitor_retrieve_run_response.rb +232 -0
  9. data/lib/context_dev/models/monitor_rotate_webhook_secret_params.rb +20 -0
  10. data/lib/context_dev/models/monitor_rotate_webhook_secret_response.rb +765 -0
  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_styleguide_params.rb +30 -3
  16. data/lib/context_dev/models/{web_web_scrape_sitemap_params.rb → web_map_urls_params.rb} +22 -20
  17. data/lib/context_dev/models/web_map_urls_response.rb +123 -0
  18. data/lib/context_dev/models/web_scrape_params.rb +906 -0
  19. data/lib/context_dev/models/web_scrape_response.rb +659 -0
  20. data/lib/context_dev/models/web_screenshot_params.rb +25 -9
  21. data/lib/context_dev/models/web_screenshot_response.rb +3 -3
  22. data/lib/context_dev/models/web_search_params.rb +30 -3
  23. data/lib/context_dev/models.rb +8 -20
  24. data/lib/context_dev/resources/brand.rb +0 -36
  25. data/lib/context_dev/resources/industry.rb +6 -2
  26. data/lib/context_dev/resources/monitors.rb +47 -0
  27. data/lib/context_dev/resources/people.rb +3 -1
  28. data/lib/context_dev/resources/web.rb +116 -413
  29. data/lib/context_dev/version.rb +1 -1
  30. data/lib/context_dev.rb +8 -21
  31. data/rbi/context_dev/client.rbi +0 -3
  32. data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +59 -0
  33. data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +57 -0
  34. data/rbi/context_dev/models/monitor_retrieve_run_params.rbi +46 -0
  35. data/rbi/context_dev/models/monitor_retrieve_run_response.rbi +452 -0
  36. data/rbi/context_dev/models/monitor_rotate_webhook_secret_params.rbi +38 -0
  37. data/rbi/context_dev/models/monitor_rotate_webhook_secret_response.rbi +1367 -0
  38. data/rbi/context_dev/models/parse_handle_params.rbi +12 -9
  39. data/rbi/context_dev/models/person_enrich_params.rbi +45 -0
  40. data/rbi/context_dev/models/web_answers_params.rbi +45 -0
  41. data/rbi/context_dev/models/web_extract_competitors_params.rbi +59 -0
  42. data/rbi/context_dev/models/web_extract_styleguide_params.rbi +62 -3
  43. data/rbi/context_dev/models/{web_web_scrape_sitemap_params.rbi → web_map_urls_params.rbi} +35 -54
  44. data/rbi/context_dev/models/web_map_urls_response.rbi +226 -0
  45. data/rbi/context_dev/models/web_scrape_params.rbi +2000 -0
  46. data/rbi/context_dev/models/{web_web_scrape_html_response.rbi → web_scrape_response.rbi} +550 -418
  47. data/rbi/context_dev/models/web_screenshot_params.rbi +38 -12
  48. data/rbi/context_dev/models/web_screenshot_response.rbi +4 -4
  49. data/rbi/context_dev/models/web_search_params.rbi +48 -3
  50. data/rbi/context_dev/models.rbi +9 -21
  51. data/rbi/context_dev/resources/brand.rbi +0 -35
  52. data/rbi/context_dev/resources/industry.rbi +14 -0
  53. data/rbi/context_dev/resources/monitors.rbi +24 -0
  54. data/rbi/context_dev/resources/parse.rbi +4 -4
  55. data/rbi/context_dev/resources/people.rbi +7 -0
  56. data/rbi/context_dev/resources/web.rbi +166 -533
  57. data/sig/context_dev/client.rbs +0 -2
  58. data/sig/context_dev/models/industry_retrieve_naics_params.rbs +21 -1
  59. data/sig/context_dev/models/industry_retrieve_sic_params.rbs +21 -1
  60. data/sig/context_dev/models/monitor_retrieve_run_params.rbs +28 -0
  61. data/sig/context_dev/models/monitor_retrieve_run_response.rbs +182 -0
  62. data/sig/context_dev/models/monitor_rotate_webhook_secret_params.rbs +23 -0
  63. data/sig/context_dev/models/monitor_rotate_webhook_secret_response.rbs +545 -0
  64. data/sig/context_dev/models/person_enrich_params.rbs +21 -1
  65. data/sig/context_dev/models/web_answers_params.rbs +21 -1
  66. data/sig/context_dev/models/web_extract_competitors_params.rbs +21 -1
  67. data/sig/context_dev/models/web_extract_styleguide_params.rbs +21 -1
  68. data/sig/context_dev/models/{web_web_scrape_sitemap_params.rbs → web_map_urls_params.rbs} +22 -22
  69. data/sig/context_dev/models/web_map_urls_response.rbs +125 -0
  70. data/sig/context_dev/models/web_scrape_params.rbs +834 -0
  71. data/sig/context_dev/models/web_scrape_response.rbs +552 -0
  72. data/sig/context_dev/models/web_screenshot_params.rbs +7 -0
  73. data/sig/context_dev/models/web_search_params.rbs +21 -1
  74. data/sig/context_dev/models.rbs +8 -20
  75. data/sig/context_dev/resources/brand.rbs +0 -9
  76. data/sig/context_dev/resources/industry.rbs +2 -0
  77. data/sig/context_dev/resources/monitors.rbs +11 -0
  78. data/sig/context_dev/resources/people.rbs +1 -0
  79. data/sig/context_dev/resources/web.rbs +34 -108
  80. metadata +26 -65
  81. data/lib/context_dev/models/ai_extract_product_params.rb +0 -98
  82. data/lib/context_dev/models/ai_extract_product_response.rb +0 -352
  83. data/lib/context_dev/models/ai_extract_products_params.rb +0 -233
  84. data/lib/context_dev/models/ai_extract_products_response.rb +0 -320
  85. data/lib/context_dev/models/brand_retrieve_simplified_params.rb +0 -120
  86. data/lib/context_dev/models/brand_retrieve_simplified_response.rb +0 -441
  87. data/lib/context_dev/models/web_extract_fonts_params.rb +0 -114
  88. data/lib/context_dev/models/web_extract_fonts_response.rb +0 -291
  89. data/lib/context_dev/models/web_extract_params.rb +0 -392
  90. data/lib/context_dev/models/web_extract_response.rb +0 -287
  91. data/lib/context_dev/models/web_web_scrape_bytes_params.rb +0 -344
  92. data/lib/context_dev/models/web_web_scrape_bytes_response.rb +0 -135
  93. data/lib/context_dev/models/web_web_scrape_html_params.rb +0 -633
  94. data/lib/context_dev/models/web_web_scrape_html_response.rb +0 -588
  95. data/lib/context_dev/models/web_web_scrape_images_params.rb +0 -346
  96. data/lib/context_dev/models/web_web_scrape_images_response.rb +0 -409
  97. data/lib/context_dev/models/web_web_scrape_md_params.rb +0 -668
  98. data/lib/context_dev/models/web_web_scrape_md_response.rb +0 -567
  99. data/lib/context_dev/models/web_web_scrape_sitemap_response.rb +0 -144
  100. data/lib/context_dev/resources/ai.rb +0 -69
  101. data/rbi/context_dev/models/ai_extract_product_params.rbi +0 -199
  102. data/rbi/context_dev/models/ai_extract_product_response.rbi +0 -696
  103. data/rbi/context_dev/models/ai_extract_products_params.rbi +0 -490
  104. data/rbi/context_dev/models/ai_extract_products_response.rbi +0 -623
  105. data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +0 -256
  106. data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +0 -1040
  107. data/rbi/context_dev/models/web_extract_fonts_params.rbi +0 -223
  108. data/rbi/context_dev/models/web_extract_fonts_response.rbi +0 -563
  109. data/rbi/context_dev/models/web_extract_params.rbi +0 -736
  110. data/rbi/context_dev/models/web_extract_response.rbi +0 -512
  111. data/rbi/context_dev/models/web_web_scrape_bytes_params.rbi +0 -699
  112. data/rbi/context_dev/models/web_web_scrape_bytes_response.rbi +0 -238
  113. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +0 -1217
  114. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +0 -671
  115. data/rbi/context_dev/models/web_web_scrape_images_response.rbi +0 -910
  116. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +0 -1049
  117. data/rbi/context_dev/models/web_web_scrape_md_response.rbi +0 -1088
  118. data/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi +0 -258
  119. data/rbi/context_dev/resources/ai.rbi +0 -56
  120. data/sig/context_dev/models/ai_extract_product_params.rbs +0 -86
  121. data/sig/context_dev/models/ai_extract_product_response.rbs +0 -273
  122. data/sig/context_dev/models/ai_extract_products_params.rbs +0 -202
  123. data/sig/context_dev/models/ai_extract_products_response.rbs +0 -252
  124. data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +0 -104
  125. data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +0 -413
  126. data/sig/context_dev/models/web_extract_fonts_params.rbs +0 -93
  127. data/sig/context_dev/models/web_extract_fonts_response.rbs +0 -230
  128. data/sig/context_dev/models/web_extract_params.rbs +0 -304
  129. data/sig/context_dev/models/web_extract_response.rbs +0 -239
  130. data/sig/context_dev/models/web_web_scrape_bytes_params.rbs +0 -531
  131. data/sig/context_dev/models/web_web_scrape_bytes_response.rbs +0 -108
  132. data/sig/context_dev/models/web_web_scrape_html_params.rbs +0 -730
  133. data/sig/context_dev/models/web_web_scrape_html_response.rbs +0 -495
  134. data/sig/context_dev/models/web_web_scrape_images_params.rbs +0 -261
  135. data/sig/context_dev/models/web_web_scrape_images_response.rbs +0 -371
  136. data/sig/context_dev/models/web_web_scrape_md_params.rbs +0 -758
  137. data/sig/context_dev/models/web_web_scrape_md_response.rbs +0 -465
  138. data/sig/context_dev/models/web_web_scrape_sitemap_response.rbs +0 -117
  139. data/sig/context_dev/resources/ai.rbs +0 -20
@@ -1,633 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ContextDev
4
- module Models
5
- # @see ContextDev::Resources::Web#web_scrape_html
6
- class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel
7
- extend ContextDev::Internal::Type::RequestParameters::Converter
8
- include ContextDev::Internal::Type::RequestParameters
9
-
10
- # @!attribute url
11
- # Full URL to scrape (must include http:// or https:// protocol)
12
- #
13
- # @return [String]
14
- required :url, String
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, ContextDev::Models::WebWebScrapeHTMLParams::Action::Scroll>, nil]
22
- optional :actions,
23
- -> { ContextDev::Internal::Type::ArrayOf[union: ContextDev::WebWebScrapeHTMLParams::Action] },
24
- nil?: true
25
-
26
- # @!attribute country
27
- # Fetch the target page through a residential proxy in this country (ISO 3166-1
28
- # alpha-2).
29
- #
30
- # @return [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country, nil]
31
- optional :country, enum: -> { ContextDev::WebWebScrapeHTMLParams::Country }
32
-
33
- # @!attribute exclude_selectors
34
- # CSS selectors to remove from the result. Applied after includeSelectors.
35
- # Exclusion takes precedence: an element matching both is removed. Examples:
36
- # "nav", "footer", ".ad-banner", "[aria-hidden=true]".
37
- #
38
- # @return [Array<String>, nil]
39
- optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String], nil?: true
40
-
41
- # @!attribute headers
42
- # Optional outbound HTTP headers forwarded only to the target URL, sent as
43
- # deep-object query params such as headers[X-Custom]=value. When provided, caching
44
- # is bypassed: the result is neither read from nor written to cache.
45
- #
46
- # @return [Hash{Symbol=>String}, nil]
47
- optional :headers, ContextDev::Internal::Type::HashOf[String]
48
-
49
- # @!attribute include_frames
50
- # When true, iframes are rendered inline into the returned HTML.
51
- #
52
- # @return [Boolean, nil]
53
- optional :include_frames, ContextDev::Internal::Type::Boolean
54
-
55
- # @!attribute include_selectors
56
- # CSS selectors. When provided, only matching subtrees (and their descendants) are
57
- # kept and everything else is dropped. When omitted, the entire document is kept.
58
- # Examples: "article.main", "#content", "[role=main]".
59
- #
60
- # @return [Array<String>, nil]
61
- optional :include_selectors, ContextDev::Internal::Type::ArrayOf[String], nil?: true
62
-
63
- # @!attribute max_age_ms
64
- # Return a cached result if a prior scrape for the same parameters exists and is
65
- # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
66
- # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
67
- #
68
- # @return [Integer, nil]
69
- optional :max_age_ms, Integer, nil?: true
70
-
71
- # @!attribute pdf
72
- # PDF parsing controls. Use start/end to limit text extraction and embedded-image
73
- # detection/OCR to an inclusive 1-based page range.
74
- #
75
- # @return [ContextDev::Models::WebWebScrapeHTMLParams::Pdf, nil]
76
- optional :pdf, -> { ContextDev::WebWebScrapeHTMLParams::Pdf }
77
-
78
- # @!attribute settle_animations
79
- # When true, waits briefly for CSS and transition animations to settle before
80
- # extracting HTML. Defaults to false. This adds a bit of latency in exchange for
81
- # more stable output on animated pages.
82
- #
83
- # @return [Boolean, nil]
84
- optional :settle_animations, ContextDev::Internal::Type::Boolean
85
-
86
- # @!attribute tags
87
- # Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50
88
- # characters.
89
- #
90
- # @return [Array<String>, nil]
91
- optional :tags, ContextDev::Internal::Type::ArrayOf[String]
92
-
93
- # @!attribute timeout_opts
94
- # Optional request deadline and behavior on timeout. For GET requests, use
95
- # timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
96
- # timeoutOpts object.
97
- #
98
- # @return [ContextDev::Models::WebWebScrapeHTMLParams::TimeoutOpts, nil]
99
- optional :timeout_opts, -> { ContextDev::WebWebScrapeHTMLParams::TimeoutOpts }
100
-
101
- # @!attribute use_main_content_only
102
- # When true, return only the page's main content in the HTML response, excluding
103
- # headers, footers, sidebars, and navigation when detectable.
104
- #
105
- # @return [Boolean, nil]
106
- optional :use_main_content_only, ContextDev::Internal::Type::Boolean
107
-
108
- # @!attribute wait_for_ms
109
- # Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
110
- # 30000 (30 seconds). When combined with timeoutOpts, timeoutOpts.milliseconds
111
- # must be at least waitForMs + 10000 ms; a shorter deadline is rejected with 400
112
- # TIMEOUT_TOO_SHORT_FOR_WAIT.
113
- #
114
- # @return [Integer, nil]
115
- optional :wait_for_ms, Integer, nil?: true
116
-
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_opts: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {})
127
- # Some parameter documentations has been truncated, see
128
- # {ContextDev::Models::WebWebScrapeHTMLParams} for more details.
129
- #
130
- # @param url [String] Full URL to scrape (must include http:// or https:// protocol)
131
- #
132
- # @param actions [Array<ContextDev::Models::WebWebScrapeHTMLParams::Action::Wait, ContextDev::Models::WebWebScrapeHTMLParams::Action::Perform, ContextDev::Models::WebWebScrapeHTMLParams::Action::Scroll>, nil] Optional browser actions executed in array order after the page loads and before
133
- #
134
- # @param country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Fetch the target page through a residential proxy in this country (ISO 3166-1 al
135
- #
136
- # @param exclude_selectors [Array<String>, nil] CSS selectors to remove from the result. Applied after includeSelectors. Exclusi
137
- #
138
- # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
139
- #
140
- # @param include_frames [Boolean] When true, iframes are rendered inline into the returned HTML.
141
- #
142
- # @param include_selectors [Array<String>, nil] CSS selectors. When provided, only matching subtrees (and their descendants) are
143
- #
144
- # @param max_age_ms [Integer, nil] Return a cached result if a prior scrape for the same parameters exists and is y
145
- #
146
- # @param pdf [ContextDev::Models::WebWebScrapeHTMLParams::Pdf] PDF parsing controls. Use start/end to limit text extraction and embedded-image
147
- #
148
- # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before extr
149
- #
150
- # @param tags [Array<String>] Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50 charac
151
- #
152
- # @param timeout_opts [ContextDev::Models::WebWebScrapeHTMLParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
153
- #
154
- # @param use_main_content_only [Boolean] 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:
157
- #
158
- # @param zdr [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
159
- #
160
- # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
161
-
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
- # Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.
176
- variant :scroll, -> { ContextDev::WebWebScrapeHTMLParams::Action::Scroll }
177
-
178
- class Wait < ContextDev::Internal::Type::BaseModel
179
- # @!attribute do_
180
- #
181
- # @return [Symbol, :wait]
182
- required :do_, const: :wait, api_name: :do
183
-
184
- # @!attribute time_ms
185
- #
186
- # @return [Integer]
187
- required :time_ms, Integer, api_name: :timeMs
188
-
189
- # @!method initialize(time_ms:, do_: :wait)
190
- # Pause for a fixed number of milliseconds before continuing to the next action.
191
- #
192
- # @param time_ms [Integer]
193
- # @param do_ [Symbol, :wait]
194
- end
195
-
196
- class Perform < ContextDev::Internal::Type::BaseModel
197
- # @!attribute action
198
- #
199
- # @return [String]
200
- required :action, String
201
-
202
- # @!attribute do_
203
- #
204
- # @return [Symbol, :perform]
205
- required :do_, const: :perform, api_name: :do
206
-
207
- # @!method initialize(action:, do_: :perform)
208
- # Resolve and perform one natural-language browser action.
209
- #
210
- # @param action [String]
211
- # @param do_ [Symbol, :perform]
212
- end
213
-
214
- class Scroll < ContextDev::Internal::Type::BaseModel
215
- # @!attribute do_
216
- #
217
- # @return [Symbol, :scroll]
218
- required :do_, const: :scroll, api_name: :do
219
-
220
- # @!attribute amount
221
- # Pixels per scroll, one visible viewport, or the current scroll boundary.
222
- # Defaults to viewport.
223
- #
224
- # @return [Integer, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Action::Scroll::Amount, nil]
225
- optional :amount, union: -> { ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Amount }
226
-
227
- # @!attribute container
228
- # CSS selector for the first matching scroll container. Defaults to the page.
229
- #
230
- # @return [String, nil]
231
- optional :container, String
232
-
233
- # @!attribute direction
234
- # Direction to scroll. Defaults to down.
235
- #
236
- # @return [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Action::Scroll::Direction, nil]
237
- optional :direction, enum: -> { ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Direction }
238
-
239
- # @!attribute max_scrolls
240
- # Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
241
- # changing. Defaults to 1.
242
- #
243
- # @return [Integer, nil]
244
- optional :max_scrolls, Integer, api_name: :maxScrolls
245
-
246
- # @!method initialize(amount: nil, container: nil, direction: nil, max_scrolls: nil, do_: :scroll)
247
- # Some parameter documentations has been truncated, see
248
- # {ContextDev::Models::WebWebScrapeHTMLParams::Action::Scroll} for more details.
249
- #
250
- # Scroll the page or a selected scrollable container, waiting adaptively for
251
- # content and dimensions to settle after each iteration.
252
- #
253
- # @param amount [Integer, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Action::Scroll::Amount] Pixels per scroll, one visible viewport, or the current scroll boundary. Default
254
- #
255
- # @param container [String] CSS selector for the first matching scroll container. Defaults to the page.
256
- #
257
- # @param direction [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Action::Scroll::Direction] Direction to scroll. Defaults to down.
258
- #
259
- # @param max_scrolls [Integer] Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
260
- #
261
- # @param do_ [Symbol, :scroll]
262
-
263
- # Pixels per scroll, one visible viewport, or the current scroll boundary.
264
- # Defaults to viewport.
265
- #
266
- # @see ContextDev::Models::WebWebScrapeHTMLParams::Action::Scroll#amount
267
- module Amount
268
- extend ContextDev::Internal::Type::Union
269
-
270
- variant Integer
271
-
272
- variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::Action::Scroll::Amount::VIEWPORT }
273
-
274
- variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::Action::Scroll::Amount::MAX }
275
-
276
- # @!method self.variants
277
- # @return [Array(Integer, Symbol)]
278
-
279
- define_sorbet_constant!(:Variants) do
280
- T.type_alias { T.any(Integer, ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Amount::TaggedSymbol) }
281
- end
282
-
283
- # @!group
284
-
285
- VIEWPORT = :viewport
286
- MAX = :max
287
-
288
- # @!endgroup
289
- end
290
-
291
- # Direction to scroll. Defaults to down.
292
- #
293
- # @see ContextDev::Models::WebWebScrapeHTMLParams::Action::Scroll#direction
294
- module Direction
295
- extend ContextDev::Internal::Type::Enum
296
-
297
- UP = :up
298
- DOWN = :down
299
- LEFT = :left
300
- RIGHT = :right
301
-
302
- # @!method self.values
303
- # @return [Array<Symbol>]
304
- end
305
- end
306
-
307
- # @!method self.variants
308
- # @return [Array(ContextDev::Models::WebWebScrapeHTMLParams::Action::Wait, ContextDev::Models::WebWebScrapeHTMLParams::Action::Perform, ContextDev::Models::WebWebScrapeHTMLParams::Action::Scroll)]
309
- end
310
-
311
- # Fetch the target page through a residential proxy in this country (ISO 3166-1
312
- # alpha-2).
313
- module Country
314
- extend ContextDev::Internal::Type::Enum
315
-
316
- AD = :ad
317
- AE = :ae
318
- AF = :af
319
- AG = :ag
320
- AI = :ai
321
- AL = :al
322
- AM = :am
323
- AO = :ao
324
- AR = :ar
325
- AT = :at
326
- AU = :au
327
- AW = :aw
328
- AZ = :az
329
- BA = :ba
330
- BB = :bb
331
- BD = :bd
332
- BE = :be
333
- BF = :bf
334
- BG = :bg
335
- BH = :bh
336
- BI = :bi
337
- BJ = :bj
338
- BM = :bm
339
- BN = :bn
340
- BO = :bo
341
- BQ = :bq
342
- BR = :br
343
- BS = :bs
344
- BW = :bw
345
- BY = :by
346
- BZ = :bz
347
- CA = :ca
348
- CD = :cd
349
- CF = :cf
350
- CG = :cg
351
- CH = :ch
352
- CI = :ci
353
- CL = :cl
354
- CM = :cm
355
- CN = :cn
356
- CO = :co
357
- CR = :cr
358
- CV = :cv
359
- CW = :cw
360
- CY = :cy
361
- CZ = :cz
362
- DE = :de
363
- DJ = :dj
364
- DK = :dk
365
- DM = :dm
366
- DO = :do
367
- DZ = :dz
368
- EC = :ec
369
- EE = :ee
370
- EG = :eg
371
- ES = :es
372
- ET = :et
373
- FI = :fi
374
- FJ = :fj
375
- FR = :fr
376
- GA = :ga
377
- GB = :gb
378
- GD = :gd
379
- GE = :ge
380
- GF = :gf
381
- GG = :gg
382
- GH = :gh
383
- GM = :gm
384
- GN = :gn
385
- GP = :gp
386
- GQ = :gq
387
- GR = :gr
388
- GT = :gt
389
- GU = :gu
390
- GW = :gw
391
- GY = :gy
392
- HK = :hk
393
- HN = :hn
394
- HR = :hr
395
- HT = :ht
396
- HU = :hu
397
- ID = :id
398
- IE = :ie
399
- IL = :il
400
- IM = :im
401
- IN = :in
402
- IQ = :iq
403
- IR = :ir
404
- IS = :is
405
- IT = :it
406
- JE = :je
407
- JM = :jm
408
- JO = :jo
409
- JP = :jp
410
- KE = :ke
411
- KG = :kg
412
- KH = :kh
413
- KN = :kn
414
- KR = :kr
415
- KW = :kw
416
- KY = :ky
417
- KZ = :kz
418
- LA = :la
419
- LB = :lb
420
- LC = :lc
421
- LK = :lk
422
- LR = :lr
423
- LS = :ls
424
- LT = :lt
425
- LU = :lu
426
- LV = :lv
427
- LY = :ly
428
- MA = :ma
429
- MC = :mc
430
- MD = :md
431
- ME = :me
432
- MF = :mf
433
- MG = :mg
434
- MK = :mk
435
- ML = :ml
436
- MM = :mm
437
- MN = :mn
438
- MO = :mo
439
- MQ = :mq
440
- MR = :mr
441
- MT = :mt
442
- MU = :mu
443
- MV = :mv
444
- MW = :mw
445
- MX = :mx
446
- MY = :my
447
- MZ = :mz
448
- NA = :na
449
- NC = :nc
450
- NE = :ne
451
- NG = :ng
452
- NI = :ni
453
- NL = :nl
454
- NO = :no
455
- NP = :np
456
- NZ = :nz
457
- OM = :om
458
- PA = :pa
459
- PE = :pe
460
- PF = :pf
461
- PG = :pg
462
- PH = :ph
463
- PK = :pk
464
- PL = :pl
465
- PR = :pr
466
- PS = :ps
467
- PT = :pt
468
- PY = :py
469
- QA = :qa
470
- RE = :re
471
- RO = :ro
472
- RS = :rs
473
- RU = :ru
474
- RW = :rw
475
- SA = :sa
476
- SC = :sc
477
- SD = :sd
478
- SE = :se
479
- SG = :sg
480
- SI = :si
481
- SK = :sk
482
- SL = :sl
483
- SM = :sm
484
- SN = :sn
485
- SO = :so
486
- SR = :sr
487
- SS = :ss
488
- ST = :st
489
- SV = :sv
490
- SX = :sx
491
- SY = :sy
492
- SZ = :sz
493
- TC = :tc
494
- TD = :td
495
- TG = :tg
496
- TH = :th
497
- TJ = :tj
498
- TL = :tl
499
- TM = :tm
500
- TN = :tn
501
- TR = :tr
502
- TT = :tt
503
- TW = :tw
504
- TZ = :tz
505
- UA = :ua
506
- UG = :ug
507
- US = :us
508
- UY = :uy
509
- UZ = :uz
510
- VC = :vc
511
- VE = :ve
512
- VG = :vg
513
- VI = :vi
514
- VN = :vn
515
- YE = :ye
516
- YT = :yt
517
- ZA = :za
518
- ZM = :zm
519
- ZW = :zw
520
-
521
- # @!method self.values
522
- # @return [Array<Symbol>]
523
- end
524
-
525
- class Pdf < ContextDev::Internal::Type::BaseModel
526
- # @!attribute end_
527
- # Last 1-based PDF page to parse. When omitted, parsing ends at the last page.
528
- # Must be greater than or equal to start when both are provided.
529
- #
530
- # @return [Integer, nil]
531
- optional :end_, Integer, api_name: :end
532
-
533
- # @!attribute ocr
534
- # When true, OCR the selected PDF pages that have no usable text layer (scans),
535
- # replacing each recovered page's text with the OCR result while pages with a real
536
- # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top
537
- # of the base request cost. When false, no OCR runs.
538
- #
539
- # @return [Boolean, nil]
540
- optional :ocr, ContextDev::Internal::Type::Boolean
541
-
542
- # @!attribute should_parse
543
- # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
544
- # a 400 PDF_SKIPPED is returned.
545
- #
546
- # @return [Boolean, nil]
547
- optional :should_parse, ContextDev::Internal::Type::Boolean, api_name: :shouldParse
548
-
549
- # @!attribute start
550
- # First 1-based PDF page to parse. When omitted, parsing starts at the first page.
551
- #
552
- # @return [Integer, nil]
553
- optional :start, Integer
554
-
555
- # @!method initialize(end_: nil, ocr: nil, should_parse: nil, start: nil)
556
- # Some parameter documentations has been truncated, see
557
- # {ContextDev::Models::WebWebScrapeHTMLParams::Pdf} for more details.
558
- #
559
- # PDF parsing controls. Use start/end to limit text extraction and embedded-image
560
- # detection/OCR to an inclusive 1-based page range.
561
- #
562
- # @param end_ [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus
563
- #
564
- # @param ocr [Boolean] When true, OCR the selected PDF pages that have no usable text layer (scans), re
565
- #
566
- # @param should_parse [Boolean] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
567
- #
568
- # @param start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page.
569
- end
570
-
571
- class TimeoutOpts < ContextDev::Internal::Type::BaseModel
572
- # @!attribute milliseconds
573
- # Request deadline in milliseconds. Maximum: 300000 (5 minutes).
574
- #
575
- # @return [Integer]
576
- required :milliseconds, Integer
577
-
578
- # @!attribute behavior
579
- # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
580
- # credits. "return-partial" returns usable results collected so far; if none are
581
- # available, the request still fails without charging credits. Partial results are
582
- # not cached as complete results. "return-partial" requires milliseconds of at
583
- # least 15000.
584
- #
585
- # @return [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::TimeoutOpts::Behavior, nil]
586
- optional :behavior, enum: -> { ContextDev::WebWebScrapeHTMLParams::TimeoutOpts::Behavior }
587
-
588
- # @!method initialize(milliseconds:, behavior: nil)
589
- # Some parameter documentations has been truncated, see
590
- # {ContextDev::Models::WebWebScrapeHTMLParams::TimeoutOpts} for more details.
591
- #
592
- # Optional request deadline and behavior on timeout. For GET requests, use
593
- # timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
594
- # timeoutOpts object.
595
- #
596
- # @param milliseconds [Integer] Request deadline in milliseconds. Maximum: 300000 (5 minutes).
597
- #
598
- # @param behavior [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::TimeoutOpts::Behavior] What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
599
-
600
- # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
601
- # credits. "return-partial" returns usable results collected so far; if none are
602
- # available, the request still fails without charging credits. Partial results are
603
- # not cached as complete results. "return-partial" requires milliseconds of at
604
- # least 15000.
605
- #
606
- # @see ContextDev::Models::WebWebScrapeHTMLParams::TimeoutOpts#behavior
607
- module Behavior
608
- extend ContextDev::Internal::Type::Enum
609
-
610
- FAIL = :fail
611
- RETURN_PARTIAL = :"return-partial"
612
-
613
- # @!method self.values
614
- # @return [Array<Symbol>]
615
- end
616
- end
617
-
618
- # Set to enabled to bypass shared caches and omit request and response content
619
- # from retained usage logs. Requires zero data retention to be enabled for your
620
- # organization (contact support@context.dev), otherwise the request fails with
621
- # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
622
- module Zdr
623
- extend ContextDev::Internal::Type::Enum
624
-
625
- ENABLED = :enabled
626
- DISABLED = :disabled
627
-
628
- # @!method self.values
629
- # @return [Array<Symbol>]
630
- end
631
- end
632
- end
633
- end