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