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