Skip to content

Commit d48939f

Browse files
author
stlc-bot
committed
docs(openapi): unify regex wording and shorten sourcePreference descriptions (#2051)
Stainless-Generated-From: e48b99a5d546868816f315c7d33a33477517eb6f
1 parent 7617fc9 commit d48939f

13 files changed

Lines changed: 167 additions & 319 deletions

‎Gemfile.lock‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GIT
1111
PATH
1212
remote: .
1313
specs:
14-
context.dev (2.35.0)
14+
context.dev (2.36.0)
1515
cgi
1616
connection_pool
1717

‎lib/context_dev/models/batch_submit_params.rb‎

Lines changed: 33 additions & 59 deletions
Large diffs are not rendered by default.

‎lib/context_dev/models/crawl_controls.rb‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module ContextDev
44
module Models
55
class CrawlControls < ContextDev::Internal::Type::BaseModel
66
# @!attribute exclude_url_pattern
7-
# RE2 pattern URLs must not match to be crawled. Null when the crawl set none.
7+
# Regex pattern URLs must not match to be crawled. Null when the crawl set none.
88
#
99
# @return [String, nil]
1010
required :exclude_url_pattern, String, nil?: true
@@ -16,9 +16,7 @@ class CrawlControls < ContextDev::Internal::Type::BaseModel
1616
required :follow_subdomains, ContextDev::Internal::Type::Boolean
1717

1818
# @!attribute languages
19-
# Languages whose pages were followed: `same_as_start_url` or a list of language
20-
# codes. Null when every language was followed, which is always the case for a
21-
# sitemap crawl.
19+
# Languages whose pages were followed; null when all languages were.
2220
#
2321
# @return [Symbol, Array<Symbol, ContextDev::Models::CrawlControls::Languages::UnionMember1>, ContextDev::Models::CrawlControls::Languages, nil]
2422
required :languages, union: -> { ContextDev::CrawlControls::Languages }, nil?: true
@@ -44,7 +42,7 @@ class CrawlControls < ContextDev::Internal::Type::BaseModel
4442
required :source, union: -> { ContextDev::CrawlControls::Source }
4543

4644
# @!attribute url_pattern
47-
# RE2 pattern URLs had to match to be crawled. Null when the crawl set none.
45+
# Regex pattern URLs had to match to be crawled. Null when the crawl set none.
4846
#
4947
# @return [String, nil]
5048
required :url_pattern, String, nil?: true
@@ -55,23 +53,21 @@ class CrawlControls < ContextDev::Internal::Type::BaseModel
5553
#
5654
# Crawl settings as submitted.
5755
#
58-
# @param exclude_url_pattern [String, nil] RE2 pattern URLs must not match to be crawled. Null when the crawl set none.
56+
# @param exclude_url_pattern [String, nil] Regex pattern URLs must not match to be crawled. Null when the crawl set none.
5957
#
6058
# @param follow_subdomains [Boolean] Whether links to subdomains were followed. Always false for a sitemap crawl.
6159
#
62-
# @param languages [Symbol, Array<Symbol, ContextDev::Models::CrawlControls::Languages::UnionMember1>, ContextDev::Models::CrawlControls::Languages, nil] Languages whose pages were followed: `same_as_start_url` or a list of language c
60+
# @param languages [Symbol, Array<Symbol, ContextDev::Models::CrawlControls::Languages::UnionMember1>, ContextDev::Models::CrawlControls::Languages, nil] Languages whose pages were followed; null when all languages were.
6361
#
6462
# @param max_depth [Integer, nil] Link depth limit. Always 0 for a sitemap crawl, which never follows links off it
6563
#
6664
# @param max_pages [Integer] The `maxUrls` submitted with the crawl. A sitemap crawl scrapes only the URLs it
6765
#
6866
# @param source [ContextDev::Models::CrawlControls::Source::StartURL, ContextDev::Models::CrawlControls::Source::Sitemap] Where the crawl started.
6967
#
70-
# @param url_pattern [String, nil] RE2 pattern URLs had to match to be crawled. Null when the crawl set none.
68+
# @param url_pattern [String, nil] Regex pattern URLs had to match to be crawled. Null when the crawl set none.
7169

72-
# Languages whose pages were followed: `same_as_start_url` or a list of language
73-
# codes. Null when every language was followed, which is always the case for a
74-
# sitemap crawl.
70+
# Languages whose pages were followed; null when all languages were.
7571
#
7672
# @see ContextDev::Models::CrawlControls#languages
7773
module Languages

‎lib/context_dev/models/web_map_urls_params.rb‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class WebMapURLsParams < ContextDev::Internal::Type::BaseModel
1414
required :domain, String
1515

1616
# @!attribute exclude_url_regex
17-
# Optional RE2-compatible regex pattern. URLs matching this pattern are not
18-
# returned, even when they match urlRegex.
17+
# Regex pattern. URLs matching this pattern are not returned, even when they match
18+
# urlRegex.
1919
#
2020
# @return [String, nil]
2121
optional :exclude_url_regex, String
@@ -64,8 +64,8 @@ class WebMapURLsParams < ContextDev::Internal::Type::BaseModel
6464
optional :timeout_opts, -> { ContextDev::WebMapURLsParams::TimeoutOpts }
6565

6666
# @!attribute url_regex
67-
# Optional RE2-compatible regex pattern. Only URLs matching this pattern are
68-
# returned and counted against maxLinks.
67+
# Regex pattern. Only URLs matching this pattern are returned and counted against
68+
# maxLinks.
6969
#
7070
# @return [String, nil]
7171
optional :url_regex, String
@@ -83,7 +83,7 @@ class WebMapURLsParams < ContextDev::Internal::Type::BaseModel
8383
#
8484
# @param domain [String] Domain to map, e.g. `stripe.com`.
8585
#
86-
# @param exclude_url_regex [String] Optional RE2-compatible regex pattern. URLs matching this pattern are not return
86+
# @param exclude_url_regex [String] Regex pattern. URLs matching this pattern are not returned, even when they match
8787
#
8888
# @param headers [Hash{Symbol=>String}] HTTP headers for the target origin. Non-empty headers bypass caching.
8989
#
@@ -99,7 +99,7 @@ class WebMapURLsParams < ContextDev::Internal::Type::BaseModel
9999
#
100100
# @param timeout_opts [ContextDev::Models::WebMapURLsParams::TimeoutOpts] Request deadline and what to return when it passes.
101101
#
102-
# @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur
102+
# @param url_regex [String] Regex pattern. Only URLs matching this pattern are returned and counted against
103103
#
104104
# @param zdr [Symbol, ContextDev::Models::WebMapURLsParams::Zdr] `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless you
105105
#

‎lib/context_dev/models/web_scrape_params.rb‎

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -302,38 +302,28 @@ class JsonParams < ContextDev::Internal::Type::BaseModel
302302

303303
class MarkdownParams < ContextDev::Internal::Type::BaseModel
304304
# @!attribute include_images
305-
# Include images in the Markdown using image syntax with URLs and alt text. Only
306-
# applies to `html-conversion` extractions.
305+
# Include images in the Markdown (`html-conversion` only).
307306
#
308307
# @return [Boolean, nil]
309308
optional :include_images, ContextDev::Internal::Type::Boolean, api_name: :includeImages
310309

311310
# @!attribute include_links
312-
# Keep link URLs in the Markdown. Set false to return link text without URLs. Only
313-
# applies to `html-conversion` extractions.
311+
# Keep link URLs in the Markdown (`html-conversion` only).
314312
#
315313
# @return [Boolean, nil]
316314
optional :include_links, ContextDev::Internal::Type::Boolean, api_name: :includeLinks
317315

318316
# @!attribute inline_images
319-
# How base64 images appear: `placeholder` (default) or `preserve`. Requires
320-
# `includeImages`. Only applies to `html-conversion` extractions.
317+
# How base64 images appear when `includeImages` is set (`html-conversion` only).
321318
#
322319
# @return [Symbol, ContextDev::Models::WebScrapeParams::MarkdownParams::InlineImages, nil]
323320
optional :inline_images,
324321
enum: -> { ContextDev::WebScrapeParams::MarkdownParams::InlineImages },
325322
api_name: :inlineImages
326323

327324
# @!attribute source_preference
328-
# Where the Markdown should come from, in order of preference; the first usable
329-
# source wins. `html-conversion` converts the page HTML, and counts as unusable
330-
# when the conversion has almost no content (under 200 characters).
331-
# `markdown-direct` uses the official Markdown version the page publishes through,
332-
# returned as the site serves it. Defaults to
333-
# `["html-conversion", "markdown-direct"]`. With only `markdown-direct`, a page
334-
# that publishes no Markdown fails with `NO_PUBLISHED_MARKDOWN` and is not billed.
335-
# Requests with include or exclude selectors never use `markdown-direct`, so they
336-
# must include `html-conversion`.
325+
# Markdown sources in order of preference: `html-conversion` converts the page
326+
# HTML, `markdown-direct` uses Markdown the site publishes.
337327
#
338328
# @return [Array<Symbol, ContextDev::Models::WebScrapeParams::MarkdownParams::SourcePreference>, nil]
339329
optional :source_preference,
@@ -348,16 +338,15 @@ class MarkdownParams < ContextDev::Internal::Type::BaseModel
348338
#
349339
# Markdown options. Requires `formats.markdown`.
350340
#
351-
# @param include_images [Boolean] Include images in the Markdown using image syntax with URLs and alt text. Only a
341+
# @param include_images [Boolean] Include images in the Markdown (`html-conversion` only).
352342
#
353-
# @param include_links [Boolean] Keep link URLs in the Markdown. Set false to return link text without URLs. Only
343+
# @param include_links [Boolean] Keep link URLs in the Markdown (`html-conversion` only).
354344
#
355-
# @param inline_images [Symbol, ContextDev::Models::WebScrapeParams::MarkdownParams::InlineImages] How base64 images appear: `placeholder` (default) or `preserve`. Requires `inclu
345+
# @param inline_images [Symbol, ContextDev::Models::WebScrapeParams::MarkdownParams::InlineImages] How base64 images appear when `includeImages` is set (`html-conversion` only).
356346
#
357-
# @param source_preference [Array<Symbol, ContextDev::Models::WebScrapeParams::MarkdownParams::SourcePreference>] Where the Markdown should come from, in order of preference; the first usable so
347+
# @param source_preference [Array<Symbol, ContextDev::Models::WebScrapeParams::MarkdownParams::SourcePreference>] Markdown sources in order of preference: `html-conversion` converts the page HTM
358348

359-
# How base64 images appear: `placeholder` (default) or `preserve`. Requires
360-
# `includeImages`. Only applies to `html-conversion` extractions.
349+
# How base64 images appear when `includeImages` is set (`html-conversion` only).
361350
#
362351
# @see ContextDev::Models::WebScrapeParams::MarkdownParams#inline_images
363352
module InlineImages

‎lib/context_dev/models/web_web_crawl_md_params.rb‎

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel
2929
nil?: true
3030

3131
# @!attribute exclude_url_regex
32-
# RE2 regex pattern. URLs matching this pattern are never followed or scraped,
33-
# even when they match urlRegex. The starting URL is always scraped.
32+
# Regex pattern. URLs matching this pattern are never followed or scraped, even
33+
# when they match urlRegex. The starting URL is always scraped.
3434
#
3535
# @return [String, nil]
3636
optional :exclude_url_regex, String, api_name: :excludeUrlRegex
@@ -51,15 +51,13 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel
5151
optional :include_frames, ContextDev::Internal::Type::Boolean, api_name: :includeFrames
5252

5353
# @!attribute include_images
54-
# Include image references in the Markdown output Only applies to
55-
# `html-conversion` extractions.
54+
# Include image references in the Markdown output (`html-conversion` only).
5655
#
5756
# @return [Boolean, nil]
5857
optional :include_images, ContextDev::Internal::Type::Boolean, api_name: :includeImages
5958

6059
# @!attribute include_links
61-
# Preserve hyperlinks in the Markdown output Only applies to `html-conversion`
62-
# extractions.
60+
# Preserve hyperlinks in the Markdown output (`html-conversion` only).
6361
#
6462
# @return [Boolean, nil]
6563
optional :include_links, ContextDev::Internal::Type::Boolean, api_name: :includeLinks
@@ -105,22 +103,15 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel
105103
optional :settle_animations, ContextDev::Internal::Type::Boolean, api_name: :settleAnimations
106104

107105
# @!attribute shorten_base64_images
108-
# Truncate base64-encoded image data in the Markdown output Only applies to
109-
# `html-conversion` extractions.
106+
# Truncate base64-encoded image data in the Markdown output (`html-conversion`
107+
# only).
110108
#
111109
# @return [Boolean, nil]
112110
optional :shorten_base64_images, ContextDev::Internal::Type::Boolean, api_name: :shortenBase64Images
113111

114112
# @!attribute source_preference
115-
# Where the Markdown should come from, in order of preference; the first usable
116-
# source wins. `html-conversion` converts the page HTML, and counts as unusable
117-
# when the conversion has almost no content (under 200 characters).
118-
# `markdown-direct` uses the official Markdown version the page publishes through,
119-
# returned as the site serves it. Defaults to
120-
# `["html-conversion", "markdown-direct"]`. With only `markdown-direct`, a page
121-
# that publishes no Markdown fails with `NO_PUBLISHED_MARKDOWN` and is not billed.
122-
# Requests with include or exclude selectors never use `markdown-direct`, so they
123-
# must include `html-conversion`.
113+
# Markdown sources in order of preference: `html-conversion` converts the page
114+
# HTML, `markdown-direct` uses Markdown the site publishes.
124115
#
125116
# @return [Array<Symbol, ContextDev::Models::WebWebCrawlMdParams::SourcePreference>, nil]
126117
optional :source_preference,
@@ -187,15 +178,15 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel
187178
#
188179
# @param exclude_selectors [Array<String>, nil] Remove matching elements after inclusions. Exclusions take precedence.
189180
#
190-
# @param exclude_url_regex [String] RE2 regex pattern. URLs matching this pattern are never followed or scraped, eve
181+
# @param exclude_url_regex [String] Regex pattern. URLs matching this pattern are never followed or scraped, even wh
191182
#
192183
# @param follow_subdomains [Boolean] When true, follow links on subdomains of the starting URL's domain (e.g. docs.ex
193184
#
194185
# @param include_frames [Boolean] When true, the contents of iframes are rendered to Markdown for each crawled pag
195186
#
196-
# @param include_images [Boolean] Include image references in the Markdown output Only applies to `html-conversion
187+
# @param include_images [Boolean] Include image references in the Markdown output (`html-conversion` only).
197188
#
198-
# @param include_links [Boolean] Preserve hyperlinks in the Markdown output Only applies to `html-conversion` ext
189+
# @param include_links [Boolean] Preserve hyperlinks in the Markdown output (`html-conversion` only).
199190
#
200191
# @param include_selectors [Array<String>, nil] Keep matching HTML subtrees before converting each page to Markdown.
201192
#
@@ -209,9 +200,9 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel
209200
#
210201
# @param settle_animations [Boolean] Wait briefly for CSS animations and transitions to settle before reading each pa
211202
#
212-
# @param shorten_base64_images [Boolean] Truncate base64-encoded image data in the Markdown output Only applies to `html-
203+
# @param shorten_base64_images [Boolean] Truncate base64-encoded image data in the Markdown output (`html-conversion` onl
213204
#
214-
# @param source_preference [Array<Symbol, ContextDev::Models::WebWebCrawlMdParams::SourcePreference>] Where the Markdown should come from, in order of preference; the first usable so
205+
# @param source_preference [Array<Symbol, ContextDev::Models::WebWebCrawlMdParams::SourcePreference>] Markdown sources in order of preference: `html-conversion` converts the page HTM
215206
#
216207
# @param stop_after_ms [Integer] Soft crawl deadline in milliseconds. Returns pages collected before the next dea
217208
#

‎lib/context_dev/resources/web.rb‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def extract_styleguide(params = {})
127127
#
128128
# @param domain [String] Domain to map, e.g. `stripe.com`.
129129
#
130-
# @param exclude_url_regex [String] Optional RE2-compatible regex pattern. URLs matching this pattern are not return
130+
# @param exclude_url_regex [String] Regex pattern. URLs matching this pattern are not returned, even when they match
131131
#
132132
# @param headers [Hash{Symbol=>String}] HTTP headers for the target origin. Non-empty headers bypass caching.
133133
#
@@ -143,7 +143,7 @@ def extract_styleguide(params = {})
143143
#
144144
# @param timeout_opts [ContextDev::Models::WebMapURLsParams::TimeoutOpts] Request deadline and what to return when it passes.
145145
#
146-
# @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur
146+
# @param url_regex [String] Regex pattern. Only URLs matching this pattern are returned and counted against
147147
#
148148
# @param zdr [Symbol, ContextDev::Models::WebMapURLsParams::Zdr] `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless you
149149
#
@@ -355,15 +355,15 @@ def search(params)
355355
#
356356
# @param exclude_selectors [Array<String>, nil] Remove matching elements after inclusions. Exclusions take precedence.
357357
#
358-
# @param exclude_url_regex [String] RE2 regex pattern. URLs matching this pattern are never followed or scraped, eve
358+
# @param exclude_url_regex [String] Regex pattern. URLs matching this pattern are never followed or scraped, even wh
359359
#
360360
# @param follow_subdomains [Boolean] When true, follow links on subdomains of the starting URL's domain (e.g. docs.ex
361361
#
362362
# @param include_frames [Boolean] When true, the contents of iframes are rendered to Markdown for each crawled pag
363363
#
364-
# @param include_images [Boolean] Include image references in the Markdown output Only applies to `html-conversion
364+
# @param include_images [Boolean] Include image references in the Markdown output (`html-conversion` only).
365365
#
366-
# @param include_links [Boolean] Preserve hyperlinks in the Markdown output Only applies to `html-conversion` ext
366+
# @param include_links [Boolean] Preserve hyperlinks in the Markdown output (`html-conversion` only).
367367
#
368368
# @param include_selectors [Array<String>, nil] Keep matching HTML subtrees before converting each page to Markdown.
369369
#
@@ -377,9 +377,9 @@ def search(params)
377377
#
378378
# @param settle_animations [Boolean] Wait briefly for CSS animations and transitions to settle before reading each pa
379379
#
380-
# @param shorten_base64_images [Boolean] Truncate base64-encoded image data in the Markdown output Only applies to `html-
380+
# @param shorten_base64_images [Boolean] Truncate base64-encoded image data in the Markdown output (`html-conversion` onl
381381
#
382-
# @param source_preference [Array<Symbol, ContextDev::Models::WebWebCrawlMdParams::SourcePreference>] Where the Markdown should come from, in order of preference; the first usable so
382+
# @param source_preference [Array<Symbol, ContextDev::Models::WebWebCrawlMdParams::SourcePreference>] Markdown sources in order of preference: `html-conversion` converts the page HTM
383383
#
384384
# @param stop_after_ms [Integer] Soft crawl deadline in milliseconds. Returns pages collected before the next dea
385385
#

0 commit comments

Comments
 (0)