context.dev 2.12.0 → 2.14.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 +19 -0
- data/README.md +2 -11
- data/lib/context_dev/models/ai_extract_product_response.rb +54 -1
- data/lib/context_dev/models/ai_extract_products_response.rb +54 -1
- data/lib/context_dev/models/batch_get_results_response.rb +56 -1
- data/lib/context_dev/models/batch_submit_response.rb +54 -1
- data/lib/context_dev/models/brand_retrieve_response.rb +58 -3
- data/lib/context_dev/models/brand_retrieve_simplified_response.rb +55 -1
- data/lib/context_dev/models/web_extract_fonts_response.rb +54 -1
- data/lib/context_dev/models/web_extract_response.rb +54 -1
- data/lib/context_dev/models/web_extract_styleguide_response.rb +55 -1
- data/lib/context_dev/models/web_screenshot_response.rb +54 -1
- data/lib/context_dev/models/web_search_response.rb +54 -1
- data/lib/context_dev/models/web_web_crawl_md_response.rb +54 -1
- data/lib/context_dev/models/web_web_scrape_html_response.rb +54 -1
- data/lib/context_dev/models/web_web_scrape_images_response.rb +55 -1
- data/lib/context_dev/models/web_web_scrape_md_response.rb +54 -1
- data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +10 -1
- data/lib/context_dev/resources/web.rb +10 -6
- data/lib/context_dev/version.rb +1 -1
- data/rbi/context_dev/models/ai_extract_product_response.rbi +119 -0
- data/rbi/context_dev/models/ai_extract_products_response.rbi +119 -0
- data/rbi/context_dev/models/batch_get_results_response.rbi +121 -0
- data/rbi/context_dev/models/batch_submit_response.rbi +117 -0
- data/rbi/context_dev/models/brand_retrieve_response.rbi +123 -2
- data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +121 -0
- data/rbi/context_dev/models/web_extract_fonts_response.rbi +119 -0
- data/rbi/context_dev/models/web_extract_response.rbi +117 -0
- data/rbi/context_dev/models/web_extract_styleguide_response.rbi +119 -0
- data/rbi/context_dev/models/web_screenshot_response.rbi +117 -0
- data/rbi/context_dev/models/web_search_response.rbi +117 -0
- data/rbi/context_dev/models/web_web_crawl_md_response.rbi +117 -0
- data/rbi/context_dev/models/web_web_scrape_html_response.rbi +119 -0
- data/rbi/context_dev/models/web_web_scrape_images_response.rbi +119 -0
- data/rbi/context_dev/models/web_web_scrape_md_response.rbi +117 -0
- data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +13 -0
- data/rbi/context_dev/resources/web.rbi +10 -5
- data/sig/context_dev/models/ai_extract_product_response.rbs +39 -0
- data/sig/context_dev/models/ai_extract_products_response.rbs +39 -0
- data/sig/context_dev/models/batch_get_results_response.rbs +39 -0
- data/sig/context_dev/models/batch_submit_response.rbs +39 -0
- data/sig/context_dev/models/brand_retrieve_response.rbs +39 -0
- data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +39 -0
- data/sig/context_dev/models/web_extract_fonts_response.rbs +39 -0
- data/sig/context_dev/models/web_extract_response.rbs +39 -0
- data/sig/context_dev/models/web_extract_styleguide_response.rbs +39 -0
- data/sig/context_dev/models/web_screenshot_response.rbs +39 -0
- data/sig/context_dev/models/web_search_response.rbs +39 -0
- data/sig/context_dev/models/web_web_crawl_md_response.rbs +39 -0
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +39 -0
- data/sig/context_dev/models/web_web_scrape_images_response.rbs +39 -0
- data/sig/context_dev/models/web_web_scrape_md_response.rbs +39 -0
- data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +7 -0
- data/sig/context_dev/resources/web.rbs +1 -0
- metadata +2 -2
|
@@ -566,18 +566,21 @@ module ContextDev
|
|
|
566
566
|
# Some parameter documentations has been truncated, see
|
|
567
567
|
# {ContextDev::Models::WebWebScrapeSitemapParams} for more details.
|
|
568
568
|
#
|
|
569
|
-
# Crawl an entire website's sitemap and return all discovered page URLs.
|
|
570
|
-
# `
|
|
571
|
-
#
|
|
572
|
-
#
|
|
573
|
-
#
|
|
569
|
+
# Crawl an entire website's sitemap and return all discovered page URLs. Set
|
|
570
|
+
# `includeSubdomains=true` to also discover public pages and sitemaps on child
|
|
571
|
+
# hosts such as `docs.example.com` or `brand.example.com`. Pass `search` to have
|
|
572
|
+
# the discovered URLs filtered down to the pages about a phrase (for example
|
|
573
|
+
# `pricing and plans` or `api authentication docs`), most relevant first — a
|
|
574
|
+
# searched crawl scans the whole sitemap and costs 2 credits instead of 1.
|
|
574
575
|
#
|
|
575
|
-
# @overload web_scrape_sitemap(domain:, headers: nil, max_links: nil, search: nil, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, zdr: nil, request_options: {})
|
|
576
|
+
# @overload web_scrape_sitemap(domain:, headers: nil, include_subdomains: nil, max_links: nil, search: nil, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, zdr: nil, request_options: {})
|
|
576
577
|
#
|
|
577
578
|
# @param domain [String] Domain to build a sitemap for
|
|
578
579
|
#
|
|
579
580
|
# @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
|
|
580
581
|
#
|
|
582
|
+
# @param include_subdomains [Boolean] When true, discover and include public pages and sitemaps on subdomains of the r
|
|
583
|
+
#
|
|
581
584
|
# @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi
|
|
582
585
|
#
|
|
583
586
|
# @param search [String] Optional search phrase. When provided, the crawled sitemap is filtered to the pa
|
|
@@ -604,6 +607,7 @@ module ContextDev
|
|
|
604
607
|
method: :get,
|
|
605
608
|
path: "web/scrape/sitemap",
|
|
606
609
|
query: query.transform_keys(
|
|
610
|
+
include_subdomains: "includeSubdomains",
|
|
607
611
|
max_links: "maxLinks",
|
|
608
612
|
sitemap_url: "sitemapUrl",
|
|
609
613
|
timeout_ms: "timeoutMS",
|
data/lib/context_dev/version.rb
CHANGED
|
@@ -11,6 +11,22 @@ module ContextDev
|
|
|
11
11
|
)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
15
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
16
|
+
# oldest contributing hit.
|
|
17
|
+
sig do
|
|
18
|
+
returns(ContextDev::Models::AIExtractProductResponse::CacheMetadata)
|
|
19
|
+
end
|
|
20
|
+
attr_reader :cache_metadata
|
|
21
|
+
|
|
22
|
+
sig do
|
|
23
|
+
params(
|
|
24
|
+
cache_metadata:
|
|
25
|
+
ContextDev::Models::AIExtractProductResponse::CacheMetadata::OrHash
|
|
26
|
+
).void
|
|
27
|
+
end
|
|
28
|
+
attr_writer :cache_metadata
|
|
29
|
+
|
|
14
30
|
# Whether the given URL is a product detail page
|
|
15
31
|
sig { returns(T.nilable(T::Boolean)) }
|
|
16
32
|
attr_reader :is_product_page
|
|
@@ -65,6 +81,8 @@ module ContextDev
|
|
|
65
81
|
|
|
66
82
|
sig do
|
|
67
83
|
params(
|
|
84
|
+
cache_metadata:
|
|
85
|
+
ContextDev::Models::AIExtractProductResponse::CacheMetadata::OrHash,
|
|
68
86
|
is_product_page: T::Boolean,
|
|
69
87
|
key_metadata:
|
|
70
88
|
ContextDev::Models::AIExtractProductResponse::KeyMetadata::OrHash,
|
|
@@ -79,6 +97,10 @@ module ContextDev
|
|
|
79
97
|
).returns(T.attached_class)
|
|
80
98
|
end
|
|
81
99
|
def self.new(
|
|
100
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
101
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
102
|
+
# oldest contributing hit.
|
|
103
|
+
cache_metadata:,
|
|
82
104
|
# Whether the given URL is a product detail page
|
|
83
105
|
is_product_page: nil,
|
|
84
106
|
# Metadata about the API key used for the request. Included in every response
|
|
@@ -94,6 +116,8 @@ module ContextDev
|
|
|
94
116
|
sig do
|
|
95
117
|
override.returns(
|
|
96
118
|
{
|
|
119
|
+
cache_metadata:
|
|
120
|
+
ContextDev::Models::AIExtractProductResponse::CacheMetadata,
|
|
97
121
|
is_product_page: T::Boolean,
|
|
98
122
|
key_metadata:
|
|
99
123
|
ContextDev::Models::AIExtractProductResponse::KeyMetadata,
|
|
@@ -109,6 +133,101 @@ module ContextDev
|
|
|
109
133
|
def to_hash
|
|
110
134
|
end
|
|
111
135
|
|
|
136
|
+
class CacheMetadata < ContextDev::Internal::Type::BaseModel
|
|
137
|
+
OrHash =
|
|
138
|
+
T.type_alias do
|
|
139
|
+
T.any(
|
|
140
|
+
ContextDev::Models::AIExtractProductResponse::CacheMetadata,
|
|
141
|
+
ContextDev::Internal::AnyHash
|
|
142
|
+
)
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
|
|
146
|
+
sig { returns(Integer) }
|
|
147
|
+
attr_accessor :age_ms
|
|
148
|
+
|
|
149
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
150
|
+
# zero-data-retention cache bypass.
|
|
151
|
+
sig do
|
|
152
|
+
returns(
|
|
153
|
+
ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status::TaggedSymbol
|
|
154
|
+
)
|
|
155
|
+
end
|
|
156
|
+
attr_accessor :status
|
|
157
|
+
|
|
158
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
159
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
160
|
+
# oldest contributing hit.
|
|
161
|
+
sig do
|
|
162
|
+
params(
|
|
163
|
+
age_ms: Integer,
|
|
164
|
+
status:
|
|
165
|
+
ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status::OrSymbol
|
|
166
|
+
).returns(T.attached_class)
|
|
167
|
+
end
|
|
168
|
+
def self.new(
|
|
169
|
+
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
|
|
170
|
+
age_ms:,
|
|
171
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
172
|
+
# zero-data-retention cache bypass.
|
|
173
|
+
status:
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
sig do
|
|
178
|
+
override.returns(
|
|
179
|
+
{
|
|
180
|
+
age_ms: Integer,
|
|
181
|
+
status:
|
|
182
|
+
ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status::TaggedSymbol
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
end
|
|
186
|
+
def to_hash
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
190
|
+
# zero-data-retention cache bypass.
|
|
191
|
+
module Status
|
|
192
|
+
extend ContextDev::Internal::Type::Enum
|
|
193
|
+
|
|
194
|
+
TaggedSymbol =
|
|
195
|
+
T.type_alias do
|
|
196
|
+
T.all(
|
|
197
|
+
Symbol,
|
|
198
|
+
ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status
|
|
199
|
+
)
|
|
200
|
+
end
|
|
201
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
202
|
+
|
|
203
|
+
HIT =
|
|
204
|
+
T.let(
|
|
205
|
+
:hit,
|
|
206
|
+
ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status::TaggedSymbol
|
|
207
|
+
)
|
|
208
|
+
MISS =
|
|
209
|
+
T.let(
|
|
210
|
+
:miss,
|
|
211
|
+
ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status::TaggedSymbol
|
|
212
|
+
)
|
|
213
|
+
ZDR =
|
|
214
|
+
T.let(
|
|
215
|
+
:zdr,
|
|
216
|
+
ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status::TaggedSymbol
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
sig do
|
|
220
|
+
override.returns(
|
|
221
|
+
T::Array[
|
|
222
|
+
ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status::TaggedSymbol
|
|
223
|
+
]
|
|
224
|
+
)
|
|
225
|
+
end
|
|
226
|
+
def self.values
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
|
|
112
231
|
class KeyMetadata < ContextDev::Internal::Type::BaseModel
|
|
113
232
|
OrHash =
|
|
114
233
|
T.type_alias do
|
|
@@ -11,6 +11,22 @@ module ContextDev
|
|
|
11
11
|
)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
15
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
16
|
+
# oldest contributing hit.
|
|
17
|
+
sig do
|
|
18
|
+
returns(ContextDev::Models::AIExtractProductsResponse::CacheMetadata)
|
|
19
|
+
end
|
|
20
|
+
attr_reader :cache_metadata
|
|
21
|
+
|
|
22
|
+
sig do
|
|
23
|
+
params(
|
|
24
|
+
cache_metadata:
|
|
25
|
+
ContextDev::Models::AIExtractProductsResponse::CacheMetadata::OrHash
|
|
26
|
+
).void
|
|
27
|
+
end
|
|
28
|
+
attr_writer :cache_metadata
|
|
29
|
+
|
|
14
30
|
# Metadata about the API key used for the request. Included in every response
|
|
15
31
|
# whenever a valid API key is provided, even when the response status is not 200.
|
|
16
32
|
sig do
|
|
@@ -50,6 +66,8 @@ module ContextDev
|
|
|
50
66
|
|
|
51
67
|
sig do
|
|
52
68
|
params(
|
|
69
|
+
cache_metadata:
|
|
70
|
+
ContextDev::Models::AIExtractProductsResponse::CacheMetadata::OrHash,
|
|
53
71
|
key_metadata:
|
|
54
72
|
ContextDev::Models::AIExtractProductsResponse::KeyMetadata::OrHash,
|
|
55
73
|
products:
|
|
@@ -59,6 +77,10 @@ module ContextDev
|
|
|
59
77
|
).returns(T.attached_class)
|
|
60
78
|
end
|
|
61
79
|
def self.new(
|
|
80
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
81
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
82
|
+
# oldest contributing hit.
|
|
83
|
+
cache_metadata:,
|
|
62
84
|
# Metadata about the API key used for the request. Included in every response
|
|
63
85
|
# whenever a valid API key is provided, even when the response status is not 200.
|
|
64
86
|
key_metadata: nil,
|
|
@@ -70,6 +92,8 @@ module ContextDev
|
|
|
70
92
|
sig do
|
|
71
93
|
override.returns(
|
|
72
94
|
{
|
|
95
|
+
cache_metadata:
|
|
96
|
+
ContextDev::Models::AIExtractProductsResponse::CacheMetadata,
|
|
73
97
|
key_metadata:
|
|
74
98
|
ContextDev::Models::AIExtractProductsResponse::KeyMetadata,
|
|
75
99
|
products:
|
|
@@ -80,6 +104,101 @@ module ContextDev
|
|
|
80
104
|
def to_hash
|
|
81
105
|
end
|
|
82
106
|
|
|
107
|
+
class CacheMetadata < ContextDev::Internal::Type::BaseModel
|
|
108
|
+
OrHash =
|
|
109
|
+
T.type_alias do
|
|
110
|
+
T.any(
|
|
111
|
+
ContextDev::Models::AIExtractProductsResponse::CacheMetadata,
|
|
112
|
+
ContextDev::Internal::AnyHash
|
|
113
|
+
)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
|
|
117
|
+
sig { returns(Integer) }
|
|
118
|
+
attr_accessor :age_ms
|
|
119
|
+
|
|
120
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
121
|
+
# zero-data-retention cache bypass.
|
|
122
|
+
sig do
|
|
123
|
+
returns(
|
|
124
|
+
ContextDev::Models::AIExtractProductsResponse::CacheMetadata::Status::TaggedSymbol
|
|
125
|
+
)
|
|
126
|
+
end
|
|
127
|
+
attr_accessor :status
|
|
128
|
+
|
|
129
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
130
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
131
|
+
# oldest contributing hit.
|
|
132
|
+
sig do
|
|
133
|
+
params(
|
|
134
|
+
age_ms: Integer,
|
|
135
|
+
status:
|
|
136
|
+
ContextDev::Models::AIExtractProductsResponse::CacheMetadata::Status::OrSymbol
|
|
137
|
+
).returns(T.attached_class)
|
|
138
|
+
end
|
|
139
|
+
def self.new(
|
|
140
|
+
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
|
|
141
|
+
age_ms:,
|
|
142
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
143
|
+
# zero-data-retention cache bypass.
|
|
144
|
+
status:
|
|
145
|
+
)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
sig do
|
|
149
|
+
override.returns(
|
|
150
|
+
{
|
|
151
|
+
age_ms: Integer,
|
|
152
|
+
status:
|
|
153
|
+
ContextDev::Models::AIExtractProductsResponse::CacheMetadata::Status::TaggedSymbol
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
end
|
|
157
|
+
def to_hash
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
161
|
+
# zero-data-retention cache bypass.
|
|
162
|
+
module Status
|
|
163
|
+
extend ContextDev::Internal::Type::Enum
|
|
164
|
+
|
|
165
|
+
TaggedSymbol =
|
|
166
|
+
T.type_alias do
|
|
167
|
+
T.all(
|
|
168
|
+
Symbol,
|
|
169
|
+
ContextDev::Models::AIExtractProductsResponse::CacheMetadata::Status
|
|
170
|
+
)
|
|
171
|
+
end
|
|
172
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
173
|
+
|
|
174
|
+
HIT =
|
|
175
|
+
T.let(
|
|
176
|
+
:hit,
|
|
177
|
+
ContextDev::Models::AIExtractProductsResponse::CacheMetadata::Status::TaggedSymbol
|
|
178
|
+
)
|
|
179
|
+
MISS =
|
|
180
|
+
T.let(
|
|
181
|
+
:miss,
|
|
182
|
+
ContextDev::Models::AIExtractProductsResponse::CacheMetadata::Status::TaggedSymbol
|
|
183
|
+
)
|
|
184
|
+
ZDR =
|
|
185
|
+
T.let(
|
|
186
|
+
:zdr,
|
|
187
|
+
ContextDev::Models::AIExtractProductsResponse::CacheMetadata::Status::TaggedSymbol
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
sig do
|
|
191
|
+
override.returns(
|
|
192
|
+
T::Array[
|
|
193
|
+
ContextDev::Models::AIExtractProductsResponse::CacheMetadata::Status::TaggedSymbol
|
|
194
|
+
]
|
|
195
|
+
)
|
|
196
|
+
end
|
|
197
|
+
def self.values
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
|
|
83
202
|
class KeyMetadata < ContextDev::Internal::Type::BaseModel
|
|
84
203
|
OrHash =
|
|
85
204
|
T.type_alias do
|
|
@@ -130,6 +130,24 @@ module ContextDev
|
|
|
130
130
|
)
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
134
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
135
|
+
# oldest contributing hit.
|
|
136
|
+
sig do
|
|
137
|
+
returns(
|
|
138
|
+
ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata
|
|
139
|
+
)
|
|
140
|
+
end
|
|
141
|
+
attr_reader :cache_metadata
|
|
142
|
+
|
|
143
|
+
sig do
|
|
144
|
+
params(
|
|
145
|
+
cache_metadata:
|
|
146
|
+
ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::OrHash
|
|
147
|
+
).void
|
|
148
|
+
end
|
|
149
|
+
attr_writer :cache_metadata
|
|
150
|
+
|
|
133
151
|
# URL the content was read from, after redirects.
|
|
134
152
|
sig { returns(String) }
|
|
135
153
|
attr_accessor :final_url
|
|
@@ -202,6 +220,8 @@ module ContextDev
|
|
|
202
220
|
# A page the batch fetched successfully.
|
|
203
221
|
sig do
|
|
204
222
|
params(
|
|
223
|
+
cache_metadata:
|
|
224
|
+
ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::OrHash,
|
|
205
225
|
final_url: String,
|
|
206
226
|
http_status: T.nilable(Integer),
|
|
207
227
|
metadata:
|
|
@@ -216,6 +236,10 @@ module ContextDev
|
|
|
216
236
|
).returns(T.attached_class)
|
|
217
237
|
end
|
|
218
238
|
def self.new(
|
|
239
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
240
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
241
|
+
# oldest contributing hit.
|
|
242
|
+
cache_metadata:,
|
|
219
243
|
# URL the content was read from, after redirects.
|
|
220
244
|
final_url:,
|
|
221
245
|
# HTTP status of the final response, when known.
|
|
@@ -244,6 +268,8 @@ module ContextDev
|
|
|
244
268
|
sig do
|
|
245
269
|
override.returns(
|
|
246
270
|
{
|
|
271
|
+
cache_metadata:
|
|
272
|
+
ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata,
|
|
247
273
|
final_url: String,
|
|
248
274
|
http_status: T.nilable(Integer),
|
|
249
275
|
metadata:
|
|
@@ -261,6 +287,101 @@ module ContextDev
|
|
|
261
287
|
def to_hash
|
|
262
288
|
end
|
|
263
289
|
|
|
290
|
+
class CacheMetadata < ContextDev::Internal::Type::BaseModel
|
|
291
|
+
OrHash =
|
|
292
|
+
T.type_alias do
|
|
293
|
+
T.any(
|
|
294
|
+
ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata,
|
|
295
|
+
ContextDev::Internal::AnyHash
|
|
296
|
+
)
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
|
|
300
|
+
sig { returns(Integer) }
|
|
301
|
+
attr_accessor :age_ms
|
|
302
|
+
|
|
303
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
304
|
+
# zero-data-retention cache bypass.
|
|
305
|
+
sig do
|
|
306
|
+
returns(
|
|
307
|
+
ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::Status::TaggedSymbol
|
|
308
|
+
)
|
|
309
|
+
end
|
|
310
|
+
attr_accessor :status
|
|
311
|
+
|
|
312
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
313
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
314
|
+
# oldest contributing hit.
|
|
315
|
+
sig do
|
|
316
|
+
params(
|
|
317
|
+
age_ms: Integer,
|
|
318
|
+
status:
|
|
319
|
+
ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::Status::OrSymbol
|
|
320
|
+
).returns(T.attached_class)
|
|
321
|
+
end
|
|
322
|
+
def self.new(
|
|
323
|
+
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
|
|
324
|
+
age_ms:,
|
|
325
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
326
|
+
# zero-data-retention cache bypass.
|
|
327
|
+
status:
|
|
328
|
+
)
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
sig do
|
|
332
|
+
override.returns(
|
|
333
|
+
{
|
|
334
|
+
age_ms: Integer,
|
|
335
|
+
status:
|
|
336
|
+
ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::Status::TaggedSymbol
|
|
337
|
+
}
|
|
338
|
+
)
|
|
339
|
+
end
|
|
340
|
+
def to_hash
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
344
|
+
# zero-data-retention cache bypass.
|
|
345
|
+
module Status
|
|
346
|
+
extend ContextDev::Internal::Type::Enum
|
|
347
|
+
|
|
348
|
+
TaggedSymbol =
|
|
349
|
+
T.type_alias do
|
|
350
|
+
T.all(
|
|
351
|
+
Symbol,
|
|
352
|
+
ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::Status
|
|
353
|
+
)
|
|
354
|
+
end
|
|
355
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
356
|
+
|
|
357
|
+
HIT =
|
|
358
|
+
T.let(
|
|
359
|
+
:hit,
|
|
360
|
+
ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::Status::TaggedSymbol
|
|
361
|
+
)
|
|
362
|
+
MISS =
|
|
363
|
+
T.let(
|
|
364
|
+
:miss,
|
|
365
|
+
ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::Status::TaggedSymbol
|
|
366
|
+
)
|
|
367
|
+
ZDR =
|
|
368
|
+
T.let(
|
|
369
|
+
:zdr,
|
|
370
|
+
ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::Status::TaggedSymbol
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
sig do
|
|
374
|
+
override.returns(
|
|
375
|
+
T::Array[
|
|
376
|
+
ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::Status::TaggedSymbol
|
|
377
|
+
]
|
|
378
|
+
)
|
|
379
|
+
end
|
|
380
|
+
def self.values
|
|
381
|
+
end
|
|
382
|
+
end
|
|
383
|
+
end
|
|
384
|
+
|
|
264
385
|
class Metadata < ContextDev::Internal::Type::BaseModel
|
|
265
386
|
OrHash =
|
|
266
387
|
T.type_alias do
|
|
@@ -15,6 +15,20 @@ module ContextDev
|
|
|
15
15
|
sig { returns(String) }
|
|
16
16
|
attr_accessor :id
|
|
17
17
|
|
|
18
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
19
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
20
|
+
# oldest contributing hit.
|
|
21
|
+
sig { returns(ContextDev::Models::BatchSubmitResponse::CacheMetadata) }
|
|
22
|
+
attr_reader :cache_metadata
|
|
23
|
+
|
|
24
|
+
sig do
|
|
25
|
+
params(
|
|
26
|
+
cache_metadata:
|
|
27
|
+
ContextDev::Models::BatchSubmitResponse::CacheMetadata::OrHash
|
|
28
|
+
).void
|
|
29
|
+
end
|
|
30
|
+
attr_writer :cache_metadata
|
|
31
|
+
|
|
18
32
|
# The crawl controls as submitted, so the limits requested can be compared against
|
|
19
33
|
# what the crawl reached.
|
|
20
34
|
sig { returns(T.nilable(ContextDev::CrawlControls)) }
|
|
@@ -98,6 +112,8 @@ module ContextDev
|
|
|
98
112
|
sig do
|
|
99
113
|
params(
|
|
100
114
|
id: String,
|
|
115
|
+
cache_metadata:
|
|
116
|
+
ContextDev::Models::BatchSubmitResponse::CacheMetadata::OrHash,
|
|
101
117
|
crawl: T.nilable(ContextDev::CrawlControls::OrHash),
|
|
102
118
|
created_at: String,
|
|
103
119
|
credits: ContextDev::Models::BatchSubmitResponse::Credits::OrHash,
|
|
@@ -118,6 +134,10 @@ module ContextDev
|
|
|
118
134
|
def self.new(
|
|
119
135
|
# Batch ID. Poll GET /batch/{batch_id} with it.
|
|
120
136
|
id:,
|
|
137
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
138
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
139
|
+
# oldest contributing hit.
|
|
140
|
+
cache_metadata:,
|
|
121
141
|
# The crawl controls as submitted, so the limits requested can be compared against
|
|
122
142
|
# what the crawl reached.
|
|
123
143
|
crawl:,
|
|
@@ -149,6 +169,8 @@ module ContextDev
|
|
|
149
169
|
override.returns(
|
|
150
170
|
{
|
|
151
171
|
id: String,
|
|
172
|
+
cache_metadata:
|
|
173
|
+
ContextDev::Models::BatchSubmitResponse::CacheMetadata,
|
|
152
174
|
crawl: T.nilable(ContextDev::CrawlControls),
|
|
153
175
|
created_at: String,
|
|
154
176
|
credits: ContextDev::Models::BatchSubmitResponse::Credits,
|
|
@@ -169,6 +191,101 @@ module ContextDev
|
|
|
169
191
|
def to_hash
|
|
170
192
|
end
|
|
171
193
|
|
|
194
|
+
class CacheMetadata < ContextDev::Internal::Type::BaseModel
|
|
195
|
+
OrHash =
|
|
196
|
+
T.type_alias do
|
|
197
|
+
T.any(
|
|
198
|
+
ContextDev::Models::BatchSubmitResponse::CacheMetadata,
|
|
199
|
+
ContextDev::Internal::AnyHash
|
|
200
|
+
)
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
|
|
204
|
+
sig { returns(Integer) }
|
|
205
|
+
attr_accessor :age_ms
|
|
206
|
+
|
|
207
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
208
|
+
# zero-data-retention cache bypass.
|
|
209
|
+
sig do
|
|
210
|
+
returns(
|
|
211
|
+
ContextDev::Models::BatchSubmitResponse::CacheMetadata::Status::TaggedSymbol
|
|
212
|
+
)
|
|
213
|
+
end
|
|
214
|
+
attr_accessor :status
|
|
215
|
+
|
|
216
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
217
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
218
|
+
# oldest contributing hit.
|
|
219
|
+
sig do
|
|
220
|
+
params(
|
|
221
|
+
age_ms: Integer,
|
|
222
|
+
status:
|
|
223
|
+
ContextDev::Models::BatchSubmitResponse::CacheMetadata::Status::OrSymbol
|
|
224
|
+
).returns(T.attached_class)
|
|
225
|
+
end
|
|
226
|
+
def self.new(
|
|
227
|
+
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
|
|
228
|
+
age_ms:,
|
|
229
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
230
|
+
# zero-data-retention cache bypass.
|
|
231
|
+
status:
|
|
232
|
+
)
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
sig do
|
|
236
|
+
override.returns(
|
|
237
|
+
{
|
|
238
|
+
age_ms: Integer,
|
|
239
|
+
status:
|
|
240
|
+
ContextDev::Models::BatchSubmitResponse::CacheMetadata::Status::TaggedSymbol
|
|
241
|
+
}
|
|
242
|
+
)
|
|
243
|
+
end
|
|
244
|
+
def to_hash
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
248
|
+
# zero-data-retention cache bypass.
|
|
249
|
+
module Status
|
|
250
|
+
extend ContextDev::Internal::Type::Enum
|
|
251
|
+
|
|
252
|
+
TaggedSymbol =
|
|
253
|
+
T.type_alias do
|
|
254
|
+
T.all(
|
|
255
|
+
Symbol,
|
|
256
|
+
ContextDev::Models::BatchSubmitResponse::CacheMetadata::Status
|
|
257
|
+
)
|
|
258
|
+
end
|
|
259
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
260
|
+
|
|
261
|
+
HIT =
|
|
262
|
+
T.let(
|
|
263
|
+
:hit,
|
|
264
|
+
ContextDev::Models::BatchSubmitResponse::CacheMetadata::Status::TaggedSymbol
|
|
265
|
+
)
|
|
266
|
+
MISS =
|
|
267
|
+
T.let(
|
|
268
|
+
:miss,
|
|
269
|
+
ContextDev::Models::BatchSubmitResponse::CacheMetadata::Status::TaggedSymbol
|
|
270
|
+
)
|
|
271
|
+
ZDR =
|
|
272
|
+
T.let(
|
|
273
|
+
:zdr,
|
|
274
|
+
ContextDev::Models::BatchSubmitResponse::CacheMetadata::Status::TaggedSymbol
|
|
275
|
+
)
|
|
276
|
+
|
|
277
|
+
sig do
|
|
278
|
+
override.returns(
|
|
279
|
+
T::Array[
|
|
280
|
+
ContextDev::Models::BatchSubmitResponse::CacheMetadata::Status::TaggedSymbol
|
|
281
|
+
]
|
|
282
|
+
)
|
|
283
|
+
end
|
|
284
|
+
def self.values
|
|
285
|
+
end
|
|
286
|
+
end
|
|
287
|
+
end
|
|
288
|
+
|
|
172
289
|
class Credits < ContextDev::Internal::Type::BaseModel
|
|
173
290
|
OrHash =
|
|
174
291
|
T.type_alias do
|