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::WebWebScrapeImagesResponse::CacheMetadata)
|
|
19
|
+
end
|
|
20
|
+
attr_reader :cache_metadata
|
|
21
|
+
|
|
22
|
+
sig do
|
|
23
|
+
params(
|
|
24
|
+
cache_metadata:
|
|
25
|
+
ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata::OrHash
|
|
26
|
+
).void
|
|
27
|
+
end
|
|
28
|
+
attr_writer :cache_metadata
|
|
29
|
+
|
|
14
30
|
# Images found on the page.
|
|
15
31
|
sig do
|
|
16
32
|
returns(T::Array[ContextDev::Models::WebWebScrapeImagesResponse::Image])
|
|
@@ -29,6 +45,28 @@ module ContextDev
|
|
|
29
45
|
sig { returns(String) }
|
|
30
46
|
attr_accessor :url
|
|
31
47
|
|
|
48
|
+
# One verified outcome per requested browser action, in request order.
|
|
49
|
+
sig do
|
|
50
|
+
returns(
|
|
51
|
+
T.nilable(
|
|
52
|
+
T::Array[
|
|
53
|
+
ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied
|
|
54
|
+
]
|
|
55
|
+
)
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
attr_reader :actions_applied
|
|
59
|
+
|
|
60
|
+
sig do
|
|
61
|
+
params(
|
|
62
|
+
actions_applied:
|
|
63
|
+
T::Array[
|
|
64
|
+
ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied::OrHash
|
|
65
|
+
]
|
|
66
|
+
).void
|
|
67
|
+
end
|
|
68
|
+
attr_writer :actions_applied
|
|
69
|
+
|
|
32
70
|
# Metadata about the API key used for the request. Included in every response
|
|
33
71
|
# whenever a valid API key is provided, even when the response status is not 200.
|
|
34
72
|
sig do
|
|
@@ -48,6 +86,8 @@ module ContextDev
|
|
|
48
86
|
|
|
49
87
|
sig do
|
|
50
88
|
params(
|
|
89
|
+
cache_metadata:
|
|
90
|
+
ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata::OrHash,
|
|
51
91
|
images:
|
|
52
92
|
T::Array[
|
|
53
93
|
ContextDev::Models::WebWebScrapeImagesResponse::Image::OrHash
|
|
@@ -55,17 +95,27 @@ module ContextDev
|
|
|
55
95
|
success:
|
|
56
96
|
ContextDev::Models::WebWebScrapeImagesResponse::Success::OrBoolean,
|
|
57
97
|
url: String,
|
|
98
|
+
actions_applied:
|
|
99
|
+
T::Array[
|
|
100
|
+
ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied::OrHash
|
|
101
|
+
],
|
|
58
102
|
key_metadata:
|
|
59
103
|
ContextDev::Models::WebWebScrapeImagesResponse::KeyMetadata::OrHash
|
|
60
104
|
).returns(T.attached_class)
|
|
61
105
|
end
|
|
62
106
|
def self.new(
|
|
107
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
108
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
109
|
+
# oldest contributing hit.
|
|
110
|
+
cache_metadata:,
|
|
63
111
|
# Images found on the page.
|
|
64
112
|
images:,
|
|
65
113
|
# Always true on success.
|
|
66
114
|
success:,
|
|
67
115
|
# Page URL that was scraped.
|
|
68
116
|
url:,
|
|
117
|
+
# One verified outcome per requested browser action, in request order.
|
|
118
|
+
actions_applied: nil,
|
|
69
119
|
# Metadata about the API key used for the request. Included in every response
|
|
70
120
|
# whenever a valid API key is provided, even when the response status is not 200.
|
|
71
121
|
key_metadata: nil
|
|
@@ -75,11 +125,17 @@ module ContextDev
|
|
|
75
125
|
sig do
|
|
76
126
|
override.returns(
|
|
77
127
|
{
|
|
128
|
+
cache_metadata:
|
|
129
|
+
ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata,
|
|
78
130
|
images:
|
|
79
131
|
T::Array[ContextDev::Models::WebWebScrapeImagesResponse::Image],
|
|
80
132
|
success:
|
|
81
133
|
ContextDev::Models::WebWebScrapeImagesResponse::Success::TaggedBoolean,
|
|
82
134
|
url: String,
|
|
135
|
+
actions_applied:
|
|
136
|
+
T::Array[
|
|
137
|
+
ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied
|
|
138
|
+
],
|
|
83
139
|
key_metadata:
|
|
84
140
|
ContextDev::Models::WebWebScrapeImagesResponse::KeyMetadata
|
|
85
141
|
}
|
|
@@ -88,6 +144,101 @@ module ContextDev
|
|
|
88
144
|
def to_hash
|
|
89
145
|
end
|
|
90
146
|
|
|
147
|
+
class CacheMetadata < ContextDev::Internal::Type::BaseModel
|
|
148
|
+
OrHash =
|
|
149
|
+
T.type_alias do
|
|
150
|
+
T.any(
|
|
151
|
+
ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata,
|
|
152
|
+
ContextDev::Internal::AnyHash
|
|
153
|
+
)
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
|
|
157
|
+
sig { returns(Integer) }
|
|
158
|
+
attr_accessor :age_ms
|
|
159
|
+
|
|
160
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
161
|
+
# zero-data-retention cache bypass.
|
|
162
|
+
sig do
|
|
163
|
+
returns(
|
|
164
|
+
ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata::Status::TaggedSymbol
|
|
165
|
+
)
|
|
166
|
+
end
|
|
167
|
+
attr_accessor :status
|
|
168
|
+
|
|
169
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
170
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
171
|
+
# oldest contributing hit.
|
|
172
|
+
sig do
|
|
173
|
+
params(
|
|
174
|
+
age_ms: Integer,
|
|
175
|
+
status:
|
|
176
|
+
ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata::Status::OrSymbol
|
|
177
|
+
).returns(T.attached_class)
|
|
178
|
+
end
|
|
179
|
+
def self.new(
|
|
180
|
+
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
|
|
181
|
+
age_ms:,
|
|
182
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
183
|
+
# zero-data-retention cache bypass.
|
|
184
|
+
status:
|
|
185
|
+
)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
sig do
|
|
189
|
+
override.returns(
|
|
190
|
+
{
|
|
191
|
+
age_ms: Integer,
|
|
192
|
+
status:
|
|
193
|
+
ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata::Status::TaggedSymbol
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
end
|
|
197
|
+
def to_hash
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
201
|
+
# zero-data-retention cache bypass.
|
|
202
|
+
module Status
|
|
203
|
+
extend ContextDev::Internal::Type::Enum
|
|
204
|
+
|
|
205
|
+
TaggedSymbol =
|
|
206
|
+
T.type_alias do
|
|
207
|
+
T.all(
|
|
208
|
+
Symbol,
|
|
209
|
+
ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata::Status
|
|
210
|
+
)
|
|
211
|
+
end
|
|
212
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
213
|
+
|
|
214
|
+
HIT =
|
|
215
|
+
T.let(
|
|
216
|
+
:hit,
|
|
217
|
+
ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata::Status::TaggedSymbol
|
|
218
|
+
)
|
|
219
|
+
MISS =
|
|
220
|
+
T.let(
|
|
221
|
+
:miss,
|
|
222
|
+
ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata::Status::TaggedSymbol
|
|
223
|
+
)
|
|
224
|
+
ZDR =
|
|
225
|
+
T.let(
|
|
226
|
+
:zdr,
|
|
227
|
+
ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata::Status::TaggedSymbol
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
sig do
|
|
231
|
+
override.returns(
|
|
232
|
+
T::Array[
|
|
233
|
+
ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata::Status::TaggedSymbol
|
|
234
|
+
]
|
|
235
|
+
)
|
|
236
|
+
end
|
|
237
|
+
def self.values
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
end
|
|
241
|
+
|
|
91
242
|
class Image < ContextDev::Internal::Type::BaseModel
|
|
92
243
|
OrHash =
|
|
93
244
|
T.type_alias do
|
|
@@ -484,6 +635,143 @@ module ContextDev
|
|
|
484
635
|
end
|
|
485
636
|
end
|
|
486
637
|
|
|
638
|
+
class ActionsApplied < ContextDev::Internal::Type::BaseModel
|
|
639
|
+
OrHash =
|
|
640
|
+
T.type_alias do
|
|
641
|
+
T.any(
|
|
642
|
+
ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied,
|
|
643
|
+
ContextDev::Internal::AnyHash
|
|
644
|
+
)
|
|
645
|
+
end
|
|
646
|
+
|
|
647
|
+
sig { returns(String) }
|
|
648
|
+
attr_accessor :instruction
|
|
649
|
+
|
|
650
|
+
# Applied means the requested page state was visibly verified. Failed means it was
|
|
651
|
+
# not verified. Skipped means it was not attempted.
|
|
652
|
+
sig do
|
|
653
|
+
returns(
|
|
654
|
+
ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied::Status::TaggedSymbol
|
|
655
|
+
)
|
|
656
|
+
end
|
|
657
|
+
attr_accessor :status
|
|
658
|
+
|
|
659
|
+
# Visible page evidence used to verify an applied action.
|
|
660
|
+
sig { returns(T.nilable(String)) }
|
|
661
|
+
attr_reader :completion_evidence
|
|
662
|
+
|
|
663
|
+
sig { params(completion_evidence: String).void }
|
|
664
|
+
attr_writer :completion_evidence
|
|
665
|
+
|
|
666
|
+
sig { returns(T.nilable(Float)) }
|
|
667
|
+
attr_reader :duration_ms
|
|
668
|
+
|
|
669
|
+
sig { params(duration_ms: Float).void }
|
|
670
|
+
attr_writer :duration_ms
|
|
671
|
+
|
|
672
|
+
sig { returns(T.nilable(String)) }
|
|
673
|
+
attr_reader :error
|
|
674
|
+
|
|
675
|
+
sig { params(error: String).void }
|
|
676
|
+
attr_writer :error
|
|
677
|
+
|
|
678
|
+
sig { returns(T.nilable(String)) }
|
|
679
|
+
attr_reader :method_
|
|
680
|
+
|
|
681
|
+
sig { params(method_: String).void }
|
|
682
|
+
attr_writer :method_
|
|
683
|
+
|
|
684
|
+
sig { returns(T.nilable(String)) }
|
|
685
|
+
attr_reader :target_description
|
|
686
|
+
|
|
687
|
+
sig { params(target_description: String).void }
|
|
688
|
+
attr_writer :target_description
|
|
689
|
+
|
|
690
|
+
sig do
|
|
691
|
+
params(
|
|
692
|
+
instruction: String,
|
|
693
|
+
status:
|
|
694
|
+
ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied::Status::OrSymbol,
|
|
695
|
+
completion_evidence: String,
|
|
696
|
+
duration_ms: Float,
|
|
697
|
+
error: String,
|
|
698
|
+
method_: String,
|
|
699
|
+
target_description: String
|
|
700
|
+
).returns(T.attached_class)
|
|
701
|
+
end
|
|
702
|
+
def self.new(
|
|
703
|
+
instruction:,
|
|
704
|
+
# Applied means the requested page state was visibly verified. Failed means it was
|
|
705
|
+
# not verified. Skipped means it was not attempted.
|
|
706
|
+
status:,
|
|
707
|
+
# Visible page evidence used to verify an applied action.
|
|
708
|
+
completion_evidence: nil,
|
|
709
|
+
duration_ms: nil,
|
|
710
|
+
error: nil,
|
|
711
|
+
method_: nil,
|
|
712
|
+
target_description: nil
|
|
713
|
+
)
|
|
714
|
+
end
|
|
715
|
+
|
|
716
|
+
sig do
|
|
717
|
+
override.returns(
|
|
718
|
+
{
|
|
719
|
+
instruction: String,
|
|
720
|
+
status:
|
|
721
|
+
ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied::Status::TaggedSymbol,
|
|
722
|
+
completion_evidence: String,
|
|
723
|
+
duration_ms: Float,
|
|
724
|
+
error: String,
|
|
725
|
+
method_: String,
|
|
726
|
+
target_description: String
|
|
727
|
+
}
|
|
728
|
+
)
|
|
729
|
+
end
|
|
730
|
+
def to_hash
|
|
731
|
+
end
|
|
732
|
+
|
|
733
|
+
# Applied means the requested page state was visibly verified. Failed means it was
|
|
734
|
+
# not verified. Skipped means it was not attempted.
|
|
735
|
+
module Status
|
|
736
|
+
extend ContextDev::Internal::Type::Enum
|
|
737
|
+
|
|
738
|
+
TaggedSymbol =
|
|
739
|
+
T.type_alias do
|
|
740
|
+
T.all(
|
|
741
|
+
Symbol,
|
|
742
|
+
ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied::Status
|
|
743
|
+
)
|
|
744
|
+
end
|
|
745
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
746
|
+
|
|
747
|
+
APPLIED =
|
|
748
|
+
T.let(
|
|
749
|
+
:applied,
|
|
750
|
+
ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied::Status::TaggedSymbol
|
|
751
|
+
)
|
|
752
|
+
FAILED =
|
|
753
|
+
T.let(
|
|
754
|
+
:failed,
|
|
755
|
+
ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied::Status::TaggedSymbol
|
|
756
|
+
)
|
|
757
|
+
SKIPPED =
|
|
758
|
+
T.let(
|
|
759
|
+
:skipped,
|
|
760
|
+
ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied::Status::TaggedSymbol
|
|
761
|
+
)
|
|
762
|
+
|
|
763
|
+
sig do
|
|
764
|
+
override.returns(
|
|
765
|
+
T::Array[
|
|
766
|
+
ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied::Status::TaggedSymbol
|
|
767
|
+
]
|
|
768
|
+
)
|
|
769
|
+
end
|
|
770
|
+
def self.values
|
|
771
|
+
end
|
|
772
|
+
end
|
|
773
|
+
end
|
|
774
|
+
|
|
487
775
|
class KeyMetadata < ContextDev::Internal::Type::BaseModel
|
|
488
776
|
OrHash =
|
|
489
777
|
T.type_alias do
|
|
@@ -25,7 +25,8 @@ module ContextDev
|
|
|
25
25
|
T::Array[
|
|
26
26
|
T.any(
|
|
27
27
|
ContextDev::WebWebScrapeMdParams::Action::Wait,
|
|
28
|
-
ContextDev::WebWebScrapeMdParams::Action::Perform
|
|
28
|
+
ContextDev::WebWebScrapeMdParams::Action::Perform,
|
|
29
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll
|
|
29
30
|
)
|
|
30
31
|
]
|
|
31
32
|
)
|
|
@@ -179,7 +180,8 @@ module ContextDev
|
|
|
179
180
|
T::Array[
|
|
180
181
|
T.any(
|
|
181
182
|
ContextDev::WebWebScrapeMdParams::Action::Wait::OrHash,
|
|
182
|
-
ContextDev::WebWebScrapeMdParams::Action::Perform::OrHash
|
|
183
|
+
ContextDev::WebWebScrapeMdParams::Action::Perform::OrHash,
|
|
184
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::OrHash
|
|
183
185
|
)
|
|
184
186
|
]
|
|
185
187
|
),
|
|
@@ -281,7 +283,8 @@ module ContextDev
|
|
|
281
283
|
T::Array[
|
|
282
284
|
T.any(
|
|
283
285
|
ContextDev::WebWebScrapeMdParams::Action::Wait,
|
|
284
|
-
ContextDev::WebWebScrapeMdParams::Action::Perform
|
|
286
|
+
ContextDev::WebWebScrapeMdParams::Action::Perform,
|
|
287
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll
|
|
285
288
|
)
|
|
286
289
|
]
|
|
287
290
|
),
|
|
@@ -318,7 +321,8 @@ module ContextDev
|
|
|
318
321
|
T.type_alias do
|
|
319
322
|
T.any(
|
|
320
323
|
ContextDev::WebWebScrapeMdParams::Action::Wait,
|
|
321
|
-
ContextDev::WebWebScrapeMdParams::Action::Perform
|
|
324
|
+
ContextDev::WebWebScrapeMdParams::Action::Perform,
|
|
325
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll
|
|
322
326
|
)
|
|
323
327
|
end
|
|
324
328
|
|
|
@@ -374,6 +378,216 @@ module ContextDev
|
|
|
374
378
|
end
|
|
375
379
|
end
|
|
376
380
|
|
|
381
|
+
class Scroll < ContextDev::Internal::Type::BaseModel
|
|
382
|
+
OrHash =
|
|
383
|
+
T.type_alias do
|
|
384
|
+
T.any(
|
|
385
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll,
|
|
386
|
+
ContextDev::Internal::AnyHash
|
|
387
|
+
)
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
sig { returns(Symbol) }
|
|
391
|
+
attr_accessor :do_
|
|
392
|
+
|
|
393
|
+
# Pixels per scroll, one visible viewport, or the current scroll boundary.
|
|
394
|
+
# Defaults to viewport.
|
|
395
|
+
sig do
|
|
396
|
+
returns(
|
|
397
|
+
T.nilable(
|
|
398
|
+
T.any(
|
|
399
|
+
Integer,
|
|
400
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Amount::OrSymbol
|
|
401
|
+
)
|
|
402
|
+
)
|
|
403
|
+
)
|
|
404
|
+
end
|
|
405
|
+
attr_reader :amount
|
|
406
|
+
|
|
407
|
+
sig do
|
|
408
|
+
params(
|
|
409
|
+
amount:
|
|
410
|
+
T.any(
|
|
411
|
+
Integer,
|
|
412
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Amount::OrSymbol
|
|
413
|
+
)
|
|
414
|
+
).void
|
|
415
|
+
end
|
|
416
|
+
attr_writer :amount
|
|
417
|
+
|
|
418
|
+
# CSS selector for the first matching scroll container. Defaults to the page.
|
|
419
|
+
sig { returns(T.nilable(String)) }
|
|
420
|
+
attr_reader :container
|
|
421
|
+
|
|
422
|
+
sig { params(container: String).void }
|
|
423
|
+
attr_writer :container
|
|
424
|
+
|
|
425
|
+
# Direction to scroll. Defaults to down.
|
|
426
|
+
sig do
|
|
427
|
+
returns(
|
|
428
|
+
T.nilable(
|
|
429
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Direction::OrSymbol
|
|
430
|
+
)
|
|
431
|
+
)
|
|
432
|
+
end
|
|
433
|
+
attr_reader :direction
|
|
434
|
+
|
|
435
|
+
sig do
|
|
436
|
+
params(
|
|
437
|
+
direction:
|
|
438
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Direction::OrSymbol
|
|
439
|
+
).void
|
|
440
|
+
end
|
|
441
|
+
attr_writer :direction
|
|
442
|
+
|
|
443
|
+
# Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
|
|
444
|
+
# changing. Defaults to 1.
|
|
445
|
+
sig { returns(T.nilable(Integer)) }
|
|
446
|
+
attr_reader :max_scrolls
|
|
447
|
+
|
|
448
|
+
sig { params(max_scrolls: Integer).void }
|
|
449
|
+
attr_writer :max_scrolls
|
|
450
|
+
|
|
451
|
+
# Scroll the page or a selected scrollable container, waiting adaptively for
|
|
452
|
+
# content and dimensions to settle after each iteration.
|
|
453
|
+
sig do
|
|
454
|
+
params(
|
|
455
|
+
amount:
|
|
456
|
+
T.any(
|
|
457
|
+
Integer,
|
|
458
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Amount::OrSymbol
|
|
459
|
+
),
|
|
460
|
+
container: String,
|
|
461
|
+
direction:
|
|
462
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Direction::OrSymbol,
|
|
463
|
+
max_scrolls: Integer,
|
|
464
|
+
do_: Symbol
|
|
465
|
+
).returns(T.attached_class)
|
|
466
|
+
end
|
|
467
|
+
def self.new(
|
|
468
|
+
# Pixels per scroll, one visible viewport, or the current scroll boundary.
|
|
469
|
+
# Defaults to viewport.
|
|
470
|
+
amount: nil,
|
|
471
|
+
# CSS selector for the first matching scroll container. Defaults to the page.
|
|
472
|
+
container: nil,
|
|
473
|
+
# Direction to scroll. Defaults to down.
|
|
474
|
+
direction: nil,
|
|
475
|
+
# Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
|
|
476
|
+
# changing. Defaults to 1.
|
|
477
|
+
max_scrolls: nil,
|
|
478
|
+
do_: :scroll
|
|
479
|
+
)
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
sig do
|
|
483
|
+
override.returns(
|
|
484
|
+
{
|
|
485
|
+
do_: Symbol,
|
|
486
|
+
amount:
|
|
487
|
+
T.any(
|
|
488
|
+
Integer,
|
|
489
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Amount::OrSymbol
|
|
490
|
+
),
|
|
491
|
+
container: String,
|
|
492
|
+
direction:
|
|
493
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Direction::OrSymbol,
|
|
494
|
+
max_scrolls: Integer
|
|
495
|
+
}
|
|
496
|
+
)
|
|
497
|
+
end
|
|
498
|
+
def to_hash
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
# Pixels per scroll, one visible viewport, or the current scroll boundary.
|
|
502
|
+
# Defaults to viewport.
|
|
503
|
+
module Amount
|
|
504
|
+
extend ContextDev::Internal::Type::Union
|
|
505
|
+
|
|
506
|
+
Variants =
|
|
507
|
+
T.type_alias do
|
|
508
|
+
T.any(
|
|
509
|
+
Integer,
|
|
510
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Amount::TaggedSymbol
|
|
511
|
+
)
|
|
512
|
+
end
|
|
513
|
+
|
|
514
|
+
sig do
|
|
515
|
+
override.returns(
|
|
516
|
+
T::Array[
|
|
517
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Amount::Variants
|
|
518
|
+
]
|
|
519
|
+
)
|
|
520
|
+
end
|
|
521
|
+
def self.variants
|
|
522
|
+
end
|
|
523
|
+
|
|
524
|
+
TaggedSymbol =
|
|
525
|
+
T.type_alias do
|
|
526
|
+
T.all(
|
|
527
|
+
Symbol,
|
|
528
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Amount
|
|
529
|
+
)
|
|
530
|
+
end
|
|
531
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
532
|
+
|
|
533
|
+
VIEWPORT =
|
|
534
|
+
T.let(
|
|
535
|
+
:viewport,
|
|
536
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Amount::TaggedSymbol
|
|
537
|
+
)
|
|
538
|
+
MAX =
|
|
539
|
+
T.let(
|
|
540
|
+
:max,
|
|
541
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Amount::TaggedSymbol
|
|
542
|
+
)
|
|
543
|
+
end
|
|
544
|
+
|
|
545
|
+
# Direction to scroll. Defaults to down.
|
|
546
|
+
module Direction
|
|
547
|
+
extend ContextDev::Internal::Type::Enum
|
|
548
|
+
|
|
549
|
+
TaggedSymbol =
|
|
550
|
+
T.type_alias do
|
|
551
|
+
T.all(
|
|
552
|
+
Symbol,
|
|
553
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Direction
|
|
554
|
+
)
|
|
555
|
+
end
|
|
556
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
557
|
+
|
|
558
|
+
UP =
|
|
559
|
+
T.let(
|
|
560
|
+
:up,
|
|
561
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Direction::TaggedSymbol
|
|
562
|
+
)
|
|
563
|
+
DOWN =
|
|
564
|
+
T.let(
|
|
565
|
+
:down,
|
|
566
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Direction::TaggedSymbol
|
|
567
|
+
)
|
|
568
|
+
LEFT =
|
|
569
|
+
T.let(
|
|
570
|
+
:left,
|
|
571
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Direction::TaggedSymbol
|
|
572
|
+
)
|
|
573
|
+
RIGHT =
|
|
574
|
+
T.let(
|
|
575
|
+
:right,
|
|
576
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Direction::TaggedSymbol
|
|
577
|
+
)
|
|
578
|
+
|
|
579
|
+
sig do
|
|
580
|
+
override.returns(
|
|
581
|
+
T::Array[
|
|
582
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::Direction::TaggedSymbol
|
|
583
|
+
]
|
|
584
|
+
)
|
|
585
|
+
end
|
|
586
|
+
def self.values
|
|
587
|
+
end
|
|
588
|
+
end
|
|
589
|
+
end
|
|
590
|
+
|
|
377
591
|
sig do
|
|
378
592
|
override.returns(
|
|
379
593
|
T::Array[ContextDev::WebWebScrapeMdParams::Action::Variants]
|