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.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/models/ai_extract_product_params.rb +9 -1
  5. data/lib/context_dev/models/ai_extract_products_params.rb +18 -2
  6. data/lib/context_dev/models/brand_retrieve_params.rb +109 -22
  7. data/lib/context_dev/models/brand_retrieve_response.rb +4 -6
  8. data/lib/context_dev/models/brand_retrieve_simplified_params.rb +32 -3
  9. data/lib/context_dev/models/industry_retrieve_naics_params.rb +11 -1
  10. data/lib/context_dev/models/industry_retrieve_sic_params.rb +11 -1
  11. data/lib/context_dev/models/monitor_create_params.rb +6 -5
  12. data/lib/context_dev/models/monitor_create_response.rb +6 -5
  13. data/lib/context_dev/models/monitor_get_credit_usage_params.rb +30 -0
  14. data/lib/context_dev/models/monitor_get_credit_usage_response.rb +59 -0
  15. data/lib/context_dev/models/monitor_get_limits_params.rb +14 -0
  16. data/lib/context_dev/models/monitor_get_limits_response.rb +52 -0
  17. data/lib/context_dev/models/monitor_list_account_changes_params.rb +16 -7
  18. data/lib/context_dev/models/monitor_list_account_changes_response.rb +2 -1
  19. data/lib/context_dev/models/monitor_list_account_runs_params.rb +7 -10
  20. data/lib/context_dev/models/monitor_list_changes_params.rb +8 -4
  21. data/lib/context_dev/models/monitor_list_changes_response.rb +2 -1
  22. data/lib/context_dev/models/monitor_list_params.rb +18 -19
  23. data/lib/context_dev/models/monitor_list_response.rb +6 -5
  24. data/lib/context_dev/models/monitor_list_runs_params.rb +7 -10
  25. data/lib/context_dev/models/monitor_retrieve_change_response.rb +2 -1
  26. data/lib/context_dev/models/monitor_retrieve_response.rb +6 -5
  27. data/lib/context_dev/models/monitor_update_params.rb +6 -5
  28. data/lib/context_dev/models/monitor_update_response.rb +6 -5
  29. data/lib/context_dev/models/parse_handle_params.rb +199 -33
  30. data/lib/context_dev/models/utility_prefetch_params.rb +9 -1
  31. data/lib/context_dev/models/web_extract_competitors_params.rb +11 -1
  32. data/lib/context_dev/models/web_extract_fonts_params.rb +14 -4
  33. data/lib/context_dev/models/web_extract_params.rb +19 -1
  34. data/lib/context_dev/models/web_extract_styleguide_params.rb +14 -4
  35. data/lib/context_dev/models/web_screenshot_params.rb +69 -18
  36. data/lib/context_dev/models/web_screenshot_response.rb +3 -2
  37. data/lib/context_dev/models/web_search_params.rb +9 -1
  38. data/lib/context_dev/models/web_web_crawl_md_params.rb +34 -1
  39. data/lib/context_dev/models/web_web_scrape_html_params.rb +268 -29
  40. data/lib/context_dev/models/web_web_scrape_images_params.rb +208 -19
  41. data/lib/context_dev/models/web_web_scrape_md_params.rb +352 -38
  42. data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +45 -1
  43. data/lib/context_dev/models.rb +4 -0
  44. data/lib/context_dev/resources/ai.rb +3 -1
  45. data/lib/context_dev/resources/brand.rb +6 -2
  46. data/lib/context_dev/resources/industry.rb +6 -2
  47. data/lib/context_dev/resources/monitors.rb +70 -32
  48. data/lib/context_dev/resources/parse.rb +15 -11
  49. data/lib/context_dev/resources/utility.rb +3 -1
  50. data/lib/context_dev/resources/web.rb +104 -55
  51. data/lib/context_dev/version.rb +1 -1
  52. data/lib/context_dev.rb +4 -0
  53. data/rbi/context_dev/models/ai_extract_product_params.rbi +11 -0
  54. data/rbi/context_dev/models/ai_extract_products_params.rbi +22 -0
  55. data/rbi/context_dev/models/brand_retrieve_params.rbi +175 -64
  56. data/rbi/context_dev/models/brand_retrieve_response.rbi +8 -11
  57. data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +68 -5
  58. data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +15 -0
  59. data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +15 -0
  60. data/rbi/context_dev/models/monitor_create_params.rbi +6 -4
  61. data/rbi/context_dev/models/monitor_create_response.rbi +6 -4
  62. data/rbi/context_dev/models/monitor_get_credit_usage_params.rbi +60 -0
  63. data/rbi/context_dev/models/monitor_get_credit_usage_response.rbi +111 -0
  64. data/rbi/context_dev/models/monitor_get_limits_params.rbi +30 -0
  65. data/rbi/context_dev/models/monitor_get_limits_response.rbi +105 -0
  66. data/rbi/context_dev/models/monitor_list_account_changes_params.rbi +16 -0
  67. data/rbi/context_dev/models/monitor_list_account_changes_response.rbi +2 -0
  68. data/rbi/context_dev/models/monitor_list_account_runs_params.rbi +7 -6
  69. data/rbi/context_dev/models/monitor_list_changes_params.rbi +8 -0
  70. data/rbi/context_dev/models/monitor_list_changes_response.rbi +2 -0
  71. data/rbi/context_dev/models/monitor_list_params.rbi +23 -31
  72. data/rbi/context_dev/models/monitor_list_response.rbi +6 -4
  73. data/rbi/context_dev/models/monitor_list_runs_params.rbi +7 -6
  74. data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +2 -0
  75. data/rbi/context_dev/models/monitor_retrieve_response.rbi +6 -4
  76. data/rbi/context_dev/models/monitor_update_params.rbi +6 -4
  77. data/rbi/context_dev/models/monitor_update_response.rbi +6 -4
  78. data/rbi/context_dev/models/parse_handle_params.rbi +400 -46
  79. data/rbi/context_dev/models/utility_prefetch_params.rbi +11 -0
  80. data/rbi/context_dev/models/web_extract_competitors_params.rbi +15 -0
  81. data/rbi/context_dev/models/web_extract_fonts_params.rbi +19 -7
  82. data/rbi/context_dev/models/web_extract_params.rbi +26 -0
  83. data/rbi/context_dev/models/web_extract_styleguide_params.rbi +19 -7
  84. data/rbi/context_dev/models/web_screenshot_params.rbi +108 -37
  85. data/rbi/context_dev/models/web_screenshot_response.rbi +4 -2
  86. data/rbi/context_dev/models/web_search_params.rbi +11 -0
  87. data/rbi/context_dev/models/web_web_crawl_md_params.rbi +53 -0
  88. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +554 -49
  89. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +426 -30
  90. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +742 -61
  91. data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +82 -0
  92. data/rbi/context_dev/models.rbi +4 -0
  93. data/rbi/context_dev/resources/ai.rbi +3 -0
  94. data/rbi/context_dev/resources/brand.rbi +9 -1
  95. data/rbi/context_dev/resources/industry.rbi +10 -0
  96. data/rbi/context_dev/resources/monitors.rbi +55 -11
  97. data/rbi/context_dev/resources/parse.rbi +46 -19
  98. data/rbi/context_dev/resources/utility.rbi +3 -0
  99. data/rbi/context_dev/resources/web.rbi +224 -48
  100. data/sig/context_dev/models/ai_extract_product_params.rbs +12 -1
  101. data/sig/context_dev/models/ai_extract_products_params.rbs +14 -0
  102. data/sig/context_dev/models/brand_retrieve_params.rbs +97 -51
  103. data/sig/context_dev/models/brand_retrieve_response.rbs +2 -2
  104. data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +34 -5
  105. data/sig/context_dev/models/industry_retrieve_naics_params.rbs +7 -0
  106. data/sig/context_dev/models/industry_retrieve_sic_params.rbs +7 -0
  107. data/sig/context_dev/models/monitor_get_credit_usage_params.rbs +32 -0
  108. data/sig/context_dev/models/monitor_get_credit_usage_response.rbs +52 -0
  109. data/sig/context_dev/models/monitor_get_limits_params.rbs +15 -0
  110. data/sig/context_dev/models/monitor_get_limits_response.rbs +43 -0
  111. data/sig/context_dev/models/monitor_list_params.rbs +8 -14
  112. data/sig/context_dev/models/parse_handle_params.rbs +124 -25
  113. data/sig/context_dev/models/utility_prefetch_params.rbs +7 -0
  114. data/sig/context_dev/models/web_extract_competitors_params.rbs +12 -1
  115. data/sig/context_dev/models/web_extract_fonts_params.rbs +10 -5
  116. data/sig/context_dev/models/web_extract_params.rbs +14 -0
  117. data/sig/context_dev/models/web_extract_styleguide_params.rbs +10 -5
  118. data/sig/context_dev/models/web_screenshot_params.rbs +41 -20
  119. data/sig/context_dev/models/web_search_params.rbs +7 -0
  120. data/sig/context_dev/models/web_web_crawl_md_params.rbs +28 -1
  121. data/sig/context_dev/models/web_web_scrape_html_params.rbs +175 -47
  122. data/sig/context_dev/models/web_web_scrape_images_params.rbs +128 -38
  123. data/sig/context_dev/models/web_web_scrape_md_params.rbs +229 -62
  124. data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +35 -1
  125. data/sig/context_dev/models.rbs +4 -0
  126. data/sig/context_dev/resources/ai.rbs +1 -0
  127. data/sig/context_dev/resources/brand.rbs +3 -1
  128. data/sig/context_dev/resources/industry.rbs +2 -0
  129. data/sig/context_dev/resources/monitors.rbs +12 -2
  130. data/sig/context_dev/resources/parse.rbs +8 -5
  131. data/sig/context_dev/resources/utility.rbs +1 -0
  132. data/sig/context_dev/resources/web.rbs +47 -26
  133. metadata +14 -2
@@ -14,9 +14,20 @@ module ContextDev
14
14
  # @return [String]
15
15
  required :url, String
16
16
 
17
+ # @!attribute actions
18
+ # Optional browser actions executed in array order after the page loads and before
19
+ # content is captured. Requires a paid plan. Send a JSON array in the query
20
+ # parameter. Maximum: 5 actions.
21
+ #
22
+ # @return [Array<ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform>, nil]
23
+ optional :actions,
24
+ -> { ContextDev::Internal::Type::ArrayOf[union: ContextDev::WebWebScrapeMdParams::Action] },
25
+ nil?: true
26
+
17
27
  # @!attribute country
18
- # Two-letter ISO 3166-1 alpha-2 country code for the website request location.
19
- # When provided, Context.dev fetches the target page from that country.
28
+ # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
29
+ # residential proxy exit location. Must be one of Context.dev's supported
30
+ # countries. When provided, Context.dev fetches the target page from that country.
20
31
  #
21
32
  # @return [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country, nil]
22
33
  optional :country, enum: -> { ContextDev::WebWebScrapeMdParams::Country }
@@ -27,7 +38,7 @@ module ContextDev
27
38
  # removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
28
39
  #
29
40
  # @return [Array<String>, nil]
30
- optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String]
41
+ optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String], nil?: true
31
42
 
32
43
  # @!attribute headers
33
44
  # Optional outbound HTTP headers forwarded only to the target URL, sent as
@@ -40,20 +51,20 @@ module ContextDev
40
51
  # @!attribute include_frames
41
52
  # When true, the contents of iframes are rendered to Markdown.
42
53
  #
43
- # @return [Boolean, nil]
44
- optional :include_frames, ContextDev::Internal::Type::Boolean
54
+ # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeFrames, nil]
55
+ optional :include_frames, union: -> { ContextDev::WebWebScrapeMdParams::IncludeFrames }
45
56
 
46
57
  # @!attribute include_images
47
58
  # Include image references in Markdown output
48
59
  #
49
- # @return [Boolean, nil]
50
- optional :include_images, ContextDev::Internal::Type::Boolean
60
+ # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeImages, nil]
61
+ optional :include_images, union: -> { ContextDev::WebWebScrapeMdParams::IncludeImages }
51
62
 
52
63
  # @!attribute include_links
53
64
  # Preserve hyperlinks in Markdown output
54
65
  #
55
- # @return [Boolean, nil]
56
- optional :include_links, ContextDev::Internal::Type::Boolean
66
+ # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeLinks, nil]
67
+ optional :include_links, union: -> { ContextDev::WebWebScrapeMdParams::IncludeLinks }
57
68
 
58
69
  # @!attribute include_selectors
59
70
  # CSS selectors. When provided, only matching HTML subtrees (and their
@@ -61,7 +72,7 @@ module ContextDev
61
72
  # document is kept. Examples: "article.main", "#content", "[role=main]".
62
73
  #
63
74
  # @return [Array<String>, nil]
64
- optional :include_selectors, ContextDev::Internal::Type::ArrayOf[String]
75
+ optional :include_selectors, ContextDev::Internal::Type::ArrayOf[String], nil?: true
65
76
 
66
77
  # @!attribute max_age_ms
67
78
  # Return a cached result if a prior scrape for the same parameters exists and is
@@ -69,7 +80,7 @@ module ContextDev
69
80
  # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
70
81
  #
71
82
  # @return [Integer, nil]
72
- optional :max_age_ms, Integer
83
+ optional :max_age_ms, Integer, nil?: true
73
84
 
74
85
  # @!attribute pdf
75
86
  # PDF parsing controls. Use start/end to limit text extraction and embedded-image
@@ -83,14 +94,22 @@ module ContextDev
83
94
  # converting to Markdown. Defaults to false. This adds a bit of latency in
84
95
  # exchange for more stable output on animated pages.
85
96
  #
86
- # @return [Boolean, nil]
87
- optional :settle_animations, ContextDev::Internal::Type::Boolean
97
+ # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::SettleAnimations, nil]
98
+ optional :settle_animations, union: -> { ContextDev::WebWebScrapeMdParams::SettleAnimations }
88
99
 
89
100
  # @!attribute shorten_base64_images
90
101
  # Shorten base64-encoded image data in the Markdown output
91
102
  #
92
- # @return [Boolean, nil]
93
- optional :shorten_base64_images, ContextDev::Internal::Type::Boolean
103
+ # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::ShortenBase64Images, nil]
104
+ optional :shorten_base64_images, union: -> { ContextDev::WebWebScrapeMdParams::ShortenBase64Images }
105
+
106
+ # @!attribute tags
107
+ # Optional comma-separated caller-defined tags for tracking this request. Tags are
108
+ # recorded on the request's usage log and can be used to filter usage on the
109
+ # dashboard usage page. Up to 20 tags, each 1-50 characters.
110
+ #
111
+ # @return [Array<String>, nil]
112
+ optional :tags, ContextDev::Internal::Type::ArrayOf[String]
94
113
 
95
114
  # @!attribute timeout_ms
96
115
  # Optional timeout in milliseconds for the request. If the request takes longer
@@ -104,54 +123,123 @@ module ContextDev
104
123
  # Extract only the main content of the page, excluding headers, footers, sidebars,
105
124
  # and navigation
106
125
  #
107
- # @return [Boolean, nil]
108
- optional :use_main_content_only, ContextDev::Internal::Type::Boolean
126
+ # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::UseMainContentOnly, nil]
127
+ optional :use_main_content_only, union: -> { ContextDev::WebWebScrapeMdParams::UseMainContentOnly }
109
128
 
110
129
  # @!attribute wait_for_ms
111
130
  # Optional browser wait time in milliseconds after initial page load before
112
131
  # converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).
113
132
  #
114
133
  # @return [Integer, nil]
115
- optional :wait_for_ms, Integer
134
+ optional :wait_for_ms, Integer, nil?: true
135
+
136
+ # @!attribute zdr
137
+ # Set to enabled to bypass shared caches and omit request and response content
138
+ # from retained usage logs. Requires zero data retention to be enabled for your
139
+ # organization (contact support@context.dev), otherwise the request fails with
140
+ # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
141
+ #
142
+ # @return [Symbol, ContextDev::Models::WebWebScrapeMdParams::Zdr, nil]
143
+ optional :zdr, enum: -> { ContextDev::WebWebScrapeMdParams::Zdr }
116
144
 
117
- # @!method initialize(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
145
+ # @!method initialize(url:, actions: nil, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, tags: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {})
118
146
  # Some parameter documentations has been truncated, see
119
147
  # {ContextDev::Models::WebWebScrapeMdParams} for more details.
120
148
  #
121
149
  # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr
122
150
  #
123
- # @param country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe
151
+ # @param actions [Array<ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform>, nil] Optional browser actions executed in array order after the page loads and before
124
152
  #
125
- # @param exclude_selectors [Array<String>] CSS selectors to remove before conversion to Markdown. Applied after includeSele
153
+ # @param country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r
154
+ #
155
+ # @param exclude_selectors [Array<String>, nil] CSS selectors to remove before conversion to Markdown. Applied after includeSele
126
156
  #
127
157
  # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
128
158
  #
129
- # @param include_frames [Boolean] When true, the contents of iframes are rendered to Markdown.
159
+ # @param include_frames [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeFrames] When true, the contents of iframes are rendered to Markdown.
130
160
  #
131
- # @param include_images [Boolean] Include image references in Markdown output
161
+ # @param include_images [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeImages] Include image references in Markdown output
132
162
  #
133
- # @param include_links [Boolean] Preserve hyperlinks in Markdown output
163
+ # @param include_links [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeLinks] Preserve hyperlinks in Markdown output
134
164
  #
135
- # @param include_selectors [Array<String>] CSS selectors. When provided, only matching HTML subtrees (and their descendants
165
+ # @param include_selectors [Array<String>, nil] CSS selectors. When provided, only matching HTML subtrees (and their descendants
136
166
  #
137
- # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
167
+ # @param max_age_ms [Integer, nil] Return a cached result if a prior scrape for the same parameters exists and is y
138
168
  #
139
169
  # @param pdf [ContextDev::Models::WebWebScrapeMdParams::Pdf] PDF parsing controls. Use start/end to limit text extraction and embedded-image
140
170
  #
141
- # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before conv
171
+ # @param settle_animations [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::SettleAnimations] When true, waits briefly for CSS and transition animations to settle before conv
172
+ #
173
+ # @param shorten_base64_images [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::ShortenBase64Images] Shorten base64-encoded image data in the Markdown output
142
174
  #
143
- # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output
175
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
144
176
  #
145
177
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
146
178
  #
147
- # @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars,
179
+ # @param use_main_content_only [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::UseMainContentOnly] Extract only the main content of the page, excluding headers, footers, sidebars,
148
180
  #
149
- # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before conver
181
+ # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before conver
182
+ #
183
+ # @param zdr [Symbol, ContextDev::Models::WebWebScrapeMdParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
150
184
  #
151
185
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
152
186
 
153
- # Two-letter ISO 3166-1 alpha-2 country code for the website request location.
154
- # When provided, Context.dev fetches the target page from that country.
187
+ # Browser action discriminated by `do`. Each variant exposes only its applicable
188
+ # fields.
189
+ module Action
190
+ extend ContextDev::Internal::Type::Union
191
+
192
+ discriminator :do
193
+
194
+ # Pause for a fixed number of milliseconds before continuing to the next action.
195
+ variant :wait, -> { ContextDev::WebWebScrapeMdParams::Action::Wait }
196
+
197
+ # Resolve and perform one natural-language browser action.
198
+ variant :perform, -> { ContextDev::WebWebScrapeMdParams::Action::Perform }
199
+
200
+ class Wait < ContextDev::Internal::Type::BaseModel
201
+ # @!attribute do_
202
+ #
203
+ # @return [Symbol, :wait]
204
+ required :do_, const: :wait, api_name: :do
205
+
206
+ # @!attribute time_ms
207
+ #
208
+ # @return [Integer]
209
+ required :time_ms, Integer, api_name: :timeMs
210
+
211
+ # @!method initialize(time_ms:, do_: :wait)
212
+ # Pause for a fixed number of milliseconds before continuing to the next action.
213
+ #
214
+ # @param time_ms [Integer]
215
+ # @param do_ [Symbol, :wait]
216
+ end
217
+
218
+ class Perform < ContextDev::Internal::Type::BaseModel
219
+ # @!attribute action
220
+ #
221
+ # @return [String]
222
+ required :action, String
223
+
224
+ # @!attribute do_
225
+ #
226
+ # @return [Symbol, :perform]
227
+ required :do_, const: :perform, api_name: :do
228
+
229
+ # @!method initialize(action:, do_: :perform)
230
+ # Resolve and perform one natural-language browser action.
231
+ #
232
+ # @param action [String]
233
+ # @param do_ [Symbol, :perform]
234
+ end
235
+
236
+ # @!method self.variants
237
+ # @return [Array(ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform)]
238
+ end
239
+
240
+ # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
241
+ # residential proxy exit location. Must be one of Context.dev's supported
242
+ # countries. When provided, Context.dev fetches the target page from that country.
155
243
  module Country
156
244
  extend ContextDev::Internal::Type::Enum
157
245
 
@@ -364,6 +452,81 @@ module ContextDev
364
452
  # @return [Array<Symbol>]
365
453
  end
366
454
 
455
+ # When true, the contents of iframes are rendered to Markdown.
456
+ module IncludeFrames
457
+ extend ContextDev::Internal::Type::Union
458
+
459
+ variant ContextDev::Internal::Type::Boolean
460
+
461
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::IncludeFrames::TRUE }
462
+
463
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::IncludeFrames::FALSE }
464
+
465
+ # @!method self.variants
466
+ # @return [Array(Boolean, Symbol)]
467
+
468
+ define_sorbet_constant!(:Variants) do
469
+ T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeMdParams::IncludeFrames::TaggedSymbol) }
470
+ end
471
+
472
+ # @!group
473
+
474
+ TRUE = :true
475
+ FALSE = :false
476
+
477
+ # @!endgroup
478
+ end
479
+
480
+ # Include image references in Markdown output
481
+ module IncludeImages
482
+ extend ContextDev::Internal::Type::Union
483
+
484
+ variant ContextDev::Internal::Type::Boolean
485
+
486
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::IncludeImages::TRUE }
487
+
488
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::IncludeImages::FALSE }
489
+
490
+ # @!method self.variants
491
+ # @return [Array(Boolean, Symbol)]
492
+
493
+ define_sorbet_constant!(:Variants) do
494
+ T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeMdParams::IncludeImages::TaggedSymbol) }
495
+ end
496
+
497
+ # @!group
498
+
499
+ TRUE = :true
500
+ FALSE = :false
501
+
502
+ # @!endgroup
503
+ end
504
+
505
+ # Preserve hyperlinks in Markdown output
506
+ module IncludeLinks
507
+ extend ContextDev::Internal::Type::Union
508
+
509
+ variant ContextDev::Internal::Type::Boolean
510
+
511
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::IncludeLinks::TRUE }
512
+
513
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::IncludeLinks::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::WebWebScrapeMdParams::IncludeLinks::TaggedSymbol) }
520
+ end
521
+
522
+ # @!group
523
+
524
+ TRUE = :true
525
+ FALSE = :false
526
+
527
+ # @!endgroup
528
+ end
529
+
367
530
  class Pdf < ContextDev::Internal::Type::BaseModel
368
531
  # @!attribute end_
369
532
  # Last 1-based PDF page to parse. When omitted, parsing ends at the last page.
@@ -377,15 +540,17 @@ module ContextDev
377
540
  # recognized text at each image's position in page reading order while preserving
378
541
  # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback.
379
542
  #
380
- # @return [Boolean, nil]
381
- optional :ocr, ContextDev::Internal::Type::Boolean
543
+ # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::Pdf::Ocr, nil]
544
+ optional :ocr, union: -> { ContextDev::WebWebScrapeMdParams::Pdf::Ocr }
382
545
 
383
546
  # @!attribute should_parse
384
547
  # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
385
548
  # a 400 WEBSITE_ACCESS_ERROR is returned.
386
549
  #
387
- # @return [Boolean, nil]
388
- optional :should_parse, ContextDev::Internal::Type::Boolean, api_name: :shouldParse
550
+ # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::Pdf::ShouldParse, nil]
551
+ optional :should_parse,
552
+ union: -> { ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse },
553
+ api_name: :shouldParse
389
554
 
390
555
  # @!attribute start
391
556
  # First 1-based PDF page to parse. When omitted, parsing starts at the first page.
@@ -402,11 +567,160 @@ module ContextDev
402
567
  #
403
568
  # @param end_ [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus
404
569
  #
405
- # @param ocr [Boolean] When true, detect and OCR images embedded in the selected PDF pages, inserting r
570
+ # @param ocr [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::Pdf::Ocr] When true, detect and OCR images embedded in the selected PDF pages, inserting r
406
571
  #
407
- # @param should_parse [Boolean] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
572
+ # @param should_parse [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::Pdf::ShouldParse] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
408
573
  #
409
574
  # @param start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page.
575
+
576
+ # When true, detect and OCR images embedded in the selected PDF pages, inserting
577
+ # recognized text at each image's position in page reading order while preserving
578
+ # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback.
579
+ #
580
+ # @see ContextDev::Models::WebWebScrapeMdParams::Pdf#ocr
581
+ module Ocr
582
+ extend ContextDev::Internal::Type::Union
583
+
584
+ variant ContextDev::Internal::Type::Boolean
585
+
586
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::Pdf::Ocr::TRUE }
587
+
588
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::Pdf::Ocr::FALSE }
589
+
590
+ # @!method self.variants
591
+ # @return [Array(Boolean, Symbol)]
592
+
593
+ define_sorbet_constant!(:Variants) do
594
+ T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeMdParams::Pdf::Ocr::TaggedSymbol) }
595
+ end
596
+
597
+ # @!group
598
+
599
+ TRUE = :true
600
+ FALSE = :false
601
+
602
+ # @!endgroup
603
+ end
604
+
605
+ # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
606
+ # a 400 WEBSITE_ACCESS_ERROR is returned.
607
+ #
608
+ # @see ContextDev::Models::WebWebScrapeMdParams::Pdf#should_parse
609
+ module ShouldParse
610
+ extend ContextDev::Internal::Type::Union
611
+
612
+ variant ContextDev::Internal::Type::Boolean
613
+
614
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::Pdf::ShouldParse::TRUE }
615
+
616
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::Pdf::ShouldParse::FALSE }
617
+
618
+ # @!method self.variants
619
+ # @return [Array(Boolean, Symbol)]
620
+
621
+ define_sorbet_constant!(:Variants) do
622
+ T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::TaggedSymbol) }
623
+ end
624
+
625
+ # @!group
626
+
627
+ TRUE = :true
628
+ FALSE = :false
629
+
630
+ # @!endgroup
631
+ end
632
+ end
633
+
634
+ # When true, waits briefly for CSS and transition animations to settle before
635
+ # converting to Markdown. Defaults to false. This adds a bit of latency in
636
+ # exchange for more stable output on animated pages.
637
+ module SettleAnimations
638
+ extend ContextDev::Internal::Type::Union
639
+
640
+ variant ContextDev::Internal::Type::Boolean
641
+
642
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::SettleAnimations::TRUE }
643
+
644
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::SettleAnimations::FALSE }
645
+
646
+ # @!method self.variants
647
+ # @return [Array(Boolean, Symbol)]
648
+
649
+ define_sorbet_constant!(:Variants) do
650
+ T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeMdParams::SettleAnimations::TaggedSymbol) }
651
+ end
652
+
653
+ # @!group
654
+
655
+ TRUE = :true
656
+ FALSE = :false
657
+
658
+ # @!endgroup
659
+ end
660
+
661
+ # Shorten base64-encoded image data in the Markdown output
662
+ module ShortenBase64Images
663
+ extend ContextDev::Internal::Type::Union
664
+
665
+ variant ContextDev::Internal::Type::Boolean
666
+
667
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::ShortenBase64Images::TRUE }
668
+
669
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::ShortenBase64Images::FALSE }
670
+
671
+ # @!method self.variants
672
+ # @return [Array(Boolean, Symbol)]
673
+
674
+ define_sorbet_constant!(:Variants) do
675
+ T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeMdParams::ShortenBase64Images::TaggedSymbol) }
676
+ end
677
+
678
+ # @!group
679
+
680
+ TRUE = :true
681
+ FALSE = :false
682
+
683
+ # @!endgroup
684
+ end
685
+
686
+ # Extract only the main content of the page, excluding headers, footers, sidebars,
687
+ # and navigation
688
+ module UseMainContentOnly
689
+ extend ContextDev::Internal::Type::Union
690
+
691
+ variant ContextDev::Internal::Type::Boolean
692
+
693
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::UseMainContentOnly::TRUE }
694
+
695
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::UseMainContentOnly::FALSE }
696
+
697
+ # @!method self.variants
698
+ # @return [Array(Boolean, Symbol)]
699
+
700
+ define_sorbet_constant!(:Variants) do
701
+ T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeMdParams::UseMainContentOnly::TaggedSymbol) }
702
+ end
703
+
704
+ # @!group
705
+
706
+ TRUE = :true
707
+ FALSE = :false
708
+
709
+ # @!endgroup
710
+ end
711
+
712
+ # Set to enabled to bypass shared caches and omit request and response content
713
+ # from retained usage logs. Requires zero data retention to be enabled for your
714
+ # organization (contact support@context.dev), otherwise the request fails with
715
+ # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
716
+ module Zdr
717
+ extend ContextDev::Internal::Type::Enum
718
+
719
+ ENABLED = :enabled
720
+ DISABLED = :disabled
721
+
722
+ # @!method self.values
723
+ # @return [Array<Symbol>]
410
724
  end
411
725
  end
412
726
  end
@@ -28,6 +28,21 @@ module ContextDev
28
28
  # @return [Integer, nil]
29
29
  optional :max_links, Integer
30
30
 
31
+ # @!attribute sitemap_url
32
+ # Optional explicit sitemap URL. When provided, exactly this sitemap is crawled
33
+ # instead of discovering the domain's sitemaps.
34
+ #
35
+ # @return [String, nil]
36
+ optional :sitemap_url, String
37
+
38
+ # @!attribute tags
39
+ # Optional comma-separated caller-defined tags for tracking this request. Tags are
40
+ # recorded on the request's usage log and can be used to filter usage on the
41
+ # dashboard usage page. Up to 20 tags, each 1-50 characters.
42
+ #
43
+ # @return [Array<String>, nil]
44
+ optional :tags, ContextDev::Internal::Type::ArrayOf[String]
45
+
31
46
  # @!attribute timeout_ms
32
47
  # Optional timeout in milliseconds for the request. If the request takes longer
33
48
  # than this value, it will be aborted with a 408 status code. Maximum allowed
@@ -43,7 +58,16 @@ module ContextDev
43
58
  # @return [String, nil]
44
59
  optional :url_regex, String
45
60
 
46
- # @!method initialize(domain:, headers: nil, max_links: nil, timeout_ms: nil, url_regex: nil, request_options: {})
61
+ # @!attribute zdr
62
+ # Set to enabled to bypass shared caches and omit request and response content
63
+ # from retained usage logs. Requires zero data retention to be enabled for your
64
+ # organization (contact support@context.dev), otherwise the request fails with
65
+ # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
66
+ #
67
+ # @return [Symbol, ContextDev::Models::WebWebScrapeSitemapParams::Zdr, nil]
68
+ optional :zdr, enum: -> { ContextDev::WebWebScrapeSitemapParams::Zdr }
69
+
70
+ # @!method initialize(domain:, headers: nil, max_links: nil, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, zdr: nil, request_options: {})
47
71
  # Some parameter documentations has been truncated, see
48
72
  # {ContextDev::Models::WebWebScrapeSitemapParams} for more details.
49
73
  #
@@ -53,11 +77,31 @@ module ContextDev
53
77
  #
54
78
  # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi
55
79
  #
80
+ # @param sitemap_url [String] Optional explicit sitemap URL. When provided, exactly this sitemap is crawled in
81
+ #
82
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
83
+ #
56
84
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
57
85
  #
58
86
  # @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur
59
87
  #
88
+ # @param zdr [Symbol, ContextDev::Models::WebWebScrapeSitemapParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
89
+ #
60
90
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
91
+
92
+ # Set to enabled to bypass shared caches and omit request and response content
93
+ # from retained usage logs. Requires zero data retention to be enabled for your
94
+ # organization (contact support@context.dev), otherwise the request fails with
95
+ # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
96
+ module Zdr
97
+ extend ContextDev::Internal::Type::Enum
98
+
99
+ ENABLED = :enabled
100
+ DISABLED = :disabled
101
+
102
+ # @!method self.values
103
+ # @return [Array<Symbol>]
104
+ end
61
105
  end
62
106
  end
63
107
  end
@@ -55,6 +55,10 @@ module ContextDev
55
55
 
56
56
  MonitorDeleteParams = ContextDev::Models::MonitorDeleteParams
57
57
 
58
+ MonitorGetCreditUsageParams = ContextDev::Models::MonitorGetCreditUsageParams
59
+
60
+ MonitorGetLimitsParams = ContextDev::Models::MonitorGetLimitsParams
61
+
58
62
  MonitorListAccountChangesParams = ContextDev::Models::MonitorListAccountChangesParams
59
63
 
60
64
  MonitorListAccountRunsParams = ContextDev::Models::MonitorListAccountRunsParams
@@ -9,12 +9,14 @@ module ContextDev
9
9
  # Given a single URL, determines if it is a product page and extracts the product
10
10
  # information.
11
11
  #
12
- # @overload extract_product(url:, max_age_ms: nil, timeout_ms: nil, request_options: {})
12
+ # @overload extract_product(url:, max_age_ms: nil, tags: nil, timeout_ms: nil, request_options: {})
13
13
  #
14
14
  # @param url [String] The product page URL to extract product data from.
15
15
  #
16
16
  # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
17
17
  #
18
+ # @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
19
+ #
18
20
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
19
21
  #
20
22
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -36,11 +36,15 @@ module ContextDev
36
36
  # information: domain, title, colors, logos, and backdrops. Optimized for faster
37
37
  # responses and reduced data transfer.
38
38
  #
39
- # @overload retrieve_simplified(domain:, max_age_ms: nil, timeout_ms: nil, request_options: {})
39
+ # @overload retrieve_simplified(domain:, max_age_ms: nil, tags: nil, theme: nil, timeout_ms: nil, request_options: {})
40
40
  #
41
41
  # @param domain [String] Domain name to retrieve simplified brand data for
42
42
  #
43
- # @param max_age_ms [Integer] Maximum age in milliseconds for cached brand data before the API performs a hard
43
+ # @param max_age_ms [Integer, nil] Maximum age in milliseconds for cached brand data before the API performs a hard
44
+ #
45
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
46
+ #
47
+ # @param theme [Symbol, ContextDev::Models::BrandRetrieveSimplifiedParams::Theme] Optional theme preference used when selecting brand assets.
44
48
  #
45
49
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
46
50
  #
@@ -8,7 +8,7 @@ module ContextDev
8
8
  #
9
9
  # Classify any brand into 2022 NAICS industry codes from its domain or name.
10
10
  #
11
- # @overload retrieve_naics(input:, max_results: nil, min_results: nil, timeout_ms: nil, request_options: {})
11
+ # @overload retrieve_naics(input:, max_results: nil, min_results: nil, tags: nil, timeout_ms: nil, request_options: {})
12
12
  #
13
13
  # @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided,
14
14
  #
@@ -16,6 +16,8 @@ module ContextDev
16
16
  #
17
17
  # @param min_results [Integer] Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
18
18
  #
19
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
20
+ #
19
21
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
20
22
  #
21
23
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -46,7 +48,7 @@ module ContextDev
46
48
  # domain or name. Choose between the original SIC system (`original_sic`) or the
47
49
  # latest SIC list maintained by the SEC (`latest_sec`).
48
50
  #
49
- # @overload retrieve_sic(input:, max_results: nil, min_results: nil, timeout_ms: nil, type: nil, request_options: {})
51
+ # @overload retrieve_sic(input:, max_results: nil, min_results: nil, tags: nil, timeout_ms: nil, type: nil, request_options: {})
50
52
  #
51
53
  # @param input [String] Brand domain or title to retrieve SIC code for. If a valid domain is provided, i
52
54
  #
@@ -54,6 +56,8 @@ module ContextDev
54
56
  #
55
57
  # @param min_results [Integer] Minimum number of SIC codes to return. Must be at least 1. Defaults to 1.
56
58
  #
59
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
60
+ #
57
61
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
58
62
  #
59
63
  # @param type [Symbol, ContextDev::Models::IndustryRetrieveSicParams::Type] Which SIC dataset to classify against. `original_sic` uses the 1987 Standard Ind