context.dev 2.17.1 → 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +33 -0
- data/README.md +1 -1
- data/lib/context_dev/client.rb +0 -4
- data/lib/context_dev/models/industry_retrieve_naics_params.rb +28 -1
- data/lib/context_dev/models/industry_retrieve_sic_params.rb +28 -1
- data/lib/context_dev/models/monitor_retrieve_run_params.rb +26 -0
- data/lib/context_dev/models/monitor_retrieve_run_response.rb +232 -0
- data/lib/context_dev/models/monitor_rotate_webhook_secret_params.rb +20 -0
- data/lib/context_dev/models/monitor_rotate_webhook_secret_response.rb +765 -0
- data/lib/context_dev/models/parse_handle_params.rb +8 -6
- data/lib/context_dev/models/person_enrich_params.rb +28 -1
- data/lib/context_dev/models/web_answers_params.rb +28 -1
- data/lib/context_dev/models/web_extract_competitors_params.rb +28 -1
- data/lib/context_dev/models/web_extract_styleguide_params.rb +30 -3
- data/lib/context_dev/models/{web_web_scrape_sitemap_params.rb → web_map_urls_params.rb} +22 -20
- data/lib/context_dev/models/web_map_urls_response.rb +123 -0
- data/lib/context_dev/models/web_scrape_params.rb +906 -0
- data/lib/context_dev/models/web_scrape_response.rb +659 -0
- data/lib/context_dev/models/web_screenshot_params.rb +25 -9
- data/lib/context_dev/models/web_screenshot_response.rb +3 -3
- data/lib/context_dev/models/web_search_params.rb +30 -3
- data/lib/context_dev/models.rb +8 -20
- data/lib/context_dev/resources/brand.rb +0 -36
- data/lib/context_dev/resources/industry.rb +6 -2
- data/lib/context_dev/resources/monitors.rb +47 -0
- data/lib/context_dev/resources/people.rb +3 -1
- data/lib/context_dev/resources/web.rb +116 -413
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +8 -21
- data/rbi/context_dev/client.rbi +0 -3
- data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +59 -0
- data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +57 -0
- data/rbi/context_dev/models/monitor_retrieve_run_params.rbi +46 -0
- data/rbi/context_dev/models/monitor_retrieve_run_response.rbi +452 -0
- data/rbi/context_dev/models/monitor_rotate_webhook_secret_params.rbi +38 -0
- data/rbi/context_dev/models/monitor_rotate_webhook_secret_response.rbi +1367 -0
- data/rbi/context_dev/models/parse_handle_params.rbi +12 -9
- data/rbi/context_dev/models/person_enrich_params.rbi +45 -0
- data/rbi/context_dev/models/web_answers_params.rbi +45 -0
- data/rbi/context_dev/models/web_extract_competitors_params.rbi +59 -0
- data/rbi/context_dev/models/web_extract_styleguide_params.rbi +62 -3
- data/rbi/context_dev/models/{web_web_scrape_sitemap_params.rbi → web_map_urls_params.rbi} +35 -54
- data/rbi/context_dev/models/web_map_urls_response.rbi +226 -0
- data/rbi/context_dev/models/web_scrape_params.rbi +2000 -0
- data/rbi/context_dev/models/{web_web_scrape_html_response.rbi → web_scrape_response.rbi} +550 -418
- data/rbi/context_dev/models/web_screenshot_params.rbi +38 -12
- data/rbi/context_dev/models/web_screenshot_response.rbi +4 -4
- data/rbi/context_dev/models/web_search_params.rbi +48 -3
- data/rbi/context_dev/models.rbi +9 -21
- data/rbi/context_dev/resources/brand.rbi +0 -35
- data/rbi/context_dev/resources/industry.rbi +14 -0
- data/rbi/context_dev/resources/monitors.rbi +24 -0
- data/rbi/context_dev/resources/parse.rbi +4 -4
- data/rbi/context_dev/resources/people.rbi +7 -0
- data/rbi/context_dev/resources/web.rbi +166 -533
- data/sig/context_dev/client.rbs +0 -2
- data/sig/context_dev/models/industry_retrieve_naics_params.rbs +21 -1
- data/sig/context_dev/models/industry_retrieve_sic_params.rbs +21 -1
- data/sig/context_dev/models/monitor_retrieve_run_params.rbs +28 -0
- data/sig/context_dev/models/monitor_retrieve_run_response.rbs +182 -0
- data/sig/context_dev/models/monitor_rotate_webhook_secret_params.rbs +23 -0
- data/sig/context_dev/models/monitor_rotate_webhook_secret_response.rbs +545 -0
- data/sig/context_dev/models/person_enrich_params.rbs +21 -1
- data/sig/context_dev/models/web_answers_params.rbs +21 -1
- data/sig/context_dev/models/web_extract_competitors_params.rbs +21 -1
- data/sig/context_dev/models/web_extract_styleguide_params.rbs +21 -1
- data/sig/context_dev/models/{web_web_scrape_sitemap_params.rbs → web_map_urls_params.rbs} +22 -22
- data/sig/context_dev/models/web_map_urls_response.rbs +125 -0
- data/sig/context_dev/models/web_scrape_params.rbs +834 -0
- data/sig/context_dev/models/web_scrape_response.rbs +552 -0
- data/sig/context_dev/models/web_screenshot_params.rbs +7 -0
- data/sig/context_dev/models/web_search_params.rbs +21 -1
- data/sig/context_dev/models.rbs +8 -20
- data/sig/context_dev/resources/brand.rbs +0 -9
- data/sig/context_dev/resources/industry.rbs +2 -0
- data/sig/context_dev/resources/monitors.rbs +11 -0
- data/sig/context_dev/resources/people.rbs +1 -0
- data/sig/context_dev/resources/web.rbs +34 -108
- metadata +26 -65
- data/lib/context_dev/models/ai_extract_product_params.rb +0 -98
- data/lib/context_dev/models/ai_extract_product_response.rb +0 -352
- data/lib/context_dev/models/ai_extract_products_params.rb +0 -233
- data/lib/context_dev/models/ai_extract_products_response.rb +0 -320
- data/lib/context_dev/models/brand_retrieve_simplified_params.rb +0 -120
- data/lib/context_dev/models/brand_retrieve_simplified_response.rb +0 -441
- data/lib/context_dev/models/web_extract_fonts_params.rb +0 -114
- data/lib/context_dev/models/web_extract_fonts_response.rb +0 -291
- data/lib/context_dev/models/web_extract_params.rb +0 -392
- data/lib/context_dev/models/web_extract_response.rb +0 -287
- data/lib/context_dev/models/web_web_scrape_bytes_params.rb +0 -344
- data/lib/context_dev/models/web_web_scrape_bytes_response.rb +0 -135
- data/lib/context_dev/models/web_web_scrape_html_params.rb +0 -633
- data/lib/context_dev/models/web_web_scrape_html_response.rb +0 -588
- data/lib/context_dev/models/web_web_scrape_images_params.rb +0 -346
- data/lib/context_dev/models/web_web_scrape_images_response.rb +0 -409
- data/lib/context_dev/models/web_web_scrape_md_params.rb +0 -668
- data/lib/context_dev/models/web_web_scrape_md_response.rb +0 -567
- data/lib/context_dev/models/web_web_scrape_sitemap_response.rb +0 -144
- data/lib/context_dev/resources/ai.rb +0 -69
- data/rbi/context_dev/models/ai_extract_product_params.rbi +0 -199
- data/rbi/context_dev/models/ai_extract_product_response.rbi +0 -696
- data/rbi/context_dev/models/ai_extract_products_params.rbi +0 -490
- data/rbi/context_dev/models/ai_extract_products_response.rbi +0 -623
- data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +0 -256
- data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +0 -1040
- data/rbi/context_dev/models/web_extract_fonts_params.rbi +0 -223
- data/rbi/context_dev/models/web_extract_fonts_response.rbi +0 -563
- data/rbi/context_dev/models/web_extract_params.rbi +0 -736
- data/rbi/context_dev/models/web_extract_response.rbi +0 -512
- data/rbi/context_dev/models/web_web_scrape_bytes_params.rbi +0 -699
- data/rbi/context_dev/models/web_web_scrape_bytes_response.rbi +0 -238
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +0 -1217
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +0 -671
- data/rbi/context_dev/models/web_web_scrape_images_response.rbi +0 -910
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +0 -1049
- data/rbi/context_dev/models/web_web_scrape_md_response.rbi +0 -1088
- data/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi +0 -258
- data/rbi/context_dev/resources/ai.rbi +0 -56
- data/sig/context_dev/models/ai_extract_product_params.rbs +0 -86
- data/sig/context_dev/models/ai_extract_product_response.rbs +0 -273
- data/sig/context_dev/models/ai_extract_products_params.rbs +0 -202
- data/sig/context_dev/models/ai_extract_products_response.rbs +0 -252
- data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +0 -104
- data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +0 -413
- data/sig/context_dev/models/web_extract_fonts_params.rbs +0 -93
- data/sig/context_dev/models/web_extract_fonts_response.rbs +0 -230
- data/sig/context_dev/models/web_extract_params.rbs +0 -304
- data/sig/context_dev/models/web_extract_response.rbs +0 -239
- data/sig/context_dev/models/web_web_scrape_bytes_params.rbs +0 -531
- data/sig/context_dev/models/web_web_scrape_bytes_response.rbs +0 -108
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +0 -730
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +0 -495
- data/sig/context_dev/models/web_web_scrape_images_params.rbs +0 -261
- data/sig/context_dev/models/web_web_scrape_images_response.rbs +0 -371
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +0 -758
- data/sig/context_dev/models/web_web_scrape_md_response.rbs +0 -465
- data/sig/context_dev/models/web_web_scrape_sitemap_response.rbs +0 -117
- data/sig/context_dev/resources/ai.rbs +0 -20
|
@@ -1,671 +0,0 @@
|
|
|
1
|
-
# typed: strong
|
|
2
|
-
|
|
3
|
-
module ContextDev
|
|
4
|
-
module Models
|
|
5
|
-
class WebWebScrapeImagesParams < 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::WebWebScrapeImagesParams,
|
|
13
|
-
ContextDev::Internal::AnyHash
|
|
14
|
-
)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
# Page URL to inspect. Must include http:// or https://.
|
|
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::WebWebScrapeImagesParams::Action::Wait,
|
|
30
|
-
ContextDev::WebWebScrapeImagesParams::Action::Perform,
|
|
31
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll
|
|
32
|
-
)
|
|
33
|
-
]
|
|
34
|
-
)
|
|
35
|
-
)
|
|
36
|
-
end
|
|
37
|
-
attr_accessor :actions
|
|
38
|
-
|
|
39
|
-
# When true, visually duplicate images are removed: every image is loaded and
|
|
40
|
-
# perceptually hashed, and only the highest-resolution copy of each duplicate
|
|
41
|
-
# group is kept. Images that cannot be downloaded or hashed are kept. Default:
|
|
42
|
-
# false.
|
|
43
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
44
|
-
attr_reader :dedupe
|
|
45
|
-
|
|
46
|
-
sig { params(dedupe: T::Boolean).void }
|
|
47
|
-
attr_writer :dedupe
|
|
48
|
-
|
|
49
|
-
# Optional per-image processing, sent as deep-object query params such as
|
|
50
|
-
# enrichment[resolution]=true.
|
|
51
|
-
sig do
|
|
52
|
-
returns(T.nilable(ContextDev::WebWebScrapeImagesParams::Enrichment))
|
|
53
|
-
end
|
|
54
|
-
attr_reader :enrichment
|
|
55
|
-
|
|
56
|
-
sig do
|
|
57
|
-
params(
|
|
58
|
-
enrichment:
|
|
59
|
-
T.nilable(ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash)
|
|
60
|
-
).void
|
|
61
|
-
end
|
|
62
|
-
attr_writer :enrichment
|
|
63
|
-
|
|
64
|
-
# Optional outbound HTTP headers forwarded only to the target URL, sent as
|
|
65
|
-
# deep-object query params such as headers[X-Custom]=value. When provided, caching
|
|
66
|
-
# is bypassed: the result is neither read from nor written to cache.
|
|
67
|
-
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
68
|
-
attr_reader :headers
|
|
69
|
-
|
|
70
|
-
sig { params(headers: T::Hash[Symbol, String]).void }
|
|
71
|
-
attr_writer :headers
|
|
72
|
-
|
|
73
|
-
# Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
|
|
74
|
-
# day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days).
|
|
75
|
-
sig { returns(T.nilable(Integer)) }
|
|
76
|
-
attr_accessor :max_age_ms
|
|
77
|
-
|
|
78
|
-
# Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50
|
|
79
|
-
# characters.
|
|
80
|
-
sig { returns(T.nilable(T::Array[String])) }
|
|
81
|
-
attr_reader :tags
|
|
82
|
-
|
|
83
|
-
sig { params(tags: T::Array[String]).void }
|
|
84
|
-
attr_writer :tags
|
|
85
|
-
|
|
86
|
-
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
87
|
-
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
88
|
-
# timeoutOpts object.
|
|
89
|
-
sig do
|
|
90
|
-
returns(T.nilable(ContextDev::WebWebScrapeImagesParams::TimeoutOpts))
|
|
91
|
-
end
|
|
92
|
-
attr_reader :timeout_opts
|
|
93
|
-
|
|
94
|
-
sig do
|
|
95
|
-
params(
|
|
96
|
-
timeout_opts:
|
|
97
|
-
ContextDev::WebWebScrapeImagesParams::TimeoutOpts::OrHash
|
|
98
|
-
).void
|
|
99
|
-
end
|
|
100
|
-
attr_writer :timeout_opts
|
|
101
|
-
|
|
102
|
-
# Optional browser wait time in milliseconds after initial page load before
|
|
103
|
-
# collecting images. Min: 0. Max: 30000 (30 seconds). When combined with
|
|
104
|
-
# timeoutOpts, timeoutOpts.milliseconds must be at least waitForMs + 10000 ms; a
|
|
105
|
-
# shorter deadline is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
|
|
106
|
-
sig { returns(T.nilable(Integer)) }
|
|
107
|
-
attr_accessor :wait_for_ms
|
|
108
|
-
|
|
109
|
-
sig do
|
|
110
|
-
params(
|
|
111
|
-
url: String,
|
|
112
|
-
actions:
|
|
113
|
-
T.nilable(
|
|
114
|
-
T::Array[
|
|
115
|
-
T.any(
|
|
116
|
-
ContextDev::WebWebScrapeImagesParams::Action::Wait::OrHash,
|
|
117
|
-
ContextDev::WebWebScrapeImagesParams::Action::Perform::OrHash,
|
|
118
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::OrHash
|
|
119
|
-
)
|
|
120
|
-
]
|
|
121
|
-
),
|
|
122
|
-
dedupe: T::Boolean,
|
|
123
|
-
enrichment:
|
|
124
|
-
T.nilable(ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash),
|
|
125
|
-
headers: T::Hash[Symbol, String],
|
|
126
|
-
max_age_ms: T.nilable(Integer),
|
|
127
|
-
tags: T::Array[String],
|
|
128
|
-
timeout_opts:
|
|
129
|
-
ContextDev::WebWebScrapeImagesParams::TimeoutOpts::OrHash,
|
|
130
|
-
wait_for_ms: T.nilable(Integer),
|
|
131
|
-
request_options: ContextDev::RequestOptions::OrHash
|
|
132
|
-
).returns(T.attached_class)
|
|
133
|
-
end
|
|
134
|
-
def self.new(
|
|
135
|
-
# Page URL to inspect. Must include http:// or https://.
|
|
136
|
-
url:,
|
|
137
|
-
# Optional browser actions executed in array order after the page loads and before
|
|
138
|
-
# content is captured. Requires a paid plan. Send a JSON array in the query
|
|
139
|
-
# parameter. Maximum: 5 actions.
|
|
140
|
-
actions: nil,
|
|
141
|
-
# When true, visually duplicate images are removed: every image is loaded and
|
|
142
|
-
# perceptually hashed, and only the highest-resolution copy of each duplicate
|
|
143
|
-
# group is kept. Images that cannot be downloaded or hashed are kept. Default:
|
|
144
|
-
# false.
|
|
145
|
-
dedupe: nil,
|
|
146
|
-
# Optional per-image processing, sent as deep-object query params such as
|
|
147
|
-
# enrichment[resolution]=true.
|
|
148
|
-
enrichment: nil,
|
|
149
|
-
# Optional outbound HTTP headers forwarded only to the target URL, sent as
|
|
150
|
-
# deep-object query params such as headers[X-Custom]=value. When provided, caching
|
|
151
|
-
# is bypassed: the result is neither read from nor written to cache.
|
|
152
|
-
headers: nil,
|
|
153
|
-
# Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
|
|
154
|
-
# day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days).
|
|
155
|
-
max_age_ms: nil,
|
|
156
|
-
# Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50
|
|
157
|
-
# characters.
|
|
158
|
-
tags: nil,
|
|
159
|
-
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
160
|
-
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
161
|
-
# timeoutOpts object.
|
|
162
|
-
timeout_opts: nil,
|
|
163
|
-
# Optional browser wait time in milliseconds after initial page load before
|
|
164
|
-
# collecting images. Min: 0. Max: 30000 (30 seconds). When combined with
|
|
165
|
-
# timeoutOpts, timeoutOpts.milliseconds must be at least waitForMs + 10000 ms; a
|
|
166
|
-
# shorter deadline is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
|
|
167
|
-
wait_for_ms: nil,
|
|
168
|
-
request_options: {}
|
|
169
|
-
)
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
sig do
|
|
173
|
-
override.returns(
|
|
174
|
-
{
|
|
175
|
-
url: String,
|
|
176
|
-
actions:
|
|
177
|
-
T.nilable(
|
|
178
|
-
T::Array[
|
|
179
|
-
T.any(
|
|
180
|
-
ContextDev::WebWebScrapeImagesParams::Action::Wait,
|
|
181
|
-
ContextDev::WebWebScrapeImagesParams::Action::Perform,
|
|
182
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll
|
|
183
|
-
)
|
|
184
|
-
]
|
|
185
|
-
),
|
|
186
|
-
dedupe: T::Boolean,
|
|
187
|
-
enrichment:
|
|
188
|
-
T.nilable(ContextDev::WebWebScrapeImagesParams::Enrichment),
|
|
189
|
-
headers: T::Hash[Symbol, String],
|
|
190
|
-
max_age_ms: T.nilable(Integer),
|
|
191
|
-
tags: T::Array[String],
|
|
192
|
-
timeout_opts: ContextDev::WebWebScrapeImagesParams::TimeoutOpts,
|
|
193
|
-
wait_for_ms: T.nilable(Integer),
|
|
194
|
-
request_options: ContextDev::RequestOptions
|
|
195
|
-
}
|
|
196
|
-
)
|
|
197
|
-
end
|
|
198
|
-
def to_hash
|
|
199
|
-
end
|
|
200
|
-
|
|
201
|
-
# Browser action discriminated by `do`. Each variant exposes only its applicable
|
|
202
|
-
# fields.
|
|
203
|
-
module Action
|
|
204
|
-
extend ContextDev::Internal::Type::Union
|
|
205
|
-
|
|
206
|
-
Variants =
|
|
207
|
-
T.type_alias do
|
|
208
|
-
T.any(
|
|
209
|
-
ContextDev::WebWebScrapeImagesParams::Action::Wait,
|
|
210
|
-
ContextDev::WebWebScrapeImagesParams::Action::Perform,
|
|
211
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll
|
|
212
|
-
)
|
|
213
|
-
end
|
|
214
|
-
|
|
215
|
-
class Wait < ContextDev::Internal::Type::BaseModel
|
|
216
|
-
OrHash =
|
|
217
|
-
T.type_alias do
|
|
218
|
-
T.any(
|
|
219
|
-
ContextDev::WebWebScrapeImagesParams::Action::Wait,
|
|
220
|
-
ContextDev::Internal::AnyHash
|
|
221
|
-
)
|
|
222
|
-
end
|
|
223
|
-
|
|
224
|
-
sig { returns(Symbol) }
|
|
225
|
-
attr_accessor :do_
|
|
226
|
-
|
|
227
|
-
sig { returns(Integer) }
|
|
228
|
-
attr_accessor :time_ms
|
|
229
|
-
|
|
230
|
-
# Pause for a fixed number of milliseconds before continuing to the next action.
|
|
231
|
-
sig do
|
|
232
|
-
params(time_ms: Integer, do_: Symbol).returns(T.attached_class)
|
|
233
|
-
end
|
|
234
|
-
def self.new(time_ms:, do_: :wait)
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
sig { override.returns({ do_: Symbol, time_ms: Integer }) }
|
|
238
|
-
def to_hash
|
|
239
|
-
end
|
|
240
|
-
end
|
|
241
|
-
|
|
242
|
-
class Perform < ContextDev::Internal::Type::BaseModel
|
|
243
|
-
OrHash =
|
|
244
|
-
T.type_alias do
|
|
245
|
-
T.any(
|
|
246
|
-
ContextDev::WebWebScrapeImagesParams::Action::Perform,
|
|
247
|
-
ContextDev::Internal::AnyHash
|
|
248
|
-
)
|
|
249
|
-
end
|
|
250
|
-
|
|
251
|
-
sig { returns(String) }
|
|
252
|
-
attr_accessor :action
|
|
253
|
-
|
|
254
|
-
sig { returns(Symbol) }
|
|
255
|
-
attr_accessor :do_
|
|
256
|
-
|
|
257
|
-
# Resolve and perform one natural-language browser action.
|
|
258
|
-
sig { params(action: String, do_: Symbol).returns(T.attached_class) }
|
|
259
|
-
def self.new(action:, do_: :perform)
|
|
260
|
-
end
|
|
261
|
-
|
|
262
|
-
sig { override.returns({ action: String, do_: Symbol }) }
|
|
263
|
-
def to_hash
|
|
264
|
-
end
|
|
265
|
-
end
|
|
266
|
-
|
|
267
|
-
class Scroll < ContextDev::Internal::Type::BaseModel
|
|
268
|
-
OrHash =
|
|
269
|
-
T.type_alias do
|
|
270
|
-
T.any(
|
|
271
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll,
|
|
272
|
-
ContextDev::Internal::AnyHash
|
|
273
|
-
)
|
|
274
|
-
end
|
|
275
|
-
|
|
276
|
-
sig { returns(Symbol) }
|
|
277
|
-
attr_accessor :do_
|
|
278
|
-
|
|
279
|
-
# Pixels per scroll, one visible viewport, or the current scroll boundary.
|
|
280
|
-
# Defaults to viewport.
|
|
281
|
-
sig do
|
|
282
|
-
returns(
|
|
283
|
-
T.nilable(
|
|
284
|
-
T.any(
|
|
285
|
-
Integer,
|
|
286
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Amount::OrSymbol
|
|
287
|
-
)
|
|
288
|
-
)
|
|
289
|
-
)
|
|
290
|
-
end
|
|
291
|
-
attr_reader :amount
|
|
292
|
-
|
|
293
|
-
sig do
|
|
294
|
-
params(
|
|
295
|
-
amount:
|
|
296
|
-
T.any(
|
|
297
|
-
Integer,
|
|
298
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Amount::OrSymbol
|
|
299
|
-
)
|
|
300
|
-
).void
|
|
301
|
-
end
|
|
302
|
-
attr_writer :amount
|
|
303
|
-
|
|
304
|
-
# CSS selector for the first matching scroll container. Defaults to the page.
|
|
305
|
-
sig { returns(T.nilable(String)) }
|
|
306
|
-
attr_reader :container
|
|
307
|
-
|
|
308
|
-
sig { params(container: String).void }
|
|
309
|
-
attr_writer :container
|
|
310
|
-
|
|
311
|
-
# Direction to scroll. Defaults to down.
|
|
312
|
-
sig do
|
|
313
|
-
returns(
|
|
314
|
-
T.nilable(
|
|
315
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Direction::OrSymbol
|
|
316
|
-
)
|
|
317
|
-
)
|
|
318
|
-
end
|
|
319
|
-
attr_reader :direction
|
|
320
|
-
|
|
321
|
-
sig do
|
|
322
|
-
params(
|
|
323
|
-
direction:
|
|
324
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Direction::OrSymbol
|
|
325
|
-
).void
|
|
326
|
-
end
|
|
327
|
-
attr_writer :direction
|
|
328
|
-
|
|
329
|
-
# Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
|
|
330
|
-
# changing. Defaults to 1.
|
|
331
|
-
sig { returns(T.nilable(Integer)) }
|
|
332
|
-
attr_reader :max_scrolls
|
|
333
|
-
|
|
334
|
-
sig { params(max_scrolls: Integer).void }
|
|
335
|
-
attr_writer :max_scrolls
|
|
336
|
-
|
|
337
|
-
# Scroll the page or a selected scrollable container, waiting adaptively for
|
|
338
|
-
# content and dimensions to settle after each iteration.
|
|
339
|
-
sig do
|
|
340
|
-
params(
|
|
341
|
-
amount:
|
|
342
|
-
T.any(
|
|
343
|
-
Integer,
|
|
344
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Amount::OrSymbol
|
|
345
|
-
),
|
|
346
|
-
container: String,
|
|
347
|
-
direction:
|
|
348
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Direction::OrSymbol,
|
|
349
|
-
max_scrolls: Integer,
|
|
350
|
-
do_: Symbol
|
|
351
|
-
).returns(T.attached_class)
|
|
352
|
-
end
|
|
353
|
-
def self.new(
|
|
354
|
-
# Pixels per scroll, one visible viewport, or the current scroll boundary.
|
|
355
|
-
# Defaults to viewport.
|
|
356
|
-
amount: nil,
|
|
357
|
-
# CSS selector for the first matching scroll container. Defaults to the page.
|
|
358
|
-
container: nil,
|
|
359
|
-
# Direction to scroll. Defaults to down.
|
|
360
|
-
direction: nil,
|
|
361
|
-
# Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
|
|
362
|
-
# changing. Defaults to 1.
|
|
363
|
-
max_scrolls: nil,
|
|
364
|
-
do_: :scroll
|
|
365
|
-
)
|
|
366
|
-
end
|
|
367
|
-
|
|
368
|
-
sig do
|
|
369
|
-
override.returns(
|
|
370
|
-
{
|
|
371
|
-
do_: Symbol,
|
|
372
|
-
amount:
|
|
373
|
-
T.any(
|
|
374
|
-
Integer,
|
|
375
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Amount::OrSymbol
|
|
376
|
-
),
|
|
377
|
-
container: String,
|
|
378
|
-
direction:
|
|
379
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Direction::OrSymbol,
|
|
380
|
-
max_scrolls: Integer
|
|
381
|
-
}
|
|
382
|
-
)
|
|
383
|
-
end
|
|
384
|
-
def to_hash
|
|
385
|
-
end
|
|
386
|
-
|
|
387
|
-
# Pixels per scroll, one visible viewport, or the current scroll boundary.
|
|
388
|
-
# Defaults to viewport.
|
|
389
|
-
module Amount
|
|
390
|
-
extend ContextDev::Internal::Type::Union
|
|
391
|
-
|
|
392
|
-
Variants =
|
|
393
|
-
T.type_alias do
|
|
394
|
-
T.any(
|
|
395
|
-
Integer,
|
|
396
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Amount::TaggedSymbol
|
|
397
|
-
)
|
|
398
|
-
end
|
|
399
|
-
|
|
400
|
-
sig do
|
|
401
|
-
override.returns(
|
|
402
|
-
T::Array[
|
|
403
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Amount::Variants
|
|
404
|
-
]
|
|
405
|
-
)
|
|
406
|
-
end
|
|
407
|
-
def self.variants
|
|
408
|
-
end
|
|
409
|
-
|
|
410
|
-
TaggedSymbol =
|
|
411
|
-
T.type_alias do
|
|
412
|
-
T.all(
|
|
413
|
-
Symbol,
|
|
414
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Amount
|
|
415
|
-
)
|
|
416
|
-
end
|
|
417
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
418
|
-
|
|
419
|
-
VIEWPORT =
|
|
420
|
-
T.let(
|
|
421
|
-
:viewport,
|
|
422
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Amount::TaggedSymbol
|
|
423
|
-
)
|
|
424
|
-
MAX =
|
|
425
|
-
T.let(
|
|
426
|
-
:max,
|
|
427
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Amount::TaggedSymbol
|
|
428
|
-
)
|
|
429
|
-
end
|
|
430
|
-
|
|
431
|
-
# Direction to scroll. Defaults to down.
|
|
432
|
-
module Direction
|
|
433
|
-
extend ContextDev::Internal::Type::Enum
|
|
434
|
-
|
|
435
|
-
TaggedSymbol =
|
|
436
|
-
T.type_alias do
|
|
437
|
-
T.all(
|
|
438
|
-
Symbol,
|
|
439
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Direction
|
|
440
|
-
)
|
|
441
|
-
end
|
|
442
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
443
|
-
|
|
444
|
-
UP =
|
|
445
|
-
T.let(
|
|
446
|
-
:up,
|
|
447
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Direction::TaggedSymbol
|
|
448
|
-
)
|
|
449
|
-
DOWN =
|
|
450
|
-
T.let(
|
|
451
|
-
:down,
|
|
452
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Direction::TaggedSymbol
|
|
453
|
-
)
|
|
454
|
-
LEFT =
|
|
455
|
-
T.let(
|
|
456
|
-
:left,
|
|
457
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Direction::TaggedSymbol
|
|
458
|
-
)
|
|
459
|
-
RIGHT =
|
|
460
|
-
T.let(
|
|
461
|
-
:right,
|
|
462
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Direction::TaggedSymbol
|
|
463
|
-
)
|
|
464
|
-
|
|
465
|
-
sig do
|
|
466
|
-
override.returns(
|
|
467
|
-
T::Array[
|
|
468
|
-
ContextDev::WebWebScrapeImagesParams::Action::Scroll::Direction::TaggedSymbol
|
|
469
|
-
]
|
|
470
|
-
)
|
|
471
|
-
end
|
|
472
|
-
def self.values
|
|
473
|
-
end
|
|
474
|
-
end
|
|
475
|
-
end
|
|
476
|
-
|
|
477
|
-
sig do
|
|
478
|
-
override.returns(
|
|
479
|
-
T::Array[ContextDev::WebWebScrapeImagesParams::Action::Variants]
|
|
480
|
-
)
|
|
481
|
-
end
|
|
482
|
-
def self.variants
|
|
483
|
-
end
|
|
484
|
-
end
|
|
485
|
-
|
|
486
|
-
class Enrichment < ContextDev::Internal::Type::BaseModel
|
|
487
|
-
OrHash =
|
|
488
|
-
T.type_alias do
|
|
489
|
-
T.any(
|
|
490
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment,
|
|
491
|
-
ContextDev::Internal::AnyHash
|
|
492
|
-
)
|
|
493
|
-
end
|
|
494
|
-
|
|
495
|
-
# Classify each image by visual asset type.
|
|
496
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
497
|
-
attr_reader :classification
|
|
498
|
-
|
|
499
|
-
sig { params(classification: T::Boolean).void }
|
|
500
|
-
attr_writer :classification
|
|
501
|
-
|
|
502
|
-
# Host materializable images on the Brand.dev CDN and return their URL and MIME
|
|
503
|
-
# type.
|
|
504
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
505
|
-
attr_reader :hosted_url
|
|
506
|
-
|
|
507
|
-
sig { params(hosted_url: T::Boolean).void }
|
|
508
|
-
attr_writer :hosted_url
|
|
509
|
-
|
|
510
|
-
# Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000.
|
|
511
|
-
sig { returns(T.nilable(Integer)) }
|
|
512
|
-
attr_reader :max_time_per_ms
|
|
513
|
-
|
|
514
|
-
sig { params(max_time_per_ms: Integer).void }
|
|
515
|
-
attr_writer :max_time_per_ms
|
|
516
|
-
|
|
517
|
-
# Measure image width and height when possible.
|
|
518
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
519
|
-
attr_reader :resolution
|
|
520
|
-
|
|
521
|
-
sig { params(resolution: T::Boolean).void }
|
|
522
|
-
attr_writer :resolution
|
|
523
|
-
|
|
524
|
-
# Optional per-image processing, sent as deep-object query params such as
|
|
525
|
-
# enrichment[resolution]=true.
|
|
526
|
-
sig do
|
|
527
|
-
params(
|
|
528
|
-
classification: T::Boolean,
|
|
529
|
-
hosted_url: T::Boolean,
|
|
530
|
-
max_time_per_ms: Integer,
|
|
531
|
-
resolution: T::Boolean
|
|
532
|
-
).returns(T.attached_class)
|
|
533
|
-
end
|
|
534
|
-
def self.new(
|
|
535
|
-
# Classify each image by visual asset type.
|
|
536
|
-
classification: nil,
|
|
537
|
-
# Host materializable images on the Brand.dev CDN and return their URL and MIME
|
|
538
|
-
# type.
|
|
539
|
-
hosted_url: nil,
|
|
540
|
-
# Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000.
|
|
541
|
-
max_time_per_ms: nil,
|
|
542
|
-
# Measure image width and height when possible.
|
|
543
|
-
resolution: nil
|
|
544
|
-
)
|
|
545
|
-
end
|
|
546
|
-
|
|
547
|
-
sig do
|
|
548
|
-
override.returns(
|
|
549
|
-
{
|
|
550
|
-
classification: T::Boolean,
|
|
551
|
-
hosted_url: T::Boolean,
|
|
552
|
-
max_time_per_ms: Integer,
|
|
553
|
-
resolution: T::Boolean
|
|
554
|
-
}
|
|
555
|
-
)
|
|
556
|
-
end
|
|
557
|
-
def to_hash
|
|
558
|
-
end
|
|
559
|
-
end
|
|
560
|
-
|
|
561
|
-
class TimeoutOpts < ContextDev::Internal::Type::BaseModel
|
|
562
|
-
OrHash =
|
|
563
|
-
T.type_alias do
|
|
564
|
-
T.any(
|
|
565
|
-
ContextDev::WebWebScrapeImagesParams::TimeoutOpts,
|
|
566
|
-
ContextDev::Internal::AnyHash
|
|
567
|
-
)
|
|
568
|
-
end
|
|
569
|
-
|
|
570
|
-
# Request deadline in milliseconds. Maximum: 300000 (5 minutes).
|
|
571
|
-
sig { returns(Integer) }
|
|
572
|
-
attr_accessor :milliseconds
|
|
573
|
-
|
|
574
|
-
# What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
|
|
575
|
-
# credits. "return-partial" returns usable results collected so far; if none are
|
|
576
|
-
# available, the request still fails without charging credits. Partial results are
|
|
577
|
-
# not cached as complete results. "return-partial" requires milliseconds of at
|
|
578
|
-
# least 15000.
|
|
579
|
-
sig do
|
|
580
|
-
returns(
|
|
581
|
-
T.nilable(
|
|
582
|
-
ContextDev::WebWebScrapeImagesParams::TimeoutOpts::Behavior::OrSymbol
|
|
583
|
-
)
|
|
584
|
-
)
|
|
585
|
-
end
|
|
586
|
-
attr_reader :behavior
|
|
587
|
-
|
|
588
|
-
sig do
|
|
589
|
-
params(
|
|
590
|
-
behavior:
|
|
591
|
-
ContextDev::WebWebScrapeImagesParams::TimeoutOpts::Behavior::OrSymbol
|
|
592
|
-
).void
|
|
593
|
-
end
|
|
594
|
-
attr_writer :behavior
|
|
595
|
-
|
|
596
|
-
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
597
|
-
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
598
|
-
# timeoutOpts object.
|
|
599
|
-
sig do
|
|
600
|
-
params(
|
|
601
|
-
milliseconds: Integer,
|
|
602
|
-
behavior:
|
|
603
|
-
ContextDev::WebWebScrapeImagesParams::TimeoutOpts::Behavior::OrSymbol
|
|
604
|
-
).returns(T.attached_class)
|
|
605
|
-
end
|
|
606
|
-
def self.new(
|
|
607
|
-
# Request deadline in milliseconds. Maximum: 300000 (5 minutes).
|
|
608
|
-
milliseconds:,
|
|
609
|
-
# What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
|
|
610
|
-
# credits. "return-partial" returns usable results collected so far; if none are
|
|
611
|
-
# available, the request still fails without charging credits. Partial results are
|
|
612
|
-
# not cached as complete results. "return-partial" requires milliseconds of at
|
|
613
|
-
# least 15000.
|
|
614
|
-
behavior: nil
|
|
615
|
-
)
|
|
616
|
-
end
|
|
617
|
-
|
|
618
|
-
sig do
|
|
619
|
-
override.returns(
|
|
620
|
-
{
|
|
621
|
-
milliseconds: Integer,
|
|
622
|
-
behavior:
|
|
623
|
-
ContextDev::WebWebScrapeImagesParams::TimeoutOpts::Behavior::OrSymbol
|
|
624
|
-
}
|
|
625
|
-
)
|
|
626
|
-
end
|
|
627
|
-
def to_hash
|
|
628
|
-
end
|
|
629
|
-
|
|
630
|
-
# What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
|
|
631
|
-
# credits. "return-partial" returns usable results collected so far; if none are
|
|
632
|
-
# available, the request still fails without charging credits. Partial results are
|
|
633
|
-
# not cached as complete results. "return-partial" requires milliseconds of at
|
|
634
|
-
# least 15000.
|
|
635
|
-
module Behavior
|
|
636
|
-
extend ContextDev::Internal::Type::Enum
|
|
637
|
-
|
|
638
|
-
TaggedSymbol =
|
|
639
|
-
T.type_alias do
|
|
640
|
-
T.all(
|
|
641
|
-
Symbol,
|
|
642
|
-
ContextDev::WebWebScrapeImagesParams::TimeoutOpts::Behavior
|
|
643
|
-
)
|
|
644
|
-
end
|
|
645
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
646
|
-
|
|
647
|
-
FAIL =
|
|
648
|
-
T.let(
|
|
649
|
-
:fail,
|
|
650
|
-
ContextDev::WebWebScrapeImagesParams::TimeoutOpts::Behavior::TaggedSymbol
|
|
651
|
-
)
|
|
652
|
-
RETURN_PARTIAL =
|
|
653
|
-
T.let(
|
|
654
|
-
:"return-partial",
|
|
655
|
-
ContextDev::WebWebScrapeImagesParams::TimeoutOpts::Behavior::TaggedSymbol
|
|
656
|
-
)
|
|
657
|
-
|
|
658
|
-
sig do
|
|
659
|
-
override.returns(
|
|
660
|
-
T::Array[
|
|
661
|
-
ContextDev::WebWebScrapeImagesParams::TimeoutOpts::Behavior::TaggedSymbol
|
|
662
|
-
]
|
|
663
|
-
)
|
|
664
|
-
end
|
|
665
|
-
def self.values
|
|
666
|
-
end
|
|
667
|
-
end
|
|
668
|
-
end
|
|
669
|
-
end
|
|
670
|
-
end
|
|
671
|
-
end
|