context.dev 2.4.0 → 2.6.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 +29 -0
- data/README.md +1 -1
- data/lib/context_dev/client.rb +4 -0
- 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/batch_cancel_params.rb +22 -0
- data/lib/context_dev/models/batch_cancel_response.rb +354 -0
- data/lib/context_dev/models/batch_get_results_params.rb +42 -0
- data/lib/context_dev/models/batch_get_results_response.rb +463 -0
- data/lib/context_dev/models/batch_list_params.rb +94 -0
- data/lib/context_dev/models/batch_list_response.rb +388 -0
- data/lib/context_dev/models/batch_retrieve_params.rb +22 -0
- data/lib/context_dev/models/batch_retrieve_response.rb +390 -0
- data/lib/context_dev/models/batch_submit_params.rb +56 -0
- data/lib/context_dev/models/batch_submit_response.rb +614 -0
- 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/error.rb +26 -0
- data/lib/context_dev/models/error_count.rb +26 -0
- 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 +147 -132
- data/lib/context_dev/models/monitor_create_response.rb +40 -15
- 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 +27 -12
- 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 +27 -12
- data/lib/context_dev/models/monitor_update_params.rb +27 -12
- data/lib/context_dev/models/monitor_update_response.rb +27 -12
- 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_html_response.rb +93 -1
- 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_md_response.rb +93 -1
- data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +45 -1
- data/lib/context_dev/models.rb +18 -0
- data/lib/context_dev/resources/ai.rb +3 -1
- data/lib/context_dev/resources/batch.rb +155 -0
- 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 +75 -37
- 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 +17 -0
- data/rbi/context_dev/client.rbi +3 -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/batch_cancel_params.rbi +40 -0
- data/rbi/context_dev/models/batch_cancel_response.rbi +642 -0
- data/rbi/context_dev/models/batch_get_results_params.rbi +70 -0
- data/rbi/context_dev/models/batch_get_results_response.rbi +848 -0
- data/rbi/context_dev/models/batch_list_params.rbi +166 -0
- data/rbi/context_dev/models/batch_list_response.rbi +738 -0
- data/rbi/context_dev/models/batch_retrieve_params.rbi +40 -0
- data/rbi/context_dev/models/batch_retrieve_response.rbi +707 -0
- data/rbi/context_dev/models/batch_submit_params.rbi +105 -0
- data/rbi/context_dev/models/batch_submit_response.rbi +1330 -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/error.rbi +32 -0
- data/rbi/context_dev/models/error_count.rbi +34 -0
- 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 +280 -246
- data/rbi/context_dev/models/monitor_create_response.rbi +44 -11
- 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 +30 -9
- 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 +30 -9
- data/rbi/context_dev/models/monitor_update_params.rbi +30 -9
- data/rbi/context_dev/models/monitor_update_response.rbi +30 -9
- 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_html_response.rbi +182 -0
- 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_md_response.rbi +180 -0
- data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +82 -0
- data/rbi/context_dev/models.rbi +18 -0
- data/rbi/context_dev/resources/ai.rbi +3 -0
- data/rbi/context_dev/resources/batch.rbi +120 -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 +67 -23
- 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/client.rbs +2 -0
- 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/batch_cancel_params.rbs +23 -0
- data/sig/context_dev/models/batch_cancel_response.rbs +266 -0
- data/sig/context_dev/models/batch_get_results_params.rbs +36 -0
- data/sig/context_dev/models/batch_get_results_response.rbs +399 -0
- data/sig/context_dev/models/batch_list_params.rbs +94 -0
- data/sig/context_dev/models/batch_list_response.rbs +304 -0
- data/sig/context_dev/models/batch_retrieve_params.rbs +23 -0
- data/sig/context_dev/models/batch_retrieve_response.rbs +290 -0
- data/sig/context_dev/models/batch_submit_params.rbs +52 -0
- data/sig/context_dev/models/batch_submit_response.rbs +542 -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/error.rbs +15 -0
- data/sig/context_dev/models/error_count.rbs +15 -0
- 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_create_params.rbs +117 -97
- data/sig/context_dev/models/monitor_create_response.rbs +18 -1
- 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/monitor_list_response.rbs +13 -1
- data/sig/context_dev/models/monitor_retrieve_response.rbs +13 -1
- data/sig/context_dev/models/monitor_update_params.rbs +13 -1
- data/sig/context_dev/models/monitor_update_response.rbs +13 -1
- 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_html_response.rbs +85 -0
- 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_md_response.rbs +85 -0
- data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +35 -1
- data/sig/context_dev/models.rbs +18 -0
- data/sig/context_dev/resources/ai.rbs +1 -0
- data/sig/context_dev/resources/batch.rbs +41 -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 +14 -4
- 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 +53 -2
|
@@ -13,9 +13,20 @@ module ContextDev
|
|
|
13
13
|
# @return [String]
|
|
14
14
|
required :url, String
|
|
15
15
|
|
|
16
|
+
# @!attribute actions
|
|
17
|
+
# Optional browser actions executed in array order after the page loads and before
|
|
18
|
+
# content is captured. Requires a paid plan. Send a JSON array in the query
|
|
19
|
+
# parameter. Maximum: 5 actions.
|
|
20
|
+
#
|
|
21
|
+
# @return [Array<ContextDev::Models::WebWebScrapeHTMLParams::Action::Wait, ContextDev::Models::WebWebScrapeHTMLParams::Action::Perform>, nil]
|
|
22
|
+
optional :actions,
|
|
23
|
+
-> { ContextDev::Internal::Type::ArrayOf[union: ContextDev::WebWebScrapeHTMLParams::Action] },
|
|
24
|
+
nil?: true
|
|
25
|
+
|
|
16
26
|
# @!attribute country
|
|
17
|
-
# Two-letter ISO 3166-1 alpha-2 country code
|
|
18
|
-
#
|
|
27
|
+
# Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
|
|
28
|
+
# residential proxy exit location. Must be one of Context.dev's supported
|
|
29
|
+
# countries. When provided, Context.dev fetches the target page from that country.
|
|
19
30
|
#
|
|
20
31
|
# @return [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country, nil]
|
|
21
32
|
optional :country, enum: -> { ContextDev::WebWebScrapeHTMLParams::Country }
|
|
@@ -26,7 +37,7 @@ module ContextDev
|
|
|
26
37
|
# "nav", "footer", ".ad-banner", "[aria-hidden=true]".
|
|
27
38
|
#
|
|
28
39
|
# @return [Array<String>, nil]
|
|
29
|
-
optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String]
|
|
40
|
+
optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String], nil?: true
|
|
30
41
|
|
|
31
42
|
# @!attribute headers
|
|
32
43
|
# Optional outbound HTTP headers forwarded only to the target URL, sent as
|
|
@@ -39,8 +50,8 @@ module ContextDev
|
|
|
39
50
|
# @!attribute include_frames
|
|
40
51
|
# When true, iframes are rendered inline into the returned HTML.
|
|
41
52
|
#
|
|
42
|
-
# @return [Boolean, nil]
|
|
43
|
-
optional :include_frames, ContextDev::
|
|
53
|
+
# @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::IncludeFrames, nil]
|
|
54
|
+
optional :include_frames, union: -> { ContextDev::WebWebScrapeHTMLParams::IncludeFrames }
|
|
44
55
|
|
|
45
56
|
# @!attribute include_selectors
|
|
46
57
|
# CSS selectors. When provided, only matching subtrees (and their descendants) are
|
|
@@ -48,7 +59,7 @@ module ContextDev
|
|
|
48
59
|
# Examples: "article.main", "#content", "[role=main]".
|
|
49
60
|
#
|
|
50
61
|
# @return [Array<String>, nil]
|
|
51
|
-
optional :include_selectors, ContextDev::Internal::Type::ArrayOf[String]
|
|
62
|
+
optional :include_selectors, ContextDev::Internal::Type::ArrayOf[String], nil?: true
|
|
52
63
|
|
|
53
64
|
# @!attribute max_age_ms
|
|
54
65
|
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
@@ -56,7 +67,7 @@ module ContextDev
|
|
|
56
67
|
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
57
68
|
#
|
|
58
69
|
# @return [Integer, nil]
|
|
59
|
-
optional :max_age_ms, Integer
|
|
70
|
+
optional :max_age_ms, Integer, nil?: true
|
|
60
71
|
|
|
61
72
|
# @!attribute pdf
|
|
62
73
|
# PDF parsing controls. Use start/end to limit text extraction and embedded-image
|
|
@@ -70,8 +81,16 @@ module ContextDev
|
|
|
70
81
|
# extracting HTML. Defaults to false. This adds a bit of latency in exchange for
|
|
71
82
|
# more stable output on animated pages.
|
|
72
83
|
#
|
|
73
|
-
# @return [Boolean, nil]
|
|
74
|
-
optional :settle_animations, ContextDev::
|
|
84
|
+
# @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::SettleAnimations, nil]
|
|
85
|
+
optional :settle_animations, union: -> { ContextDev::WebWebScrapeHTMLParams::SettleAnimations }
|
|
86
|
+
|
|
87
|
+
# @!attribute tags
|
|
88
|
+
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
89
|
+
# recorded on the request's usage log and can be used to filter usage on the
|
|
90
|
+
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
91
|
+
#
|
|
92
|
+
# @return [Array<String>, nil]
|
|
93
|
+
optional :tags, ContextDev::Internal::Type::ArrayOf[String]
|
|
75
94
|
|
|
76
95
|
# @!attribute timeout_ms
|
|
77
96
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
@@ -85,48 +104,117 @@ module ContextDev
|
|
|
85
104
|
# When true, return only the page's main content in the HTML response, excluding
|
|
86
105
|
# headers, footers, sidebars, and navigation when detectable.
|
|
87
106
|
#
|
|
88
|
-
# @return [Boolean, nil]
|
|
89
|
-
optional :use_main_content_only, ContextDev::
|
|
107
|
+
# @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::UseMainContentOnly, nil]
|
|
108
|
+
optional :use_main_content_only, union: -> { ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly }
|
|
90
109
|
|
|
91
110
|
# @!attribute wait_for_ms
|
|
92
111
|
# Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
|
|
93
112
|
# 30000 (30 seconds).
|
|
94
113
|
#
|
|
95
114
|
# @return [Integer, nil]
|
|
96
|
-
optional :wait_for_ms, Integer
|
|
115
|
+
optional :wait_for_ms, Integer, nil?: true
|
|
97
116
|
|
|
98
|
-
# @!
|
|
117
|
+
# @!attribute zdr
|
|
118
|
+
# Set to enabled to bypass shared caches and omit request and response content
|
|
119
|
+
# from retained usage logs. Requires zero data retention to be enabled for your
|
|
120
|
+
# organization (contact support@context.dev), otherwise the request fails with
|
|
121
|
+
# ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
|
|
122
|
+
#
|
|
123
|
+
# @return [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Zdr, nil]
|
|
124
|
+
optional :zdr, enum: -> { ContextDev::WebWebScrapeHTMLParams::Zdr }
|
|
125
|
+
|
|
126
|
+
# @!method initialize(url:, actions: nil, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, tags: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {})
|
|
99
127
|
# Some parameter documentations has been truncated, see
|
|
100
128
|
# {ContextDev::Models::WebWebScrapeHTMLParams} for more details.
|
|
101
129
|
#
|
|
102
130
|
# @param url [String] Full URL to scrape (must include http:// or https:// protocol)
|
|
103
131
|
#
|
|
104
|
-
# @param
|
|
132
|
+
# @param actions [Array<ContextDev::Models::WebWebScrapeHTMLParams::Action::Wait, ContextDev::Models::WebWebScrapeHTMLParams::Action::Perform>, nil] Optional browser actions executed in array order after the page loads and before
|
|
133
|
+
#
|
|
134
|
+
# @param country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r
|
|
105
135
|
#
|
|
106
|
-
# @param exclude_selectors [Array<String
|
|
136
|
+
# @param exclude_selectors [Array<String>, nil] CSS selectors to remove from the result. Applied after includeSelectors. Exclusi
|
|
107
137
|
#
|
|
108
138
|
# @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
|
|
109
139
|
#
|
|
110
|
-
# @param include_frames [Boolean] When true, iframes are rendered inline into the returned HTML.
|
|
140
|
+
# @param include_frames [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::IncludeFrames] When true, iframes are rendered inline into the returned HTML.
|
|
111
141
|
#
|
|
112
|
-
# @param include_selectors [Array<String
|
|
142
|
+
# @param include_selectors [Array<String>, nil] CSS selectors. When provided, only matching subtrees (and their descendants) are
|
|
113
143
|
#
|
|
114
|
-
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
|
|
144
|
+
# @param max_age_ms [Integer, nil] Return a cached result if a prior scrape for the same parameters exists and is y
|
|
115
145
|
#
|
|
116
146
|
# @param pdf [ContextDev::Models::WebWebScrapeHTMLParams::Pdf] PDF parsing controls. Use start/end to limit text extraction and embedded-image
|
|
117
147
|
#
|
|
118
|
-
# @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before extr
|
|
148
|
+
# @param settle_animations [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::SettleAnimations] When true, waits briefly for CSS and transition animations to settle before extr
|
|
149
|
+
#
|
|
150
|
+
# @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
119
151
|
#
|
|
120
152
|
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
121
153
|
#
|
|
122
|
-
# @param use_main_content_only [Boolean] When true, return only the page's main content in the HTML response, excluding h
|
|
154
|
+
# @param use_main_content_only [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::UseMainContentOnly] When true, return only the page's main content in the HTML response, excluding h
|
|
155
|
+
#
|
|
156
|
+
# @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
|
|
123
157
|
#
|
|
124
|
-
# @param
|
|
158
|
+
# @param zdr [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
|
|
125
159
|
#
|
|
126
160
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
|
|
127
161
|
|
|
128
|
-
#
|
|
129
|
-
#
|
|
162
|
+
# Browser action discriminated by `do`. Each variant exposes only its applicable
|
|
163
|
+
# fields.
|
|
164
|
+
module Action
|
|
165
|
+
extend ContextDev::Internal::Type::Union
|
|
166
|
+
|
|
167
|
+
discriminator :do
|
|
168
|
+
|
|
169
|
+
# Pause for a fixed number of milliseconds before continuing to the next action.
|
|
170
|
+
variant :wait, -> { ContextDev::WebWebScrapeHTMLParams::Action::Wait }
|
|
171
|
+
|
|
172
|
+
# Resolve and perform one natural-language browser action.
|
|
173
|
+
variant :perform, -> { ContextDev::WebWebScrapeHTMLParams::Action::Perform }
|
|
174
|
+
|
|
175
|
+
class Wait < ContextDev::Internal::Type::BaseModel
|
|
176
|
+
# @!attribute do_
|
|
177
|
+
#
|
|
178
|
+
# @return [Symbol, :wait]
|
|
179
|
+
required :do_, const: :wait, api_name: :do
|
|
180
|
+
|
|
181
|
+
# @!attribute time_ms
|
|
182
|
+
#
|
|
183
|
+
# @return [Integer]
|
|
184
|
+
required :time_ms, Integer, api_name: :timeMs
|
|
185
|
+
|
|
186
|
+
# @!method initialize(time_ms:, do_: :wait)
|
|
187
|
+
# Pause for a fixed number of milliseconds before continuing to the next action.
|
|
188
|
+
#
|
|
189
|
+
# @param time_ms [Integer]
|
|
190
|
+
# @param do_ [Symbol, :wait]
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
class Perform < ContextDev::Internal::Type::BaseModel
|
|
194
|
+
# @!attribute action
|
|
195
|
+
#
|
|
196
|
+
# @return [String]
|
|
197
|
+
required :action, String
|
|
198
|
+
|
|
199
|
+
# @!attribute do_
|
|
200
|
+
#
|
|
201
|
+
# @return [Symbol, :perform]
|
|
202
|
+
required :do_, const: :perform, api_name: :do
|
|
203
|
+
|
|
204
|
+
# @!method initialize(action:, do_: :perform)
|
|
205
|
+
# Resolve and perform one natural-language browser action.
|
|
206
|
+
#
|
|
207
|
+
# @param action [String]
|
|
208
|
+
# @param do_ [Symbol, :perform]
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# @!method self.variants
|
|
212
|
+
# @return [Array(ContextDev::Models::WebWebScrapeHTMLParams::Action::Wait, ContextDev::Models::WebWebScrapeHTMLParams::Action::Perform)]
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
|
|
216
|
+
# residential proxy exit location. Must be one of Context.dev's supported
|
|
217
|
+
# countries. When provided, Context.dev fetches the target page from that country.
|
|
130
218
|
module Country
|
|
131
219
|
extend ContextDev::Internal::Type::Enum
|
|
132
220
|
|
|
@@ -339,6 +427,31 @@ module ContextDev
|
|
|
339
427
|
# @return [Array<Symbol>]
|
|
340
428
|
end
|
|
341
429
|
|
|
430
|
+
# When true, iframes are rendered inline into the returned HTML.
|
|
431
|
+
module IncludeFrames
|
|
432
|
+
extend ContextDev::Internal::Type::Union
|
|
433
|
+
|
|
434
|
+
variant ContextDev::Internal::Type::Boolean
|
|
435
|
+
|
|
436
|
+
variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::IncludeFrames::TRUE }
|
|
437
|
+
|
|
438
|
+
variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::IncludeFrames::FALSE }
|
|
439
|
+
|
|
440
|
+
# @!method self.variants
|
|
441
|
+
# @return [Array(Boolean, Symbol)]
|
|
442
|
+
|
|
443
|
+
define_sorbet_constant!(:Variants) do
|
|
444
|
+
T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeHTMLParams::IncludeFrames::TaggedSymbol) }
|
|
445
|
+
end
|
|
446
|
+
|
|
447
|
+
# @!group
|
|
448
|
+
|
|
449
|
+
TRUE = :true
|
|
450
|
+
FALSE = :false
|
|
451
|
+
|
|
452
|
+
# @!endgroup
|
|
453
|
+
end
|
|
454
|
+
|
|
342
455
|
class Pdf < ContextDev::Internal::Type::BaseModel
|
|
343
456
|
# @!attribute end_
|
|
344
457
|
# Last 1-based PDF page to parse. When omitted, parsing ends at the last page.
|
|
@@ -352,15 +465,17 @@ module ContextDev
|
|
|
352
465
|
# recognized text at each image's position in page reading order while preserving
|
|
353
466
|
# the PDF text layer. This is separate from automatic scanned-PDF OCR fallback.
|
|
354
467
|
#
|
|
355
|
-
# @return [Boolean, nil]
|
|
356
|
-
optional :ocr, ContextDev::
|
|
468
|
+
# @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::Ocr, nil]
|
|
469
|
+
optional :ocr, union: -> { ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr }
|
|
357
470
|
|
|
358
471
|
# @!attribute should_parse
|
|
359
472
|
# When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
|
|
360
473
|
# a 400 WEBSITE_ACCESS_ERROR is returned.
|
|
361
474
|
#
|
|
362
|
-
# @return [Boolean, nil]
|
|
363
|
-
optional :should_parse,
|
|
475
|
+
# @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ShouldParse, nil]
|
|
476
|
+
optional :should_parse,
|
|
477
|
+
union: -> { ContextDev::WebWebScrapeHTMLParams::Pdf::ShouldParse },
|
|
478
|
+
api_name: :shouldParse
|
|
364
479
|
|
|
365
480
|
# @!attribute start
|
|
366
481
|
# First 1-based PDF page to parse. When omitted, parsing starts at the first page.
|
|
@@ -377,11 +492,135 @@ module ContextDev
|
|
|
377
492
|
#
|
|
378
493
|
# @param end_ [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus
|
|
379
494
|
#
|
|
380
|
-
# @param ocr [Boolean] When true, detect and OCR images embedded in the selected PDF pages, inserting r
|
|
495
|
+
# @param ocr [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::Ocr] When true, detect and OCR images embedded in the selected PDF pages, inserting r
|
|
381
496
|
#
|
|
382
|
-
# @param should_parse [Boolean] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
|
|
497
|
+
# @param should_parse [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ShouldParse] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
|
|
383
498
|
#
|
|
384
499
|
# @param start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page.
|
|
500
|
+
|
|
501
|
+
# When true, detect and OCR images embedded in the selected PDF pages, inserting
|
|
502
|
+
# recognized text at each image's position in page reading order while preserving
|
|
503
|
+
# the PDF text layer. This is separate from automatic scanned-PDF OCR fallback.
|
|
504
|
+
#
|
|
505
|
+
# @see ContextDev::Models::WebWebScrapeHTMLParams::Pdf#ocr
|
|
506
|
+
module Ocr
|
|
507
|
+
extend ContextDev::Internal::Type::Union
|
|
508
|
+
|
|
509
|
+
variant ContextDev::Internal::Type::Boolean
|
|
510
|
+
|
|
511
|
+
variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::Pdf::Ocr::TRUE }
|
|
512
|
+
|
|
513
|
+
variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::Pdf::Ocr::FALSE }
|
|
514
|
+
|
|
515
|
+
# @!method self.variants
|
|
516
|
+
# @return [Array(Boolean, Symbol)]
|
|
517
|
+
|
|
518
|
+
define_sorbet_constant!(:Variants) do
|
|
519
|
+
T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr::TaggedSymbol) }
|
|
520
|
+
end
|
|
521
|
+
|
|
522
|
+
# @!group
|
|
523
|
+
|
|
524
|
+
TRUE = :true
|
|
525
|
+
FALSE = :false
|
|
526
|
+
|
|
527
|
+
# @!endgroup
|
|
528
|
+
end
|
|
529
|
+
|
|
530
|
+
# When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
|
|
531
|
+
# a 400 WEBSITE_ACCESS_ERROR is returned.
|
|
532
|
+
#
|
|
533
|
+
# @see ContextDev::Models::WebWebScrapeHTMLParams::Pdf#should_parse
|
|
534
|
+
module ShouldParse
|
|
535
|
+
extend ContextDev::Internal::Type::Union
|
|
536
|
+
|
|
537
|
+
variant ContextDev::Internal::Type::Boolean
|
|
538
|
+
|
|
539
|
+
variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ShouldParse::TRUE }
|
|
540
|
+
|
|
541
|
+
variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ShouldParse::FALSE }
|
|
542
|
+
|
|
543
|
+
# @!method self.variants
|
|
544
|
+
# @return [Array(Boolean, Symbol)]
|
|
545
|
+
|
|
546
|
+
define_sorbet_constant!(:Variants) do
|
|
547
|
+
T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeHTMLParams::Pdf::ShouldParse::TaggedSymbol) }
|
|
548
|
+
end
|
|
549
|
+
|
|
550
|
+
# @!group
|
|
551
|
+
|
|
552
|
+
TRUE = :true
|
|
553
|
+
FALSE = :false
|
|
554
|
+
|
|
555
|
+
# @!endgroup
|
|
556
|
+
end
|
|
557
|
+
end
|
|
558
|
+
|
|
559
|
+
# When true, waits briefly for CSS and transition animations to settle before
|
|
560
|
+
# extracting HTML. Defaults to false. This adds a bit of latency in exchange for
|
|
561
|
+
# more stable output on animated pages.
|
|
562
|
+
module SettleAnimations
|
|
563
|
+
extend ContextDev::Internal::Type::Union
|
|
564
|
+
|
|
565
|
+
variant ContextDev::Internal::Type::Boolean
|
|
566
|
+
|
|
567
|
+
variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::SettleAnimations::TRUE }
|
|
568
|
+
|
|
569
|
+
variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::SettleAnimations::FALSE }
|
|
570
|
+
|
|
571
|
+
# @!method self.variants
|
|
572
|
+
# @return [Array(Boolean, Symbol)]
|
|
573
|
+
|
|
574
|
+
define_sorbet_constant!(:Variants) do
|
|
575
|
+
T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeHTMLParams::SettleAnimations::TaggedSymbol) }
|
|
576
|
+
end
|
|
577
|
+
|
|
578
|
+
# @!group
|
|
579
|
+
|
|
580
|
+
TRUE = :true
|
|
581
|
+
FALSE = :false
|
|
582
|
+
|
|
583
|
+
# @!endgroup
|
|
584
|
+
end
|
|
585
|
+
|
|
586
|
+
# When true, return only the page's main content in the HTML response, excluding
|
|
587
|
+
# headers, footers, sidebars, and navigation when detectable.
|
|
588
|
+
module UseMainContentOnly
|
|
589
|
+
extend ContextDev::Internal::Type::Union
|
|
590
|
+
|
|
591
|
+
variant ContextDev::Internal::Type::Boolean
|
|
592
|
+
|
|
593
|
+
variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::UseMainContentOnly::TRUE }
|
|
594
|
+
|
|
595
|
+
variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::UseMainContentOnly::FALSE }
|
|
596
|
+
|
|
597
|
+
# @!method self.variants
|
|
598
|
+
# @return [Array(Boolean, Symbol)]
|
|
599
|
+
|
|
600
|
+
define_sorbet_constant!(:Variants) do
|
|
601
|
+
T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::TaggedSymbol) }
|
|
602
|
+
end
|
|
603
|
+
|
|
604
|
+
# @!group
|
|
605
|
+
|
|
606
|
+
TRUE = :true
|
|
607
|
+
FALSE = :false
|
|
608
|
+
|
|
609
|
+
# @!endgroup
|
|
610
|
+
end
|
|
611
|
+
|
|
612
|
+
# Set to enabled to bypass shared caches and omit request and response content
|
|
613
|
+
# from retained usage logs. Requires zero data retention to be enabled for your
|
|
614
|
+
# organization (contact support@context.dev), otherwise the request fails with
|
|
615
|
+
# ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
|
|
616
|
+
module Zdr
|
|
617
|
+
extend ContextDev::Internal::Type::Enum
|
|
618
|
+
|
|
619
|
+
ENABLED = :enabled
|
|
620
|
+
DISABLED = :disabled
|
|
621
|
+
|
|
622
|
+
# @!method self.values
|
|
623
|
+
# @return [Array<Symbol>]
|
|
385
624
|
end
|
|
386
625
|
end
|
|
387
626
|
end
|
|
@@ -39,6 +39,21 @@ module ContextDev
|
|
|
39
39
|
# @return [String]
|
|
40
40
|
required :url, String
|
|
41
41
|
|
|
42
|
+
# @!attribute actions_applied
|
|
43
|
+
# One verified outcome per requested browser action, in request order.
|
|
44
|
+
#
|
|
45
|
+
# @return [Array<ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied>, nil]
|
|
46
|
+
optional :actions_applied,
|
|
47
|
+
-> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied] },
|
|
48
|
+
api_name: :actionsApplied
|
|
49
|
+
|
|
50
|
+
# @!attribute actions_html_stale
|
|
51
|
+
# True when an action was applied but the returned content could not be refreshed
|
|
52
|
+
# afterward.
|
|
53
|
+
#
|
|
54
|
+
# @return [Boolean, nil]
|
|
55
|
+
optional :actions_html_stale, ContextDev::Internal::Type::Boolean, api_name: :actionsHtmlStale
|
|
56
|
+
|
|
42
57
|
# @!attribute key_metadata
|
|
43
58
|
# Metadata about the API key used for the request. Included in every response
|
|
44
59
|
# whenever a valid API key is provided, even when the response status is not 200.
|
|
@@ -46,7 +61,7 @@ module ContextDev
|
|
|
46
61
|
# @return [ContextDev::Models::WebWebScrapeHTMLResponse::KeyMetadata, nil]
|
|
47
62
|
optional :key_metadata, -> { ContextDev::Models::WebWebScrapeHTMLResponse::KeyMetadata }
|
|
48
63
|
|
|
49
|
-
# @!method initialize(html:, metadata:, success:, type:, url:, key_metadata: nil)
|
|
64
|
+
# @!method initialize(html:, metadata:, success:, type:, url:, actions_applied: nil, actions_html_stale: nil, key_metadata: nil)
|
|
50
65
|
# Some parameter documentations has been truncated, see
|
|
51
66
|
# {ContextDev::Models::WebWebScrapeHTMLResponse} for more details.
|
|
52
67
|
#
|
|
@@ -60,6 +75,10 @@ module ContextDev
|
|
|
60
75
|
#
|
|
61
76
|
# @param url [String] The URL that was scraped
|
|
62
77
|
#
|
|
78
|
+
# @param actions_applied [Array<ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied>] One verified outcome per requested browser action, in request order.
|
|
79
|
+
#
|
|
80
|
+
# @param actions_html_stale [Boolean] True when an action was applied but the returned content could not be refreshed
|
|
81
|
+
#
|
|
63
82
|
# @param key_metadata [ContextDev::Models::WebWebScrapeHTMLResponse::KeyMetadata] Metadata about the API key used for the request. Included in every response when
|
|
64
83
|
|
|
65
84
|
# @see ContextDev::Models::WebWebScrapeHTMLResponse#metadata
|
|
@@ -349,6 +368,79 @@ module ContextDev
|
|
|
349
368
|
# @return [Array<Symbol>]
|
|
350
369
|
end
|
|
351
370
|
|
|
371
|
+
class ActionsApplied < ContextDev::Internal::Type::BaseModel
|
|
372
|
+
# @!attribute instruction
|
|
373
|
+
#
|
|
374
|
+
# @return [String]
|
|
375
|
+
required :instruction, String
|
|
376
|
+
|
|
377
|
+
# @!attribute status
|
|
378
|
+
# Applied means the requested page state was visibly verified. Failed means it was
|
|
379
|
+
# not verified. Skipped means it was not attempted.
|
|
380
|
+
#
|
|
381
|
+
# @return [Symbol, ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied::Status]
|
|
382
|
+
required :status, enum: -> { ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied::Status }
|
|
383
|
+
|
|
384
|
+
# @!attribute completion_evidence
|
|
385
|
+
# Visible page evidence used to verify an applied action.
|
|
386
|
+
#
|
|
387
|
+
# @return [String, nil]
|
|
388
|
+
optional :completion_evidence, String, api_name: :completionEvidence
|
|
389
|
+
|
|
390
|
+
# @!attribute duration_ms
|
|
391
|
+
#
|
|
392
|
+
# @return [Float, nil]
|
|
393
|
+
optional :duration_ms, Float, api_name: :durationMs
|
|
394
|
+
|
|
395
|
+
# @!attribute error
|
|
396
|
+
#
|
|
397
|
+
# @return [String, nil]
|
|
398
|
+
optional :error, String
|
|
399
|
+
|
|
400
|
+
# @!attribute method_
|
|
401
|
+
#
|
|
402
|
+
# @return [String, nil]
|
|
403
|
+
optional :method_, String, api_name: :method
|
|
404
|
+
|
|
405
|
+
# @!attribute target_description
|
|
406
|
+
#
|
|
407
|
+
# @return [String, nil]
|
|
408
|
+
optional :target_description, String, api_name: :targetDescription
|
|
409
|
+
|
|
410
|
+
# @!method initialize(instruction:, status:, completion_evidence: nil, duration_ms: nil, error: nil, method_: nil, target_description: nil)
|
|
411
|
+
# Some parameter documentations has been truncated, see
|
|
412
|
+
# {ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied} for more details.
|
|
413
|
+
#
|
|
414
|
+
# @param instruction [String]
|
|
415
|
+
#
|
|
416
|
+
# @param status [Symbol, ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied::Status] Applied means the requested page state was visibly verified. Failed means it was
|
|
417
|
+
#
|
|
418
|
+
# @param completion_evidence [String] Visible page evidence used to verify an applied action.
|
|
419
|
+
#
|
|
420
|
+
# @param duration_ms [Float]
|
|
421
|
+
#
|
|
422
|
+
# @param error [String]
|
|
423
|
+
#
|
|
424
|
+
# @param method_ [String]
|
|
425
|
+
#
|
|
426
|
+
# @param target_description [String]
|
|
427
|
+
|
|
428
|
+
# Applied means the requested page state was visibly verified. Failed means it was
|
|
429
|
+
# not verified. Skipped means it was not attempted.
|
|
430
|
+
#
|
|
431
|
+
# @see ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied#status
|
|
432
|
+
module Status
|
|
433
|
+
extend ContextDev::Internal::Type::Enum
|
|
434
|
+
|
|
435
|
+
APPLIED = :applied
|
|
436
|
+
FAILED = :failed
|
|
437
|
+
SKIPPED = :skipped
|
|
438
|
+
|
|
439
|
+
# @!method self.values
|
|
440
|
+
# @return [Array<Symbol>]
|
|
441
|
+
end
|
|
442
|
+
end
|
|
443
|
+
|
|
352
444
|
# @see ContextDev::Models::WebWebScrapeHTMLResponse#key_metadata
|
|
353
445
|
class KeyMetadata < ContextDev::Internal::Type::BaseModel
|
|
354
446
|
# @!attribute credits_consumed
|