context.dev 2.4.0 → 2.5.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 +16 -0
- data/README.md +1 -1
- data/lib/context_dev/models/ai_extract_product_params.rb +9 -1
- data/lib/context_dev/models/ai_extract_products_params.rb +18 -2
- data/lib/context_dev/models/brand_retrieve_params.rb +109 -22
- data/lib/context_dev/models/brand_retrieve_response.rb +4 -6
- data/lib/context_dev/models/brand_retrieve_simplified_params.rb +32 -3
- data/lib/context_dev/models/industry_retrieve_naics_params.rb +11 -1
- data/lib/context_dev/models/industry_retrieve_sic_params.rb +11 -1
- data/lib/context_dev/models/monitor_create_params.rb +6 -5
- data/lib/context_dev/models/monitor_create_response.rb +6 -5
- data/lib/context_dev/models/monitor_get_credit_usage_params.rb +30 -0
- data/lib/context_dev/models/monitor_get_credit_usage_response.rb +59 -0
- data/lib/context_dev/models/monitor_get_limits_params.rb +14 -0
- data/lib/context_dev/models/monitor_get_limits_response.rb +52 -0
- data/lib/context_dev/models/monitor_list_account_changes_params.rb +16 -7
- data/lib/context_dev/models/monitor_list_account_changes_response.rb +2 -1
- data/lib/context_dev/models/monitor_list_account_runs_params.rb +7 -10
- data/lib/context_dev/models/monitor_list_changes_params.rb +8 -4
- data/lib/context_dev/models/monitor_list_changes_response.rb +2 -1
- data/lib/context_dev/models/monitor_list_params.rb +18 -19
- data/lib/context_dev/models/monitor_list_response.rb +6 -5
- data/lib/context_dev/models/monitor_list_runs_params.rb +7 -10
- data/lib/context_dev/models/monitor_retrieve_change_response.rb +2 -1
- data/lib/context_dev/models/monitor_retrieve_response.rb +6 -5
- data/lib/context_dev/models/monitor_update_params.rb +6 -5
- data/lib/context_dev/models/monitor_update_response.rb +6 -5
- data/lib/context_dev/models/parse_handle_params.rb +199 -33
- data/lib/context_dev/models/utility_prefetch_params.rb +9 -1
- data/lib/context_dev/models/web_extract_competitors_params.rb +11 -1
- data/lib/context_dev/models/web_extract_fonts_params.rb +14 -4
- data/lib/context_dev/models/web_extract_params.rb +19 -1
- data/lib/context_dev/models/web_extract_styleguide_params.rb +14 -4
- data/lib/context_dev/models/web_screenshot_params.rb +69 -18
- data/lib/context_dev/models/web_screenshot_response.rb +3 -2
- data/lib/context_dev/models/web_search_params.rb +9 -1
- data/lib/context_dev/models/web_web_crawl_md_params.rb +34 -1
- data/lib/context_dev/models/web_web_scrape_html_params.rb +268 -29
- data/lib/context_dev/models/web_web_scrape_images_params.rb +208 -19
- data/lib/context_dev/models/web_web_scrape_md_params.rb +352 -38
- data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +45 -1
- data/lib/context_dev/models.rb +4 -0
- data/lib/context_dev/resources/ai.rb +3 -1
- data/lib/context_dev/resources/brand.rb +6 -2
- data/lib/context_dev/resources/industry.rb +6 -2
- data/lib/context_dev/resources/monitors.rb +70 -32
- data/lib/context_dev/resources/parse.rb +15 -11
- data/lib/context_dev/resources/utility.rb +3 -1
- data/lib/context_dev/resources/web.rb +104 -55
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +4 -0
- data/rbi/context_dev/models/ai_extract_product_params.rbi +11 -0
- data/rbi/context_dev/models/ai_extract_products_params.rbi +22 -0
- data/rbi/context_dev/models/brand_retrieve_params.rbi +175 -64
- data/rbi/context_dev/models/brand_retrieve_response.rbi +8 -11
- data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +68 -5
- data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +15 -0
- data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +15 -0
- data/rbi/context_dev/models/monitor_create_params.rbi +6 -4
- data/rbi/context_dev/models/monitor_create_response.rbi +6 -4
- data/rbi/context_dev/models/monitor_get_credit_usage_params.rbi +60 -0
- data/rbi/context_dev/models/monitor_get_credit_usage_response.rbi +111 -0
- data/rbi/context_dev/models/monitor_get_limits_params.rbi +30 -0
- data/rbi/context_dev/models/monitor_get_limits_response.rbi +105 -0
- data/rbi/context_dev/models/monitor_list_account_changes_params.rbi +16 -0
- data/rbi/context_dev/models/monitor_list_account_changes_response.rbi +2 -0
- data/rbi/context_dev/models/monitor_list_account_runs_params.rbi +7 -6
- data/rbi/context_dev/models/monitor_list_changes_params.rbi +8 -0
- data/rbi/context_dev/models/monitor_list_changes_response.rbi +2 -0
- data/rbi/context_dev/models/monitor_list_params.rbi +23 -31
- data/rbi/context_dev/models/monitor_list_response.rbi +6 -4
- data/rbi/context_dev/models/monitor_list_runs_params.rbi +7 -6
- data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +2 -0
- data/rbi/context_dev/models/monitor_retrieve_response.rbi +6 -4
- data/rbi/context_dev/models/monitor_update_params.rbi +6 -4
- data/rbi/context_dev/models/monitor_update_response.rbi +6 -4
- data/rbi/context_dev/models/parse_handle_params.rbi +400 -46
- data/rbi/context_dev/models/utility_prefetch_params.rbi +11 -0
- data/rbi/context_dev/models/web_extract_competitors_params.rbi +15 -0
- data/rbi/context_dev/models/web_extract_fonts_params.rbi +19 -7
- data/rbi/context_dev/models/web_extract_params.rbi +26 -0
- data/rbi/context_dev/models/web_extract_styleguide_params.rbi +19 -7
- data/rbi/context_dev/models/web_screenshot_params.rbi +108 -37
- data/rbi/context_dev/models/web_screenshot_response.rbi +4 -2
- data/rbi/context_dev/models/web_search_params.rbi +11 -0
- data/rbi/context_dev/models/web_web_crawl_md_params.rbi +53 -0
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +554 -49
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +426 -30
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +742 -61
- data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +82 -0
- data/rbi/context_dev/models.rbi +4 -0
- data/rbi/context_dev/resources/ai.rbi +3 -0
- data/rbi/context_dev/resources/brand.rbi +9 -1
- data/rbi/context_dev/resources/industry.rbi +10 -0
- data/rbi/context_dev/resources/monitors.rbi +55 -11
- data/rbi/context_dev/resources/parse.rbi +46 -19
- data/rbi/context_dev/resources/utility.rbi +3 -0
- data/rbi/context_dev/resources/web.rbi +224 -48
- data/sig/context_dev/models/ai_extract_product_params.rbs +12 -1
- data/sig/context_dev/models/ai_extract_products_params.rbs +14 -0
- data/sig/context_dev/models/brand_retrieve_params.rbs +97 -51
- data/sig/context_dev/models/brand_retrieve_response.rbs +2 -2
- data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +34 -5
- data/sig/context_dev/models/industry_retrieve_naics_params.rbs +7 -0
- data/sig/context_dev/models/industry_retrieve_sic_params.rbs +7 -0
- data/sig/context_dev/models/monitor_get_credit_usage_params.rbs +32 -0
- data/sig/context_dev/models/monitor_get_credit_usage_response.rbs +52 -0
- data/sig/context_dev/models/monitor_get_limits_params.rbs +15 -0
- data/sig/context_dev/models/monitor_get_limits_response.rbs +43 -0
- data/sig/context_dev/models/monitor_list_params.rbs +8 -14
- data/sig/context_dev/models/parse_handle_params.rbs +124 -25
- data/sig/context_dev/models/utility_prefetch_params.rbs +7 -0
- data/sig/context_dev/models/web_extract_competitors_params.rbs +12 -1
- data/sig/context_dev/models/web_extract_fonts_params.rbs +10 -5
- data/sig/context_dev/models/web_extract_params.rbs +14 -0
- data/sig/context_dev/models/web_extract_styleguide_params.rbs +10 -5
- data/sig/context_dev/models/web_screenshot_params.rbs +41 -20
- data/sig/context_dev/models/web_search_params.rbs +7 -0
- data/sig/context_dev/models/web_web_crawl_md_params.rbs +28 -1
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +175 -47
- data/sig/context_dev/models/web_web_scrape_images_params.rbs +128 -38
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +229 -62
- data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +35 -1
- data/sig/context_dev/models.rbs +4 -0
- data/sig/context_dev/resources/ai.rbs +1 -0
- data/sig/context_dev/resources/brand.rbs +3 -1
- data/sig/context_dev/resources/industry.rbs +2 -0
- data/sig/context_dev/resources/monitors.rbs +12 -2
- data/sig/context_dev/resources/parse.rbs +8 -5
- data/sig/context_dev/resources/utility.rbs +1 -0
- data/sig/context_dev/resources/web.rbs +47 -26
- metadata +14 -2
|
@@ -16,8 +16,26 @@ module ContextDev
|
|
|
16
16
|
sig { returns(String) }
|
|
17
17
|
attr_accessor :url
|
|
18
18
|
|
|
19
|
-
#
|
|
20
|
-
#
|
|
19
|
+
# Optional browser actions executed in array order after the page loads and before
|
|
20
|
+
# content is captured. Requires a paid plan. Send a JSON array in the query
|
|
21
|
+
# parameter. Maximum: 5 actions.
|
|
22
|
+
sig do
|
|
23
|
+
returns(
|
|
24
|
+
T.nilable(
|
|
25
|
+
T::Array[
|
|
26
|
+
T.any(
|
|
27
|
+
ContextDev::WebWebScrapeMdParams::Action::Wait,
|
|
28
|
+
ContextDev::WebWebScrapeMdParams::Action::Perform
|
|
29
|
+
)
|
|
30
|
+
]
|
|
31
|
+
)
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
attr_accessor :actions
|
|
35
|
+
|
|
36
|
+
# Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
|
|
37
|
+
# residential proxy exit location. Must be one of Context.dev's supported
|
|
38
|
+
# countries. When provided, Context.dev fetches the target page from that country.
|
|
21
39
|
sig do
|
|
22
40
|
returns(T.nilable(ContextDev::WebWebScrapeMdParams::Country::OrSymbol))
|
|
23
41
|
end
|
|
@@ -34,10 +52,7 @@ module ContextDev
|
|
|
34
52
|
# includeSelectors. Exclusion takes precedence: an element matching both is
|
|
35
53
|
# removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
|
|
36
54
|
sig { returns(T.nilable(T::Array[String])) }
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
sig { params(exclude_selectors: T::Array[String]).void }
|
|
40
|
-
attr_writer :exclude_selectors
|
|
55
|
+
attr_accessor :exclude_selectors
|
|
41
56
|
|
|
42
57
|
# Optional outbound HTTP headers forwarded only to the target URL, sent as
|
|
43
58
|
# deep-object query params such as headers[X-Custom]=value. When provided, caching
|
|
@@ -49,43 +64,88 @@ module ContextDev
|
|
|
49
64
|
attr_writer :headers
|
|
50
65
|
|
|
51
66
|
# When true, the contents of iframes are rendered to Markdown.
|
|
52
|
-
sig
|
|
67
|
+
sig do
|
|
68
|
+
returns(
|
|
69
|
+
T.nilable(
|
|
70
|
+
T.any(
|
|
71
|
+
T::Boolean,
|
|
72
|
+
ContextDev::WebWebScrapeMdParams::IncludeFrames::OrSymbol
|
|
73
|
+
)
|
|
74
|
+
)
|
|
75
|
+
)
|
|
76
|
+
end
|
|
53
77
|
attr_reader :include_frames
|
|
54
78
|
|
|
55
|
-
sig
|
|
79
|
+
sig do
|
|
80
|
+
params(
|
|
81
|
+
include_frames:
|
|
82
|
+
T.any(
|
|
83
|
+
T::Boolean,
|
|
84
|
+
ContextDev::WebWebScrapeMdParams::IncludeFrames::OrSymbol
|
|
85
|
+
)
|
|
86
|
+
).void
|
|
87
|
+
end
|
|
56
88
|
attr_writer :include_frames
|
|
57
89
|
|
|
58
90
|
# Include image references in Markdown output
|
|
59
|
-
sig
|
|
91
|
+
sig do
|
|
92
|
+
returns(
|
|
93
|
+
T.nilable(
|
|
94
|
+
T.any(
|
|
95
|
+
T::Boolean,
|
|
96
|
+
ContextDev::WebWebScrapeMdParams::IncludeImages::OrSymbol
|
|
97
|
+
)
|
|
98
|
+
)
|
|
99
|
+
)
|
|
100
|
+
end
|
|
60
101
|
attr_reader :include_images
|
|
61
102
|
|
|
62
|
-
sig
|
|
103
|
+
sig do
|
|
104
|
+
params(
|
|
105
|
+
include_images:
|
|
106
|
+
T.any(
|
|
107
|
+
T::Boolean,
|
|
108
|
+
ContextDev::WebWebScrapeMdParams::IncludeImages::OrSymbol
|
|
109
|
+
)
|
|
110
|
+
).void
|
|
111
|
+
end
|
|
63
112
|
attr_writer :include_images
|
|
64
113
|
|
|
65
114
|
# Preserve hyperlinks in Markdown output
|
|
66
|
-
sig
|
|
115
|
+
sig do
|
|
116
|
+
returns(
|
|
117
|
+
T.nilable(
|
|
118
|
+
T.any(
|
|
119
|
+
T::Boolean,
|
|
120
|
+
ContextDev::WebWebScrapeMdParams::IncludeLinks::OrSymbol
|
|
121
|
+
)
|
|
122
|
+
)
|
|
123
|
+
)
|
|
124
|
+
end
|
|
67
125
|
attr_reader :include_links
|
|
68
126
|
|
|
69
|
-
sig
|
|
127
|
+
sig do
|
|
128
|
+
params(
|
|
129
|
+
include_links:
|
|
130
|
+
T.any(
|
|
131
|
+
T::Boolean,
|
|
132
|
+
ContextDev::WebWebScrapeMdParams::IncludeLinks::OrSymbol
|
|
133
|
+
)
|
|
134
|
+
).void
|
|
135
|
+
end
|
|
70
136
|
attr_writer :include_links
|
|
71
137
|
|
|
72
138
|
# CSS selectors. When provided, only matching HTML subtrees (and their
|
|
73
139
|
# descendants) are kept before conversion to Markdown. When omitted, the entire
|
|
74
140
|
# document is kept. Examples: "article.main", "#content", "[role=main]".
|
|
75
141
|
sig { returns(T.nilable(T::Array[String])) }
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
sig { params(include_selectors: T::Array[String]).void }
|
|
79
|
-
attr_writer :include_selectors
|
|
142
|
+
attr_accessor :include_selectors
|
|
80
143
|
|
|
81
144
|
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
82
145
|
# younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
|
|
83
146
|
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
84
147
|
sig { returns(T.nilable(Integer)) }
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
sig { params(max_age_ms: Integer).void }
|
|
88
|
-
attr_writer :max_age_ms
|
|
148
|
+
attr_accessor :max_age_ms
|
|
89
149
|
|
|
90
150
|
# PDF parsing controls. Use start/end to limit text extraction and embedded-image
|
|
91
151
|
# detection/OCR to an inclusive 1-based page range.
|
|
@@ -98,19 +158,62 @@ module ContextDev
|
|
|
98
158
|
# When true, waits briefly for CSS and transition animations to settle before
|
|
99
159
|
# converting to Markdown. Defaults to false. This adds a bit of latency in
|
|
100
160
|
# exchange for more stable output on animated pages.
|
|
101
|
-
sig
|
|
161
|
+
sig do
|
|
162
|
+
returns(
|
|
163
|
+
T.nilable(
|
|
164
|
+
T.any(
|
|
165
|
+
T::Boolean,
|
|
166
|
+
ContextDev::WebWebScrapeMdParams::SettleAnimations::OrSymbol
|
|
167
|
+
)
|
|
168
|
+
)
|
|
169
|
+
)
|
|
170
|
+
end
|
|
102
171
|
attr_reader :settle_animations
|
|
103
172
|
|
|
104
|
-
sig
|
|
173
|
+
sig do
|
|
174
|
+
params(
|
|
175
|
+
settle_animations:
|
|
176
|
+
T.any(
|
|
177
|
+
T::Boolean,
|
|
178
|
+
ContextDev::WebWebScrapeMdParams::SettleAnimations::OrSymbol
|
|
179
|
+
)
|
|
180
|
+
).void
|
|
181
|
+
end
|
|
105
182
|
attr_writer :settle_animations
|
|
106
183
|
|
|
107
184
|
# Shorten base64-encoded image data in the Markdown output
|
|
108
|
-
sig
|
|
185
|
+
sig do
|
|
186
|
+
returns(
|
|
187
|
+
T.nilable(
|
|
188
|
+
T.any(
|
|
189
|
+
T::Boolean,
|
|
190
|
+
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::OrSymbol
|
|
191
|
+
)
|
|
192
|
+
)
|
|
193
|
+
)
|
|
194
|
+
end
|
|
109
195
|
attr_reader :shorten_base64_images
|
|
110
196
|
|
|
111
|
-
sig
|
|
197
|
+
sig do
|
|
198
|
+
params(
|
|
199
|
+
shorten_base64_images:
|
|
200
|
+
T.any(
|
|
201
|
+
T::Boolean,
|
|
202
|
+
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::OrSymbol
|
|
203
|
+
)
|
|
204
|
+
).void
|
|
205
|
+
end
|
|
112
206
|
attr_writer :shorten_base64_images
|
|
113
207
|
|
|
208
|
+
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
209
|
+
# recorded on the request's usage log and can be used to filter usage on the
|
|
210
|
+
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
211
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
212
|
+
attr_reader :tags
|
|
213
|
+
|
|
214
|
+
sig { params(tags: T::Array[String]).void }
|
|
215
|
+
attr_writer :tags
|
|
216
|
+
|
|
114
217
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
115
218
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
116
219
|
# value is 300000ms (5 minutes).
|
|
@@ -122,37 +225,98 @@ module ContextDev
|
|
|
122
225
|
|
|
123
226
|
# Extract only the main content of the page, excluding headers, footers, sidebars,
|
|
124
227
|
# and navigation
|
|
125
|
-
sig
|
|
228
|
+
sig do
|
|
229
|
+
returns(
|
|
230
|
+
T.nilable(
|
|
231
|
+
T.any(
|
|
232
|
+
T::Boolean,
|
|
233
|
+
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol
|
|
234
|
+
)
|
|
235
|
+
)
|
|
236
|
+
)
|
|
237
|
+
end
|
|
126
238
|
attr_reader :use_main_content_only
|
|
127
239
|
|
|
128
|
-
sig
|
|
240
|
+
sig do
|
|
241
|
+
params(
|
|
242
|
+
use_main_content_only:
|
|
243
|
+
T.any(
|
|
244
|
+
T::Boolean,
|
|
245
|
+
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol
|
|
246
|
+
)
|
|
247
|
+
).void
|
|
248
|
+
end
|
|
129
249
|
attr_writer :use_main_content_only
|
|
130
250
|
|
|
131
251
|
# Optional browser wait time in milliseconds after initial page load before
|
|
132
252
|
# converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).
|
|
133
253
|
sig { returns(T.nilable(Integer)) }
|
|
134
|
-
|
|
254
|
+
attr_accessor :wait_for_ms
|
|
135
255
|
|
|
136
|
-
|
|
137
|
-
|
|
256
|
+
# Set to enabled to bypass shared caches and omit request and response content
|
|
257
|
+
# from retained usage logs. Requires zero data retention to be enabled for your
|
|
258
|
+
# organization (contact support@context.dev), otherwise the request fails with
|
|
259
|
+
# ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
|
|
260
|
+
sig do
|
|
261
|
+
returns(T.nilable(ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol))
|
|
262
|
+
end
|
|
263
|
+
attr_reader :zdr
|
|
264
|
+
|
|
265
|
+
sig { params(zdr: ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol).void }
|
|
266
|
+
attr_writer :zdr
|
|
138
267
|
|
|
139
268
|
sig do
|
|
140
269
|
params(
|
|
141
270
|
url: String,
|
|
271
|
+
actions:
|
|
272
|
+
T.nilable(
|
|
273
|
+
T::Array[
|
|
274
|
+
T.any(
|
|
275
|
+
ContextDev::WebWebScrapeMdParams::Action::Wait::OrHash,
|
|
276
|
+
ContextDev::WebWebScrapeMdParams::Action::Perform::OrHash
|
|
277
|
+
)
|
|
278
|
+
]
|
|
279
|
+
),
|
|
142
280
|
country: ContextDev::WebWebScrapeMdParams::Country::OrSymbol,
|
|
143
|
-
exclude_selectors: T::Array[String],
|
|
281
|
+
exclude_selectors: T.nilable(T::Array[String]),
|
|
144
282
|
headers: T::Hash[Symbol, String],
|
|
145
|
-
include_frames:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
283
|
+
include_frames:
|
|
284
|
+
T.any(
|
|
285
|
+
T::Boolean,
|
|
286
|
+
ContextDev::WebWebScrapeMdParams::IncludeFrames::OrSymbol
|
|
287
|
+
),
|
|
288
|
+
include_images:
|
|
289
|
+
T.any(
|
|
290
|
+
T::Boolean,
|
|
291
|
+
ContextDev::WebWebScrapeMdParams::IncludeImages::OrSymbol
|
|
292
|
+
),
|
|
293
|
+
include_links:
|
|
294
|
+
T.any(
|
|
295
|
+
T::Boolean,
|
|
296
|
+
ContextDev::WebWebScrapeMdParams::IncludeLinks::OrSymbol
|
|
297
|
+
),
|
|
298
|
+
include_selectors: T.nilable(T::Array[String]),
|
|
299
|
+
max_age_ms: T.nilable(Integer),
|
|
150
300
|
pdf: ContextDev::WebWebScrapeMdParams::Pdf::OrHash,
|
|
151
|
-
settle_animations:
|
|
152
|
-
|
|
301
|
+
settle_animations:
|
|
302
|
+
T.any(
|
|
303
|
+
T::Boolean,
|
|
304
|
+
ContextDev::WebWebScrapeMdParams::SettleAnimations::OrSymbol
|
|
305
|
+
),
|
|
306
|
+
shorten_base64_images:
|
|
307
|
+
T.any(
|
|
308
|
+
T::Boolean,
|
|
309
|
+
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::OrSymbol
|
|
310
|
+
),
|
|
311
|
+
tags: T::Array[String],
|
|
153
312
|
timeout_ms: Integer,
|
|
154
|
-
use_main_content_only:
|
|
155
|
-
|
|
313
|
+
use_main_content_only:
|
|
314
|
+
T.any(
|
|
315
|
+
T::Boolean,
|
|
316
|
+
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol
|
|
317
|
+
),
|
|
318
|
+
wait_for_ms: T.nilable(Integer),
|
|
319
|
+
zdr: ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol,
|
|
156
320
|
request_options: ContextDev::RequestOptions::OrHash
|
|
157
321
|
).returns(T.attached_class)
|
|
158
322
|
end
|
|
@@ -160,8 +324,13 @@ module ContextDev
|
|
|
160
324
|
# Full URL to scrape into LLM usable Markdown (must include http:// or https://
|
|
161
325
|
# protocol)
|
|
162
326
|
url:,
|
|
163
|
-
#
|
|
164
|
-
#
|
|
327
|
+
# Optional browser actions executed in array order after the page loads and before
|
|
328
|
+
# content is captured. Requires a paid plan. Send a JSON array in the query
|
|
329
|
+
# parameter. Maximum: 5 actions.
|
|
330
|
+
actions: nil,
|
|
331
|
+
# Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
|
|
332
|
+
# residential proxy exit location. Must be one of Context.dev's supported
|
|
333
|
+
# countries. When provided, Context.dev fetches the target page from that country.
|
|
165
334
|
country: nil,
|
|
166
335
|
# CSS selectors to remove before conversion to Markdown. Applied after
|
|
167
336
|
# includeSelectors. Exclusion takes precedence: an element matching both is
|
|
@@ -194,6 +363,10 @@ module ContextDev
|
|
|
194
363
|
settle_animations: nil,
|
|
195
364
|
# Shorten base64-encoded image data in the Markdown output
|
|
196
365
|
shorten_base64_images: nil,
|
|
366
|
+
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
367
|
+
# recorded on the request's usage log and can be used to filter usage on the
|
|
368
|
+
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
369
|
+
tags: nil,
|
|
197
370
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
198
371
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
199
372
|
# value is 300000ms (5 minutes).
|
|
@@ -204,6 +377,11 @@ module ContextDev
|
|
|
204
377
|
# Optional browser wait time in milliseconds after initial page load before
|
|
205
378
|
# converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).
|
|
206
379
|
wait_for_ms: nil,
|
|
380
|
+
# Set to enabled to bypass shared caches and omit request and response content
|
|
381
|
+
# from retained usage logs. Requires zero data retention to be enabled for your
|
|
382
|
+
# organization (contact support@context.dev), otherwise the request fails with
|
|
383
|
+
# ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
|
|
384
|
+
zdr: nil,
|
|
207
385
|
request_options: {}
|
|
208
386
|
)
|
|
209
387
|
end
|
|
@@ -212,20 +390,55 @@ module ContextDev
|
|
|
212
390
|
override.returns(
|
|
213
391
|
{
|
|
214
392
|
url: String,
|
|
393
|
+
actions:
|
|
394
|
+
T.nilable(
|
|
395
|
+
T::Array[
|
|
396
|
+
T.any(
|
|
397
|
+
ContextDev::WebWebScrapeMdParams::Action::Wait,
|
|
398
|
+
ContextDev::WebWebScrapeMdParams::Action::Perform
|
|
399
|
+
)
|
|
400
|
+
]
|
|
401
|
+
),
|
|
215
402
|
country: ContextDev::WebWebScrapeMdParams::Country::OrSymbol,
|
|
216
|
-
exclude_selectors: T::Array[String],
|
|
403
|
+
exclude_selectors: T.nilable(T::Array[String]),
|
|
217
404
|
headers: T::Hash[Symbol, String],
|
|
218
|
-
include_frames:
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
405
|
+
include_frames:
|
|
406
|
+
T.any(
|
|
407
|
+
T::Boolean,
|
|
408
|
+
ContextDev::WebWebScrapeMdParams::IncludeFrames::OrSymbol
|
|
409
|
+
),
|
|
410
|
+
include_images:
|
|
411
|
+
T.any(
|
|
412
|
+
T::Boolean,
|
|
413
|
+
ContextDev::WebWebScrapeMdParams::IncludeImages::OrSymbol
|
|
414
|
+
),
|
|
415
|
+
include_links:
|
|
416
|
+
T.any(
|
|
417
|
+
T::Boolean,
|
|
418
|
+
ContextDev::WebWebScrapeMdParams::IncludeLinks::OrSymbol
|
|
419
|
+
),
|
|
420
|
+
include_selectors: T.nilable(T::Array[String]),
|
|
421
|
+
max_age_ms: T.nilable(Integer),
|
|
223
422
|
pdf: ContextDev::WebWebScrapeMdParams::Pdf,
|
|
224
|
-
settle_animations:
|
|
225
|
-
|
|
423
|
+
settle_animations:
|
|
424
|
+
T.any(
|
|
425
|
+
T::Boolean,
|
|
426
|
+
ContextDev::WebWebScrapeMdParams::SettleAnimations::OrSymbol
|
|
427
|
+
),
|
|
428
|
+
shorten_base64_images:
|
|
429
|
+
T.any(
|
|
430
|
+
T::Boolean,
|
|
431
|
+
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::OrSymbol
|
|
432
|
+
),
|
|
433
|
+
tags: T::Array[String],
|
|
226
434
|
timeout_ms: Integer,
|
|
227
|
-
use_main_content_only:
|
|
228
|
-
|
|
435
|
+
use_main_content_only:
|
|
436
|
+
T.any(
|
|
437
|
+
T::Boolean,
|
|
438
|
+
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol
|
|
439
|
+
),
|
|
440
|
+
wait_for_ms: T.nilable(Integer),
|
|
441
|
+
zdr: ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol,
|
|
229
442
|
request_options: ContextDev::RequestOptions
|
|
230
443
|
}
|
|
231
444
|
)
|
|
@@ -233,8 +446,83 @@ module ContextDev
|
|
|
233
446
|
def to_hash
|
|
234
447
|
end
|
|
235
448
|
|
|
236
|
-
#
|
|
237
|
-
#
|
|
449
|
+
# Browser action discriminated by `do`. Each variant exposes only its applicable
|
|
450
|
+
# fields.
|
|
451
|
+
module Action
|
|
452
|
+
extend ContextDev::Internal::Type::Union
|
|
453
|
+
|
|
454
|
+
Variants =
|
|
455
|
+
T.type_alias do
|
|
456
|
+
T.any(
|
|
457
|
+
ContextDev::WebWebScrapeMdParams::Action::Wait,
|
|
458
|
+
ContextDev::WebWebScrapeMdParams::Action::Perform
|
|
459
|
+
)
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
class Wait < ContextDev::Internal::Type::BaseModel
|
|
463
|
+
OrHash =
|
|
464
|
+
T.type_alias do
|
|
465
|
+
T.any(
|
|
466
|
+
ContextDev::WebWebScrapeMdParams::Action::Wait,
|
|
467
|
+
ContextDev::Internal::AnyHash
|
|
468
|
+
)
|
|
469
|
+
end
|
|
470
|
+
|
|
471
|
+
sig { returns(Symbol) }
|
|
472
|
+
attr_accessor :do_
|
|
473
|
+
|
|
474
|
+
sig { returns(Integer) }
|
|
475
|
+
attr_accessor :time_ms
|
|
476
|
+
|
|
477
|
+
# Pause for a fixed number of milliseconds before continuing to the next action.
|
|
478
|
+
sig do
|
|
479
|
+
params(time_ms: Integer, do_: Symbol).returns(T.attached_class)
|
|
480
|
+
end
|
|
481
|
+
def self.new(time_ms:, do_: :wait)
|
|
482
|
+
end
|
|
483
|
+
|
|
484
|
+
sig { override.returns({ do_: Symbol, time_ms: Integer }) }
|
|
485
|
+
def to_hash
|
|
486
|
+
end
|
|
487
|
+
end
|
|
488
|
+
|
|
489
|
+
class Perform < ContextDev::Internal::Type::BaseModel
|
|
490
|
+
OrHash =
|
|
491
|
+
T.type_alias do
|
|
492
|
+
T.any(
|
|
493
|
+
ContextDev::WebWebScrapeMdParams::Action::Perform,
|
|
494
|
+
ContextDev::Internal::AnyHash
|
|
495
|
+
)
|
|
496
|
+
end
|
|
497
|
+
|
|
498
|
+
sig { returns(String) }
|
|
499
|
+
attr_accessor :action
|
|
500
|
+
|
|
501
|
+
sig { returns(Symbol) }
|
|
502
|
+
attr_accessor :do_
|
|
503
|
+
|
|
504
|
+
# Resolve and perform one natural-language browser action.
|
|
505
|
+
sig { params(action: String, do_: Symbol).returns(T.attached_class) }
|
|
506
|
+
def self.new(action:, do_: :perform)
|
|
507
|
+
end
|
|
508
|
+
|
|
509
|
+
sig { override.returns({ action: String, do_: Symbol }) }
|
|
510
|
+
def to_hash
|
|
511
|
+
end
|
|
512
|
+
end
|
|
513
|
+
|
|
514
|
+
sig do
|
|
515
|
+
override.returns(
|
|
516
|
+
T::Array[ContextDev::WebWebScrapeMdParams::Action::Variants]
|
|
517
|
+
)
|
|
518
|
+
end
|
|
519
|
+
def self.variants
|
|
520
|
+
end
|
|
521
|
+
end
|
|
522
|
+
|
|
523
|
+
# Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
|
|
524
|
+
# residential proxy exit location. Must be one of Context.dev's supported
|
|
525
|
+
# countries. When provided, Context.dev fetches the target page from that country.
|
|
238
526
|
module Country
|
|
239
527
|
extend ContextDev::Internal::Type::Enum
|
|
240
528
|
|
|
@@ -458,6 +746,120 @@ module ContextDev
|
|
|
458
746
|
end
|
|
459
747
|
end
|
|
460
748
|
|
|
749
|
+
# When true, the contents of iframes are rendered to Markdown.
|
|
750
|
+
module IncludeFrames
|
|
751
|
+
extend ContextDev::Internal::Type::Union
|
|
752
|
+
|
|
753
|
+
Variants =
|
|
754
|
+
T.type_alias do
|
|
755
|
+
T.any(
|
|
756
|
+
T::Boolean,
|
|
757
|
+
ContextDev::WebWebScrapeMdParams::IncludeFrames::TaggedSymbol
|
|
758
|
+
)
|
|
759
|
+
end
|
|
760
|
+
|
|
761
|
+
sig do
|
|
762
|
+
override.returns(
|
|
763
|
+
T::Array[ContextDev::WebWebScrapeMdParams::IncludeFrames::Variants]
|
|
764
|
+
)
|
|
765
|
+
end
|
|
766
|
+
def self.variants
|
|
767
|
+
end
|
|
768
|
+
|
|
769
|
+
TaggedSymbol =
|
|
770
|
+
T.type_alias do
|
|
771
|
+
T.all(Symbol, ContextDev::WebWebScrapeMdParams::IncludeFrames)
|
|
772
|
+
end
|
|
773
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
774
|
+
|
|
775
|
+
TRUE =
|
|
776
|
+
T.let(
|
|
777
|
+
:true,
|
|
778
|
+
ContextDev::WebWebScrapeMdParams::IncludeFrames::TaggedSymbol
|
|
779
|
+
)
|
|
780
|
+
FALSE =
|
|
781
|
+
T.let(
|
|
782
|
+
:false,
|
|
783
|
+
ContextDev::WebWebScrapeMdParams::IncludeFrames::TaggedSymbol
|
|
784
|
+
)
|
|
785
|
+
end
|
|
786
|
+
|
|
787
|
+
# Include image references in Markdown output
|
|
788
|
+
module IncludeImages
|
|
789
|
+
extend ContextDev::Internal::Type::Union
|
|
790
|
+
|
|
791
|
+
Variants =
|
|
792
|
+
T.type_alias do
|
|
793
|
+
T.any(
|
|
794
|
+
T::Boolean,
|
|
795
|
+
ContextDev::WebWebScrapeMdParams::IncludeImages::TaggedSymbol
|
|
796
|
+
)
|
|
797
|
+
end
|
|
798
|
+
|
|
799
|
+
sig do
|
|
800
|
+
override.returns(
|
|
801
|
+
T::Array[ContextDev::WebWebScrapeMdParams::IncludeImages::Variants]
|
|
802
|
+
)
|
|
803
|
+
end
|
|
804
|
+
def self.variants
|
|
805
|
+
end
|
|
806
|
+
|
|
807
|
+
TaggedSymbol =
|
|
808
|
+
T.type_alias do
|
|
809
|
+
T.all(Symbol, ContextDev::WebWebScrapeMdParams::IncludeImages)
|
|
810
|
+
end
|
|
811
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
812
|
+
|
|
813
|
+
TRUE =
|
|
814
|
+
T.let(
|
|
815
|
+
:true,
|
|
816
|
+
ContextDev::WebWebScrapeMdParams::IncludeImages::TaggedSymbol
|
|
817
|
+
)
|
|
818
|
+
FALSE =
|
|
819
|
+
T.let(
|
|
820
|
+
:false,
|
|
821
|
+
ContextDev::WebWebScrapeMdParams::IncludeImages::TaggedSymbol
|
|
822
|
+
)
|
|
823
|
+
end
|
|
824
|
+
|
|
825
|
+
# Preserve hyperlinks in Markdown output
|
|
826
|
+
module IncludeLinks
|
|
827
|
+
extend ContextDev::Internal::Type::Union
|
|
828
|
+
|
|
829
|
+
Variants =
|
|
830
|
+
T.type_alias do
|
|
831
|
+
T.any(
|
|
832
|
+
T::Boolean,
|
|
833
|
+
ContextDev::WebWebScrapeMdParams::IncludeLinks::TaggedSymbol
|
|
834
|
+
)
|
|
835
|
+
end
|
|
836
|
+
|
|
837
|
+
sig do
|
|
838
|
+
override.returns(
|
|
839
|
+
T::Array[ContextDev::WebWebScrapeMdParams::IncludeLinks::Variants]
|
|
840
|
+
)
|
|
841
|
+
end
|
|
842
|
+
def self.variants
|
|
843
|
+
end
|
|
844
|
+
|
|
845
|
+
TaggedSymbol =
|
|
846
|
+
T.type_alias do
|
|
847
|
+
T.all(Symbol, ContextDev::WebWebScrapeMdParams::IncludeLinks)
|
|
848
|
+
end
|
|
849
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
850
|
+
|
|
851
|
+
TRUE =
|
|
852
|
+
T.let(
|
|
853
|
+
:true,
|
|
854
|
+
ContextDev::WebWebScrapeMdParams::IncludeLinks::TaggedSymbol
|
|
855
|
+
)
|
|
856
|
+
FALSE =
|
|
857
|
+
T.let(
|
|
858
|
+
:false,
|
|
859
|
+
ContextDev::WebWebScrapeMdParams::IncludeLinks::TaggedSymbol
|
|
860
|
+
)
|
|
861
|
+
end
|
|
862
|
+
|
|
461
863
|
class Pdf < ContextDev::Internal::Type::BaseModel
|
|
462
864
|
OrHash =
|
|
463
865
|
T.type_alias do
|
|
@@ -478,18 +880,52 @@ module ContextDev
|
|
|
478
880
|
# When true, detect and OCR images embedded in the selected PDF pages, inserting
|
|
479
881
|
# recognized text at each image's position in page reading order while preserving
|
|
480
882
|
# the PDF text layer. This is separate from automatic scanned-PDF OCR fallback.
|
|
481
|
-
sig
|
|
883
|
+
sig do
|
|
884
|
+
returns(
|
|
885
|
+
T.nilable(
|
|
886
|
+
T.any(
|
|
887
|
+
T::Boolean,
|
|
888
|
+
ContextDev::WebWebScrapeMdParams::Pdf::Ocr::OrSymbol
|
|
889
|
+
)
|
|
890
|
+
)
|
|
891
|
+
)
|
|
892
|
+
end
|
|
482
893
|
attr_reader :ocr
|
|
483
894
|
|
|
484
|
-
sig
|
|
895
|
+
sig do
|
|
896
|
+
params(
|
|
897
|
+
ocr:
|
|
898
|
+
T.any(
|
|
899
|
+
T::Boolean,
|
|
900
|
+
ContextDev::WebWebScrapeMdParams::Pdf::Ocr::OrSymbol
|
|
901
|
+
)
|
|
902
|
+
).void
|
|
903
|
+
end
|
|
485
904
|
attr_writer :ocr
|
|
486
905
|
|
|
487
906
|
# When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
|
|
488
907
|
# a 400 WEBSITE_ACCESS_ERROR is returned.
|
|
489
|
-
sig
|
|
908
|
+
sig do
|
|
909
|
+
returns(
|
|
910
|
+
T.nilable(
|
|
911
|
+
T.any(
|
|
912
|
+
T::Boolean,
|
|
913
|
+
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::OrSymbol
|
|
914
|
+
)
|
|
915
|
+
)
|
|
916
|
+
)
|
|
917
|
+
end
|
|
490
918
|
attr_reader :should_parse
|
|
491
919
|
|
|
492
|
-
sig
|
|
920
|
+
sig do
|
|
921
|
+
params(
|
|
922
|
+
should_parse:
|
|
923
|
+
T.any(
|
|
924
|
+
T::Boolean,
|
|
925
|
+
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::OrSymbol
|
|
926
|
+
)
|
|
927
|
+
).void
|
|
928
|
+
end
|
|
493
929
|
attr_writer :should_parse
|
|
494
930
|
|
|
495
931
|
# First 1-based PDF page to parse. When omitted, parsing starts at the first page.
|
|
@@ -504,8 +940,16 @@ module ContextDev
|
|
|
504
940
|
sig do
|
|
505
941
|
params(
|
|
506
942
|
end_: Integer,
|
|
507
|
-
ocr:
|
|
508
|
-
|
|
943
|
+
ocr:
|
|
944
|
+
T.any(
|
|
945
|
+
T::Boolean,
|
|
946
|
+
ContextDev::WebWebScrapeMdParams::Pdf::Ocr::OrSymbol
|
|
947
|
+
),
|
|
948
|
+
should_parse:
|
|
949
|
+
T.any(
|
|
950
|
+
T::Boolean,
|
|
951
|
+
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::OrSymbol
|
|
952
|
+
),
|
|
509
953
|
start: Integer
|
|
510
954
|
).returns(T.attached_class)
|
|
511
955
|
end
|
|
@@ -529,14 +973,251 @@ module ContextDev
|
|
|
529
973
|
override.returns(
|
|
530
974
|
{
|
|
531
975
|
end_: Integer,
|
|
532
|
-
ocr:
|
|
533
|
-
|
|
976
|
+
ocr:
|
|
977
|
+
T.any(
|
|
978
|
+
T::Boolean,
|
|
979
|
+
ContextDev::WebWebScrapeMdParams::Pdf::Ocr::OrSymbol
|
|
980
|
+
),
|
|
981
|
+
should_parse:
|
|
982
|
+
T.any(
|
|
983
|
+
T::Boolean,
|
|
984
|
+
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::OrSymbol
|
|
985
|
+
),
|
|
534
986
|
start: Integer
|
|
535
987
|
}
|
|
536
988
|
)
|
|
537
989
|
end
|
|
538
990
|
def to_hash
|
|
539
991
|
end
|
|
992
|
+
|
|
993
|
+
# When true, detect and OCR images embedded in the selected PDF pages, inserting
|
|
994
|
+
# recognized text at each image's position in page reading order while preserving
|
|
995
|
+
# the PDF text layer. This is separate from automatic scanned-PDF OCR fallback.
|
|
996
|
+
module Ocr
|
|
997
|
+
extend ContextDev::Internal::Type::Union
|
|
998
|
+
|
|
999
|
+
Variants =
|
|
1000
|
+
T.type_alias do
|
|
1001
|
+
T.any(
|
|
1002
|
+
T::Boolean,
|
|
1003
|
+
ContextDev::WebWebScrapeMdParams::Pdf::Ocr::TaggedSymbol
|
|
1004
|
+
)
|
|
1005
|
+
end
|
|
1006
|
+
|
|
1007
|
+
sig do
|
|
1008
|
+
override.returns(
|
|
1009
|
+
T::Array[ContextDev::WebWebScrapeMdParams::Pdf::Ocr::Variants]
|
|
1010
|
+
)
|
|
1011
|
+
end
|
|
1012
|
+
def self.variants
|
|
1013
|
+
end
|
|
1014
|
+
|
|
1015
|
+
TaggedSymbol =
|
|
1016
|
+
T.type_alias do
|
|
1017
|
+
T.all(Symbol, ContextDev::WebWebScrapeMdParams::Pdf::Ocr)
|
|
1018
|
+
end
|
|
1019
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1020
|
+
|
|
1021
|
+
TRUE =
|
|
1022
|
+
T.let(
|
|
1023
|
+
:true,
|
|
1024
|
+
ContextDev::WebWebScrapeMdParams::Pdf::Ocr::TaggedSymbol
|
|
1025
|
+
)
|
|
1026
|
+
FALSE =
|
|
1027
|
+
T.let(
|
|
1028
|
+
:false,
|
|
1029
|
+
ContextDev::WebWebScrapeMdParams::Pdf::Ocr::TaggedSymbol
|
|
1030
|
+
)
|
|
1031
|
+
end
|
|
1032
|
+
|
|
1033
|
+
# When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
|
|
1034
|
+
# a 400 WEBSITE_ACCESS_ERROR is returned.
|
|
1035
|
+
module ShouldParse
|
|
1036
|
+
extend ContextDev::Internal::Type::Union
|
|
1037
|
+
|
|
1038
|
+
Variants =
|
|
1039
|
+
T.type_alias do
|
|
1040
|
+
T.any(
|
|
1041
|
+
T::Boolean,
|
|
1042
|
+
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::TaggedSymbol
|
|
1043
|
+
)
|
|
1044
|
+
end
|
|
1045
|
+
|
|
1046
|
+
sig do
|
|
1047
|
+
override.returns(
|
|
1048
|
+
T::Array[
|
|
1049
|
+
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::Variants
|
|
1050
|
+
]
|
|
1051
|
+
)
|
|
1052
|
+
end
|
|
1053
|
+
def self.variants
|
|
1054
|
+
end
|
|
1055
|
+
|
|
1056
|
+
TaggedSymbol =
|
|
1057
|
+
T.type_alias do
|
|
1058
|
+
T.all(Symbol, ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse)
|
|
1059
|
+
end
|
|
1060
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1061
|
+
|
|
1062
|
+
TRUE =
|
|
1063
|
+
T.let(
|
|
1064
|
+
:true,
|
|
1065
|
+
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::TaggedSymbol
|
|
1066
|
+
)
|
|
1067
|
+
FALSE =
|
|
1068
|
+
T.let(
|
|
1069
|
+
:false,
|
|
1070
|
+
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::TaggedSymbol
|
|
1071
|
+
)
|
|
1072
|
+
end
|
|
1073
|
+
end
|
|
1074
|
+
|
|
1075
|
+
# When true, waits briefly for CSS and transition animations to settle before
|
|
1076
|
+
# converting to Markdown. Defaults to false. This adds a bit of latency in
|
|
1077
|
+
# exchange for more stable output on animated pages.
|
|
1078
|
+
module SettleAnimations
|
|
1079
|
+
extend ContextDev::Internal::Type::Union
|
|
1080
|
+
|
|
1081
|
+
Variants =
|
|
1082
|
+
T.type_alias do
|
|
1083
|
+
T.any(
|
|
1084
|
+
T::Boolean,
|
|
1085
|
+
ContextDev::WebWebScrapeMdParams::SettleAnimations::TaggedSymbol
|
|
1086
|
+
)
|
|
1087
|
+
end
|
|
1088
|
+
|
|
1089
|
+
sig do
|
|
1090
|
+
override.returns(
|
|
1091
|
+
T::Array[
|
|
1092
|
+
ContextDev::WebWebScrapeMdParams::SettleAnimations::Variants
|
|
1093
|
+
]
|
|
1094
|
+
)
|
|
1095
|
+
end
|
|
1096
|
+
def self.variants
|
|
1097
|
+
end
|
|
1098
|
+
|
|
1099
|
+
TaggedSymbol =
|
|
1100
|
+
T.type_alias do
|
|
1101
|
+
T.all(Symbol, ContextDev::WebWebScrapeMdParams::SettleAnimations)
|
|
1102
|
+
end
|
|
1103
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1104
|
+
|
|
1105
|
+
TRUE =
|
|
1106
|
+
T.let(
|
|
1107
|
+
:true,
|
|
1108
|
+
ContextDev::WebWebScrapeMdParams::SettleAnimations::TaggedSymbol
|
|
1109
|
+
)
|
|
1110
|
+
FALSE =
|
|
1111
|
+
T.let(
|
|
1112
|
+
:false,
|
|
1113
|
+
ContextDev::WebWebScrapeMdParams::SettleAnimations::TaggedSymbol
|
|
1114
|
+
)
|
|
1115
|
+
end
|
|
1116
|
+
|
|
1117
|
+
# Shorten base64-encoded image data in the Markdown output
|
|
1118
|
+
module ShortenBase64Images
|
|
1119
|
+
extend ContextDev::Internal::Type::Union
|
|
1120
|
+
|
|
1121
|
+
Variants =
|
|
1122
|
+
T.type_alias do
|
|
1123
|
+
T.any(
|
|
1124
|
+
T::Boolean,
|
|
1125
|
+
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::TaggedSymbol
|
|
1126
|
+
)
|
|
1127
|
+
end
|
|
1128
|
+
|
|
1129
|
+
sig do
|
|
1130
|
+
override.returns(
|
|
1131
|
+
T::Array[
|
|
1132
|
+
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::Variants
|
|
1133
|
+
]
|
|
1134
|
+
)
|
|
1135
|
+
end
|
|
1136
|
+
def self.variants
|
|
1137
|
+
end
|
|
1138
|
+
|
|
1139
|
+
TaggedSymbol =
|
|
1140
|
+
T.type_alias do
|
|
1141
|
+
T.all(Symbol, ContextDev::WebWebScrapeMdParams::ShortenBase64Images)
|
|
1142
|
+
end
|
|
1143
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1144
|
+
|
|
1145
|
+
TRUE =
|
|
1146
|
+
T.let(
|
|
1147
|
+
:true,
|
|
1148
|
+
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::TaggedSymbol
|
|
1149
|
+
)
|
|
1150
|
+
FALSE =
|
|
1151
|
+
T.let(
|
|
1152
|
+
:false,
|
|
1153
|
+
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::TaggedSymbol
|
|
1154
|
+
)
|
|
1155
|
+
end
|
|
1156
|
+
|
|
1157
|
+
# Extract only the main content of the page, excluding headers, footers, sidebars,
|
|
1158
|
+
# and navigation
|
|
1159
|
+
module UseMainContentOnly
|
|
1160
|
+
extend ContextDev::Internal::Type::Union
|
|
1161
|
+
|
|
1162
|
+
Variants =
|
|
1163
|
+
T.type_alias do
|
|
1164
|
+
T.any(
|
|
1165
|
+
T::Boolean,
|
|
1166
|
+
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::TaggedSymbol
|
|
1167
|
+
)
|
|
1168
|
+
end
|
|
1169
|
+
|
|
1170
|
+
sig do
|
|
1171
|
+
override.returns(
|
|
1172
|
+
T::Array[
|
|
1173
|
+
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::Variants
|
|
1174
|
+
]
|
|
1175
|
+
)
|
|
1176
|
+
end
|
|
1177
|
+
def self.variants
|
|
1178
|
+
end
|
|
1179
|
+
|
|
1180
|
+
TaggedSymbol =
|
|
1181
|
+
T.type_alias do
|
|
1182
|
+
T.all(Symbol, ContextDev::WebWebScrapeMdParams::UseMainContentOnly)
|
|
1183
|
+
end
|
|
1184
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1185
|
+
|
|
1186
|
+
TRUE =
|
|
1187
|
+
T.let(
|
|
1188
|
+
:true,
|
|
1189
|
+
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::TaggedSymbol
|
|
1190
|
+
)
|
|
1191
|
+
FALSE =
|
|
1192
|
+
T.let(
|
|
1193
|
+
:false,
|
|
1194
|
+
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::TaggedSymbol
|
|
1195
|
+
)
|
|
1196
|
+
end
|
|
1197
|
+
|
|
1198
|
+
# Set to enabled to bypass shared caches and omit request and response content
|
|
1199
|
+
# from retained usage logs. Requires zero data retention to be enabled for your
|
|
1200
|
+
# organization (contact support@context.dev), otherwise the request fails with
|
|
1201
|
+
# ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
|
|
1202
|
+
module Zdr
|
|
1203
|
+
extend ContextDev::Internal::Type::Enum
|
|
1204
|
+
|
|
1205
|
+
TaggedSymbol =
|
|
1206
|
+
T.type_alias { T.all(Symbol, ContextDev::WebWebScrapeMdParams::Zdr) }
|
|
1207
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1208
|
+
|
|
1209
|
+
ENABLED =
|
|
1210
|
+
T.let(:enabled, ContextDev::WebWebScrapeMdParams::Zdr::TaggedSymbol)
|
|
1211
|
+
DISABLED =
|
|
1212
|
+
T.let(:disabled, ContextDev::WebWebScrapeMdParams::Zdr::TaggedSymbol)
|
|
1213
|
+
|
|
1214
|
+
sig do
|
|
1215
|
+
override.returns(
|
|
1216
|
+
T::Array[ContextDev::WebWebScrapeMdParams::Zdr::TaggedSymbol]
|
|
1217
|
+
)
|
|
1218
|
+
end
|
|
1219
|
+
def self.values
|
|
1220
|
+
end
|
|
540
1221
|
end
|
|
541
1222
|
end
|
|
542
1223
|
end
|