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,1690 +0,0 @@
1
- # typed: strong
2
-
3
- module ContextDev
4
- module Models
5
- class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel
6
- extend ContextDev::Internal::Type::RequestParameters::Converter
7
- include ContextDev::Internal::Type::RequestParameters
8
-
9
- OrHash =
10
- T.type_alias do
11
- T.any(
12
- ContextDev::WebWebScrapeHTMLParams,
13
- ContextDev::Internal::AnyHash
14
- )
15
- end
16
-
17
- # Full URL to scrape (must include http:// or https:// protocol)
18
- sig { returns(String) }
19
- attr_accessor :url
20
-
21
- # Optional browser actions executed in array order after the page loads and before
22
- # content is captured. Requires a paid plan. Send a JSON array in the query
23
- # parameter. Maximum: 5 actions.
24
- sig do
25
- returns(
26
- T.nilable(
27
- T::Array[
28
- T.any(
29
- ContextDev::WebWebScrapeHTMLParams::Action::Wait,
30
- ContextDev::WebWebScrapeHTMLParams::Action::Perform,
31
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll
32
- )
33
- ]
34
- )
35
- )
36
- end
37
- attr_accessor :actions
38
-
39
- # Fetch the target page through a residential proxy in this country (ISO 3166-1
40
- # alpha-2).
41
- sig do
42
- returns(
43
- T.nilable(ContextDev::WebWebScrapeHTMLParams::Country::OrSymbol)
44
- )
45
- end
46
- attr_reader :country
47
-
48
- sig do
49
- params(
50
- country: ContextDev::WebWebScrapeHTMLParams::Country::OrSymbol
51
- ).void
52
- end
53
- attr_writer :country
54
-
55
- # CSS selectors to remove from the result. Applied after includeSelectors.
56
- # Exclusion takes precedence: an element matching both is removed. Examples:
57
- # "nav", "footer", ".ad-banner", "[aria-hidden=true]".
58
- sig { returns(T.nilable(T::Array[String])) }
59
- attr_accessor :exclude_selectors
60
-
61
- # Optional CSS extraction rules applied to the returned HTML after selector and
62
- # main-content filtering. Use selector strings ("h1", "a@href") or objects with
63
- # selector, type (item or list), and output (text, html, @attribute, or nested
64
- # rules). Text whitespace is normalized; html includes the matched element;
65
- # attributes are returned as written. Missing items are null and missing lists are
66
- # empty. CSS only; XPath is not supported. Maximum: 100 fields across 5 levels.
67
- # Send a JSON-encoded string in the extractRules query parameter.
68
- sig do
69
- returns(
70
- T.nilable(
71
- T::Hash[
72
- Symbol,
73
- T.any(
74
- String,
75
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1
76
- )
77
- ]
78
- )
79
- )
80
- end
81
- attr_reader :extract_rules
82
-
83
- sig do
84
- params(
85
- extract_rules:
86
- T::Hash[
87
- Symbol,
88
- T.any(
89
- String,
90
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::OrHash
91
- )
92
- ]
93
- ).void
94
- end
95
- attr_writer :extract_rules
96
-
97
- # Optional outbound HTTP headers forwarded only to the target URL, sent as
98
- # deep-object query params such as headers[X-Custom]=value. When provided, caching
99
- # is bypassed: the result is neither read from nor written to cache.
100
- sig { returns(T.nilable(T::Hash[Symbol, String])) }
101
- attr_reader :headers
102
-
103
- sig { params(headers: T::Hash[Symbol, String]).void }
104
- attr_writer :headers
105
-
106
- # When true, iframes are rendered inline into the returned HTML.
107
- sig { returns(T.nilable(T::Boolean)) }
108
- attr_reader :include_frames
109
-
110
- sig { params(include_frames: T::Boolean).void }
111
- attr_writer :include_frames
112
-
113
- # CSS selectors. When provided, only matching subtrees (and their descendants) are
114
- # kept and everything else is dropped. When omitted, the entire document is kept.
115
- # Examples: "article.main", "#content", "[role=main]".
116
- sig { returns(T.nilable(T::Array[String])) }
117
- attr_accessor :include_selectors
118
-
119
- # Return a cached result if a prior scrape for the same parameters exists and is
120
- # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
121
- # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
122
- sig { returns(T.nilable(Integer)) }
123
- attr_accessor :max_age_ms
124
-
125
- # PDF parsing controls. Use start/end to limit text extraction and embedded-image
126
- # detection/OCR to an inclusive 1-based page range.
127
- sig { returns(T.nilable(ContextDev::WebWebScrapeHTMLParams::Pdf)) }
128
- attr_reader :pdf
129
-
130
- sig { params(pdf: ContextDev::WebWebScrapeHTMLParams::Pdf::OrHash).void }
131
- attr_writer :pdf
132
-
133
- # When true, waits briefly for CSS and transition animations to settle before
134
- # extracting HTML. Defaults to false. This adds a bit of latency in exchange for
135
- # more stable output on animated pages.
136
- sig { returns(T.nilable(T::Boolean)) }
137
- attr_reader :settle_animations
138
-
139
- sig { params(settle_animations: T::Boolean).void }
140
- attr_writer :settle_animations
141
-
142
- # Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50
143
- # characters.
144
- sig { returns(T.nilable(T::Array[String])) }
145
- attr_reader :tags
146
-
147
- sig { params(tags: T::Array[String]).void }
148
- attr_writer :tags
149
-
150
- # Optional request deadline and behavior on timeout. For GET requests, use
151
- # timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
152
- # timeoutOpts object.
153
- sig do
154
- returns(T.nilable(ContextDev::WebWebScrapeHTMLParams::TimeoutOpts))
155
- end
156
- attr_reader :timeout_opts
157
-
158
- sig do
159
- params(
160
- timeout_opts: ContextDev::WebWebScrapeHTMLParams::TimeoutOpts::OrHash
161
- ).void
162
- end
163
- attr_writer :timeout_opts
164
-
165
- # When true, return only the page's main content in the HTML response, excluding
166
- # headers, footers, sidebars, and navigation when detectable.
167
- sig { returns(T.nilable(T::Boolean)) }
168
- attr_reader :use_main_content_only
169
-
170
- sig { params(use_main_content_only: T::Boolean).void }
171
- attr_writer :use_main_content_only
172
-
173
- # Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
174
- # 30000 (30 seconds). When combined with timeoutOpts, timeoutOpts.milliseconds
175
- # must be at least waitForMs + 10000 ms; a shorter deadline is rejected with 400
176
- # TIMEOUT_TOO_SHORT_FOR_WAIT.
177
- sig { returns(T.nilable(Integer)) }
178
- attr_accessor :wait_for_ms
179
-
180
- # Set to enabled to bypass shared caches and omit request and response content
181
- # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
182
- # omitted. Requires zero data retention to be enabled for your organization
183
- # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
184
- # Successful ZDR responses include X-Context-ZDR: true.
185
- sig do
186
- returns(T.nilable(ContextDev::WebWebScrapeHTMLParams::Zdr::OrSymbol))
187
- end
188
- attr_reader :zdr
189
-
190
- sig do
191
- params(zdr: ContextDev::WebWebScrapeHTMLParams::Zdr::OrSymbol).void
192
- end
193
- attr_writer :zdr
194
-
195
- sig do
196
- params(
197
- url: String,
198
- actions:
199
- T.nilable(
200
- T::Array[
201
- T.any(
202
- ContextDev::WebWebScrapeHTMLParams::Action::Wait::OrHash,
203
- ContextDev::WebWebScrapeHTMLParams::Action::Perform::OrHash,
204
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::OrHash
205
- )
206
- ]
207
- ),
208
- country: ContextDev::WebWebScrapeHTMLParams::Country::OrSymbol,
209
- exclude_selectors: T.nilable(T::Array[String]),
210
- extract_rules:
211
- T::Hash[
212
- Symbol,
213
- T.any(
214
- String,
215
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::OrHash
216
- )
217
- ],
218
- headers: T::Hash[Symbol, String],
219
- include_frames: T::Boolean,
220
- include_selectors: T.nilable(T::Array[String]),
221
- max_age_ms: T.nilable(Integer),
222
- pdf: ContextDev::WebWebScrapeHTMLParams::Pdf::OrHash,
223
- settle_animations: T::Boolean,
224
- tags: T::Array[String],
225
- timeout_opts: ContextDev::WebWebScrapeHTMLParams::TimeoutOpts::OrHash,
226
- use_main_content_only: T::Boolean,
227
- wait_for_ms: T.nilable(Integer),
228
- zdr: ContextDev::WebWebScrapeHTMLParams::Zdr::OrSymbol,
229
- request_options: ContextDev::RequestOptions::OrHash
230
- ).returns(T.attached_class)
231
- end
232
- def self.new(
233
- # Full URL to scrape (must include http:// or https:// protocol)
234
- url:,
235
- # Optional browser actions executed in array order after the page loads and before
236
- # content is captured. Requires a paid plan. Send a JSON array in the query
237
- # parameter. Maximum: 5 actions.
238
- actions: nil,
239
- # Fetch the target page through a residential proxy in this country (ISO 3166-1
240
- # alpha-2).
241
- country: nil,
242
- # CSS selectors to remove from the result. Applied after includeSelectors.
243
- # Exclusion takes precedence: an element matching both is removed. Examples:
244
- # "nav", "footer", ".ad-banner", "[aria-hidden=true]".
245
- exclude_selectors: nil,
246
- # Optional CSS extraction rules applied to the returned HTML after selector and
247
- # main-content filtering. Use selector strings ("h1", "a@href") or objects with
248
- # selector, type (item or list), and output (text, html, @attribute, or nested
249
- # rules). Text whitespace is normalized; html includes the matched element;
250
- # attributes are returned as written. Missing items are null and missing lists are
251
- # empty. CSS only; XPath is not supported. Maximum: 100 fields across 5 levels.
252
- # Send a JSON-encoded string in the extractRules query parameter.
253
- extract_rules: nil,
254
- # Optional outbound HTTP headers forwarded only to the target URL, sent as
255
- # deep-object query params such as headers[X-Custom]=value. When provided, caching
256
- # is bypassed: the result is neither read from nor written to cache.
257
- headers: nil,
258
- # When true, iframes are rendered inline into the returned HTML.
259
- include_frames: nil,
260
- # CSS selectors. When provided, only matching subtrees (and their descendants) are
261
- # kept and everything else is dropped. When omitted, the entire document is kept.
262
- # Examples: "article.main", "#content", "[role=main]".
263
- include_selectors: nil,
264
- # Return a cached result if a prior scrape for the same parameters exists and is
265
- # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
266
- # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
267
- max_age_ms: nil,
268
- # PDF parsing controls. Use start/end to limit text extraction and embedded-image
269
- # detection/OCR to an inclusive 1-based page range.
270
- pdf: nil,
271
- # When true, waits briefly for CSS and transition animations to settle before
272
- # extracting HTML. Defaults to false. This adds a bit of latency in exchange for
273
- # more stable output on animated pages.
274
- settle_animations: nil,
275
- # Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50
276
- # characters.
277
- tags: nil,
278
- # Optional request deadline and behavior on timeout. For GET requests, use
279
- # timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
280
- # timeoutOpts object.
281
- timeout_opts: nil,
282
- # When true, return only the page's main content in the HTML response, excluding
283
- # headers, footers, sidebars, and navigation when detectable.
284
- use_main_content_only: nil,
285
- # Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
286
- # 30000 (30 seconds). When combined with timeoutOpts, timeoutOpts.milliseconds
287
- # must be at least waitForMs + 10000 ms; a shorter deadline is rejected with 400
288
- # TIMEOUT_TOO_SHORT_FOR_WAIT.
289
- wait_for_ms: nil,
290
- # Set to enabled to bypass shared caches and omit request and response content
291
- # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
292
- # omitted. Requires zero data retention to be enabled for your organization
293
- # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
294
- # Successful ZDR responses include X-Context-ZDR: true.
295
- zdr: nil,
296
- request_options: {}
297
- )
298
- end
299
-
300
- sig do
301
- override.returns(
302
- {
303
- url: String,
304
- actions:
305
- T.nilable(
306
- T::Array[
307
- T.any(
308
- ContextDev::WebWebScrapeHTMLParams::Action::Wait,
309
- ContextDev::WebWebScrapeHTMLParams::Action::Perform,
310
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll
311
- )
312
- ]
313
- ),
314
- country: ContextDev::WebWebScrapeHTMLParams::Country::OrSymbol,
315
- exclude_selectors: T.nilable(T::Array[String]),
316
- extract_rules:
317
- T::Hash[
318
- Symbol,
319
- T.any(
320
- String,
321
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1
322
- )
323
- ],
324
- headers: T::Hash[Symbol, String],
325
- include_frames: T::Boolean,
326
- include_selectors: T.nilable(T::Array[String]),
327
- max_age_ms: T.nilable(Integer),
328
- pdf: ContextDev::WebWebScrapeHTMLParams::Pdf,
329
- settle_animations: T::Boolean,
330
- tags: T::Array[String],
331
- timeout_opts: ContextDev::WebWebScrapeHTMLParams::TimeoutOpts,
332
- use_main_content_only: T::Boolean,
333
- wait_for_ms: T.nilable(Integer),
334
- zdr: ContextDev::WebWebScrapeHTMLParams::Zdr::OrSymbol,
335
- request_options: ContextDev::RequestOptions
336
- }
337
- )
338
- end
339
- def to_hash
340
- end
341
-
342
- # Browser action discriminated by `do`. Each variant exposes only its applicable
343
- # fields.
344
- module Action
345
- extend ContextDev::Internal::Type::Union
346
-
347
- Variants =
348
- T.type_alias do
349
- T.any(
350
- ContextDev::WebWebScrapeHTMLParams::Action::Wait,
351
- ContextDev::WebWebScrapeHTMLParams::Action::Perform,
352
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll
353
- )
354
- end
355
-
356
- class Wait < ContextDev::Internal::Type::BaseModel
357
- OrHash =
358
- T.type_alias do
359
- T.any(
360
- ContextDev::WebWebScrapeHTMLParams::Action::Wait,
361
- ContextDev::Internal::AnyHash
362
- )
363
- end
364
-
365
- sig { returns(Symbol) }
366
- attr_accessor :do_
367
-
368
- sig { returns(Integer) }
369
- attr_accessor :time_ms
370
-
371
- # Pause for a fixed number of milliseconds before continuing to the next action.
372
- sig do
373
- params(time_ms: Integer, do_: Symbol).returns(T.attached_class)
374
- end
375
- def self.new(time_ms:, do_: :wait)
376
- end
377
-
378
- sig { override.returns({ do_: Symbol, time_ms: Integer }) }
379
- def to_hash
380
- end
381
- end
382
-
383
- class Perform < ContextDev::Internal::Type::BaseModel
384
- OrHash =
385
- T.type_alias do
386
- T.any(
387
- ContextDev::WebWebScrapeHTMLParams::Action::Perform,
388
- ContextDev::Internal::AnyHash
389
- )
390
- end
391
-
392
- sig { returns(String) }
393
- attr_accessor :action
394
-
395
- sig { returns(Symbol) }
396
- attr_accessor :do_
397
-
398
- # Resolve and perform one natural-language browser action.
399
- sig { params(action: String, do_: Symbol).returns(T.attached_class) }
400
- def self.new(action:, do_: :perform)
401
- end
402
-
403
- sig { override.returns({ action: String, do_: Symbol }) }
404
- def to_hash
405
- end
406
- end
407
-
408
- class Scroll < ContextDev::Internal::Type::BaseModel
409
- OrHash =
410
- T.type_alias do
411
- T.any(
412
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll,
413
- ContextDev::Internal::AnyHash
414
- )
415
- end
416
-
417
- sig { returns(Symbol) }
418
- attr_accessor :do_
419
-
420
- # Pixels per scroll, one visible viewport, or the current scroll boundary.
421
- # Defaults to viewport.
422
- sig do
423
- returns(
424
- T.nilable(
425
- T.any(
426
- Integer,
427
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Amount::OrSymbol
428
- )
429
- )
430
- )
431
- end
432
- attr_reader :amount
433
-
434
- sig do
435
- params(
436
- amount:
437
- T.any(
438
- Integer,
439
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Amount::OrSymbol
440
- )
441
- ).void
442
- end
443
- attr_writer :amount
444
-
445
- # CSS selector for the first matching scroll container. Defaults to the page.
446
- sig { returns(T.nilable(String)) }
447
- attr_reader :container
448
-
449
- sig { params(container: String).void }
450
- attr_writer :container
451
-
452
- # Direction to scroll. Defaults to down.
453
- sig do
454
- returns(
455
- T.nilable(
456
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Direction::OrSymbol
457
- )
458
- )
459
- end
460
- attr_reader :direction
461
-
462
- sig do
463
- params(
464
- direction:
465
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Direction::OrSymbol
466
- ).void
467
- end
468
- attr_writer :direction
469
-
470
- # Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
471
- # changing. Defaults to 1.
472
- sig { returns(T.nilable(Integer)) }
473
- attr_reader :max_scrolls
474
-
475
- sig { params(max_scrolls: Integer).void }
476
- attr_writer :max_scrolls
477
-
478
- # Scroll the page or a selected scrollable container, waiting adaptively for
479
- # content and dimensions to settle after each iteration.
480
- sig do
481
- params(
482
- amount:
483
- T.any(
484
- Integer,
485
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Amount::OrSymbol
486
- ),
487
- container: String,
488
- direction:
489
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Direction::OrSymbol,
490
- max_scrolls: Integer,
491
- do_: Symbol
492
- ).returns(T.attached_class)
493
- end
494
- def self.new(
495
- # Pixels per scroll, one visible viewport, or the current scroll boundary.
496
- # Defaults to viewport.
497
- amount: nil,
498
- # CSS selector for the first matching scroll container. Defaults to the page.
499
- container: nil,
500
- # Direction to scroll. Defaults to down.
501
- direction: nil,
502
- # Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
503
- # changing. Defaults to 1.
504
- max_scrolls: nil,
505
- do_: :scroll
506
- )
507
- end
508
-
509
- sig do
510
- override.returns(
511
- {
512
- do_: Symbol,
513
- amount:
514
- T.any(
515
- Integer,
516
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Amount::OrSymbol
517
- ),
518
- container: String,
519
- direction:
520
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Direction::OrSymbol,
521
- max_scrolls: Integer
522
- }
523
- )
524
- end
525
- def to_hash
526
- end
527
-
528
- # Pixels per scroll, one visible viewport, or the current scroll boundary.
529
- # Defaults to viewport.
530
- module Amount
531
- extend ContextDev::Internal::Type::Union
532
-
533
- Variants =
534
- T.type_alias do
535
- T.any(
536
- Integer,
537
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Amount::TaggedSymbol
538
- )
539
- end
540
-
541
- sig do
542
- override.returns(
543
- T::Array[
544
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Amount::Variants
545
- ]
546
- )
547
- end
548
- def self.variants
549
- end
550
-
551
- TaggedSymbol =
552
- T.type_alias do
553
- T.all(
554
- Symbol,
555
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Amount
556
- )
557
- end
558
- OrSymbol = T.type_alias { T.any(Symbol, String) }
559
-
560
- VIEWPORT =
561
- T.let(
562
- :viewport,
563
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Amount::TaggedSymbol
564
- )
565
- MAX =
566
- T.let(
567
- :max,
568
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Amount::TaggedSymbol
569
- )
570
- end
571
-
572
- # Direction to scroll. Defaults to down.
573
- module Direction
574
- extend ContextDev::Internal::Type::Enum
575
-
576
- TaggedSymbol =
577
- T.type_alias do
578
- T.all(
579
- Symbol,
580
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Direction
581
- )
582
- end
583
- OrSymbol = T.type_alias { T.any(Symbol, String) }
584
-
585
- UP =
586
- T.let(
587
- :up,
588
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Direction::TaggedSymbol
589
- )
590
- DOWN =
591
- T.let(
592
- :down,
593
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Direction::TaggedSymbol
594
- )
595
- LEFT =
596
- T.let(
597
- :left,
598
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Direction::TaggedSymbol
599
- )
600
- RIGHT =
601
- T.let(
602
- :right,
603
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Direction::TaggedSymbol
604
- )
605
-
606
- sig do
607
- override.returns(
608
- T::Array[
609
- ContextDev::WebWebScrapeHTMLParams::Action::Scroll::Direction::TaggedSymbol
610
- ]
611
- )
612
- end
613
- def self.values
614
- end
615
- end
616
- end
617
-
618
- sig do
619
- override.returns(
620
- T::Array[ContextDev::WebWebScrapeHTMLParams::Action::Variants]
621
- )
622
- end
623
- def self.variants
624
- end
625
- end
626
-
627
- # Fetch the target page through a residential proxy in this country (ISO 3166-1
628
- # alpha-2).
629
- module Country
630
- extend ContextDev::Internal::Type::Enum
631
-
632
- TaggedSymbol =
633
- T.type_alias do
634
- T.all(Symbol, ContextDev::WebWebScrapeHTMLParams::Country)
635
- end
636
- OrSymbol = T.type_alias { T.any(Symbol, String) }
637
-
638
- AD =
639
- T.let(:ad, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
640
- AE =
641
- T.let(:ae, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
642
- AF =
643
- T.let(:af, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
644
- AG =
645
- T.let(:ag, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
646
- AI =
647
- T.let(:ai, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
648
- AL =
649
- T.let(:al, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
650
- AM =
651
- T.let(:am, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
652
- AO =
653
- T.let(:ao, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
654
- AR =
655
- T.let(:ar, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
656
- AT =
657
- T.let(:at, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
658
- AU =
659
- T.let(:au, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
660
- AW =
661
- T.let(:aw, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
662
- AZ =
663
- T.let(:az, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
664
- BA =
665
- T.let(:ba, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
666
- BB =
667
- T.let(:bb, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
668
- BD =
669
- T.let(:bd, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
670
- BE =
671
- T.let(:be, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
672
- BF =
673
- T.let(:bf, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
674
- BG =
675
- T.let(:bg, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
676
- BH =
677
- T.let(:bh, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
678
- BI =
679
- T.let(:bi, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
680
- BJ =
681
- T.let(:bj, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
682
- BM =
683
- T.let(:bm, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
684
- BN =
685
- T.let(:bn, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
686
- BO =
687
- T.let(:bo, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
688
- BQ =
689
- T.let(:bq, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
690
- BR =
691
- T.let(:br, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
692
- BS =
693
- T.let(:bs, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
694
- BW =
695
- T.let(:bw, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
696
- BY =
697
- T.let(:by, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
698
- BZ =
699
- T.let(:bz, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
700
- CA =
701
- T.let(:ca, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
702
- CD =
703
- T.let(:cd, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
704
- CF =
705
- T.let(:cf, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
706
- CG =
707
- T.let(:cg, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
708
- CH =
709
- T.let(:ch, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
710
- CI =
711
- T.let(:ci, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
712
- CL =
713
- T.let(:cl, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
714
- CM =
715
- T.let(:cm, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
716
- CN =
717
- T.let(:cn, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
718
- CO =
719
- T.let(:co, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
720
- CR =
721
- T.let(:cr, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
722
- CV =
723
- T.let(:cv, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
724
- CW =
725
- T.let(:cw, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
726
- CY =
727
- T.let(:cy, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
728
- CZ =
729
- T.let(:cz, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
730
- DE =
731
- T.let(:de, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
732
- DJ =
733
- T.let(:dj, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
734
- DK =
735
- T.let(:dk, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
736
- DM =
737
- T.let(:dm, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
738
- DO =
739
- T.let(:do, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
740
- DZ =
741
- T.let(:dz, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
742
- EC =
743
- T.let(:ec, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
744
- EE =
745
- T.let(:ee, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
746
- EG =
747
- T.let(:eg, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
748
- ES =
749
- T.let(:es, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
750
- ET =
751
- T.let(:et, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
752
- FI =
753
- T.let(:fi, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
754
- FJ =
755
- T.let(:fj, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
756
- FR =
757
- T.let(:fr, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
758
- GA =
759
- T.let(:ga, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
760
- GB =
761
- T.let(:gb, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
762
- GD =
763
- T.let(:gd, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
764
- GE =
765
- T.let(:ge, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
766
- GF =
767
- T.let(:gf, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
768
- GG =
769
- T.let(:gg, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
770
- GH =
771
- T.let(:gh, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
772
- GM =
773
- T.let(:gm, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
774
- GN =
775
- T.let(:gn, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
776
- GP =
777
- T.let(:gp, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
778
- GQ =
779
- T.let(:gq, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
780
- GR =
781
- T.let(:gr, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
782
- GT =
783
- T.let(:gt, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
784
- GU =
785
- T.let(:gu, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
786
- GW =
787
- T.let(:gw, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
788
- GY =
789
- T.let(:gy, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
790
- HK =
791
- T.let(:hk, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
792
- HN =
793
- T.let(:hn, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
794
- HR =
795
- T.let(:hr, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
796
- HT =
797
- T.let(:ht, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
798
- HU =
799
- T.let(:hu, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
800
- ID =
801
- T.let(:id, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
802
- IE =
803
- T.let(:ie, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
804
- IL =
805
- T.let(:il, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
806
- IM =
807
- T.let(:im, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
808
- IN =
809
- T.let(:in, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
810
- IQ =
811
- T.let(:iq, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
812
- IR =
813
- T.let(:ir, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
814
- IS =
815
- T.let(:is, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
816
- IT =
817
- T.let(:it, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
818
- JE =
819
- T.let(:je, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
820
- JM =
821
- T.let(:jm, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
822
- JO =
823
- T.let(:jo, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
824
- JP =
825
- T.let(:jp, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
826
- KE =
827
- T.let(:ke, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
828
- KG =
829
- T.let(:kg, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
830
- KH =
831
- T.let(:kh, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
832
- KN =
833
- T.let(:kn, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
834
- KR =
835
- T.let(:kr, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
836
- KW =
837
- T.let(:kw, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
838
- KY =
839
- T.let(:ky, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
840
- KZ =
841
- T.let(:kz, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
842
- LA =
843
- T.let(:la, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
844
- LB =
845
- T.let(:lb, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
846
- LC =
847
- T.let(:lc, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
848
- LK =
849
- T.let(:lk, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
850
- LR =
851
- T.let(:lr, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
852
- LS =
853
- T.let(:ls, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
854
- LT =
855
- T.let(:lt, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
856
- LU =
857
- T.let(:lu, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
858
- LV =
859
- T.let(:lv, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
860
- LY =
861
- T.let(:ly, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
862
- MA =
863
- T.let(:ma, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
864
- MC =
865
- T.let(:mc, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
866
- MD =
867
- T.let(:md, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
868
- ME =
869
- T.let(:me, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
870
- MF =
871
- T.let(:mf, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
872
- MG =
873
- T.let(:mg, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
874
- MK =
875
- T.let(:mk, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
876
- ML =
877
- T.let(:ml, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
878
- MM =
879
- T.let(:mm, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
880
- MN =
881
- T.let(:mn, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
882
- MO =
883
- T.let(:mo, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
884
- MQ =
885
- T.let(:mq, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
886
- MR =
887
- T.let(:mr, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
888
- MT =
889
- T.let(:mt, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
890
- MU =
891
- T.let(:mu, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
892
- MV =
893
- T.let(:mv, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
894
- MW =
895
- T.let(:mw, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
896
- MX =
897
- T.let(:mx, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
898
- MY =
899
- T.let(:my, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
900
- MZ =
901
- T.let(:mz, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
902
- NA =
903
- T.let(:na, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
904
- NC =
905
- T.let(:nc, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
906
- NE =
907
- T.let(:ne, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
908
- NG =
909
- T.let(:ng, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
910
- NI =
911
- T.let(:ni, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
912
- NL =
913
- T.let(:nl, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
914
- NO =
915
- T.let(:no, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
916
- NP =
917
- T.let(:np, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
918
- NZ =
919
- T.let(:nz, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
920
- OM =
921
- T.let(:om, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
922
- PA =
923
- T.let(:pa, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
924
- PE =
925
- T.let(:pe, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
926
- PF =
927
- T.let(:pf, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
928
- PG =
929
- T.let(:pg, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
930
- PH =
931
- T.let(:ph, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
932
- PK =
933
- T.let(:pk, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
934
- PL =
935
- T.let(:pl, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
936
- PR =
937
- T.let(:pr, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
938
- PS =
939
- T.let(:ps, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
940
- PT =
941
- T.let(:pt, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
942
- PY =
943
- T.let(:py, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
944
- QA =
945
- T.let(:qa, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
946
- RE =
947
- T.let(:re, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
948
- RO =
949
- T.let(:ro, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
950
- RS =
951
- T.let(:rs, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
952
- RU =
953
- T.let(:ru, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
954
- RW =
955
- T.let(:rw, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
956
- SA =
957
- T.let(:sa, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
958
- SC =
959
- T.let(:sc, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
960
- SD =
961
- T.let(:sd, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
962
- SE =
963
- T.let(:se, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
964
- SG =
965
- T.let(:sg, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
966
- SI =
967
- T.let(:si, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
968
- SK =
969
- T.let(:sk, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
970
- SL =
971
- T.let(:sl, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
972
- SM =
973
- T.let(:sm, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
974
- SN =
975
- T.let(:sn, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
976
- SO =
977
- T.let(:so, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
978
- SR =
979
- T.let(:sr, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
980
- SS =
981
- T.let(:ss, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
982
- ST =
983
- T.let(:st, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
984
- SV =
985
- T.let(:sv, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
986
- SX =
987
- T.let(:sx, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
988
- SY =
989
- T.let(:sy, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
990
- SZ =
991
- T.let(:sz, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
992
- TC =
993
- T.let(:tc, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
994
- TD =
995
- T.let(:td, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
996
- TG =
997
- T.let(:tg, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
998
- TH =
999
- T.let(:th, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1000
- TJ =
1001
- T.let(:tj, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1002
- TL =
1003
- T.let(:tl, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1004
- TM =
1005
- T.let(:tm, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1006
- TN =
1007
- T.let(:tn, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1008
- TR =
1009
- T.let(:tr, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1010
- TT =
1011
- T.let(:tt, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1012
- TW =
1013
- T.let(:tw, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1014
- TZ =
1015
- T.let(:tz, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1016
- UA =
1017
- T.let(:ua, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1018
- UG =
1019
- T.let(:ug, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1020
- US =
1021
- T.let(:us, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1022
- UY =
1023
- T.let(:uy, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1024
- UZ =
1025
- T.let(:uz, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1026
- VC =
1027
- T.let(:vc, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1028
- VE =
1029
- T.let(:ve, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1030
- VG =
1031
- T.let(:vg, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1032
- VI =
1033
- T.let(:vi, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1034
- VN =
1035
- T.let(:vn, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1036
- YE =
1037
- T.let(:ye, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1038
- YT =
1039
- T.let(:yt, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1040
- ZA =
1041
- T.let(:za, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1042
- ZM =
1043
- T.let(:zm, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1044
- ZW =
1045
- T.let(:zw, ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol)
1046
-
1047
- sig do
1048
- override.returns(
1049
- T::Array[ContextDev::WebWebScrapeHTMLParams::Country::TaggedSymbol]
1050
- )
1051
- end
1052
- def self.values
1053
- end
1054
- end
1055
-
1056
- module ExtractRule
1057
- extend ContextDev::Internal::Type::Union
1058
-
1059
- Variants =
1060
- T.type_alias do
1061
- T.any(
1062
- String,
1063
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1
1064
- )
1065
- end
1066
-
1067
- class UnionMember1 < ContextDev::Internal::Type::BaseModel
1068
- OrHash =
1069
- T.type_alias do
1070
- T.any(
1071
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1,
1072
- ContextDev::Internal::AnyHash
1073
- )
1074
- end
1075
-
1076
- sig { returns(String) }
1077
- attr_accessor :selector
1078
-
1079
- sig do
1080
- returns(
1081
- T.nilable(
1082
- T.any(
1083
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::OrSymbol,
1084
- String,
1085
- T::Hash[
1086
- Symbol,
1087
- T.any(
1088
- String,
1089
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1
1090
- )
1091
- ]
1092
- )
1093
- )
1094
- )
1095
- end
1096
- attr_reader :output
1097
-
1098
- sig do
1099
- params(
1100
- output:
1101
- T.any(
1102
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::OrSymbol,
1103
- String,
1104
- T::Hash[
1105
- Symbol,
1106
- T.any(
1107
- String,
1108
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::OrHash
1109
- )
1110
- ]
1111
- )
1112
- ).void
1113
- end
1114
- attr_writer :output
1115
-
1116
- sig do
1117
- returns(
1118
- T.nilable(
1119
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Type::OrSymbol
1120
- )
1121
- )
1122
- end
1123
- attr_reader :type
1124
-
1125
- sig do
1126
- params(
1127
- type:
1128
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Type::OrSymbol
1129
- ).void
1130
- end
1131
- attr_writer :type
1132
-
1133
- sig do
1134
- params(
1135
- selector: String,
1136
- output:
1137
- T.any(
1138
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::OrSymbol,
1139
- String,
1140
- T::Hash[
1141
- Symbol,
1142
- T.any(
1143
- String,
1144
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::OrHash
1145
- )
1146
- ]
1147
- ),
1148
- type:
1149
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Type::OrSymbol
1150
- ).returns(T.attached_class)
1151
- end
1152
- def self.new(selector:, output: nil, type: nil)
1153
- end
1154
-
1155
- sig do
1156
- override.returns(
1157
- {
1158
- selector: String,
1159
- output:
1160
- T.any(
1161
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::OrSymbol,
1162
- String,
1163
- T::Hash[
1164
- Symbol,
1165
- T.any(
1166
- String,
1167
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1
1168
- )
1169
- ]
1170
- ),
1171
- type:
1172
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Type::OrSymbol
1173
- }
1174
- )
1175
- end
1176
- def to_hash
1177
- end
1178
-
1179
- module Output
1180
- extend ContextDev::Internal::Type::Union
1181
-
1182
- Variants =
1183
- T.type_alias do
1184
- T.any(
1185
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::TaggedSymbol,
1186
- String,
1187
- T::Hash[
1188
- Symbol,
1189
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::Variants
1190
- ]
1191
- )
1192
- end
1193
-
1194
- module HTMLExtractionRule
1195
- extend ContextDev::Internal::Type::Union
1196
-
1197
- Variants =
1198
- T.type_alias do
1199
- T.any(
1200
- String,
1201
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1
1202
- )
1203
- end
1204
-
1205
- class UnionMember1 < ContextDev::Internal::Type::BaseModel
1206
- OrHash =
1207
- T.type_alias do
1208
- T.any(
1209
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1,
1210
- ContextDev::Internal::AnyHash
1211
- )
1212
- end
1213
-
1214
- sig { returns(String) }
1215
- attr_accessor :selector
1216
-
1217
- sig do
1218
- returns(
1219
- T.nilable(
1220
- T.any(
1221
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Output::OrSymbol,
1222
- String,
1223
- T.anything
1224
- )
1225
- )
1226
- )
1227
- end
1228
- attr_reader :output
1229
-
1230
- sig do
1231
- params(
1232
- output:
1233
- T.any(
1234
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Output::OrSymbol,
1235
- String,
1236
- T.anything
1237
- )
1238
- ).void
1239
- end
1240
- attr_writer :output
1241
-
1242
- sig do
1243
- returns(
1244
- T.nilable(
1245
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Type::OrSymbol
1246
- )
1247
- )
1248
- end
1249
- attr_reader :type
1250
-
1251
- sig do
1252
- params(
1253
- type:
1254
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Type::OrSymbol
1255
- ).void
1256
- end
1257
- attr_writer :type
1258
-
1259
- sig do
1260
- params(
1261
- selector: String,
1262
- output:
1263
- T.any(
1264
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Output::OrSymbol,
1265
- String,
1266
- T.anything
1267
- ),
1268
- type:
1269
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Type::OrSymbol
1270
- ).returns(T.attached_class)
1271
- end
1272
- def self.new(selector:, output: nil, type: nil)
1273
- end
1274
-
1275
- sig do
1276
- override.returns(
1277
- {
1278
- selector: String,
1279
- output:
1280
- T.any(
1281
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Output::OrSymbol,
1282
- String,
1283
- T.anything
1284
- ),
1285
- type:
1286
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Type::OrSymbol
1287
- }
1288
- )
1289
- end
1290
- def to_hash
1291
- end
1292
-
1293
- module Output
1294
- extend ContextDev::Internal::Type::Union
1295
-
1296
- Variants =
1297
- T.type_alias do
1298
- T.any(
1299
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Output::TaggedSymbol,
1300
- String,
1301
- T.anything
1302
- )
1303
- end
1304
-
1305
- sig do
1306
- override.returns(
1307
- T::Array[
1308
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Output::Variants
1309
- ]
1310
- )
1311
- end
1312
- def self.variants
1313
- end
1314
-
1315
- TaggedSymbol =
1316
- T.type_alias do
1317
- T.all(
1318
- Symbol,
1319
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Output
1320
- )
1321
- end
1322
- OrSymbol = T.type_alias { T.any(Symbol, String) }
1323
-
1324
- TEXT =
1325
- T.let(
1326
- :text,
1327
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Output::TaggedSymbol
1328
- )
1329
- HTML =
1330
- T.let(
1331
- :html,
1332
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Output::TaggedSymbol
1333
- )
1334
- end
1335
-
1336
- module Type
1337
- extend ContextDev::Internal::Type::Enum
1338
-
1339
- TaggedSymbol =
1340
- T.type_alias do
1341
- T.all(
1342
- Symbol,
1343
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Type
1344
- )
1345
- end
1346
- OrSymbol = T.type_alias { T.any(Symbol, String) }
1347
-
1348
- ITEM =
1349
- T.let(
1350
- :item,
1351
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Type::TaggedSymbol
1352
- )
1353
- LIST =
1354
- T.let(
1355
- :list,
1356
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Type::TaggedSymbol
1357
- )
1358
-
1359
- sig do
1360
- override.returns(
1361
- T::Array[
1362
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Type::TaggedSymbol
1363
- ]
1364
- )
1365
- end
1366
- def self.values
1367
- end
1368
- end
1369
- end
1370
-
1371
- sig do
1372
- override.returns(
1373
- T::Array[
1374
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::Variants
1375
- ]
1376
- )
1377
- end
1378
- def self.variants
1379
- end
1380
- end
1381
-
1382
- sig do
1383
- override.returns(
1384
- T::Array[
1385
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::Variants
1386
- ]
1387
- )
1388
- end
1389
- def self.variants
1390
- end
1391
-
1392
- TaggedSymbol =
1393
- T.type_alias do
1394
- T.all(
1395
- Symbol,
1396
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output
1397
- )
1398
- end
1399
- OrSymbol = T.type_alias { T.any(Symbol, String) }
1400
-
1401
- TEXT =
1402
- T.let(
1403
- :text,
1404
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::TaggedSymbol
1405
- )
1406
- HTML =
1407
- T.let(
1408
- :html,
1409
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::TaggedSymbol
1410
- )
1411
-
1412
- HTMLExtractionRuleMap =
1413
- T.let(
1414
- ContextDev::Internal::Type::HashOf[
1415
- union:
1416
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule
1417
- ],
1418
- ContextDev::Internal::Type::Converter
1419
- )
1420
- end
1421
-
1422
- module Type
1423
- extend ContextDev::Internal::Type::Enum
1424
-
1425
- TaggedSymbol =
1426
- T.type_alias do
1427
- T.all(
1428
- Symbol,
1429
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Type
1430
- )
1431
- end
1432
- OrSymbol = T.type_alias { T.any(Symbol, String) }
1433
-
1434
- ITEM =
1435
- T.let(
1436
- :item,
1437
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Type::TaggedSymbol
1438
- )
1439
- LIST =
1440
- T.let(
1441
- :list,
1442
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Type::TaggedSymbol
1443
- )
1444
-
1445
- sig do
1446
- override.returns(
1447
- T::Array[
1448
- ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Type::TaggedSymbol
1449
- ]
1450
- )
1451
- end
1452
- def self.values
1453
- end
1454
- end
1455
- end
1456
-
1457
- sig do
1458
- override.returns(
1459
- T::Array[ContextDev::WebWebScrapeHTMLParams::ExtractRule::Variants]
1460
- )
1461
- end
1462
- def self.variants
1463
- end
1464
- end
1465
-
1466
- class Pdf < ContextDev::Internal::Type::BaseModel
1467
- OrHash =
1468
- T.type_alias do
1469
- T.any(
1470
- ContextDev::WebWebScrapeHTMLParams::Pdf,
1471
- ContextDev::Internal::AnyHash
1472
- )
1473
- end
1474
-
1475
- # Last 1-based PDF page to parse. When omitted, parsing ends at the last page.
1476
- # Must be greater than or equal to start when both are provided.
1477
- sig { returns(T.nilable(Integer)) }
1478
- attr_reader :end_
1479
-
1480
- sig { params(end_: Integer).void }
1481
- attr_writer :end_
1482
-
1483
- # When true, OCR the selected PDF pages that have no usable text layer (scans),
1484
- # replacing each recovered page's text with the OCR result while pages with a real
1485
- # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top
1486
- # of the base request cost. When false, no OCR runs.
1487
- sig { returns(T.nilable(T::Boolean)) }
1488
- attr_reader :ocr
1489
-
1490
- sig { params(ocr: T::Boolean).void }
1491
- attr_writer :ocr
1492
-
1493
- # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
1494
- # a 400 PDF_SKIPPED is returned.
1495
- sig { returns(T.nilable(T::Boolean)) }
1496
- attr_reader :should_parse
1497
-
1498
- sig { params(should_parse: T::Boolean).void }
1499
- attr_writer :should_parse
1500
-
1501
- # First 1-based PDF page to parse. When omitted, parsing starts at the first page.
1502
- sig { returns(T.nilable(Integer)) }
1503
- attr_reader :start
1504
-
1505
- sig { params(start: Integer).void }
1506
- attr_writer :start
1507
-
1508
- # PDF parsing controls. Use start/end to limit text extraction and embedded-image
1509
- # detection/OCR to an inclusive 1-based page range.
1510
- sig do
1511
- params(
1512
- end_: Integer,
1513
- ocr: T::Boolean,
1514
- should_parse: T::Boolean,
1515
- start: Integer
1516
- ).returns(T.attached_class)
1517
- end
1518
- def self.new(
1519
- # Last 1-based PDF page to parse. When omitted, parsing ends at the last page.
1520
- # Must be greater than or equal to start when both are provided.
1521
- end_: nil,
1522
- # When true, OCR the selected PDF pages that have no usable text layer (scans),
1523
- # replacing each recovered page's text with the OCR result while pages with a real
1524
- # text layer keep it. Billed at 1 credit per page OCR actually recovered, on top
1525
- # of the base request cost. When false, no OCR runs.
1526
- ocr: nil,
1527
- # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
1528
- # a 400 PDF_SKIPPED is returned.
1529
- should_parse: nil,
1530
- # First 1-based PDF page to parse. When omitted, parsing starts at the first page.
1531
- start: nil
1532
- )
1533
- end
1534
-
1535
- sig do
1536
- override.returns(
1537
- {
1538
- end_: Integer,
1539
- ocr: T::Boolean,
1540
- should_parse: T::Boolean,
1541
- start: Integer
1542
- }
1543
- )
1544
- end
1545
- def to_hash
1546
- end
1547
- end
1548
-
1549
- class TimeoutOpts < ContextDev::Internal::Type::BaseModel
1550
- OrHash =
1551
- T.type_alias do
1552
- T.any(
1553
- ContextDev::WebWebScrapeHTMLParams::TimeoutOpts,
1554
- ContextDev::Internal::AnyHash
1555
- )
1556
- end
1557
-
1558
- # Request deadline in milliseconds. Maximum: 300000 (5 minutes).
1559
- sig { returns(Integer) }
1560
- attr_accessor :milliseconds
1561
-
1562
- # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
1563
- # credits. "return-partial" returns usable results collected so far; if none are
1564
- # available, the request still fails without charging credits. Partial results are
1565
- # not cached as complete results. "return-partial" requires milliseconds of at
1566
- # least 5000.
1567
- sig do
1568
- returns(
1569
- T.nilable(
1570
- ContextDev::WebWebScrapeHTMLParams::TimeoutOpts::Behavior::OrSymbol
1571
- )
1572
- )
1573
- end
1574
- attr_reader :behavior
1575
-
1576
- sig do
1577
- params(
1578
- behavior:
1579
- ContextDev::WebWebScrapeHTMLParams::TimeoutOpts::Behavior::OrSymbol
1580
- ).void
1581
- end
1582
- attr_writer :behavior
1583
-
1584
- # Optional request deadline and behavior on timeout. For GET requests, use
1585
- # timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
1586
- # timeoutOpts object.
1587
- sig do
1588
- params(
1589
- milliseconds: Integer,
1590
- behavior:
1591
- ContextDev::WebWebScrapeHTMLParams::TimeoutOpts::Behavior::OrSymbol
1592
- ).returns(T.attached_class)
1593
- end
1594
- def self.new(
1595
- # Request deadline in milliseconds. Maximum: 300000 (5 minutes).
1596
- milliseconds:,
1597
- # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
1598
- # credits. "return-partial" returns usable results collected so far; if none are
1599
- # available, the request still fails without charging credits. Partial results are
1600
- # not cached as complete results. "return-partial" requires milliseconds of at
1601
- # least 5000.
1602
- behavior: nil
1603
- )
1604
- end
1605
-
1606
- sig do
1607
- override.returns(
1608
- {
1609
- milliseconds: Integer,
1610
- behavior:
1611
- ContextDev::WebWebScrapeHTMLParams::TimeoutOpts::Behavior::OrSymbol
1612
- }
1613
- )
1614
- end
1615
- def to_hash
1616
- end
1617
-
1618
- # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
1619
- # credits. "return-partial" returns usable results collected so far; if none are
1620
- # available, the request still fails without charging credits. Partial results are
1621
- # not cached as complete results. "return-partial" requires milliseconds of at
1622
- # least 5000.
1623
- module Behavior
1624
- extend ContextDev::Internal::Type::Enum
1625
-
1626
- TaggedSymbol =
1627
- T.type_alias do
1628
- T.all(
1629
- Symbol,
1630
- ContextDev::WebWebScrapeHTMLParams::TimeoutOpts::Behavior
1631
- )
1632
- end
1633
- OrSymbol = T.type_alias { T.any(Symbol, String) }
1634
-
1635
- FAIL =
1636
- T.let(
1637
- :fail,
1638
- ContextDev::WebWebScrapeHTMLParams::TimeoutOpts::Behavior::TaggedSymbol
1639
- )
1640
- RETURN_PARTIAL =
1641
- T.let(
1642
- :"return-partial",
1643
- ContextDev::WebWebScrapeHTMLParams::TimeoutOpts::Behavior::TaggedSymbol
1644
- )
1645
-
1646
- sig do
1647
- override.returns(
1648
- T::Array[
1649
- ContextDev::WebWebScrapeHTMLParams::TimeoutOpts::Behavior::TaggedSymbol
1650
- ]
1651
- )
1652
- end
1653
- def self.values
1654
- end
1655
- end
1656
- end
1657
-
1658
- # Set to enabled to bypass shared caches and omit request and response content
1659
- # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
1660
- # omitted. Requires zero data retention to be enabled for your organization
1661
- # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
1662
- # Successful ZDR responses include X-Context-ZDR: true.
1663
- module Zdr
1664
- extend ContextDev::Internal::Type::Enum
1665
-
1666
- TaggedSymbol =
1667
- T.type_alias do
1668
- T.all(Symbol, ContextDev::WebWebScrapeHTMLParams::Zdr)
1669
- end
1670
- OrSymbol = T.type_alias { T.any(Symbol, String) }
1671
-
1672
- ENABLED =
1673
- T.let(:enabled, ContextDev::WebWebScrapeHTMLParams::Zdr::TaggedSymbol)
1674
- DISABLED =
1675
- T.let(
1676
- :disabled,
1677
- ContextDev::WebWebScrapeHTMLParams::Zdr::TaggedSymbol
1678
- )
1679
-
1680
- sig do
1681
- override.returns(
1682
- T::Array[ContextDev::WebWebScrapeHTMLParams::Zdr::TaggedSymbol]
1683
- )
1684
- end
1685
- def self.values
1686
- end
1687
- end
1688
- end
1689
- end
1690
- end