context.dev 2.17.1 → 2.19.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 +33 -0
- data/README.md +1 -1
- data/lib/context_dev/client.rb +0 -4
- data/lib/context_dev/models/industry_retrieve_naics_params.rb +28 -1
- data/lib/context_dev/models/industry_retrieve_sic_params.rb +28 -1
- data/lib/context_dev/models/monitor_retrieve_run_params.rb +26 -0
- data/lib/context_dev/models/monitor_retrieve_run_response.rb +232 -0
- data/lib/context_dev/models/monitor_rotate_webhook_secret_params.rb +20 -0
- data/lib/context_dev/models/monitor_rotate_webhook_secret_response.rb +765 -0
- data/lib/context_dev/models/parse_handle_params.rb +8 -6
- data/lib/context_dev/models/person_enrich_params.rb +28 -1
- data/lib/context_dev/models/web_answers_params.rb +28 -1
- data/lib/context_dev/models/web_extract_competitors_params.rb +28 -1
- data/lib/context_dev/models/web_extract_styleguide_params.rb +30 -3
- data/lib/context_dev/models/{web_web_scrape_sitemap_params.rb → web_map_urls_params.rb} +22 -20
- data/lib/context_dev/models/web_map_urls_response.rb +123 -0
- data/lib/context_dev/models/web_scrape_params.rb +906 -0
- data/lib/context_dev/models/web_scrape_response.rb +659 -0
- data/lib/context_dev/models/web_screenshot_params.rb +25 -9
- data/lib/context_dev/models/web_screenshot_response.rb +3 -3
- data/lib/context_dev/models/web_search_params.rb +30 -3
- data/lib/context_dev/models.rb +8 -20
- data/lib/context_dev/resources/brand.rb +0 -36
- data/lib/context_dev/resources/industry.rb +6 -2
- data/lib/context_dev/resources/monitors.rb +47 -0
- data/lib/context_dev/resources/people.rb +3 -1
- data/lib/context_dev/resources/web.rb +116 -413
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +8 -21
- data/rbi/context_dev/client.rbi +0 -3
- data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +59 -0
- data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +57 -0
- data/rbi/context_dev/models/monitor_retrieve_run_params.rbi +46 -0
- data/rbi/context_dev/models/monitor_retrieve_run_response.rbi +452 -0
- data/rbi/context_dev/models/monitor_rotate_webhook_secret_params.rbi +38 -0
- data/rbi/context_dev/models/monitor_rotate_webhook_secret_response.rbi +1367 -0
- data/rbi/context_dev/models/parse_handle_params.rbi +12 -9
- data/rbi/context_dev/models/person_enrich_params.rbi +45 -0
- data/rbi/context_dev/models/web_answers_params.rbi +45 -0
- data/rbi/context_dev/models/web_extract_competitors_params.rbi +59 -0
- data/rbi/context_dev/models/web_extract_styleguide_params.rbi +62 -3
- data/rbi/context_dev/models/{web_web_scrape_sitemap_params.rbi → web_map_urls_params.rbi} +35 -54
- data/rbi/context_dev/models/web_map_urls_response.rbi +226 -0
- data/rbi/context_dev/models/web_scrape_params.rbi +2000 -0
- data/rbi/context_dev/models/{web_web_scrape_html_response.rbi → web_scrape_response.rbi} +550 -418
- data/rbi/context_dev/models/web_screenshot_params.rbi +38 -12
- data/rbi/context_dev/models/web_screenshot_response.rbi +4 -4
- data/rbi/context_dev/models/web_search_params.rbi +48 -3
- data/rbi/context_dev/models.rbi +9 -21
- data/rbi/context_dev/resources/brand.rbi +0 -35
- data/rbi/context_dev/resources/industry.rbi +14 -0
- data/rbi/context_dev/resources/monitors.rbi +24 -0
- data/rbi/context_dev/resources/parse.rbi +4 -4
- data/rbi/context_dev/resources/people.rbi +7 -0
- data/rbi/context_dev/resources/web.rbi +166 -533
- data/sig/context_dev/client.rbs +0 -2
- data/sig/context_dev/models/industry_retrieve_naics_params.rbs +21 -1
- data/sig/context_dev/models/industry_retrieve_sic_params.rbs +21 -1
- data/sig/context_dev/models/monitor_retrieve_run_params.rbs +28 -0
- data/sig/context_dev/models/monitor_retrieve_run_response.rbs +182 -0
- data/sig/context_dev/models/monitor_rotate_webhook_secret_params.rbs +23 -0
- data/sig/context_dev/models/monitor_rotate_webhook_secret_response.rbs +545 -0
- data/sig/context_dev/models/person_enrich_params.rbs +21 -1
- data/sig/context_dev/models/web_answers_params.rbs +21 -1
- data/sig/context_dev/models/web_extract_competitors_params.rbs +21 -1
- data/sig/context_dev/models/web_extract_styleguide_params.rbs +21 -1
- data/sig/context_dev/models/{web_web_scrape_sitemap_params.rbs → web_map_urls_params.rbs} +22 -22
- data/sig/context_dev/models/web_map_urls_response.rbs +125 -0
- data/sig/context_dev/models/web_scrape_params.rbs +834 -0
- data/sig/context_dev/models/web_scrape_response.rbs +552 -0
- data/sig/context_dev/models/web_screenshot_params.rbs +7 -0
- data/sig/context_dev/models/web_search_params.rbs +21 -1
- data/sig/context_dev/models.rbs +8 -20
- data/sig/context_dev/resources/brand.rbs +0 -9
- data/sig/context_dev/resources/industry.rbs +2 -0
- data/sig/context_dev/resources/monitors.rbs +11 -0
- data/sig/context_dev/resources/people.rbs +1 -0
- data/sig/context_dev/resources/web.rbs +34 -108
- metadata +26 -65
- data/lib/context_dev/models/ai_extract_product_params.rb +0 -98
- data/lib/context_dev/models/ai_extract_product_response.rb +0 -352
- data/lib/context_dev/models/ai_extract_products_params.rb +0 -233
- data/lib/context_dev/models/ai_extract_products_response.rb +0 -320
- data/lib/context_dev/models/brand_retrieve_simplified_params.rb +0 -120
- data/lib/context_dev/models/brand_retrieve_simplified_response.rb +0 -441
- data/lib/context_dev/models/web_extract_fonts_params.rb +0 -114
- data/lib/context_dev/models/web_extract_fonts_response.rb +0 -291
- data/lib/context_dev/models/web_extract_params.rb +0 -392
- data/lib/context_dev/models/web_extract_response.rb +0 -287
- data/lib/context_dev/models/web_web_scrape_bytes_params.rb +0 -344
- data/lib/context_dev/models/web_web_scrape_bytes_response.rb +0 -135
- data/lib/context_dev/models/web_web_scrape_html_params.rb +0 -633
- data/lib/context_dev/models/web_web_scrape_html_response.rb +0 -588
- data/lib/context_dev/models/web_web_scrape_images_params.rb +0 -346
- data/lib/context_dev/models/web_web_scrape_images_response.rb +0 -409
- data/lib/context_dev/models/web_web_scrape_md_params.rb +0 -668
- data/lib/context_dev/models/web_web_scrape_md_response.rb +0 -567
- data/lib/context_dev/models/web_web_scrape_sitemap_response.rb +0 -144
- data/lib/context_dev/resources/ai.rb +0 -69
- data/rbi/context_dev/models/ai_extract_product_params.rbi +0 -199
- data/rbi/context_dev/models/ai_extract_product_response.rbi +0 -696
- data/rbi/context_dev/models/ai_extract_products_params.rbi +0 -490
- data/rbi/context_dev/models/ai_extract_products_response.rbi +0 -623
- data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +0 -256
- data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +0 -1040
- data/rbi/context_dev/models/web_extract_fonts_params.rbi +0 -223
- data/rbi/context_dev/models/web_extract_fonts_response.rbi +0 -563
- data/rbi/context_dev/models/web_extract_params.rbi +0 -736
- data/rbi/context_dev/models/web_extract_response.rbi +0 -512
- data/rbi/context_dev/models/web_web_scrape_bytes_params.rbi +0 -699
- data/rbi/context_dev/models/web_web_scrape_bytes_response.rbi +0 -238
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +0 -1217
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +0 -671
- data/rbi/context_dev/models/web_web_scrape_images_response.rbi +0 -910
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +0 -1049
- data/rbi/context_dev/models/web_web_scrape_md_response.rbi +0 -1088
- data/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi +0 -258
- data/rbi/context_dev/resources/ai.rbi +0 -56
- data/sig/context_dev/models/ai_extract_product_params.rbs +0 -86
- data/sig/context_dev/models/ai_extract_product_response.rbs +0 -273
- data/sig/context_dev/models/ai_extract_products_params.rbs +0 -202
- data/sig/context_dev/models/ai_extract_products_response.rbs +0 -252
- data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +0 -104
- data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +0 -413
- data/sig/context_dev/models/web_extract_fonts_params.rbs +0 -93
- data/sig/context_dev/models/web_extract_fonts_response.rbs +0 -230
- data/sig/context_dev/models/web_extract_params.rbs +0 -304
- data/sig/context_dev/models/web_extract_response.rbs +0 -239
- data/sig/context_dev/models/web_web_scrape_bytes_params.rbs +0 -531
- data/sig/context_dev/models/web_web_scrape_bytes_response.rbs +0 -108
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +0 -730
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +0 -495
- data/sig/context_dev/models/web_web_scrape_images_params.rbs +0 -261
- data/sig/context_dev/models/web_web_scrape_images_response.rbs +0 -371
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +0 -758
- data/sig/context_dev/models/web_web_scrape_md_response.rbs +0 -465
- data/sig/context_dev/models/web_web_scrape_sitemap_response.rbs +0 -117
- data/sig/context_dev/resources/ai.rbs +0 -20
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
# typed: strong
|
|
2
|
-
|
|
3
|
-
module ContextDev
|
|
4
|
-
module Models
|
|
5
|
-
class WebWebScrapeSitemapResponse < ContextDev::Internal::Type::BaseModel
|
|
6
|
-
OrHash =
|
|
7
|
-
T.type_alias do
|
|
8
|
-
T.any(
|
|
9
|
-
ContextDev::Models::WebWebScrapeSitemapResponse,
|
|
10
|
-
ContextDev::Internal::AnyHash
|
|
11
|
-
)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
# The normalized domain that was crawled
|
|
15
|
-
sig { returns(String) }
|
|
16
|
-
attr_accessor :domain
|
|
17
|
-
|
|
18
|
-
# Metadata about the sitemap crawl operation
|
|
19
|
-
sig { returns(ContextDev::Models::WebWebScrapeSitemapResponse::Meta) }
|
|
20
|
-
attr_reader :meta
|
|
21
|
-
|
|
22
|
-
sig do
|
|
23
|
-
params(
|
|
24
|
-
meta: ContextDev::Models::WebWebScrapeSitemapResponse::Meta::OrHash
|
|
25
|
-
).void
|
|
26
|
-
end
|
|
27
|
-
attr_writer :meta
|
|
28
|
-
|
|
29
|
-
# Unique id of this API call, also sent in the X-Request-Id response header. Quote
|
|
30
|
-
# it when contacting support about a failed request.
|
|
31
|
-
sig { returns(String) }
|
|
32
|
-
attr_accessor :request_id
|
|
33
|
-
|
|
34
|
-
# Indicates success
|
|
35
|
-
sig do
|
|
36
|
-
returns(
|
|
37
|
-
ContextDev::Models::WebWebScrapeSitemapResponse::Success::TaggedBoolean
|
|
38
|
-
)
|
|
39
|
-
end
|
|
40
|
-
attr_accessor :success
|
|
41
|
-
|
|
42
|
-
# Discovered page URLs from the sitemap, up to `maxLinks`. When `search` is set
|
|
43
|
-
# these are only the matching pages, most relevant first.
|
|
44
|
-
sig { returns(T::Array[String]) }
|
|
45
|
-
attr_accessor :urls
|
|
46
|
-
|
|
47
|
-
# Credit usage, included whenever a valid API key is provided.
|
|
48
|
-
sig do
|
|
49
|
-
returns(
|
|
50
|
-
T.nilable(
|
|
51
|
-
ContextDev::Models::WebWebScrapeSitemapResponse::KeyMetadata
|
|
52
|
-
)
|
|
53
|
-
)
|
|
54
|
-
end
|
|
55
|
-
attr_reader :key_metadata
|
|
56
|
-
|
|
57
|
-
sig do
|
|
58
|
-
params(
|
|
59
|
-
key_metadata:
|
|
60
|
-
ContextDev::Models::WebWebScrapeSitemapResponse::KeyMetadata::OrHash
|
|
61
|
-
).void
|
|
62
|
-
end
|
|
63
|
-
attr_writer :key_metadata
|
|
64
|
-
|
|
65
|
-
# True when timeoutOpts.behavior=return-partial returned the usable results
|
|
66
|
-
# collected before the deadline. Partial collections are not cached as complete
|
|
67
|
-
# results.
|
|
68
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
69
|
-
attr_reader :partial
|
|
70
|
-
|
|
71
|
-
sig { params(partial: T::Boolean).void }
|
|
72
|
-
attr_writer :partial
|
|
73
|
-
|
|
74
|
-
sig do
|
|
75
|
-
params(
|
|
76
|
-
domain: String,
|
|
77
|
-
meta: ContextDev::Models::WebWebScrapeSitemapResponse::Meta::OrHash,
|
|
78
|
-
request_id: String,
|
|
79
|
-
success:
|
|
80
|
-
ContextDev::Models::WebWebScrapeSitemapResponse::Success::OrBoolean,
|
|
81
|
-
urls: T::Array[String],
|
|
82
|
-
key_metadata:
|
|
83
|
-
ContextDev::Models::WebWebScrapeSitemapResponse::KeyMetadata::OrHash,
|
|
84
|
-
partial: T::Boolean
|
|
85
|
-
).returns(T.attached_class)
|
|
86
|
-
end
|
|
87
|
-
def self.new(
|
|
88
|
-
# The normalized domain that was crawled
|
|
89
|
-
domain:,
|
|
90
|
-
# Metadata about the sitemap crawl operation
|
|
91
|
-
meta:,
|
|
92
|
-
# Unique id of this API call, also sent in the X-Request-Id response header. Quote
|
|
93
|
-
# it when contacting support about a failed request.
|
|
94
|
-
request_id:,
|
|
95
|
-
# Indicates success
|
|
96
|
-
success:,
|
|
97
|
-
# Discovered page URLs from the sitemap, up to `maxLinks`. When `search` is set
|
|
98
|
-
# these are only the matching pages, most relevant first.
|
|
99
|
-
urls:,
|
|
100
|
-
# Credit usage, included whenever a valid API key is provided.
|
|
101
|
-
key_metadata: nil,
|
|
102
|
-
# True when timeoutOpts.behavior=return-partial returned the usable results
|
|
103
|
-
# collected before the deadline. Partial collections are not cached as complete
|
|
104
|
-
# results.
|
|
105
|
-
partial: nil
|
|
106
|
-
)
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
sig do
|
|
110
|
-
override.returns(
|
|
111
|
-
{
|
|
112
|
-
domain: String,
|
|
113
|
-
meta: ContextDev::Models::WebWebScrapeSitemapResponse::Meta,
|
|
114
|
-
request_id: String,
|
|
115
|
-
success:
|
|
116
|
-
ContextDev::Models::WebWebScrapeSitemapResponse::Success::TaggedBoolean,
|
|
117
|
-
urls: T::Array[String],
|
|
118
|
-
key_metadata:
|
|
119
|
-
ContextDev::Models::WebWebScrapeSitemapResponse::KeyMetadata,
|
|
120
|
-
partial: T::Boolean
|
|
121
|
-
}
|
|
122
|
-
)
|
|
123
|
-
end
|
|
124
|
-
def to_hash
|
|
125
|
-
end
|
|
126
|
-
|
|
127
|
-
class Meta < ContextDev::Internal::Type::BaseModel
|
|
128
|
-
OrHash =
|
|
129
|
-
T.type_alias do
|
|
130
|
-
T.any(
|
|
131
|
-
ContextDev::Models::WebWebScrapeSitemapResponse::Meta,
|
|
132
|
-
ContextDev::Internal::AnyHash
|
|
133
|
-
)
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
# Number of errors encountered during crawling
|
|
137
|
-
sig { returns(Integer) }
|
|
138
|
-
attr_accessor :errors
|
|
139
|
-
|
|
140
|
-
# Total number of sitemap files discovered
|
|
141
|
-
sig { returns(Integer) }
|
|
142
|
-
attr_accessor :sitemaps_discovered
|
|
143
|
-
|
|
144
|
-
# Number of sitemap files successfully fetched and parsed
|
|
145
|
-
sig { returns(Integer) }
|
|
146
|
-
attr_accessor :sitemaps_fetched
|
|
147
|
-
|
|
148
|
-
# Number of sitemap files skipped (due to errors, timeouts, or limits)
|
|
149
|
-
sig { returns(Integer) }
|
|
150
|
-
attr_accessor :sitemaps_skipped
|
|
151
|
-
|
|
152
|
-
# Metadata about the sitemap crawl operation
|
|
153
|
-
sig do
|
|
154
|
-
params(
|
|
155
|
-
errors: Integer,
|
|
156
|
-
sitemaps_discovered: Integer,
|
|
157
|
-
sitemaps_fetched: Integer,
|
|
158
|
-
sitemaps_skipped: Integer
|
|
159
|
-
).returns(T.attached_class)
|
|
160
|
-
end
|
|
161
|
-
def self.new(
|
|
162
|
-
# Number of errors encountered during crawling
|
|
163
|
-
errors:,
|
|
164
|
-
# Total number of sitemap files discovered
|
|
165
|
-
sitemaps_discovered:,
|
|
166
|
-
# Number of sitemap files successfully fetched and parsed
|
|
167
|
-
sitemaps_fetched:,
|
|
168
|
-
# Number of sitemap files skipped (due to errors, timeouts, or limits)
|
|
169
|
-
sitemaps_skipped:
|
|
170
|
-
)
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
sig do
|
|
174
|
-
override.returns(
|
|
175
|
-
{
|
|
176
|
-
errors: Integer,
|
|
177
|
-
sitemaps_discovered: Integer,
|
|
178
|
-
sitemaps_fetched: Integer,
|
|
179
|
-
sitemaps_skipped: Integer
|
|
180
|
-
}
|
|
181
|
-
)
|
|
182
|
-
end
|
|
183
|
-
def to_hash
|
|
184
|
-
end
|
|
185
|
-
end
|
|
186
|
-
|
|
187
|
-
# Indicates success
|
|
188
|
-
module Success
|
|
189
|
-
extend ContextDev::Internal::Type::Enum
|
|
190
|
-
|
|
191
|
-
TaggedBoolean =
|
|
192
|
-
T.type_alias do
|
|
193
|
-
T.all(
|
|
194
|
-
T::Boolean,
|
|
195
|
-
ContextDev::Models::WebWebScrapeSitemapResponse::Success
|
|
196
|
-
)
|
|
197
|
-
end
|
|
198
|
-
OrBoolean = T.type_alias { T::Boolean }
|
|
199
|
-
|
|
200
|
-
TRUE =
|
|
201
|
-
T.let(
|
|
202
|
-
true,
|
|
203
|
-
ContextDev::Models::WebWebScrapeSitemapResponse::Success::TaggedBoolean
|
|
204
|
-
)
|
|
205
|
-
|
|
206
|
-
sig do
|
|
207
|
-
override.returns(
|
|
208
|
-
T::Array[
|
|
209
|
-
ContextDev::Models::WebWebScrapeSitemapResponse::Success::TaggedBoolean
|
|
210
|
-
]
|
|
211
|
-
)
|
|
212
|
-
end
|
|
213
|
-
def self.values
|
|
214
|
-
end
|
|
215
|
-
end
|
|
216
|
-
|
|
217
|
-
class KeyMetadata < ContextDev::Internal::Type::BaseModel
|
|
218
|
-
OrHash =
|
|
219
|
-
T.type_alias do
|
|
220
|
-
T.any(
|
|
221
|
-
ContextDev::Models::WebWebScrapeSitemapResponse::KeyMetadata,
|
|
222
|
-
ContextDev::Internal::AnyHash
|
|
223
|
-
)
|
|
224
|
-
end
|
|
225
|
-
|
|
226
|
-
# Credits used by this request.
|
|
227
|
-
sig { returns(Integer) }
|
|
228
|
-
attr_accessor :credits_consumed
|
|
229
|
-
|
|
230
|
-
# Credits remaining for your organization.
|
|
231
|
-
sig { returns(Integer) }
|
|
232
|
-
attr_accessor :credits_remaining
|
|
233
|
-
|
|
234
|
-
# Credit usage, included whenever a valid API key is provided.
|
|
235
|
-
sig do
|
|
236
|
-
params(credits_consumed: Integer, credits_remaining: Integer).returns(
|
|
237
|
-
T.attached_class
|
|
238
|
-
)
|
|
239
|
-
end
|
|
240
|
-
def self.new(
|
|
241
|
-
# Credits used by this request.
|
|
242
|
-
credits_consumed:,
|
|
243
|
-
# Credits remaining for your organization.
|
|
244
|
-
credits_remaining:
|
|
245
|
-
)
|
|
246
|
-
end
|
|
247
|
-
|
|
248
|
-
sig do
|
|
249
|
-
override.returns(
|
|
250
|
-
{ credits_consumed: Integer, credits_remaining: Integer }
|
|
251
|
-
)
|
|
252
|
-
end
|
|
253
|
-
def to_hash
|
|
254
|
-
end
|
|
255
|
-
end
|
|
256
|
-
end
|
|
257
|
-
end
|
|
258
|
-
end
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# typed: strong
|
|
2
|
-
|
|
3
|
-
module ContextDev
|
|
4
|
-
module Resources
|
|
5
|
-
class AI
|
|
6
|
-
# Given a single URL, determines if it is a product page and extracts the product
|
|
7
|
-
# information.
|
|
8
|
-
sig do
|
|
9
|
-
params(
|
|
10
|
-
url: String,
|
|
11
|
-
max_age_ms: Integer,
|
|
12
|
-
tags: T::Array[String],
|
|
13
|
-
timeout_opts: ContextDev::AIExtractProductParams::TimeoutOpts::OrHash,
|
|
14
|
-
request_options: ContextDev::RequestOptions::OrHash
|
|
15
|
-
).returns(ContextDev::Models::AIExtractProductResponse)
|
|
16
|
-
end
|
|
17
|
-
def extract_product(
|
|
18
|
-
# The product page URL to extract product data from.
|
|
19
|
-
url:,
|
|
20
|
-
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
21
|
-
# younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
|
|
22
|
-
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
23
|
-
max_age_ms: nil,
|
|
24
|
-
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
25
|
-
tags: nil,
|
|
26
|
-
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
27
|
-
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
28
|
-
# timeoutOpts object.
|
|
29
|
-
timeout_opts: nil,
|
|
30
|
-
request_options: {}
|
|
31
|
-
)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
# Extract product information from a brand's website. We will analyze the website
|
|
35
|
-
# and return a list of products with details such as name, description, image,
|
|
36
|
-
# pricing, features, and more.
|
|
37
|
-
sig do
|
|
38
|
-
params(
|
|
39
|
-
body:
|
|
40
|
-
T.any(
|
|
41
|
-
ContextDev::AIExtractProductsParams::Body::ByDomain::OrHash,
|
|
42
|
-
ContextDev::AIExtractProductsParams::Body::ByDirectURL::OrHash
|
|
43
|
-
),
|
|
44
|
-
request_options: ContextDev::RequestOptions::OrHash
|
|
45
|
-
).returns(ContextDev::Models::AIExtractProductsResponse)
|
|
46
|
-
end
|
|
47
|
-
def extract_products(body:, request_options: {})
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
# @api private
|
|
51
|
-
sig { params(client: ContextDev::Client).returns(T.attached_class) }
|
|
52
|
-
def self.new(client:)
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
module ContextDev
|
|
2
|
-
module Models
|
|
3
|
-
type ai_extract_product_params =
|
|
4
|
-
{
|
|
5
|
-
url: String,
|
|
6
|
-
max_age_ms: Integer,
|
|
7
|
-
tags: ::Array[String],
|
|
8
|
-
timeout_opts: ContextDev::AIExtractProductParams::TimeoutOpts
|
|
9
|
-
}
|
|
10
|
-
& ContextDev::Internal::Type::request_parameters
|
|
11
|
-
|
|
12
|
-
class AIExtractProductParams < ContextDev::Internal::Type::BaseModel
|
|
13
|
-
extend ContextDev::Internal::Type::RequestParameters::Converter
|
|
14
|
-
include ContextDev::Internal::Type::RequestParameters
|
|
15
|
-
|
|
16
|
-
attr_accessor url: String
|
|
17
|
-
|
|
18
|
-
attr_reader max_age_ms: Integer?
|
|
19
|
-
|
|
20
|
-
def max_age_ms=: (Integer) -> Integer
|
|
21
|
-
|
|
22
|
-
attr_reader tags: ::Array[String]?
|
|
23
|
-
|
|
24
|
-
def tags=: (::Array[String]) -> ::Array[String]
|
|
25
|
-
|
|
26
|
-
attr_reader timeout_opts: ContextDev::AIExtractProductParams::TimeoutOpts?
|
|
27
|
-
|
|
28
|
-
def timeout_opts=: (
|
|
29
|
-
ContextDev::AIExtractProductParams::TimeoutOpts
|
|
30
|
-
) -> ContextDev::AIExtractProductParams::TimeoutOpts
|
|
31
|
-
|
|
32
|
-
def initialize: (
|
|
33
|
-
url: String,
|
|
34
|
-
?max_age_ms: Integer,
|
|
35
|
-
?tags: ::Array[String],
|
|
36
|
-
?timeout_opts: ContextDev::AIExtractProductParams::TimeoutOpts,
|
|
37
|
-
?request_options: ContextDev::request_opts
|
|
38
|
-
) -> void
|
|
39
|
-
|
|
40
|
-
def to_hash: -> {
|
|
41
|
-
url: String,
|
|
42
|
-
max_age_ms: Integer,
|
|
43
|
-
tags: ::Array[String],
|
|
44
|
-
timeout_opts: ContextDev::AIExtractProductParams::TimeoutOpts,
|
|
45
|
-
request_options: ContextDev::RequestOptions
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
type timeout_opts =
|
|
49
|
-
{
|
|
50
|
-
milliseconds: Integer,
|
|
51
|
-
behavior: ContextDev::Models::AIExtractProductParams::TimeoutOpts::behavior
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
class TimeoutOpts < ContextDev::Internal::Type::BaseModel
|
|
55
|
-
attr_accessor milliseconds: Integer
|
|
56
|
-
|
|
57
|
-
attr_reader behavior: ContextDev::Models::AIExtractProductParams::TimeoutOpts::behavior?
|
|
58
|
-
|
|
59
|
-
def behavior=: (
|
|
60
|
-
ContextDev::Models::AIExtractProductParams::TimeoutOpts::behavior
|
|
61
|
-
) -> ContextDev::Models::AIExtractProductParams::TimeoutOpts::behavior
|
|
62
|
-
|
|
63
|
-
def initialize: (
|
|
64
|
-
milliseconds: Integer,
|
|
65
|
-
?behavior: ContextDev::Models::AIExtractProductParams::TimeoutOpts::behavior
|
|
66
|
-
) -> void
|
|
67
|
-
|
|
68
|
-
def to_hash: -> {
|
|
69
|
-
milliseconds: Integer,
|
|
70
|
-
behavior: ContextDev::Models::AIExtractProductParams::TimeoutOpts::behavior
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
type behavior = :fail | :"return-partial"
|
|
74
|
-
|
|
75
|
-
module Behavior
|
|
76
|
-
extend ContextDev::Internal::Type::Enum
|
|
77
|
-
|
|
78
|
-
FAIL: :fail
|
|
79
|
-
RETURN_PARTIAL: :"return-partial"
|
|
80
|
-
|
|
81
|
-
def self?.values: -> ::Array[ContextDev::Models::AIExtractProductParams::TimeoutOpts::behavior]
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
end
|
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
module ContextDev
|
|
2
|
-
module Models
|
|
3
|
-
type ai_extract_product_response =
|
|
4
|
-
{
|
|
5
|
-
cache_metadata: ContextDev::Models::AIExtractProductResponse::CacheMetadata,
|
|
6
|
-
request_id: String,
|
|
7
|
-
is_product_page: bool,
|
|
8
|
-
key_metadata: ContextDev::Models::AIExtractProductResponse::KeyMetadata,
|
|
9
|
-
partial: bool,
|
|
10
|
-
platform: ContextDev::Models::AIExtractProductResponse::platform?,
|
|
11
|
-
product: ContextDev::Models::AIExtractProductResponse::Product?
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
class AIExtractProductResponse < ContextDev::Internal::Type::BaseModel
|
|
15
|
-
attr_accessor cache_metadata: ContextDev::Models::AIExtractProductResponse::CacheMetadata
|
|
16
|
-
|
|
17
|
-
attr_accessor request_id: String
|
|
18
|
-
|
|
19
|
-
attr_reader is_product_page: bool?
|
|
20
|
-
|
|
21
|
-
def is_product_page=: (bool) -> bool
|
|
22
|
-
|
|
23
|
-
attr_reader key_metadata: ContextDev::Models::AIExtractProductResponse::KeyMetadata?
|
|
24
|
-
|
|
25
|
-
def key_metadata=: (
|
|
26
|
-
ContextDev::Models::AIExtractProductResponse::KeyMetadata
|
|
27
|
-
) -> ContextDev::Models::AIExtractProductResponse::KeyMetadata
|
|
28
|
-
|
|
29
|
-
attr_reader partial: bool?
|
|
30
|
-
|
|
31
|
-
def partial=: (bool) -> bool
|
|
32
|
-
|
|
33
|
-
attr_accessor platform: ContextDev::Models::AIExtractProductResponse::platform?
|
|
34
|
-
|
|
35
|
-
attr_accessor product: ContextDev::Models::AIExtractProductResponse::Product?
|
|
36
|
-
|
|
37
|
-
def initialize: (
|
|
38
|
-
cache_metadata: ContextDev::Models::AIExtractProductResponse::CacheMetadata,
|
|
39
|
-
request_id: String,
|
|
40
|
-
?is_product_page: bool,
|
|
41
|
-
?key_metadata: ContextDev::Models::AIExtractProductResponse::KeyMetadata,
|
|
42
|
-
?partial: bool,
|
|
43
|
-
?platform: ContextDev::Models::AIExtractProductResponse::platform?,
|
|
44
|
-
?product: ContextDev::Models::AIExtractProductResponse::Product?
|
|
45
|
-
) -> void
|
|
46
|
-
|
|
47
|
-
def to_hash: -> {
|
|
48
|
-
cache_metadata: ContextDev::Models::AIExtractProductResponse::CacheMetadata,
|
|
49
|
-
request_id: String,
|
|
50
|
-
is_product_page: bool,
|
|
51
|
-
key_metadata: ContextDev::Models::AIExtractProductResponse::KeyMetadata,
|
|
52
|
-
partial: bool,
|
|
53
|
-
platform: ContextDev::Models::AIExtractProductResponse::platform?,
|
|
54
|
-
product: ContextDev::Models::AIExtractProductResponse::Product?
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
type cache_metadata =
|
|
58
|
-
{
|
|
59
|
-
age_ms: Integer,
|
|
60
|
-
status: ContextDev::Models::AIExtractProductResponse::CacheMetadata::status
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
class CacheMetadata < ContextDev::Internal::Type::BaseModel
|
|
64
|
-
attr_accessor age_ms: Integer
|
|
65
|
-
|
|
66
|
-
attr_accessor status: ContextDev::Models::AIExtractProductResponse::CacheMetadata::status
|
|
67
|
-
|
|
68
|
-
def initialize: (
|
|
69
|
-
age_ms: Integer,
|
|
70
|
-
status: ContextDev::Models::AIExtractProductResponse::CacheMetadata::status
|
|
71
|
-
) -> void
|
|
72
|
-
|
|
73
|
-
def to_hash: -> {
|
|
74
|
-
age_ms: Integer,
|
|
75
|
-
status: ContextDev::Models::AIExtractProductResponse::CacheMetadata::status
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
type status = :hit | :miss | :zdr
|
|
79
|
-
|
|
80
|
-
module Status
|
|
81
|
-
extend ContextDev::Internal::Type::Enum
|
|
82
|
-
|
|
83
|
-
HIT: :hit
|
|
84
|
-
MISS: :miss
|
|
85
|
-
ZDR: :zdr
|
|
86
|
-
|
|
87
|
-
def self?.values: -> ::Array[ContextDev::Models::AIExtractProductResponse::CacheMetadata::status]
|
|
88
|
-
end
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
type key_metadata =
|
|
92
|
-
{ credits_consumed: Integer, credits_remaining: Integer }
|
|
93
|
-
|
|
94
|
-
class KeyMetadata < ContextDev::Internal::Type::BaseModel
|
|
95
|
-
attr_accessor credits_consumed: Integer
|
|
96
|
-
|
|
97
|
-
attr_accessor credits_remaining: Integer
|
|
98
|
-
|
|
99
|
-
def initialize: (
|
|
100
|
-
credits_consumed: Integer,
|
|
101
|
-
credits_remaining: Integer
|
|
102
|
-
) -> void
|
|
103
|
-
|
|
104
|
-
def to_hash: -> {
|
|
105
|
-
credits_consumed: Integer,
|
|
106
|
-
credits_remaining: Integer
|
|
107
|
-
}
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
type platform = :amazon | :tiktok_shop | :etsy | :generic
|
|
111
|
-
|
|
112
|
-
module Platform
|
|
113
|
-
extend ContextDev::Internal::Type::Enum
|
|
114
|
-
|
|
115
|
-
AMAZON: :amazon
|
|
116
|
-
TIKTOK_SHOP: :tiktok_shop
|
|
117
|
-
ETSY: :etsy
|
|
118
|
-
GENERIC: :generic
|
|
119
|
-
|
|
120
|
-
def self?.values: -> ::Array[ContextDev::Models::AIExtractProductResponse::platform]
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
type product =
|
|
124
|
-
{
|
|
125
|
-
description: String,
|
|
126
|
-
features: ::Array[String],
|
|
127
|
-
images: ::Array[String],
|
|
128
|
-
name: String,
|
|
129
|
-
sku: String?,
|
|
130
|
-
tags: ::Array[String],
|
|
131
|
-
target_audience: ::Array[String],
|
|
132
|
-
availability: ContextDev::Models::AIExtractProductResponse::Product::availability?,
|
|
133
|
-
billing_frequency: ContextDev::Models::AIExtractProductResponse::Product::billing_frequency?,
|
|
134
|
-
category: String?,
|
|
135
|
-
currency: String?,
|
|
136
|
-
dimensions: ::Array[String],
|
|
137
|
-
image_url: String?,
|
|
138
|
-
price: Float?,
|
|
139
|
-
pricing_model: ContextDev::Models::AIExtractProductResponse::Product::pricing_model?,
|
|
140
|
-
regular_price: Float?,
|
|
141
|
-
url: String?
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
class Product < ContextDev::Internal::Type::BaseModel
|
|
145
|
-
attr_accessor description: String
|
|
146
|
-
|
|
147
|
-
attr_accessor features: ::Array[String]
|
|
148
|
-
|
|
149
|
-
attr_accessor images: ::Array[String]
|
|
150
|
-
|
|
151
|
-
attr_accessor name: String
|
|
152
|
-
|
|
153
|
-
attr_accessor sku: String?
|
|
154
|
-
|
|
155
|
-
attr_accessor tags: ::Array[String]
|
|
156
|
-
|
|
157
|
-
attr_accessor target_audience: ::Array[String]
|
|
158
|
-
|
|
159
|
-
attr_accessor availability: ContextDev::Models::AIExtractProductResponse::Product::availability?
|
|
160
|
-
|
|
161
|
-
attr_accessor billing_frequency: ContextDev::Models::AIExtractProductResponse::Product::billing_frequency?
|
|
162
|
-
|
|
163
|
-
attr_accessor category: String?
|
|
164
|
-
|
|
165
|
-
attr_accessor currency: String?
|
|
166
|
-
|
|
167
|
-
attr_reader dimensions: ::Array[String]?
|
|
168
|
-
|
|
169
|
-
def dimensions=: (::Array[String]) -> ::Array[String]
|
|
170
|
-
|
|
171
|
-
attr_accessor image_url: String?
|
|
172
|
-
|
|
173
|
-
attr_accessor price: Float?
|
|
174
|
-
|
|
175
|
-
attr_accessor pricing_model: ContextDev::Models::AIExtractProductResponse::Product::pricing_model?
|
|
176
|
-
|
|
177
|
-
attr_accessor regular_price: Float?
|
|
178
|
-
|
|
179
|
-
attr_accessor url: String?
|
|
180
|
-
|
|
181
|
-
def initialize: (
|
|
182
|
-
description: String,
|
|
183
|
-
features: ::Array[String],
|
|
184
|
-
images: ::Array[String],
|
|
185
|
-
name: String,
|
|
186
|
-
sku: String?,
|
|
187
|
-
tags: ::Array[String],
|
|
188
|
-
target_audience: ::Array[String],
|
|
189
|
-
?availability: ContextDev::Models::AIExtractProductResponse::Product::availability?,
|
|
190
|
-
?billing_frequency: ContextDev::Models::AIExtractProductResponse::Product::billing_frequency?,
|
|
191
|
-
?category: String?,
|
|
192
|
-
?currency: String?,
|
|
193
|
-
?dimensions: ::Array[String],
|
|
194
|
-
?image_url: String?,
|
|
195
|
-
?price: Float?,
|
|
196
|
-
?pricing_model: ContextDev::Models::AIExtractProductResponse::Product::pricing_model?,
|
|
197
|
-
?regular_price: Float?,
|
|
198
|
-
?url: String?
|
|
199
|
-
) -> void
|
|
200
|
-
|
|
201
|
-
def to_hash: -> {
|
|
202
|
-
description: String,
|
|
203
|
-
features: ::Array[String],
|
|
204
|
-
images: ::Array[String],
|
|
205
|
-
name: String,
|
|
206
|
-
sku: String?,
|
|
207
|
-
tags: ::Array[String],
|
|
208
|
-
target_audience: ::Array[String],
|
|
209
|
-
availability: ContextDev::Models::AIExtractProductResponse::Product::availability?,
|
|
210
|
-
billing_frequency: ContextDev::Models::AIExtractProductResponse::Product::billing_frequency?,
|
|
211
|
-
category: String?,
|
|
212
|
-
currency: String?,
|
|
213
|
-
dimensions: ::Array[String],
|
|
214
|
-
image_url: String?,
|
|
215
|
-
price: Float?,
|
|
216
|
-
pricing_model: ContextDev::Models::AIExtractProductResponse::Product::pricing_model?,
|
|
217
|
-
regular_price: Float?,
|
|
218
|
-
url: String?
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
type availability =
|
|
222
|
-
:in_stock
|
|
223
|
-
| :out_of_stock
|
|
224
|
-
| :limited_availability
|
|
225
|
-
| :preorder
|
|
226
|
-
| :backorder
|
|
227
|
-
| :made_to_order
|
|
228
|
-
| :discontinued
|
|
229
|
-
|
|
230
|
-
module Availability
|
|
231
|
-
extend ContextDev::Internal::Type::Enum
|
|
232
|
-
|
|
233
|
-
IN_STOCK: :in_stock
|
|
234
|
-
OUT_OF_STOCK: :out_of_stock
|
|
235
|
-
LIMITED_AVAILABILITY: :limited_availability
|
|
236
|
-
PREORDER: :preorder
|
|
237
|
-
BACKORDER: :backorder
|
|
238
|
-
MADE_TO_ORDER: :made_to_order
|
|
239
|
-
DISCONTINUED: :discontinued
|
|
240
|
-
|
|
241
|
-
def self?.values: -> ::Array[ContextDev::Models::AIExtractProductResponse::Product::availability]
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
type billing_frequency = :monthly | :yearly | :one_time | :usage_based
|
|
245
|
-
|
|
246
|
-
module BillingFrequency
|
|
247
|
-
extend ContextDev::Internal::Type::Enum
|
|
248
|
-
|
|
249
|
-
MONTHLY: :monthly
|
|
250
|
-
YEARLY: :yearly
|
|
251
|
-
ONE_TIME: :one_time
|
|
252
|
-
USAGE_BASED: :usage_based
|
|
253
|
-
|
|
254
|
-
def self?.values: -> ::Array[ContextDev::Models::AIExtractProductResponse::Product::billing_frequency]
|
|
255
|
-
end
|
|
256
|
-
|
|
257
|
-
type pricing_model = :per_seat | :flat | :tiered | :freemium | :custom
|
|
258
|
-
|
|
259
|
-
module PricingModel
|
|
260
|
-
extend ContextDev::Internal::Type::Enum
|
|
261
|
-
|
|
262
|
-
PER_SEAT: :per_seat
|
|
263
|
-
FLAT: :flat
|
|
264
|
-
TIERED: :tiered
|
|
265
|
-
FREEMIUM: :freemium
|
|
266
|
-
CUSTOM: :custom
|
|
267
|
-
|
|
268
|
-
def self?.values: -> ::Array[ContextDev::Models::AIExtractProductResponse::Product::pricing_model]
|
|
269
|
-
end
|
|
270
|
-
end
|
|
271
|
-
end
|
|
272
|
-
end
|
|
273
|
-
end
|