context.dev 2.11.0 → 2.13.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 +18 -0
- data/README.md +4 -4
- data/lib/context_dev/models/ai_extract_product_response.rb +102 -2
- data/lib/context_dev/models/ai_extract_products_response.rb +102 -2
- data/lib/context_dev/models/batch_get_results_response.rb +56 -1
- data/lib/context_dev/models/batch_submit_response.rb +54 -1
- data/lib/context_dev/models/brand_retrieve_response.rb +58 -3
- data/lib/context_dev/models/brand_retrieve_simplified_response.rb +55 -1
- data/lib/context_dev/models/news_search_params.rb +1 -0
- data/lib/context_dev/models/web_extract_fonts_response.rb +54 -1
- data/lib/context_dev/models/web_extract_params.rb +169 -6
- data/lib/context_dev/models/web_extract_response.rb +139 -2
- data/lib/context_dev/models/web_extract_styleguide_response.rb +55 -1
- data/lib/context_dev/models/web_screenshot_response.rb +54 -1
- data/lib/context_dev/models/web_search_response.rb +54 -1
- data/lib/context_dev/models/web_web_crawl_md_params.rb +7 -5
- data/lib/context_dev/models/web_web_crawl_md_response.rb +54 -1
- data/lib/context_dev/models/web_web_scrape_html_params.rb +99 -3
- data/lib/context_dev/models/web_web_scrape_html_response.rb +54 -1
- data/lib/context_dev/models/web_web_scrape_images_params.rb +99 -3
- data/lib/context_dev/models/web_web_scrape_images_response.rb +139 -1
- data/lib/context_dev/models/web_web_scrape_md_params.rb +99 -3
- data/lib/context_dev/models/web_web_scrape_md_response.rb +54 -1
- data/lib/context_dev/resources/web.rb +9 -7
- data/lib/context_dev/version.rb +1 -1
- data/rbi/context_dev/models/ai_extract_product_response.rbi +218 -0
- data/rbi/context_dev/models/ai_extract_products_response.rbi +218 -0
- data/rbi/context_dev/models/batch_get_results_response.rbi +121 -0
- data/rbi/context_dev/models/batch_submit_response.rbi +117 -0
- data/rbi/context_dev/models/brand_retrieve_response.rbi +123 -2
- data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +121 -0
- data/rbi/context_dev/models/news_search_params.rbi +5 -0
- data/rbi/context_dev/models/web_extract_fonts_response.rbi +119 -0
- data/rbi/context_dev/models/web_extract_params.rbi +353 -8
- data/rbi/context_dev/models/web_extract_response.rbi +289 -3
- data/rbi/context_dev/models/web_extract_styleguide_response.rbi +119 -0
- data/rbi/context_dev/models/web_screenshot_response.rbi +117 -0
- data/rbi/context_dev/models/web_search_response.rbi +117 -0
- data/rbi/context_dev/models/web_web_crawl_md_params.rbi +10 -6
- data/rbi/context_dev/models/web_web_crawl_md_response.rbi +117 -0
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +218 -4
- data/rbi/context_dev/models/web_web_scrape_html_response.rbi +119 -0
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +218 -4
- data/rbi/context_dev/models/web_web_scrape_images_response.rbi +288 -0
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +218 -4
- data/rbi/context_dev/models/web_web_scrape_md_response.rbi +117 -0
- data/rbi/context_dev/resources/web.rbi +31 -10
- data/sig/context_dev/models/ai_extract_product_response.rbs +79 -0
- data/sig/context_dev/models/ai_extract_products_response.rbs +79 -0
- data/sig/context_dev/models/batch_get_results_response.rbs +39 -0
- data/sig/context_dev/models/batch_submit_response.rbs +39 -0
- data/sig/context_dev/models/brand_retrieve_response.rbs +39 -0
- data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +39 -0
- data/sig/context_dev/models/news_search_params.rbs +2 -0
- data/sig/context_dev/models/web_extract_fonts_response.rbs +39 -0
- data/sig/context_dev/models/web_extract_params.rbs +117 -0
- data/sig/context_dev/models/web_extract_response.rbs +120 -3
- data/sig/context_dev/models/web_extract_styleguide_response.rbs +39 -0
- data/sig/context_dev/models/web_screenshot_response.rbs +39 -0
- data/sig/context_dev/models/web_search_response.rbs +39 -0
- data/sig/context_dev/models/web_web_crawl_md_response.rbs +39 -0
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +74 -0
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +39 -0
- data/sig/context_dev/models/web_web_scrape_images_params.rbs +74 -0
- data/sig/context_dev/models/web_web_scrape_images_response.rbs +117 -0
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +74 -0
- data/sig/context_dev/models/web_web_scrape_md_response.rbs +39 -0
- data/sig/context_dev/resources/web.rbs +1 -0
- metadata +2 -2
|
@@ -11,6 +11,22 @@ module ContextDev
|
|
|
11
11
|
)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
15
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
16
|
+
# oldest contributing hit.
|
|
17
|
+
sig do
|
|
18
|
+
returns(ContextDev::Models::WebExtractFontsResponse::CacheMetadata)
|
|
19
|
+
end
|
|
20
|
+
attr_reader :cache_metadata
|
|
21
|
+
|
|
22
|
+
sig do
|
|
23
|
+
params(
|
|
24
|
+
cache_metadata:
|
|
25
|
+
ContextDev::Models::WebExtractFontsResponse::CacheMetadata::OrHash
|
|
26
|
+
).void
|
|
27
|
+
end
|
|
28
|
+
attr_writer :cache_metadata
|
|
29
|
+
|
|
14
30
|
# HTTP status code, e.g., 200
|
|
15
31
|
sig { returns(Integer) }
|
|
16
32
|
attr_accessor :code
|
|
@@ -74,6 +90,8 @@ module ContextDev
|
|
|
74
90
|
|
|
75
91
|
sig do
|
|
76
92
|
params(
|
|
93
|
+
cache_metadata:
|
|
94
|
+
ContextDev::Models::WebExtractFontsResponse::CacheMetadata::OrHash,
|
|
77
95
|
code: Integer,
|
|
78
96
|
domain: String,
|
|
79
97
|
fonts:
|
|
@@ -89,6 +107,10 @@ module ContextDev
|
|
|
89
107
|
).returns(T.attached_class)
|
|
90
108
|
end
|
|
91
109
|
def self.new(
|
|
110
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
111
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
112
|
+
# oldest contributing hit.
|
|
113
|
+
cache_metadata:,
|
|
92
114
|
# HTTP status code, e.g., 200
|
|
93
115
|
code:,
|
|
94
116
|
# The normalized domain that was processed
|
|
@@ -110,6 +132,8 @@ module ContextDev
|
|
|
110
132
|
sig do
|
|
111
133
|
override.returns(
|
|
112
134
|
{
|
|
135
|
+
cache_metadata:
|
|
136
|
+
ContextDev::Models::WebExtractFontsResponse::CacheMetadata,
|
|
113
137
|
code: Integer,
|
|
114
138
|
domain: String,
|
|
115
139
|
fonts: T::Array[ContextDev::Models::WebExtractFontsResponse::Font],
|
|
@@ -127,6 +151,101 @@ module ContextDev
|
|
|
127
151
|
def to_hash
|
|
128
152
|
end
|
|
129
153
|
|
|
154
|
+
class CacheMetadata < ContextDev::Internal::Type::BaseModel
|
|
155
|
+
OrHash =
|
|
156
|
+
T.type_alias do
|
|
157
|
+
T.any(
|
|
158
|
+
ContextDev::Models::WebExtractFontsResponse::CacheMetadata,
|
|
159
|
+
ContextDev::Internal::AnyHash
|
|
160
|
+
)
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
|
|
164
|
+
sig { returns(Integer) }
|
|
165
|
+
attr_accessor :age_ms
|
|
166
|
+
|
|
167
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
168
|
+
# zero-data-retention cache bypass.
|
|
169
|
+
sig do
|
|
170
|
+
returns(
|
|
171
|
+
ContextDev::Models::WebExtractFontsResponse::CacheMetadata::Status::TaggedSymbol
|
|
172
|
+
)
|
|
173
|
+
end
|
|
174
|
+
attr_accessor :status
|
|
175
|
+
|
|
176
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
177
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
178
|
+
# oldest contributing hit.
|
|
179
|
+
sig do
|
|
180
|
+
params(
|
|
181
|
+
age_ms: Integer,
|
|
182
|
+
status:
|
|
183
|
+
ContextDev::Models::WebExtractFontsResponse::CacheMetadata::Status::OrSymbol
|
|
184
|
+
).returns(T.attached_class)
|
|
185
|
+
end
|
|
186
|
+
def self.new(
|
|
187
|
+
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
|
|
188
|
+
age_ms:,
|
|
189
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
190
|
+
# zero-data-retention cache bypass.
|
|
191
|
+
status:
|
|
192
|
+
)
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
sig do
|
|
196
|
+
override.returns(
|
|
197
|
+
{
|
|
198
|
+
age_ms: Integer,
|
|
199
|
+
status:
|
|
200
|
+
ContextDev::Models::WebExtractFontsResponse::CacheMetadata::Status::TaggedSymbol
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
end
|
|
204
|
+
def to_hash
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
208
|
+
# zero-data-retention cache bypass.
|
|
209
|
+
module Status
|
|
210
|
+
extend ContextDev::Internal::Type::Enum
|
|
211
|
+
|
|
212
|
+
TaggedSymbol =
|
|
213
|
+
T.type_alias do
|
|
214
|
+
T.all(
|
|
215
|
+
Symbol,
|
|
216
|
+
ContextDev::Models::WebExtractFontsResponse::CacheMetadata::Status
|
|
217
|
+
)
|
|
218
|
+
end
|
|
219
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
220
|
+
|
|
221
|
+
HIT =
|
|
222
|
+
T.let(
|
|
223
|
+
:hit,
|
|
224
|
+
ContextDev::Models::WebExtractFontsResponse::CacheMetadata::Status::TaggedSymbol
|
|
225
|
+
)
|
|
226
|
+
MISS =
|
|
227
|
+
T.let(
|
|
228
|
+
:miss,
|
|
229
|
+
ContextDev::Models::WebExtractFontsResponse::CacheMetadata::Status::TaggedSymbol
|
|
230
|
+
)
|
|
231
|
+
ZDR =
|
|
232
|
+
T.let(
|
|
233
|
+
:zdr,
|
|
234
|
+
ContextDev::Models::WebExtractFontsResponse::CacheMetadata::Status::TaggedSymbol
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
sig do
|
|
238
|
+
override.returns(
|
|
239
|
+
T::Array[
|
|
240
|
+
ContextDev::Models::WebExtractFontsResponse::CacheMetadata::Status::TaggedSymbol
|
|
241
|
+
]
|
|
242
|
+
)
|
|
243
|
+
end
|
|
244
|
+
def self.values
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
|
|
130
249
|
class Font < ContextDev::Internal::Type::BaseModel
|
|
131
250
|
OrHash =
|
|
132
251
|
T.type_alias do
|
|
@@ -11,9 +11,11 @@ module ContextDev
|
|
|
11
11
|
T.any(ContextDev::WebExtractParams, ContextDev::Internal::AnyHash)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
# JSON Schema for the returned data object.
|
|
15
|
-
#
|
|
16
|
-
#
|
|
14
|
+
# JSON Schema for the returned data object. Image fields such as `image_urls` or
|
|
15
|
+
# `product_photos` automatically make page image references available to
|
|
16
|
+
# extraction, so product data and photos can be returned in one call. TypeScript
|
|
17
|
+
# Zod users can pass a JSON Schema generated from a Zod object; Python users can
|
|
18
|
+
# pass the equivalent JSON Schema object.
|
|
17
19
|
sig { returns(T::Hash[Symbol, T.anything]) }
|
|
18
20
|
attr_accessor :schema
|
|
19
21
|
|
|
@@ -22,6 +24,39 @@ module ContextDev
|
|
|
22
24
|
sig { returns(String) }
|
|
23
25
|
attr_accessor :url
|
|
24
26
|
|
|
27
|
+
# Optional browser actions executed in order on the requested page after it loads,
|
|
28
|
+
# before links are discovered or additional pages are crawled. Requires a paid
|
|
29
|
+
# plan. When actions are provided and stopAfterMs is omitted, the crawl budget
|
|
30
|
+
# defaults to 110000 ms.
|
|
31
|
+
sig do
|
|
32
|
+
returns(
|
|
33
|
+
T.nilable(
|
|
34
|
+
T::Array[
|
|
35
|
+
T.any(
|
|
36
|
+
ContextDev::WebExtractParams::Action::Wait,
|
|
37
|
+
ContextDev::WebExtractParams::Action::Perform,
|
|
38
|
+
ContextDev::WebExtractParams::Action::Scroll
|
|
39
|
+
)
|
|
40
|
+
]
|
|
41
|
+
)
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
attr_reader :actions
|
|
45
|
+
|
|
46
|
+
sig do
|
|
47
|
+
params(
|
|
48
|
+
actions:
|
|
49
|
+
T::Array[
|
|
50
|
+
T.any(
|
|
51
|
+
ContextDev::WebExtractParams::Action::Wait::OrHash,
|
|
52
|
+
ContextDev::WebExtractParams::Action::Perform::OrHash,
|
|
53
|
+
ContextDev::WebExtractParams::Action::Scroll::OrHash
|
|
54
|
+
)
|
|
55
|
+
]
|
|
56
|
+
).void
|
|
57
|
+
end
|
|
58
|
+
attr_writer :actions
|
|
59
|
+
|
|
25
60
|
# When true, every returned value must be grounded in facts stated on the page;
|
|
26
61
|
# fields that cannot be supported by the page are returned as null/empty. When
|
|
27
62
|
# false (default), the model may make reasonable inferences and derivations from
|
|
@@ -95,7 +130,8 @@ module ContextDev
|
|
|
95
130
|
attr_writer :settle_animations
|
|
96
131
|
|
|
97
132
|
# Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000
|
|
98
|
-
# (110s).
|
|
133
|
+
# (110s). Defaults to 80000 (80s), or 110000 (110s) when browser actions are
|
|
134
|
+
# provided.
|
|
99
135
|
sig { returns(T.nilable(Integer)) }
|
|
100
136
|
attr_reader :stop_after_ms
|
|
101
137
|
|
|
@@ -130,6 +166,14 @@ module ContextDev
|
|
|
130
166
|
params(
|
|
131
167
|
schema: T::Hash[Symbol, T.anything],
|
|
132
168
|
url: String,
|
|
169
|
+
actions:
|
|
170
|
+
T::Array[
|
|
171
|
+
T.any(
|
|
172
|
+
ContextDev::WebExtractParams::Action::Wait::OrHash,
|
|
173
|
+
ContextDev::WebExtractParams::Action::Perform::OrHash,
|
|
174
|
+
ContextDev::WebExtractParams::Action::Scroll::OrHash
|
|
175
|
+
)
|
|
176
|
+
],
|
|
133
177
|
fact_check: T::Boolean,
|
|
134
178
|
follow_subdomains: T::Boolean,
|
|
135
179
|
include_frames: T::Boolean,
|
|
@@ -147,13 +191,20 @@ module ContextDev
|
|
|
147
191
|
).returns(T.attached_class)
|
|
148
192
|
end
|
|
149
193
|
def self.new(
|
|
150
|
-
# JSON Schema for the returned data object.
|
|
151
|
-
#
|
|
152
|
-
#
|
|
194
|
+
# JSON Schema for the returned data object. Image fields such as `image_urls` or
|
|
195
|
+
# `product_photos` automatically make page image references available to
|
|
196
|
+
# extraction, so product data and photos can be returned in one call. TypeScript
|
|
197
|
+
# Zod users can pass a JSON Schema generated from a Zod object; Python users can
|
|
198
|
+
# pass the equivalent JSON Schema object.
|
|
153
199
|
schema:,
|
|
154
200
|
# The starting website URL to crawl and extract from. Must include http:// or
|
|
155
201
|
# https://.
|
|
156
202
|
url:,
|
|
203
|
+
# Optional browser actions executed in order on the requested page after it loads,
|
|
204
|
+
# before links are discovered or additional pages are crawled. Requires a paid
|
|
205
|
+
# plan. When actions are provided and stopAfterMs is omitted, the crawl budget
|
|
206
|
+
# defaults to 110000 ms.
|
|
207
|
+
actions: nil,
|
|
157
208
|
# When true, every returned value must be grounded in facts stated on the page;
|
|
158
209
|
# fields that cannot be supported by the page are returned as null/empty. When
|
|
159
210
|
# false (default), the model may make reasonable inferences and derivations from
|
|
@@ -182,7 +233,8 @@ module ContextDev
|
|
|
182
233
|
# exchange for more stable output on animated pages.
|
|
183
234
|
settle_animations: nil,
|
|
184
235
|
# Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000
|
|
185
|
-
# (110s).
|
|
236
|
+
# (110s). Defaults to 80000 (80s), or 110000 (110s) when browser actions are
|
|
237
|
+
# provided.
|
|
186
238
|
stop_after_ms: nil,
|
|
187
239
|
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
188
240
|
tags: nil,
|
|
@@ -202,6 +254,14 @@ module ContextDev
|
|
|
202
254
|
{
|
|
203
255
|
schema: T::Hash[Symbol, T.anything],
|
|
204
256
|
url: String,
|
|
257
|
+
actions:
|
|
258
|
+
T::Array[
|
|
259
|
+
T.any(
|
|
260
|
+
ContextDev::WebExtractParams::Action::Wait,
|
|
261
|
+
ContextDev::WebExtractParams::Action::Perform,
|
|
262
|
+
ContextDev::WebExtractParams::Action::Scroll
|
|
263
|
+
)
|
|
264
|
+
],
|
|
205
265
|
fact_check: T::Boolean,
|
|
206
266
|
follow_subdomains: T::Boolean,
|
|
207
267
|
include_frames: T::Boolean,
|
|
@@ -222,6 +282,291 @@ module ContextDev
|
|
|
222
282
|
def to_hash
|
|
223
283
|
end
|
|
224
284
|
|
|
285
|
+
# Browser action discriminated by `do`. Each variant exposes only its applicable
|
|
286
|
+
# fields.
|
|
287
|
+
module Action
|
|
288
|
+
extend ContextDev::Internal::Type::Union
|
|
289
|
+
|
|
290
|
+
Variants =
|
|
291
|
+
T.type_alias do
|
|
292
|
+
T.any(
|
|
293
|
+
ContextDev::WebExtractParams::Action::Wait,
|
|
294
|
+
ContextDev::WebExtractParams::Action::Perform,
|
|
295
|
+
ContextDev::WebExtractParams::Action::Scroll
|
|
296
|
+
)
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
class Wait < ContextDev::Internal::Type::BaseModel
|
|
300
|
+
OrHash =
|
|
301
|
+
T.type_alias do
|
|
302
|
+
T.any(
|
|
303
|
+
ContextDev::WebExtractParams::Action::Wait,
|
|
304
|
+
ContextDev::Internal::AnyHash
|
|
305
|
+
)
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
sig { returns(Symbol) }
|
|
309
|
+
attr_accessor :do_
|
|
310
|
+
|
|
311
|
+
sig { returns(Integer) }
|
|
312
|
+
attr_accessor :time_ms
|
|
313
|
+
|
|
314
|
+
# Pause for a fixed number of milliseconds before continuing to the next action.
|
|
315
|
+
sig do
|
|
316
|
+
params(time_ms: Integer, do_: Symbol).returns(T.attached_class)
|
|
317
|
+
end
|
|
318
|
+
def self.new(time_ms:, do_: :wait)
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
sig { override.returns({ do_: Symbol, time_ms: Integer }) }
|
|
322
|
+
def to_hash
|
|
323
|
+
end
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
class Perform < ContextDev::Internal::Type::BaseModel
|
|
327
|
+
OrHash =
|
|
328
|
+
T.type_alias do
|
|
329
|
+
T.any(
|
|
330
|
+
ContextDev::WebExtractParams::Action::Perform,
|
|
331
|
+
ContextDev::Internal::AnyHash
|
|
332
|
+
)
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
sig { returns(String) }
|
|
336
|
+
attr_accessor :action
|
|
337
|
+
|
|
338
|
+
sig { returns(Symbol) }
|
|
339
|
+
attr_accessor :do_
|
|
340
|
+
|
|
341
|
+
# Resolve and perform one natural-language browser action.
|
|
342
|
+
sig { params(action: String, do_: Symbol).returns(T.attached_class) }
|
|
343
|
+
def self.new(action:, do_: :perform)
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
sig { override.returns({ action: String, do_: Symbol }) }
|
|
347
|
+
def to_hash
|
|
348
|
+
end
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
class Scroll < ContextDev::Internal::Type::BaseModel
|
|
352
|
+
OrHash =
|
|
353
|
+
T.type_alias do
|
|
354
|
+
T.any(
|
|
355
|
+
ContextDev::WebExtractParams::Action::Scroll,
|
|
356
|
+
ContextDev::Internal::AnyHash
|
|
357
|
+
)
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
sig { returns(Symbol) }
|
|
361
|
+
attr_accessor :do_
|
|
362
|
+
|
|
363
|
+
# Pixels per scroll, one visible viewport, or the current scroll boundary.
|
|
364
|
+
# Defaults to viewport.
|
|
365
|
+
sig do
|
|
366
|
+
returns(
|
|
367
|
+
T.nilable(
|
|
368
|
+
T.any(
|
|
369
|
+
Integer,
|
|
370
|
+
ContextDev::WebExtractParams::Action::Scroll::Amount::OrSymbol
|
|
371
|
+
)
|
|
372
|
+
)
|
|
373
|
+
)
|
|
374
|
+
end
|
|
375
|
+
attr_reader :amount
|
|
376
|
+
|
|
377
|
+
sig do
|
|
378
|
+
params(
|
|
379
|
+
amount:
|
|
380
|
+
T.any(
|
|
381
|
+
Integer,
|
|
382
|
+
ContextDev::WebExtractParams::Action::Scroll::Amount::OrSymbol
|
|
383
|
+
)
|
|
384
|
+
).void
|
|
385
|
+
end
|
|
386
|
+
attr_writer :amount
|
|
387
|
+
|
|
388
|
+
# CSS selector for the first matching scroll container. Defaults to the page.
|
|
389
|
+
sig { returns(T.nilable(String)) }
|
|
390
|
+
attr_reader :container
|
|
391
|
+
|
|
392
|
+
sig { params(container: String).void }
|
|
393
|
+
attr_writer :container
|
|
394
|
+
|
|
395
|
+
# Direction to scroll. Defaults to down.
|
|
396
|
+
sig do
|
|
397
|
+
returns(
|
|
398
|
+
T.nilable(
|
|
399
|
+
ContextDev::WebExtractParams::Action::Scroll::Direction::OrSymbol
|
|
400
|
+
)
|
|
401
|
+
)
|
|
402
|
+
end
|
|
403
|
+
attr_reader :direction
|
|
404
|
+
|
|
405
|
+
sig do
|
|
406
|
+
params(
|
|
407
|
+
direction:
|
|
408
|
+
ContextDev::WebExtractParams::Action::Scroll::Direction::OrSymbol
|
|
409
|
+
).void
|
|
410
|
+
end
|
|
411
|
+
attr_writer :direction
|
|
412
|
+
|
|
413
|
+
# Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
|
|
414
|
+
# changing. Defaults to 1.
|
|
415
|
+
sig { returns(T.nilable(Integer)) }
|
|
416
|
+
attr_reader :max_scrolls
|
|
417
|
+
|
|
418
|
+
sig { params(max_scrolls: Integer).void }
|
|
419
|
+
attr_writer :max_scrolls
|
|
420
|
+
|
|
421
|
+
# Scroll the page or a selected scrollable container, waiting adaptively for
|
|
422
|
+
# content and dimensions to settle after each iteration.
|
|
423
|
+
sig do
|
|
424
|
+
params(
|
|
425
|
+
amount:
|
|
426
|
+
T.any(
|
|
427
|
+
Integer,
|
|
428
|
+
ContextDev::WebExtractParams::Action::Scroll::Amount::OrSymbol
|
|
429
|
+
),
|
|
430
|
+
container: String,
|
|
431
|
+
direction:
|
|
432
|
+
ContextDev::WebExtractParams::Action::Scroll::Direction::OrSymbol,
|
|
433
|
+
max_scrolls: Integer,
|
|
434
|
+
do_: Symbol
|
|
435
|
+
).returns(T.attached_class)
|
|
436
|
+
end
|
|
437
|
+
def self.new(
|
|
438
|
+
# Pixels per scroll, one visible viewport, or the current scroll boundary.
|
|
439
|
+
# Defaults to viewport.
|
|
440
|
+
amount: nil,
|
|
441
|
+
# CSS selector for the first matching scroll container. Defaults to the page.
|
|
442
|
+
container: nil,
|
|
443
|
+
# Direction to scroll. Defaults to down.
|
|
444
|
+
direction: nil,
|
|
445
|
+
# Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
|
|
446
|
+
# changing. Defaults to 1.
|
|
447
|
+
max_scrolls: nil,
|
|
448
|
+
do_: :scroll
|
|
449
|
+
)
|
|
450
|
+
end
|
|
451
|
+
|
|
452
|
+
sig do
|
|
453
|
+
override.returns(
|
|
454
|
+
{
|
|
455
|
+
do_: Symbol,
|
|
456
|
+
amount:
|
|
457
|
+
T.any(
|
|
458
|
+
Integer,
|
|
459
|
+
ContextDev::WebExtractParams::Action::Scroll::Amount::OrSymbol
|
|
460
|
+
),
|
|
461
|
+
container: String,
|
|
462
|
+
direction:
|
|
463
|
+
ContextDev::WebExtractParams::Action::Scroll::Direction::OrSymbol,
|
|
464
|
+
max_scrolls: Integer
|
|
465
|
+
}
|
|
466
|
+
)
|
|
467
|
+
end
|
|
468
|
+
def to_hash
|
|
469
|
+
end
|
|
470
|
+
|
|
471
|
+
# Pixels per scroll, one visible viewport, or the current scroll boundary.
|
|
472
|
+
# Defaults to viewport.
|
|
473
|
+
module Amount
|
|
474
|
+
extend ContextDev::Internal::Type::Union
|
|
475
|
+
|
|
476
|
+
Variants =
|
|
477
|
+
T.type_alias do
|
|
478
|
+
T.any(
|
|
479
|
+
Integer,
|
|
480
|
+
ContextDev::WebExtractParams::Action::Scroll::Amount::TaggedSymbol
|
|
481
|
+
)
|
|
482
|
+
end
|
|
483
|
+
|
|
484
|
+
sig do
|
|
485
|
+
override.returns(
|
|
486
|
+
T::Array[
|
|
487
|
+
ContextDev::WebExtractParams::Action::Scroll::Amount::Variants
|
|
488
|
+
]
|
|
489
|
+
)
|
|
490
|
+
end
|
|
491
|
+
def self.variants
|
|
492
|
+
end
|
|
493
|
+
|
|
494
|
+
TaggedSymbol =
|
|
495
|
+
T.type_alias do
|
|
496
|
+
T.all(
|
|
497
|
+
Symbol,
|
|
498
|
+
ContextDev::WebExtractParams::Action::Scroll::Amount
|
|
499
|
+
)
|
|
500
|
+
end
|
|
501
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
502
|
+
|
|
503
|
+
VIEWPORT =
|
|
504
|
+
T.let(
|
|
505
|
+
:viewport,
|
|
506
|
+
ContextDev::WebExtractParams::Action::Scroll::Amount::TaggedSymbol
|
|
507
|
+
)
|
|
508
|
+
MAX =
|
|
509
|
+
T.let(
|
|
510
|
+
:max,
|
|
511
|
+
ContextDev::WebExtractParams::Action::Scroll::Amount::TaggedSymbol
|
|
512
|
+
)
|
|
513
|
+
end
|
|
514
|
+
|
|
515
|
+
# Direction to scroll. Defaults to down.
|
|
516
|
+
module Direction
|
|
517
|
+
extend ContextDev::Internal::Type::Enum
|
|
518
|
+
|
|
519
|
+
TaggedSymbol =
|
|
520
|
+
T.type_alias do
|
|
521
|
+
T.all(
|
|
522
|
+
Symbol,
|
|
523
|
+
ContextDev::WebExtractParams::Action::Scroll::Direction
|
|
524
|
+
)
|
|
525
|
+
end
|
|
526
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
527
|
+
|
|
528
|
+
UP =
|
|
529
|
+
T.let(
|
|
530
|
+
:up,
|
|
531
|
+
ContextDev::WebExtractParams::Action::Scroll::Direction::TaggedSymbol
|
|
532
|
+
)
|
|
533
|
+
DOWN =
|
|
534
|
+
T.let(
|
|
535
|
+
:down,
|
|
536
|
+
ContextDev::WebExtractParams::Action::Scroll::Direction::TaggedSymbol
|
|
537
|
+
)
|
|
538
|
+
LEFT =
|
|
539
|
+
T.let(
|
|
540
|
+
:left,
|
|
541
|
+
ContextDev::WebExtractParams::Action::Scroll::Direction::TaggedSymbol
|
|
542
|
+
)
|
|
543
|
+
RIGHT =
|
|
544
|
+
T.let(
|
|
545
|
+
:right,
|
|
546
|
+
ContextDev::WebExtractParams::Action::Scroll::Direction::TaggedSymbol
|
|
547
|
+
)
|
|
548
|
+
|
|
549
|
+
sig do
|
|
550
|
+
override.returns(
|
|
551
|
+
T::Array[
|
|
552
|
+
ContextDev::WebExtractParams::Action::Scroll::Direction::TaggedSymbol
|
|
553
|
+
]
|
|
554
|
+
)
|
|
555
|
+
end
|
|
556
|
+
def self.values
|
|
557
|
+
end
|
|
558
|
+
end
|
|
559
|
+
end
|
|
560
|
+
|
|
561
|
+
sig do
|
|
562
|
+
override.returns(
|
|
563
|
+
T::Array[ContextDev::WebExtractParams::Action::Variants]
|
|
564
|
+
)
|
|
565
|
+
end
|
|
566
|
+
def self.variants
|
|
567
|
+
end
|
|
568
|
+
end
|
|
569
|
+
|
|
225
570
|
class Pdf < ContextDev::Internal::Type::BaseModel
|
|
226
571
|
OrHash =
|
|
227
572
|
T.type_alias do
|