context.dev 1.5.0 → 1.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 +15 -0
- data/README.md +1 -1
- data/lib/context_dev/models/web_extract_fonts_response.rb +68 -1
- data/lib/context_dev/models/web_web_crawl_md_params.rb +11 -1
- data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +10 -1
- data/lib/context_dev/resources/web.rb +7 -3
- data/lib/context_dev/version.rb +1 -1
- data/rbi/context_dev/models/web_extract_fonts_response.rbi +154 -3
- data/rbi/context_dev/models/web_web_crawl_md_params.rbi +15 -0
- data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +13 -0
- data/rbi/context_dev/resources/web.rbi +9 -0
- data/sig/context_dev/models/web_extract_fonts_response.rbs +59 -3
- data/sig/context_dev/models/web_web_crawl_md_params.rbs +7 -0
- data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +7 -1
- data/sig/context_dev/resources/web.rbs +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0e9ffccdbada64211d1e7ddc15ce648d6e4ec77637768a30f71d754d9a8ff788
|
|
4
|
+
data.tar.gz: a95c5065d4f22c3a1269026fd93b936086316cb9a1a9e8de5af8e7c6021f0bcc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1bf660423aa6381d2301614c3987aedcf0edf8bec72bd2eca8b1ee88d4190cb5a4f8c8dd453783632ad1ed79da87bddbfadf09341c870947cba5784d08600610
|
|
7
|
+
data.tar.gz: aa6851f96a3b0295cbc4386ea424b6e4f856889aac74bcd21e8ad7fd6735f5822ae5ed68306891ef3779dfdf1b590fcc32ffb8f069bd78599f8eacb4c6b5b882
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.6.0 (2026-04-23)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.5.0...v1.6.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.5.0...v1.6.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([c1543f7](https://github.com/context-dot-dev/context-ruby-sdk/commit/c1543f7513b2d88b0c8ad8e209e62075bd9658bc))
|
|
10
|
+
* **api:** api update ([9c98e20](https://github.com/context-dot-dev/context-ruby-sdk/commit/9c98e20725dcda8466a2274b61be75943d0564d9))
|
|
11
|
+
* **api:** api update ([8ccafd9](https://github.com/context-dot-dev/context-ruby-sdk/commit/8ccafd9625079f40393fe23890958a80d8bdb4e8))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Chores
|
|
15
|
+
|
|
16
|
+
* **internal:** more robust bootstrap script ([57b2d93](https://github.com/context-dot-dev/context-ruby-sdk/commit/57b2d93877e5ceeb388679f239e21c09b087b2a1))
|
|
17
|
+
|
|
3
18
|
## 1.5.0 (2026-04-19)
|
|
4
19
|
|
|
5
20
|
Full Changelog: [v1.4.0...v1.5.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.4.0...v1.5.0)
|
data/README.md
CHANGED
|
@@ -29,7 +29,20 @@ module ContextDev
|
|
|
29
29
|
# @return [String]
|
|
30
30
|
required :status, String
|
|
31
31
|
|
|
32
|
-
# @!
|
|
32
|
+
# @!attribute font_links
|
|
33
|
+
# Font assets keyed by family name as it appears in the fonts array (non-generic
|
|
34
|
+
# names only). Clients match entries in fonts to pick a file URL from files.
|
|
35
|
+
# Omitted when no families resolve to Google or custom @font-face URLs.
|
|
36
|
+
#
|
|
37
|
+
# @return [Hash{Symbol=>ContextDev::Models::WebExtractFontsResponse::FontLink}, nil]
|
|
38
|
+
optional :font_links,
|
|
39
|
+
-> { ContextDev::Internal::Type::HashOf[ContextDev::Models::WebExtractFontsResponse::FontLink] },
|
|
40
|
+
api_name: :fontLinks
|
|
41
|
+
|
|
42
|
+
# @!method initialize(code:, domain:, fonts:, status:, font_links: nil)
|
|
43
|
+
# Some parameter documentations has been truncated, see
|
|
44
|
+
# {ContextDev::Models::WebExtractFontsResponse} for more details.
|
|
45
|
+
#
|
|
33
46
|
# @param code [Integer] HTTP status code, e.g., 200
|
|
34
47
|
#
|
|
35
48
|
# @param domain [String] The normalized domain that was processed
|
|
@@ -37,6 +50,8 @@ module ContextDev
|
|
|
37
50
|
# @param fonts [Array<ContextDev::Models::WebExtractFontsResponse::Font>] Array of font usage information
|
|
38
51
|
#
|
|
39
52
|
# @param status [String] Status of the response, e.g., 'ok'
|
|
53
|
+
#
|
|
54
|
+
# @param font_links [Hash{Symbol=>ContextDev::Models::WebExtractFontsResponse::FontLink}] Font assets keyed by family name as it appears in the fonts array (non-generic n
|
|
40
55
|
|
|
41
56
|
class Font < ContextDev::Internal::Type::BaseModel
|
|
42
57
|
# @!attribute fallbacks
|
|
@@ -96,6 +111,58 @@ module ContextDev
|
|
|
96
111
|
#
|
|
97
112
|
# @param uses [Array<String>] Array of CSS selectors or element types where this font is used
|
|
98
113
|
end
|
|
114
|
+
|
|
115
|
+
class FontLink < ContextDev::Internal::Type::BaseModel
|
|
116
|
+
# @!attribute files
|
|
117
|
+
# Upright font files keyed by weight string (e.g. "400" for regular, "500",
|
|
118
|
+
# "700"). Values are absolute URLs.
|
|
119
|
+
#
|
|
120
|
+
# @return [Hash{Symbol=>String}]
|
|
121
|
+
required :files, ContextDev::Internal::Type::HashOf[String]
|
|
122
|
+
|
|
123
|
+
# @!attribute type
|
|
124
|
+
#
|
|
125
|
+
# @return [Symbol, ContextDev::Models::WebExtractFontsResponse::FontLink::Type]
|
|
126
|
+
required :type, enum: -> { ContextDev::Models::WebExtractFontsResponse::FontLink::Type }
|
|
127
|
+
|
|
128
|
+
# @!attribute category
|
|
129
|
+
# Google Fonts category when type is google (e.g. sans-serif, serif, monospace,
|
|
130
|
+
# display, handwriting). Omitted for custom fonts when unknown.
|
|
131
|
+
#
|
|
132
|
+
# @return [String, nil]
|
|
133
|
+
optional :category, String
|
|
134
|
+
|
|
135
|
+
# @!attribute display_name
|
|
136
|
+
# Present when type is custom: human-readable name derived from the fontLinks key
|
|
137
|
+
# (strip build/hash suffixes, split camelCase / PascalCase, normalize separators).
|
|
138
|
+
# Google entries omit this.
|
|
139
|
+
#
|
|
140
|
+
# @return [String, nil]
|
|
141
|
+
optional :display_name, String, api_name: :displayName
|
|
142
|
+
|
|
143
|
+
# @!method initialize(files:, type:, category: nil, display_name: nil)
|
|
144
|
+
# Some parameter documentations has been truncated, see
|
|
145
|
+
# {ContextDev::Models::WebExtractFontsResponse::FontLink} for more details.
|
|
146
|
+
#
|
|
147
|
+
# @param files [Hash{Symbol=>String}] Upright font files keyed by weight string (e.g. "400" for regular, "500", "700")
|
|
148
|
+
#
|
|
149
|
+
# @param type [Symbol, ContextDev::Models::WebExtractFontsResponse::FontLink::Type]
|
|
150
|
+
#
|
|
151
|
+
# @param category [String] Google Fonts category when type is google (e.g. sans-serif, serif, monospace, di
|
|
152
|
+
#
|
|
153
|
+
# @param display_name [String] Present when type is custom: human-readable name derived from the fontLinks key
|
|
154
|
+
|
|
155
|
+
# @see ContextDev::Models::WebExtractFontsResponse::FontLink#type
|
|
156
|
+
module Type
|
|
157
|
+
extend ContextDev::Internal::Type::Enum
|
|
158
|
+
|
|
159
|
+
GOOGLE = :google
|
|
160
|
+
CUSTOM = :custom
|
|
161
|
+
|
|
162
|
+
# @!method self.values
|
|
163
|
+
# @return [Array<Symbol>]
|
|
164
|
+
end
|
|
165
|
+
end
|
|
99
166
|
end
|
|
100
167
|
end
|
|
101
168
|
end
|
|
@@ -33,6 +33,14 @@ module ContextDev
|
|
|
33
33
|
# @return [Boolean, nil]
|
|
34
34
|
optional :include_links, ContextDev::Internal::Type::Boolean, api_name: :includeLinks
|
|
35
35
|
|
|
36
|
+
# @!attribute max_age_ms
|
|
37
|
+
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
38
|
+
# younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
|
|
39
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
40
|
+
#
|
|
41
|
+
# @return [Integer, nil]
|
|
42
|
+
optional :max_age_ms, Integer, api_name: :maxAgeMs
|
|
43
|
+
|
|
36
44
|
# @!attribute max_depth
|
|
37
45
|
# Maximum link depth from the starting URL (0 = only the starting page)
|
|
38
46
|
#
|
|
@@ -64,7 +72,7 @@ module ContextDev
|
|
|
64
72
|
# @return [Boolean, nil]
|
|
65
73
|
optional :use_main_content_only, ContextDev::Internal::Type::Boolean, api_name: :useMainContentOnly
|
|
66
74
|
|
|
67
|
-
# @!method initialize(url:, follow_subdomains: nil, include_images: nil, include_links: nil, max_depth: nil, max_pages: nil, shorten_base64_images: nil, url_regex: nil, use_main_content_only: nil, request_options: {})
|
|
75
|
+
# @!method initialize(url:, follow_subdomains: nil, include_images: nil, include_links: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, shorten_base64_images: nil, url_regex: nil, use_main_content_only: nil, request_options: {})
|
|
68
76
|
# Some parameter documentations has been truncated, see
|
|
69
77
|
# {ContextDev::Models::WebWebCrawlMdParams} for more details.
|
|
70
78
|
#
|
|
@@ -76,6 +84,8 @@ module ContextDev
|
|
|
76
84
|
#
|
|
77
85
|
# @param include_links [Boolean] Preserve hyperlinks in the Markdown output
|
|
78
86
|
#
|
|
87
|
+
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
|
|
88
|
+
#
|
|
79
89
|
# @param max_depth [Integer] Maximum link depth from the starting URL (0 = only the starting page)
|
|
80
90
|
#
|
|
81
91
|
# @param max_pages [Integer] Maximum number of pages to crawl. Hard cap: 500.
|
|
@@ -20,7 +20,14 @@ module ContextDev
|
|
|
20
20
|
# @return [Integer, nil]
|
|
21
21
|
optional :max_links, Integer
|
|
22
22
|
|
|
23
|
-
# @!
|
|
23
|
+
# @!attribute url_regex
|
|
24
|
+
# Optional RE2-compatible regex pattern. Only URLs matching this pattern are
|
|
25
|
+
# returned and counted against maxLinks.
|
|
26
|
+
#
|
|
27
|
+
# @return [String, nil]
|
|
28
|
+
optional :url_regex, String
|
|
29
|
+
|
|
30
|
+
# @!method initialize(domain:, max_links: nil, url_regex: nil, request_options: {})
|
|
24
31
|
# Some parameter documentations has been truncated, see
|
|
25
32
|
# {ContextDev::Models::WebWebScrapeSitemapParams} for more details.
|
|
26
33
|
#
|
|
@@ -28,6 +35,8 @@ module ContextDev
|
|
|
28
35
|
#
|
|
29
36
|
# @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi
|
|
30
37
|
#
|
|
38
|
+
# @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur
|
|
39
|
+
#
|
|
31
40
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
|
|
32
41
|
end
|
|
33
42
|
end
|
|
@@ -105,7 +105,7 @@ module ContextDev
|
|
|
105
105
|
# Performs a crawl starting from a given URL, extracts page content as Markdown,
|
|
106
106
|
# and returns results for all crawled pages.
|
|
107
107
|
#
|
|
108
|
-
# @overload web_crawl_md(url:, follow_subdomains: nil, include_images: nil, include_links: nil, max_depth: nil, max_pages: nil, shorten_base64_images: nil, url_regex: nil, use_main_content_only: nil, request_options: {})
|
|
108
|
+
# @overload web_crawl_md(url:, follow_subdomains: nil, include_images: nil, include_links: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, shorten_base64_images: nil, url_regex: nil, use_main_content_only: nil, request_options: {})
|
|
109
109
|
#
|
|
110
110
|
# @param url [String] The starting URL for the crawl (must include http:// or https:// protocol)
|
|
111
111
|
#
|
|
@@ -115,6 +115,8 @@ module ContextDev
|
|
|
115
115
|
#
|
|
116
116
|
# @param include_links [Boolean] Preserve hyperlinks in the Markdown output
|
|
117
117
|
#
|
|
118
|
+
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
|
|
119
|
+
#
|
|
118
120
|
# @param max_depth [Integer] Maximum link depth from the starting URL (0 = only the starting page)
|
|
119
121
|
#
|
|
120
122
|
# @param max_pages [Integer] Maximum number of pages to crawl. Hard cap: 500.
|
|
@@ -241,12 +243,14 @@ module ContextDev
|
|
|
241
243
|
#
|
|
242
244
|
# Crawl an entire website's sitemap and return all discovered page URLs.
|
|
243
245
|
#
|
|
244
|
-
# @overload web_scrape_sitemap(domain:, max_links: nil, request_options: {})
|
|
246
|
+
# @overload web_scrape_sitemap(domain:, max_links: nil, url_regex: nil, request_options: {})
|
|
245
247
|
#
|
|
246
248
|
# @param domain [String] Domain to build a sitemap for
|
|
247
249
|
#
|
|
248
250
|
# @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi
|
|
249
251
|
#
|
|
252
|
+
# @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur
|
|
253
|
+
#
|
|
250
254
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
251
255
|
#
|
|
252
256
|
# @return [ContextDev::Models::WebWebScrapeSitemapResponse]
|
|
@@ -258,7 +262,7 @@ module ContextDev
|
|
|
258
262
|
@client.request(
|
|
259
263
|
method: :get,
|
|
260
264
|
path: "web/scrape/sitemap",
|
|
261
|
-
query: query.transform_keys(max_links: "maxLinks"),
|
|
265
|
+
query: query.transform_keys(max_links: "maxLinks", url_regex: "urlRegex"),
|
|
262
266
|
model: ContextDev::Models::WebWebScrapeSitemapResponse,
|
|
263
267
|
options: options
|
|
264
268
|
)
|
data/lib/context_dev/version.rb
CHANGED
|
@@ -29,13 +29,44 @@ module ContextDev
|
|
|
29
29
|
sig { returns(String) }
|
|
30
30
|
attr_accessor :status
|
|
31
31
|
|
|
32
|
+
# Font assets keyed by family name as it appears in the fonts array (non-generic
|
|
33
|
+
# names only). Clients match entries in fonts to pick a file URL from files.
|
|
34
|
+
# Omitted when no families resolve to Google or custom @font-face URLs.
|
|
35
|
+
sig do
|
|
36
|
+
returns(
|
|
37
|
+
T.nilable(
|
|
38
|
+
T::Hash[
|
|
39
|
+
Symbol,
|
|
40
|
+
ContextDev::Models::WebExtractFontsResponse::FontLink
|
|
41
|
+
]
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
attr_reader :font_links
|
|
46
|
+
|
|
47
|
+
sig do
|
|
48
|
+
params(
|
|
49
|
+
font_links:
|
|
50
|
+
T::Hash[
|
|
51
|
+
Symbol,
|
|
52
|
+
ContextDev::Models::WebExtractFontsResponse::FontLink::OrHash
|
|
53
|
+
]
|
|
54
|
+
).void
|
|
55
|
+
end
|
|
56
|
+
attr_writer :font_links
|
|
57
|
+
|
|
32
58
|
sig do
|
|
33
59
|
params(
|
|
34
60
|
code: Integer,
|
|
35
61
|
domain: String,
|
|
36
62
|
fonts:
|
|
37
63
|
T::Array[ContextDev::Models::WebExtractFontsResponse::Font::OrHash],
|
|
38
|
-
status: String
|
|
64
|
+
status: String,
|
|
65
|
+
font_links:
|
|
66
|
+
T::Hash[
|
|
67
|
+
Symbol,
|
|
68
|
+
ContextDev::Models::WebExtractFontsResponse::FontLink::OrHash
|
|
69
|
+
]
|
|
39
70
|
).returns(T.attached_class)
|
|
40
71
|
end
|
|
41
72
|
def self.new(
|
|
@@ -46,7 +77,11 @@ module ContextDev
|
|
|
46
77
|
# Array of font usage information
|
|
47
78
|
fonts:,
|
|
48
79
|
# Status of the response, e.g., 'ok'
|
|
49
|
-
status
|
|
80
|
+
status:,
|
|
81
|
+
# Font assets keyed by family name as it appears in the fonts array (non-generic
|
|
82
|
+
# names only). Clients match entries in fonts to pick a file URL from files.
|
|
83
|
+
# Omitted when no families resolve to Google or custom @font-face URLs.
|
|
84
|
+
font_links: nil
|
|
50
85
|
)
|
|
51
86
|
end
|
|
52
87
|
|
|
@@ -56,7 +91,12 @@ module ContextDev
|
|
|
56
91
|
code: Integer,
|
|
57
92
|
domain: String,
|
|
58
93
|
fonts: T::Array[ContextDev::Models::WebExtractFontsResponse::Font],
|
|
59
|
-
status: String
|
|
94
|
+
status: String,
|
|
95
|
+
font_links:
|
|
96
|
+
T::Hash[
|
|
97
|
+
Symbol,
|
|
98
|
+
ContextDev::Models::WebExtractFontsResponse::FontLink
|
|
99
|
+
]
|
|
60
100
|
}
|
|
61
101
|
)
|
|
62
102
|
end
|
|
@@ -145,6 +185,117 @@ module ContextDev
|
|
|
145
185
|
def to_hash
|
|
146
186
|
end
|
|
147
187
|
end
|
|
188
|
+
|
|
189
|
+
class FontLink < ContextDev::Internal::Type::BaseModel
|
|
190
|
+
OrHash =
|
|
191
|
+
T.type_alias do
|
|
192
|
+
T.any(
|
|
193
|
+
ContextDev::Models::WebExtractFontsResponse::FontLink,
|
|
194
|
+
ContextDev::Internal::AnyHash
|
|
195
|
+
)
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Upright font files keyed by weight string (e.g. "400" for regular, "500",
|
|
199
|
+
# "700"). Values are absolute URLs.
|
|
200
|
+
sig { returns(T::Hash[Symbol, String]) }
|
|
201
|
+
attr_accessor :files
|
|
202
|
+
|
|
203
|
+
sig do
|
|
204
|
+
returns(
|
|
205
|
+
ContextDev::Models::WebExtractFontsResponse::FontLink::Type::TaggedSymbol
|
|
206
|
+
)
|
|
207
|
+
end
|
|
208
|
+
attr_accessor :type
|
|
209
|
+
|
|
210
|
+
# Google Fonts category when type is google (e.g. sans-serif, serif, monospace,
|
|
211
|
+
# display, handwriting). Omitted for custom fonts when unknown.
|
|
212
|
+
sig { returns(T.nilable(String)) }
|
|
213
|
+
attr_reader :category
|
|
214
|
+
|
|
215
|
+
sig { params(category: String).void }
|
|
216
|
+
attr_writer :category
|
|
217
|
+
|
|
218
|
+
# Present when type is custom: human-readable name derived from the fontLinks key
|
|
219
|
+
# (strip build/hash suffixes, split camelCase / PascalCase, normalize separators).
|
|
220
|
+
# Google entries omit this.
|
|
221
|
+
sig { returns(T.nilable(String)) }
|
|
222
|
+
attr_reader :display_name
|
|
223
|
+
|
|
224
|
+
sig { params(display_name: String).void }
|
|
225
|
+
attr_writer :display_name
|
|
226
|
+
|
|
227
|
+
sig do
|
|
228
|
+
params(
|
|
229
|
+
files: T::Hash[Symbol, String],
|
|
230
|
+
type:
|
|
231
|
+
ContextDev::Models::WebExtractFontsResponse::FontLink::Type::OrSymbol,
|
|
232
|
+
category: String,
|
|
233
|
+
display_name: String
|
|
234
|
+
).returns(T.attached_class)
|
|
235
|
+
end
|
|
236
|
+
def self.new(
|
|
237
|
+
# Upright font files keyed by weight string (e.g. "400" for regular, "500",
|
|
238
|
+
# "700"). Values are absolute URLs.
|
|
239
|
+
files:,
|
|
240
|
+
type:,
|
|
241
|
+
# Google Fonts category when type is google (e.g. sans-serif, serif, monospace,
|
|
242
|
+
# display, handwriting). Omitted for custom fonts when unknown.
|
|
243
|
+
category: nil,
|
|
244
|
+
# Present when type is custom: human-readable name derived from the fontLinks key
|
|
245
|
+
# (strip build/hash suffixes, split camelCase / PascalCase, normalize separators).
|
|
246
|
+
# Google entries omit this.
|
|
247
|
+
display_name: nil
|
|
248
|
+
)
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
sig do
|
|
252
|
+
override.returns(
|
|
253
|
+
{
|
|
254
|
+
files: T::Hash[Symbol, String],
|
|
255
|
+
type:
|
|
256
|
+
ContextDev::Models::WebExtractFontsResponse::FontLink::Type::TaggedSymbol,
|
|
257
|
+
category: String,
|
|
258
|
+
display_name: String
|
|
259
|
+
}
|
|
260
|
+
)
|
|
261
|
+
end
|
|
262
|
+
def to_hash
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
module Type
|
|
266
|
+
extend ContextDev::Internal::Type::Enum
|
|
267
|
+
|
|
268
|
+
TaggedSymbol =
|
|
269
|
+
T.type_alias do
|
|
270
|
+
T.all(
|
|
271
|
+
Symbol,
|
|
272
|
+
ContextDev::Models::WebExtractFontsResponse::FontLink::Type
|
|
273
|
+
)
|
|
274
|
+
end
|
|
275
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
276
|
+
|
|
277
|
+
GOOGLE =
|
|
278
|
+
T.let(
|
|
279
|
+
:google,
|
|
280
|
+
ContextDev::Models::WebExtractFontsResponse::FontLink::Type::TaggedSymbol
|
|
281
|
+
)
|
|
282
|
+
CUSTOM =
|
|
283
|
+
T.let(
|
|
284
|
+
:custom,
|
|
285
|
+
ContextDev::Models::WebExtractFontsResponse::FontLink::Type::TaggedSymbol
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
sig do
|
|
289
|
+
override.returns(
|
|
290
|
+
T::Array[
|
|
291
|
+
ContextDev::Models::WebExtractFontsResponse::FontLink::Type::TaggedSymbol
|
|
292
|
+
]
|
|
293
|
+
)
|
|
294
|
+
end
|
|
295
|
+
def self.values
|
|
296
|
+
end
|
|
297
|
+
end
|
|
298
|
+
end
|
|
148
299
|
end
|
|
149
300
|
end
|
|
150
301
|
end
|
|
@@ -38,6 +38,15 @@ module ContextDev
|
|
|
38
38
|
sig { params(include_links: T::Boolean).void }
|
|
39
39
|
attr_writer :include_links
|
|
40
40
|
|
|
41
|
+
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
42
|
+
# younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
|
|
43
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
44
|
+
sig { returns(T.nilable(Integer)) }
|
|
45
|
+
attr_reader :max_age_ms
|
|
46
|
+
|
|
47
|
+
sig { params(max_age_ms: Integer).void }
|
|
48
|
+
attr_writer :max_age_ms
|
|
49
|
+
|
|
41
50
|
# Maximum link depth from the starting URL (0 = only the starting page)
|
|
42
51
|
sig { returns(T.nilable(Integer)) }
|
|
43
52
|
attr_reader :max_depth
|
|
@@ -80,6 +89,7 @@ module ContextDev
|
|
|
80
89
|
follow_subdomains: T::Boolean,
|
|
81
90
|
include_images: T::Boolean,
|
|
82
91
|
include_links: T::Boolean,
|
|
92
|
+
max_age_ms: Integer,
|
|
83
93
|
max_depth: Integer,
|
|
84
94
|
max_pages: Integer,
|
|
85
95
|
shorten_base64_images: T::Boolean,
|
|
@@ -99,6 +109,10 @@ module ContextDev
|
|
|
99
109
|
include_images: nil,
|
|
100
110
|
# Preserve hyperlinks in the Markdown output
|
|
101
111
|
include_links: nil,
|
|
112
|
+
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
113
|
+
# younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
|
|
114
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
115
|
+
max_age_ms: nil,
|
|
102
116
|
# Maximum link depth from the starting URL (0 = only the starting page)
|
|
103
117
|
max_depth: nil,
|
|
104
118
|
# Maximum number of pages to crawl. Hard cap: 500.
|
|
@@ -121,6 +135,7 @@ module ContextDev
|
|
|
121
135
|
follow_subdomains: T::Boolean,
|
|
122
136
|
include_images: T::Boolean,
|
|
123
137
|
include_links: T::Boolean,
|
|
138
|
+
max_age_ms: Integer,
|
|
124
139
|
max_depth: Integer,
|
|
125
140
|
max_pages: Integer,
|
|
126
141
|
shorten_base64_images: T::Boolean,
|
|
@@ -26,10 +26,19 @@ module ContextDev
|
|
|
26
26
|
sig { params(max_links: Integer).void }
|
|
27
27
|
attr_writer :max_links
|
|
28
28
|
|
|
29
|
+
# Optional RE2-compatible regex pattern. Only URLs matching this pattern are
|
|
30
|
+
# returned and counted against maxLinks.
|
|
31
|
+
sig { returns(T.nilable(String)) }
|
|
32
|
+
attr_reader :url_regex
|
|
33
|
+
|
|
34
|
+
sig { params(url_regex: String).void }
|
|
35
|
+
attr_writer :url_regex
|
|
36
|
+
|
|
29
37
|
sig do
|
|
30
38
|
params(
|
|
31
39
|
domain: String,
|
|
32
40
|
max_links: Integer,
|
|
41
|
+
url_regex: String,
|
|
33
42
|
request_options: ContextDev::RequestOptions::OrHash
|
|
34
43
|
).returns(T.attached_class)
|
|
35
44
|
end
|
|
@@ -39,6 +48,9 @@ module ContextDev
|
|
|
39
48
|
# Maximum number of links to return from the sitemap crawl. Defaults to 10,000.
|
|
40
49
|
# Minimum is 1, maximum is 100,000.
|
|
41
50
|
max_links: nil,
|
|
51
|
+
# Optional RE2-compatible regex pattern. Only URLs matching this pattern are
|
|
52
|
+
# returned and counted against maxLinks.
|
|
53
|
+
url_regex: nil,
|
|
42
54
|
request_options: {}
|
|
43
55
|
)
|
|
44
56
|
end
|
|
@@ -48,6 +60,7 @@ module ContextDev
|
|
|
48
60
|
{
|
|
49
61
|
domain: String,
|
|
50
62
|
max_links: Integer,
|
|
63
|
+
url_regex: String,
|
|
51
64
|
request_options: ContextDev::RequestOptions
|
|
52
65
|
}
|
|
53
66
|
)
|
|
@@ -105,6 +105,7 @@ module ContextDev
|
|
|
105
105
|
follow_subdomains: T::Boolean,
|
|
106
106
|
include_images: T::Boolean,
|
|
107
107
|
include_links: T::Boolean,
|
|
108
|
+
max_age_ms: Integer,
|
|
108
109
|
max_depth: Integer,
|
|
109
110
|
max_pages: Integer,
|
|
110
111
|
shorten_base64_images: T::Boolean,
|
|
@@ -124,6 +125,10 @@ module ContextDev
|
|
|
124
125
|
include_images: nil,
|
|
125
126
|
# Preserve hyperlinks in the Markdown output
|
|
126
127
|
include_links: nil,
|
|
128
|
+
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
129
|
+
# younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
|
|
130
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
131
|
+
max_age_ms: nil,
|
|
127
132
|
# Maximum link depth from the starting URL (0 = only the starting page)
|
|
128
133
|
max_depth: nil,
|
|
129
134
|
# Maximum number of pages to crawl. Hard cap: 500.
|
|
@@ -212,6 +217,7 @@ module ContextDev
|
|
|
212
217
|
params(
|
|
213
218
|
domain: String,
|
|
214
219
|
max_links: Integer,
|
|
220
|
+
url_regex: String,
|
|
215
221
|
request_options: ContextDev::RequestOptions::OrHash
|
|
216
222
|
).returns(ContextDev::Models::WebWebScrapeSitemapResponse)
|
|
217
223
|
end
|
|
@@ -221,6 +227,9 @@ module ContextDev
|
|
|
221
227
|
# Maximum number of links to return from the sitemap crawl. Defaults to 10,000.
|
|
222
228
|
# Minimum is 1, maximum is 100,000.
|
|
223
229
|
max_links: nil,
|
|
230
|
+
# Optional RE2-compatible regex pattern. Only URLs matching this pattern are
|
|
231
|
+
# returned and counted against maxLinks.
|
|
232
|
+
url_regex: nil,
|
|
224
233
|
request_options: {}
|
|
225
234
|
)
|
|
226
235
|
end
|
|
@@ -5,7 +5,8 @@ module ContextDev
|
|
|
5
5
|
code: Integer,
|
|
6
6
|
domain: String,
|
|
7
7
|
fonts: ::Array[ContextDev::Models::WebExtractFontsResponse::Font],
|
|
8
|
-
status: String
|
|
8
|
+
status: String,
|
|
9
|
+
font_links: ::Hash[Symbol, ContextDev::Models::WebExtractFontsResponse::FontLink]
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
class WebExtractFontsResponse < ContextDev::Internal::Type::BaseModel
|
|
@@ -17,18 +18,26 @@ module ContextDev
|
|
|
17
18
|
|
|
18
19
|
attr_accessor status: String
|
|
19
20
|
|
|
21
|
+
attr_reader font_links: ::Hash[Symbol, ContextDev::Models::WebExtractFontsResponse::FontLink]?
|
|
22
|
+
|
|
23
|
+
def font_links=: (
|
|
24
|
+
::Hash[Symbol, ContextDev::Models::WebExtractFontsResponse::FontLink]
|
|
25
|
+
) -> ::Hash[Symbol, ContextDev::Models::WebExtractFontsResponse::FontLink]
|
|
26
|
+
|
|
20
27
|
def initialize: (
|
|
21
28
|
code: Integer,
|
|
22
29
|
domain: String,
|
|
23
30
|
fonts: ::Array[ContextDev::Models::WebExtractFontsResponse::Font],
|
|
24
|
-
status: String
|
|
31
|
+
status: String,
|
|
32
|
+
?font_links: ::Hash[Symbol, ContextDev::Models::WebExtractFontsResponse::FontLink]
|
|
25
33
|
) -> void
|
|
26
34
|
|
|
27
35
|
def to_hash: -> {
|
|
28
36
|
code: Integer,
|
|
29
37
|
domain: String,
|
|
30
38
|
fonts: ::Array[ContextDev::Models::WebExtractFontsResponse::Font],
|
|
31
|
-
status: String
|
|
39
|
+
status: String,
|
|
40
|
+
font_links: ::Hash[Symbol, ContextDev::Models::WebExtractFontsResponse::FontLink]
|
|
32
41
|
}
|
|
33
42
|
|
|
34
43
|
type font =
|
|
@@ -77,6 +86,53 @@ module ContextDev
|
|
|
77
86
|
uses: ::Array[String]
|
|
78
87
|
}
|
|
79
88
|
end
|
|
89
|
+
|
|
90
|
+
type font_link =
|
|
91
|
+
{
|
|
92
|
+
files: ::Hash[Symbol, String],
|
|
93
|
+
type: ContextDev::Models::WebExtractFontsResponse::FontLink::type_,
|
|
94
|
+
category: String,
|
|
95
|
+
display_name: String
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
class FontLink < ContextDev::Internal::Type::BaseModel
|
|
99
|
+
attr_accessor files: ::Hash[Symbol, String]
|
|
100
|
+
|
|
101
|
+
attr_accessor type: ContextDev::Models::WebExtractFontsResponse::FontLink::type_
|
|
102
|
+
|
|
103
|
+
attr_reader category: String?
|
|
104
|
+
|
|
105
|
+
def category=: (String) -> String
|
|
106
|
+
|
|
107
|
+
attr_reader display_name: String?
|
|
108
|
+
|
|
109
|
+
def display_name=: (String) -> String
|
|
110
|
+
|
|
111
|
+
def initialize: (
|
|
112
|
+
files: ::Hash[Symbol, String],
|
|
113
|
+
type: ContextDev::Models::WebExtractFontsResponse::FontLink::type_,
|
|
114
|
+
?category: String,
|
|
115
|
+
?display_name: String
|
|
116
|
+
) -> void
|
|
117
|
+
|
|
118
|
+
def to_hash: -> {
|
|
119
|
+
files: ::Hash[Symbol, String],
|
|
120
|
+
type: ContextDev::Models::WebExtractFontsResponse::FontLink::type_,
|
|
121
|
+
category: String,
|
|
122
|
+
display_name: String
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
type type_ = :google | :custom
|
|
126
|
+
|
|
127
|
+
module Type
|
|
128
|
+
extend ContextDev::Internal::Type::Enum
|
|
129
|
+
|
|
130
|
+
GOOGLE: :google
|
|
131
|
+
CUSTOM: :custom
|
|
132
|
+
|
|
133
|
+
def self?.values: -> ::Array[ContextDev::Models::WebExtractFontsResponse::FontLink::type_]
|
|
134
|
+
end
|
|
135
|
+
end
|
|
80
136
|
end
|
|
81
137
|
end
|
|
82
138
|
end
|
|
@@ -6,6 +6,7 @@ module ContextDev
|
|
|
6
6
|
follow_subdomains: bool,
|
|
7
7
|
include_images: bool,
|
|
8
8
|
include_links: bool,
|
|
9
|
+
max_age_ms: Integer,
|
|
9
10
|
max_depth: Integer,
|
|
10
11
|
max_pages: Integer,
|
|
11
12
|
:shorten_base64_images => bool,
|
|
@@ -32,6 +33,10 @@ module ContextDev
|
|
|
32
33
|
|
|
33
34
|
def include_links=: (bool) -> bool
|
|
34
35
|
|
|
36
|
+
attr_reader max_age_ms: Integer?
|
|
37
|
+
|
|
38
|
+
def max_age_ms=: (Integer) -> Integer
|
|
39
|
+
|
|
35
40
|
attr_reader max_depth: Integer?
|
|
36
41
|
|
|
37
42
|
def max_depth=: (Integer) -> Integer
|
|
@@ -57,6 +62,7 @@ module ContextDev
|
|
|
57
62
|
?follow_subdomains: bool,
|
|
58
63
|
?include_images: bool,
|
|
59
64
|
?include_links: bool,
|
|
65
|
+
?max_age_ms: Integer,
|
|
60
66
|
?max_depth: Integer,
|
|
61
67
|
?max_pages: Integer,
|
|
62
68
|
?shorten_base64_images: bool,
|
|
@@ -70,6 +76,7 @@ module ContextDev
|
|
|
70
76
|
follow_subdomains: bool,
|
|
71
77
|
include_images: bool,
|
|
72
78
|
include_links: bool,
|
|
79
|
+
max_age_ms: Integer,
|
|
73
80
|
max_depth: Integer,
|
|
74
81
|
max_pages: Integer,
|
|
75
82
|
:shorten_base64_images => bool,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module ContextDev
|
|
2
2
|
module Models
|
|
3
3
|
type web_web_scrape_sitemap_params =
|
|
4
|
-
{ domain: String, max_links: Integer }
|
|
4
|
+
{ domain: String, max_links: Integer, url_regex: String }
|
|
5
5
|
& ContextDev::Internal::Type::request_parameters
|
|
6
6
|
|
|
7
7
|
class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel
|
|
@@ -14,15 +14,21 @@ module ContextDev
|
|
|
14
14
|
|
|
15
15
|
def max_links=: (Integer) -> Integer
|
|
16
16
|
|
|
17
|
+
attr_reader url_regex: String?
|
|
18
|
+
|
|
19
|
+
def url_regex=: (String) -> String
|
|
20
|
+
|
|
17
21
|
def initialize: (
|
|
18
22
|
domain: String,
|
|
19
23
|
?max_links: Integer,
|
|
24
|
+
?url_regex: String,
|
|
20
25
|
?request_options: ContextDev::request_opts
|
|
21
26
|
) -> void
|
|
22
27
|
|
|
23
28
|
def to_hash: -> {
|
|
24
29
|
domain: String,
|
|
25
30
|
max_links: Integer,
|
|
31
|
+
url_regex: String,
|
|
26
32
|
request_options: ContextDev::RequestOptions
|
|
27
33
|
}
|
|
28
34
|
end
|
|
@@ -29,6 +29,7 @@ module ContextDev
|
|
|
29
29
|
?follow_subdomains: bool,
|
|
30
30
|
?include_images: bool,
|
|
31
31
|
?include_links: bool,
|
|
32
|
+
?max_age_ms: Integer,
|
|
32
33
|
?max_depth: Integer,
|
|
33
34
|
?max_pages: Integer,
|
|
34
35
|
?shorten_base64_images: bool,
|
|
@@ -61,6 +62,7 @@ module ContextDev
|
|
|
61
62
|
def web_scrape_sitemap: (
|
|
62
63
|
domain: String,
|
|
63
64
|
?max_links: Integer,
|
|
65
|
+
?url_regex: String,
|
|
64
66
|
?request_options: ContextDev::request_opts
|
|
65
67
|
) -> ContextDev::Models::WebWebScrapeSitemapResponse
|
|
66
68
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: context.dev
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Context Dev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-04-
|
|
11
|
+
date: 2026-04-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|