context.dev 2.11.0 → 2.12.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 +11 -0
- data/README.md +1 -1
- data/lib/context_dev/models/ai_extract_product_response.rb +48 -1
- data/lib/context_dev/models/ai_extract_products_response.rb +48 -1
- data/lib/context_dev/models/news_search_params.rb +1 -0
- data/lib/context_dev/models/web_extract_params.rb +169 -6
- data/lib/context_dev/models/web_extract_response.rb +85 -1
- data/lib/context_dev/models/web_web_crawl_md_params.rb +7 -5
- data/lib/context_dev/models/web_web_scrape_html_params.rb +99 -3
- data/lib/context_dev/models/web_web_scrape_images_params.rb +99 -3
- data/lib/context_dev/models/web_web_scrape_images_response.rb +85 -1
- data/lib/context_dev/models/web_web_scrape_md_params.rb +99 -3
- 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 +99 -0
- data/rbi/context_dev/models/ai_extract_products_response.rbi +99 -0
- data/rbi/context_dev/models/news_search_params.rbi +5 -0
- data/rbi/context_dev/models/web_extract_params.rbi +353 -8
- data/rbi/context_dev/models/web_extract_response.rbi +172 -3
- data/rbi/context_dev/models/web_web_crawl_md_params.rbi +10 -6
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +218 -4
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +218 -4
- data/rbi/context_dev/models/web_web_scrape_images_response.rbi +169 -0
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +218 -4
- data/rbi/context_dev/resources/web.rbi +31 -10
- data/sig/context_dev/models/ai_extract_product_response.rbs +40 -0
- data/sig/context_dev/models/ai_extract_products_response.rbs +40 -0
- data/sig/context_dev/models/news_search_params.rbs +2 -0
- data/sig/context_dev/models/web_extract_params.rbs +117 -0
- data/sig/context_dev/models/web_extract_response.rbs +81 -3
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +74 -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 +78 -0
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +74 -0
- data/sig/context_dev/resources/web.rbs +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8ef98d3030c8e13d2b4d3ec497e6b4603b18108b853b2dfbf72b784fcf2797d5
|
|
4
|
+
data.tar.gz: 05571a05f9ca05ca7b76fef39a942eccc063cd067584537af015c3c75bd8c171
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 535b48a03656e47a7936e4e57b6e93cc479cfadb801a8d0b1d0dd814bfaa5be9612778286f2dde0727b3274e8fd14efa9248e1609a9ef07e22c65a3e64205d0a
|
|
7
|
+
data.tar.gz: 1da1214b1edddf28e4c442870b77fa58e117a0da698fb32a7c9f0562f760d40f784db28751aaf018d51c0e87c0597d5b9160e97aa9e3c4c5965f6c5671642c1b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.12.0 (2026-08-23)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.11.0...v2.12.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v2.11.0...v2.12.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([f7adbd6](https://github.com/context-dot-dev/context-ruby-sdk/commit/f7adbd63407b697245019ea9483dc090de9ba0ff))
|
|
10
|
+
* **api:** api update ([c26b304](https://github.com/context-dot-dev/context-ruby-sdk/commit/c26b30411607dcc2eaad14962d582f4588f5193f))
|
|
11
|
+
* **api:** api update ([852a96e](https://github.com/context-dot-dev/context-ruby-sdk/commit/852a96e58dab7e6fef53af10093119ffc237f52e))
|
|
12
|
+
* **api:** api update ([c16beb5](https://github.com/context-dot-dev/context-ruby-sdk/commit/c16beb55d66977611c58711b489132f347ab2c96))
|
|
13
|
+
|
|
3
14
|
## 2.11.0 (2026-08-18)
|
|
4
15
|
|
|
5
16
|
Full Changelog: [v2.10.0...v2.11.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v2.10.0...v2.11.0)
|
data/README.md
CHANGED
|
@@ -123,6 +123,14 @@ module ContextDev
|
|
|
123
123
|
# @return [Array<String>]
|
|
124
124
|
required :target_audience, ContextDev::Internal::Type::ArrayOf[String]
|
|
125
125
|
|
|
126
|
+
# @!attribute availability
|
|
127
|
+
# Normalized stock or ordering availability
|
|
128
|
+
#
|
|
129
|
+
# @return [Symbol, ContextDev::Models::AIExtractProductResponse::Product::Availability, nil]
|
|
130
|
+
optional :availability,
|
|
131
|
+
enum: -> { ContextDev::Models::AIExtractProductResponse::Product::Availability },
|
|
132
|
+
nil?: true
|
|
133
|
+
|
|
126
134
|
# @!attribute billing_frequency
|
|
127
135
|
# Billing frequency for the product
|
|
128
136
|
#
|
|
@@ -143,6 +151,12 @@ module ContextDev
|
|
|
143
151
|
# @return [String, nil]
|
|
144
152
|
optional :currency, String, nil?: true
|
|
145
153
|
|
|
154
|
+
# @!attribute dimensions
|
|
155
|
+
# Dimension statements shown for the product, preserving labels, values, and units
|
|
156
|
+
#
|
|
157
|
+
# @return [Array<String>, nil]
|
|
158
|
+
optional :dimensions, ContextDev::Internal::Type::ArrayOf[String]
|
|
159
|
+
|
|
146
160
|
# @!attribute image_url
|
|
147
161
|
# URL to the product image
|
|
148
162
|
#
|
|
@@ -163,13 +177,22 @@ module ContextDev
|
|
|
163
177
|
enum: -> { ContextDev::Models::AIExtractProductResponse::Product::PricingModel },
|
|
164
178
|
nil?: true
|
|
165
179
|
|
|
180
|
+
# @!attribute regular_price
|
|
181
|
+
# Original or regular price before a displayed discount
|
|
182
|
+
#
|
|
183
|
+
# @return [Float, nil]
|
|
184
|
+
optional :regular_price, Float, nil?: true
|
|
185
|
+
|
|
166
186
|
# @!attribute url
|
|
167
187
|
# URL to the product page
|
|
168
188
|
#
|
|
169
189
|
# @return [String, nil]
|
|
170
190
|
optional :url, String, nil?: true
|
|
171
191
|
|
|
172
|
-
# @!method initialize(description:, features:, images:, name:, sku:, tags:, target_audience:, billing_frequency: nil, category: nil, currency: nil, image_url: nil, price: nil, pricing_model: nil, url: nil)
|
|
192
|
+
# @!method initialize(description:, features:, images:, name:, sku:, tags:, target_audience:, availability: nil, billing_frequency: nil, category: nil, currency: nil, dimensions: nil, image_url: nil, price: nil, pricing_model: nil, regular_price: nil, url: nil)
|
|
193
|
+
# Some parameter documentations has been truncated, see
|
|
194
|
+
# {ContextDev::Models::AIExtractProductResponse::Product} for more details.
|
|
195
|
+
#
|
|
173
196
|
# The extracted product data, or null if not a product page
|
|
174
197
|
#
|
|
175
198
|
# @param description [String] Description of the product
|
|
@@ -186,20 +209,44 @@ module ContextDev
|
|
|
186
209
|
#
|
|
187
210
|
# @param target_audience [Array<String>] Target audience for the product (array of strings)
|
|
188
211
|
#
|
|
212
|
+
# @param availability [Symbol, ContextDev::Models::AIExtractProductResponse::Product::Availability, nil] Normalized stock or ordering availability
|
|
213
|
+
#
|
|
189
214
|
# @param billing_frequency [Symbol, ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency, nil] Billing frequency for the product
|
|
190
215
|
#
|
|
191
216
|
# @param category [String, nil] Category of the product
|
|
192
217
|
#
|
|
193
218
|
# @param currency [String, nil] Currency code for the price (e.g., USD, EUR)
|
|
194
219
|
#
|
|
220
|
+
# @param dimensions [Array<String>] Dimension statements shown for the product, preserving labels, values, and units
|
|
221
|
+
#
|
|
195
222
|
# @param image_url [String, nil] URL to the product image
|
|
196
223
|
#
|
|
197
224
|
# @param price [Float, nil] Price of the product
|
|
198
225
|
#
|
|
199
226
|
# @param pricing_model [Symbol, ContextDev::Models::AIExtractProductResponse::Product::PricingModel, nil] Pricing model for the product
|
|
200
227
|
#
|
|
228
|
+
# @param regular_price [Float, nil] Original or regular price before a displayed discount
|
|
229
|
+
#
|
|
201
230
|
# @param url [String, nil] URL to the product page
|
|
202
231
|
|
|
232
|
+
# Normalized stock or ordering availability
|
|
233
|
+
#
|
|
234
|
+
# @see ContextDev::Models::AIExtractProductResponse::Product#availability
|
|
235
|
+
module Availability
|
|
236
|
+
extend ContextDev::Internal::Type::Enum
|
|
237
|
+
|
|
238
|
+
IN_STOCK = :in_stock
|
|
239
|
+
OUT_OF_STOCK = :out_of_stock
|
|
240
|
+
LIMITED_AVAILABILITY = :limited_availability
|
|
241
|
+
PREORDER = :preorder
|
|
242
|
+
BACKORDER = :backorder
|
|
243
|
+
MADE_TO_ORDER = :made_to_order
|
|
244
|
+
DISCONTINUED = :discontinued
|
|
245
|
+
|
|
246
|
+
# @!method self.values
|
|
247
|
+
# @return [Array<Symbol>]
|
|
248
|
+
end
|
|
249
|
+
|
|
203
250
|
# Billing frequency for the product
|
|
204
251
|
#
|
|
205
252
|
# @see ContextDev::Models::AIExtractProductResponse::Product#billing_frequency
|
|
@@ -92,6 +92,14 @@ module ContextDev
|
|
|
92
92
|
# @return [Array<String>]
|
|
93
93
|
required :target_audience, ContextDev::Internal::Type::ArrayOf[String]
|
|
94
94
|
|
|
95
|
+
# @!attribute availability
|
|
96
|
+
# Normalized stock or ordering availability
|
|
97
|
+
#
|
|
98
|
+
# @return [Symbol, ContextDev::Models::AIExtractProductsResponse::Product::Availability, nil]
|
|
99
|
+
optional :availability,
|
|
100
|
+
enum: -> { ContextDev::Models::AIExtractProductsResponse::Product::Availability },
|
|
101
|
+
nil?: true
|
|
102
|
+
|
|
95
103
|
# @!attribute billing_frequency
|
|
96
104
|
# Billing frequency for the product
|
|
97
105
|
#
|
|
@@ -112,6 +120,12 @@ module ContextDev
|
|
|
112
120
|
# @return [String, nil]
|
|
113
121
|
optional :currency, String, nil?: true
|
|
114
122
|
|
|
123
|
+
# @!attribute dimensions
|
|
124
|
+
# Dimension statements shown for the product, preserving labels, values, and units
|
|
125
|
+
#
|
|
126
|
+
# @return [Array<String>, nil]
|
|
127
|
+
optional :dimensions, ContextDev::Internal::Type::ArrayOf[String]
|
|
128
|
+
|
|
115
129
|
# @!attribute image_url
|
|
116
130
|
# URL to the product image
|
|
117
131
|
#
|
|
@@ -132,13 +146,22 @@ module ContextDev
|
|
|
132
146
|
enum: -> { ContextDev::Models::AIExtractProductsResponse::Product::PricingModel },
|
|
133
147
|
nil?: true
|
|
134
148
|
|
|
149
|
+
# @!attribute regular_price
|
|
150
|
+
# Original or regular price before a displayed discount
|
|
151
|
+
#
|
|
152
|
+
# @return [Float, nil]
|
|
153
|
+
optional :regular_price, Float, nil?: true
|
|
154
|
+
|
|
135
155
|
# @!attribute url
|
|
136
156
|
# URL to the product page
|
|
137
157
|
#
|
|
138
158
|
# @return [String, nil]
|
|
139
159
|
optional :url, String, nil?: true
|
|
140
160
|
|
|
141
|
-
# @!method initialize(description:, features:, images:, name:, sku:, tags:, target_audience:, billing_frequency: nil, category: nil, currency: nil, image_url: nil, price: nil, pricing_model: nil, url: nil)
|
|
161
|
+
# @!method initialize(description:, features:, images:, name:, sku:, tags:, target_audience:, availability: nil, billing_frequency: nil, category: nil, currency: nil, dimensions: nil, image_url: nil, price: nil, pricing_model: nil, regular_price: nil, url: nil)
|
|
162
|
+
# Some parameter documentations has been truncated, see
|
|
163
|
+
# {ContextDev::Models::AIExtractProductsResponse::Product} for more details.
|
|
164
|
+
#
|
|
142
165
|
# @param description [String] Description of the product
|
|
143
166
|
#
|
|
144
167
|
# @param features [Array<String>] List of product features
|
|
@@ -153,20 +176,44 @@ module ContextDev
|
|
|
153
176
|
#
|
|
154
177
|
# @param target_audience [Array<String>] Target audience for the product (array of strings)
|
|
155
178
|
#
|
|
179
|
+
# @param availability [Symbol, ContextDev::Models::AIExtractProductsResponse::Product::Availability, nil] Normalized stock or ordering availability
|
|
180
|
+
#
|
|
156
181
|
# @param billing_frequency [Symbol, ContextDev::Models::AIExtractProductsResponse::Product::BillingFrequency, nil] Billing frequency for the product
|
|
157
182
|
#
|
|
158
183
|
# @param category [String, nil] Category of the product
|
|
159
184
|
#
|
|
160
185
|
# @param currency [String, nil] Currency code for the price (e.g., USD, EUR)
|
|
161
186
|
#
|
|
187
|
+
# @param dimensions [Array<String>] Dimension statements shown for the product, preserving labels, values, and units
|
|
188
|
+
#
|
|
162
189
|
# @param image_url [String, nil] URL to the product image
|
|
163
190
|
#
|
|
164
191
|
# @param price [Float, nil] Price of the product
|
|
165
192
|
#
|
|
166
193
|
# @param pricing_model [Symbol, ContextDev::Models::AIExtractProductsResponse::Product::PricingModel, nil] Pricing model for the product
|
|
167
194
|
#
|
|
195
|
+
# @param regular_price [Float, nil] Original or regular price before a displayed discount
|
|
196
|
+
#
|
|
168
197
|
# @param url [String, nil] URL to the product page
|
|
169
198
|
|
|
199
|
+
# Normalized stock or ordering availability
|
|
200
|
+
#
|
|
201
|
+
# @see ContextDev::Models::AIExtractProductsResponse::Product#availability
|
|
202
|
+
module Availability
|
|
203
|
+
extend ContextDev::Internal::Type::Enum
|
|
204
|
+
|
|
205
|
+
IN_STOCK = :in_stock
|
|
206
|
+
OUT_OF_STOCK = :out_of_stock
|
|
207
|
+
LIMITED_AVAILABILITY = :limited_availability
|
|
208
|
+
PREORDER = :preorder
|
|
209
|
+
BACKORDER = :backorder
|
|
210
|
+
MADE_TO_ORDER = :made_to_order
|
|
211
|
+
DISCONTINUED = :discontinued
|
|
212
|
+
|
|
213
|
+
# @!method self.values
|
|
214
|
+
# @return [Array<Symbol>]
|
|
215
|
+
end
|
|
216
|
+
|
|
170
217
|
# Billing frequency for the product
|
|
171
218
|
#
|
|
172
219
|
# @see ContextDev::Models::AIExtractProductsResponse::Product#billing_frequency
|
|
@@ -8,9 +8,11 @@ module ContextDev
|
|
|
8
8
|
include ContextDev::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
10
|
# @!attribute schema
|
|
11
|
-
# JSON Schema for the returned data object.
|
|
12
|
-
#
|
|
13
|
-
#
|
|
11
|
+
# JSON Schema for the returned data object. Image fields such as `image_urls` or
|
|
12
|
+
# `product_photos` automatically make page image references available to
|
|
13
|
+
# extraction, so product data and photos can be returned in one call. TypeScript
|
|
14
|
+
# Zod users can pass a JSON Schema generated from a Zod object; Python users can
|
|
15
|
+
# pass the equivalent JSON Schema object.
|
|
14
16
|
#
|
|
15
17
|
# @return [Hash{Symbol=>Object}]
|
|
16
18
|
required :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]
|
|
@@ -22,6 +24,15 @@ module ContextDev
|
|
|
22
24
|
# @return [String]
|
|
23
25
|
required :url, String
|
|
24
26
|
|
|
27
|
+
# @!attribute actions
|
|
28
|
+
# Optional browser actions executed in order on the requested page after it loads,
|
|
29
|
+
# before links are discovered or additional pages are crawled. Requires a paid
|
|
30
|
+
# plan. When actions are provided and stopAfterMs is omitted, the crawl budget
|
|
31
|
+
# defaults to 110000 ms.
|
|
32
|
+
#
|
|
33
|
+
# @return [Array<ContextDev::Models::WebExtractParams::Action::Wait, ContextDev::Models::WebExtractParams::Action::Perform, ContextDev::Models::WebExtractParams::Action::Scroll>, nil]
|
|
34
|
+
optional :actions, -> { ContextDev::Internal::Type::ArrayOf[union: ContextDev::WebExtractParams::Action] }
|
|
35
|
+
|
|
25
36
|
# @!attribute fact_check
|
|
26
37
|
# When true, every returned value must be grounded in facts stated on the page;
|
|
27
38
|
# fields that cannot be supported by the page are returned as null/empty. When
|
|
@@ -87,7 +98,8 @@ module ContextDev
|
|
|
87
98
|
|
|
88
99
|
# @!attribute stop_after_ms
|
|
89
100
|
# Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000
|
|
90
|
-
# (110s).
|
|
101
|
+
# (110s). Defaults to 80000 (80s), or 110000 (110s) when browser actions are
|
|
102
|
+
# provided.
|
|
91
103
|
#
|
|
92
104
|
# @return [Integer, nil]
|
|
93
105
|
optional :stop_after_ms, Integer, api_name: :stopAfterMs
|
|
@@ -113,14 +125,16 @@ module ContextDev
|
|
|
113
125
|
# @return [Integer, nil]
|
|
114
126
|
optional :wait_for_ms, Integer, api_name: :waitForMs
|
|
115
127
|
|
|
116
|
-
# @!method initialize(schema:, url:, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, stop_after_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
|
|
128
|
+
# @!method initialize(schema:, url:, actions: nil, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, stop_after_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
|
|
117
129
|
# Some parameter documentations has been truncated, see
|
|
118
130
|
# {ContextDev::Models::WebExtractParams} for more details.
|
|
119
131
|
#
|
|
120
|
-
# @param schema [Hash{Symbol=>Object}] JSON Schema for the returned data object.
|
|
132
|
+
# @param schema [Hash{Symbol=>Object}] JSON Schema for the returned data object. Image fields such as `image_urls` or `
|
|
121
133
|
#
|
|
122
134
|
# @param url [String] The starting website URL to crawl and extract from. Must include http:// or http
|
|
123
135
|
#
|
|
136
|
+
# @param actions [Array<ContextDev::Models::WebExtractParams::Action::Wait, ContextDev::Models::WebExtractParams::Action::Perform, ContextDev::Models::WebExtractParams::Action::Scroll>] Optional browser actions executed in order on the requested page after it loads,
|
|
137
|
+
#
|
|
124
138
|
# @param fact_check [Boolean] When true, every returned value must be grounded in facts stated on the page; fi
|
|
125
139
|
#
|
|
126
140
|
# @param follow_subdomains [Boolean] When true, follow links on subdomains of the starting URL's domain.
|
|
@@ -149,6 +163,155 @@ module ContextDev
|
|
|
149
163
|
#
|
|
150
164
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
|
|
151
165
|
|
|
166
|
+
# Browser action discriminated by `do`. Each variant exposes only its applicable
|
|
167
|
+
# fields.
|
|
168
|
+
module Action
|
|
169
|
+
extend ContextDev::Internal::Type::Union
|
|
170
|
+
|
|
171
|
+
discriminator :do
|
|
172
|
+
|
|
173
|
+
# Pause for a fixed number of milliseconds before continuing to the next action.
|
|
174
|
+
variant :wait, -> { ContextDev::WebExtractParams::Action::Wait }
|
|
175
|
+
|
|
176
|
+
# Resolve and perform one natural-language browser action.
|
|
177
|
+
variant :perform, -> { ContextDev::WebExtractParams::Action::Perform }
|
|
178
|
+
|
|
179
|
+
# Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.
|
|
180
|
+
variant :scroll, -> { ContextDev::WebExtractParams::Action::Scroll }
|
|
181
|
+
|
|
182
|
+
class Wait < ContextDev::Internal::Type::BaseModel
|
|
183
|
+
# @!attribute do_
|
|
184
|
+
#
|
|
185
|
+
# @return [Symbol, :wait]
|
|
186
|
+
required :do_, const: :wait, api_name: :do
|
|
187
|
+
|
|
188
|
+
# @!attribute time_ms
|
|
189
|
+
#
|
|
190
|
+
# @return [Integer]
|
|
191
|
+
required :time_ms, Integer, api_name: :timeMs
|
|
192
|
+
|
|
193
|
+
# @!method initialize(time_ms:, do_: :wait)
|
|
194
|
+
# Pause for a fixed number of milliseconds before continuing to the next action.
|
|
195
|
+
#
|
|
196
|
+
# @param time_ms [Integer]
|
|
197
|
+
# @param do_ [Symbol, :wait]
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
class Perform < ContextDev::Internal::Type::BaseModel
|
|
201
|
+
# @!attribute action
|
|
202
|
+
#
|
|
203
|
+
# @return [String]
|
|
204
|
+
required :action, String
|
|
205
|
+
|
|
206
|
+
# @!attribute do_
|
|
207
|
+
#
|
|
208
|
+
# @return [Symbol, :perform]
|
|
209
|
+
required :do_, const: :perform, api_name: :do
|
|
210
|
+
|
|
211
|
+
# @!method initialize(action:, do_: :perform)
|
|
212
|
+
# Resolve and perform one natural-language browser action.
|
|
213
|
+
#
|
|
214
|
+
# @param action [String]
|
|
215
|
+
# @param do_ [Symbol, :perform]
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
class Scroll < ContextDev::Internal::Type::BaseModel
|
|
219
|
+
# @!attribute do_
|
|
220
|
+
#
|
|
221
|
+
# @return [Symbol, :scroll]
|
|
222
|
+
required :do_, const: :scroll, api_name: :do
|
|
223
|
+
|
|
224
|
+
# @!attribute amount
|
|
225
|
+
# Pixels per scroll, one visible viewport, or the current scroll boundary.
|
|
226
|
+
# Defaults to viewport.
|
|
227
|
+
#
|
|
228
|
+
# @return [Integer, Symbol, ContextDev::Models::WebExtractParams::Action::Scroll::Amount, nil]
|
|
229
|
+
optional :amount, union: -> { ContextDev::WebExtractParams::Action::Scroll::Amount }
|
|
230
|
+
|
|
231
|
+
# @!attribute container
|
|
232
|
+
# CSS selector for the first matching scroll container. Defaults to the page.
|
|
233
|
+
#
|
|
234
|
+
# @return [String, nil]
|
|
235
|
+
optional :container, String
|
|
236
|
+
|
|
237
|
+
# @!attribute direction
|
|
238
|
+
# Direction to scroll. Defaults to down.
|
|
239
|
+
#
|
|
240
|
+
# @return [Symbol, ContextDev::Models::WebExtractParams::Action::Scroll::Direction, nil]
|
|
241
|
+
optional :direction, enum: -> { ContextDev::WebExtractParams::Action::Scroll::Direction }
|
|
242
|
+
|
|
243
|
+
# @!attribute max_scrolls
|
|
244
|
+
# Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
|
|
245
|
+
# changing. Defaults to 1.
|
|
246
|
+
#
|
|
247
|
+
# @return [Integer, nil]
|
|
248
|
+
optional :max_scrolls, Integer, api_name: :maxScrolls
|
|
249
|
+
|
|
250
|
+
# @!method initialize(amount: nil, container: nil, direction: nil, max_scrolls: nil, do_: :scroll)
|
|
251
|
+
# Some parameter documentations has been truncated, see
|
|
252
|
+
# {ContextDev::Models::WebExtractParams::Action::Scroll} for more details.
|
|
253
|
+
#
|
|
254
|
+
# Scroll the page or a selected scrollable container, waiting adaptively for
|
|
255
|
+
# content and dimensions to settle after each iteration.
|
|
256
|
+
#
|
|
257
|
+
# @param amount [Integer, Symbol, ContextDev::Models::WebExtractParams::Action::Scroll::Amount] Pixels per scroll, one visible viewport, or the current scroll boundary. Default
|
|
258
|
+
#
|
|
259
|
+
# @param container [String] CSS selector for the first matching scroll container. Defaults to the page.
|
|
260
|
+
#
|
|
261
|
+
# @param direction [Symbol, ContextDev::Models::WebExtractParams::Action::Scroll::Direction] Direction to scroll. Defaults to down.
|
|
262
|
+
#
|
|
263
|
+
# @param max_scrolls [Integer] Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
|
|
264
|
+
#
|
|
265
|
+
# @param do_ [Symbol, :scroll]
|
|
266
|
+
|
|
267
|
+
# Pixels per scroll, one visible viewport, or the current scroll boundary.
|
|
268
|
+
# Defaults to viewport.
|
|
269
|
+
#
|
|
270
|
+
# @see ContextDev::Models::WebExtractParams::Action::Scroll#amount
|
|
271
|
+
module Amount
|
|
272
|
+
extend ContextDev::Internal::Type::Union
|
|
273
|
+
|
|
274
|
+
variant Integer
|
|
275
|
+
|
|
276
|
+
variant const: -> { ContextDev::Models::WebExtractParams::Action::Scroll::Amount::VIEWPORT }
|
|
277
|
+
|
|
278
|
+
variant const: -> { ContextDev::Models::WebExtractParams::Action::Scroll::Amount::MAX }
|
|
279
|
+
|
|
280
|
+
# @!method self.variants
|
|
281
|
+
# @return [Array(Integer, Symbol)]
|
|
282
|
+
|
|
283
|
+
define_sorbet_constant!(:Variants) do
|
|
284
|
+
T.type_alias { T.any(Integer, ContextDev::WebExtractParams::Action::Scroll::Amount::TaggedSymbol) }
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# @!group
|
|
288
|
+
|
|
289
|
+
VIEWPORT = :viewport
|
|
290
|
+
MAX = :max
|
|
291
|
+
|
|
292
|
+
# @!endgroup
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
# Direction to scroll. Defaults to down.
|
|
296
|
+
#
|
|
297
|
+
# @see ContextDev::Models::WebExtractParams::Action::Scroll#direction
|
|
298
|
+
module Direction
|
|
299
|
+
extend ContextDev::Internal::Type::Enum
|
|
300
|
+
|
|
301
|
+
UP = :up
|
|
302
|
+
DOWN = :down
|
|
303
|
+
LEFT = :left
|
|
304
|
+
RIGHT = :right
|
|
305
|
+
|
|
306
|
+
# @!method self.values
|
|
307
|
+
# @return [Array<Symbol>]
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
# @!method self.variants
|
|
312
|
+
# @return [Array(ContextDev::Models::WebExtractParams::Action::Wait, ContextDev::Models::WebExtractParams::Action::Perform, ContextDev::Models::WebExtractParams::Action::Scroll)]
|
|
313
|
+
end
|
|
314
|
+
|
|
152
315
|
class Pdf < ContextDev::Internal::Type::BaseModel
|
|
153
316
|
# @!attribute end_
|
|
154
317
|
# Last 1-based PDF page to parse. Must be greater than or equal to start when both
|
|
@@ -90,7 +90,15 @@ module ContextDev
|
|
|
90
90
|
# @return [Integer]
|
|
91
91
|
required :num_urls, Integer, api_name: :numUrls
|
|
92
92
|
|
|
93
|
-
# @!
|
|
93
|
+
# @!attribute actions_applied
|
|
94
|
+
# One verified outcome per requested browser action, in request order.
|
|
95
|
+
#
|
|
96
|
+
# @return [Array<ContextDev::Models::WebExtractResponse::Metadata::ActionsApplied>, nil]
|
|
97
|
+
optional :actions_applied,
|
|
98
|
+
-> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::WebExtractResponse::Metadata::ActionsApplied] },
|
|
99
|
+
api_name: :actionsApplied
|
|
100
|
+
|
|
101
|
+
# @!method initialize(max_crawl_depth:, num_blocked:, num_failed:, num_skipped:, num_succeeded:, num_urls:, actions_applied: nil)
|
|
94
102
|
# Some parameter documentations has been truncated, see
|
|
95
103
|
# {ContextDev::Models::WebExtractResponse::Metadata} for more details.
|
|
96
104
|
#
|
|
@@ -105,6 +113,82 @@ module ContextDev
|
|
|
105
113
|
# @param num_succeeded [Integer]
|
|
106
114
|
#
|
|
107
115
|
# @param num_urls [Integer]
|
|
116
|
+
#
|
|
117
|
+
# @param actions_applied [Array<ContextDev::Models::WebExtractResponse::Metadata::ActionsApplied>] One verified outcome per requested browser action, in request order.
|
|
118
|
+
|
|
119
|
+
class ActionsApplied < ContextDev::Internal::Type::BaseModel
|
|
120
|
+
# @!attribute instruction
|
|
121
|
+
#
|
|
122
|
+
# @return [String]
|
|
123
|
+
required :instruction, String
|
|
124
|
+
|
|
125
|
+
# @!attribute status
|
|
126
|
+
# Applied means the requested page state was visibly verified. Failed means it was
|
|
127
|
+
# not verified. Skipped means it was not attempted.
|
|
128
|
+
#
|
|
129
|
+
# @return [Symbol, ContextDev::Models::WebExtractResponse::Metadata::ActionsApplied::Status]
|
|
130
|
+
required :status, enum: -> { ContextDev::Models::WebExtractResponse::Metadata::ActionsApplied::Status }
|
|
131
|
+
|
|
132
|
+
# @!attribute completion_evidence
|
|
133
|
+
# Visible page evidence used to verify an applied action.
|
|
134
|
+
#
|
|
135
|
+
# @return [String, nil]
|
|
136
|
+
optional :completion_evidence, String, api_name: :completionEvidence
|
|
137
|
+
|
|
138
|
+
# @!attribute duration_ms
|
|
139
|
+
#
|
|
140
|
+
# @return [Float, nil]
|
|
141
|
+
optional :duration_ms, Float, api_name: :durationMs
|
|
142
|
+
|
|
143
|
+
# @!attribute error
|
|
144
|
+
#
|
|
145
|
+
# @return [String, nil]
|
|
146
|
+
optional :error, String
|
|
147
|
+
|
|
148
|
+
# @!attribute method_
|
|
149
|
+
#
|
|
150
|
+
# @return [String, nil]
|
|
151
|
+
optional :method_, String, api_name: :method
|
|
152
|
+
|
|
153
|
+
# @!attribute target_description
|
|
154
|
+
#
|
|
155
|
+
# @return [String, nil]
|
|
156
|
+
optional :target_description, String, api_name: :targetDescription
|
|
157
|
+
|
|
158
|
+
# @!method initialize(instruction:, status:, completion_evidence: nil, duration_ms: nil, error: nil, method_: nil, target_description: nil)
|
|
159
|
+
# Some parameter documentations has been truncated, see
|
|
160
|
+
# {ContextDev::Models::WebExtractResponse::Metadata::ActionsApplied} for more
|
|
161
|
+
# details.
|
|
162
|
+
#
|
|
163
|
+
# @param instruction [String]
|
|
164
|
+
#
|
|
165
|
+
# @param status [Symbol, ContextDev::Models::WebExtractResponse::Metadata::ActionsApplied::Status] Applied means the requested page state was visibly verified. Failed means it was
|
|
166
|
+
#
|
|
167
|
+
# @param completion_evidence [String] Visible page evidence used to verify an applied action.
|
|
168
|
+
#
|
|
169
|
+
# @param duration_ms [Float]
|
|
170
|
+
#
|
|
171
|
+
# @param error [String]
|
|
172
|
+
#
|
|
173
|
+
# @param method_ [String]
|
|
174
|
+
#
|
|
175
|
+
# @param target_description [String]
|
|
176
|
+
|
|
177
|
+
# Applied means the requested page state was visibly verified. Failed means it was
|
|
178
|
+
# not verified. Skipped means it was not attempted.
|
|
179
|
+
#
|
|
180
|
+
# @see ContextDev::Models::WebExtractResponse::Metadata::ActionsApplied#status
|
|
181
|
+
module Status
|
|
182
|
+
extend ContextDev::Internal::Type::Enum
|
|
183
|
+
|
|
184
|
+
APPLIED = :applied
|
|
185
|
+
FAILED = :failed
|
|
186
|
+
SKIPPED = :skipped
|
|
187
|
+
|
|
188
|
+
# @!method self.values
|
|
189
|
+
# @return [Array<Symbol>]
|
|
190
|
+
end
|
|
191
|
+
end
|
|
108
192
|
end
|
|
109
193
|
|
|
110
194
|
# @see ContextDev::Models::WebExtractResponse#key_metadata
|
|
@@ -129,7 +129,9 @@ module ContextDev
|
|
|
129
129
|
optional :timeout_ms, Integer, api_name: :timeoutMS
|
|
130
130
|
|
|
131
131
|
# @!attribute url_regex
|
|
132
|
-
# Regex pattern. Only URLs matching this pattern will be followed and scraped.
|
|
132
|
+
# Regex pattern. Only URLs matching this pattern will be followed and scraped. An
|
|
133
|
+
# automatic prefix scope in the form ^<starting URL> follows a redirect of the
|
|
134
|
+
# starting page.
|
|
133
135
|
#
|
|
134
136
|
# @return [String, nil]
|
|
135
137
|
optional :url_regex, String, api_name: :urlRegex
|
|
@@ -142,8 +144,8 @@ module ContextDev
|
|
|
142
144
|
optional :use_main_content_only, ContextDev::Internal::Type::Boolean, api_name: :useMainContentOnly
|
|
143
145
|
|
|
144
146
|
# @!attribute wait_for_ms
|
|
145
|
-
#
|
|
146
|
-
#
|
|
147
|
+
# Browser wait time in milliseconds after initial page load for each crawled page.
|
|
148
|
+
# Defaults to 3500 (3.5 seconds). Min: 0. Max: 30000 (30 seconds).
|
|
147
149
|
#
|
|
148
150
|
# @return [Integer, nil]
|
|
149
151
|
optional :wait_for_ms, Integer, api_name: :waitForMs
|
|
@@ -195,11 +197,11 @@ module ContextDev
|
|
|
195
197
|
#
|
|
196
198
|
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
197
199
|
#
|
|
198
|
-
# @param url_regex [String] Regex pattern. Only URLs matching this pattern will be followed and scraped.
|
|
200
|
+
# @param url_regex [String] Regex pattern. Only URLs matching this pattern will be followed and scraped. An
|
|
199
201
|
#
|
|
200
202
|
# @param use_main_content_only [Boolean] Extract only the main content, stripping headers, footers, sidebars, and navigat
|
|
201
203
|
#
|
|
202
|
-
# @param wait_for_ms [Integer]
|
|
204
|
+
# @param wait_for_ms [Integer] Browser wait time in milliseconds after initial page load for each crawled page.
|
|
203
205
|
#
|
|
204
206
|
# @param zdr [Symbol, ContextDev::Models::WebWebCrawlMdParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
|
|
205
207
|
#
|