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