context.dev 2.19.0 → 2.21.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 +219 -0
- data/README.md +1 -1
- data/lib/context_dev/client.rb +6 -0
- data/lib/context_dev/models/feedback_submit_params.rb +73 -0
- data/lib/context_dev/models/feedback_submit_response.rb +68 -0
- data/lib/context_dev/models/news_search_params.rb +13 -6
- data/lib/context_dev/models/web_scrape_params.rb +149 -14
- data/lib/context_dev/models/web_scrape_response.rb +404 -12
- data/lib/context_dev/models.rb +2 -0
- data/lib/context_dev/resources/feedback.rb +50 -0
- data/lib/context_dev/resources/news.rb +8 -4
- data/lib/context_dev/resources/web.rb +26 -8
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +3 -0
- data/rbi/context_dev/client.rbi +5 -0
- data/rbi/context_dev/models/feedback_submit_params.rbi +133 -0
- data/rbi/context_dev/models/feedback_submit_response.rbi +122 -0
- data/rbi/context_dev/models/news_search_params.rbi +12 -6
- data/rbi/context_dev/models/web_scrape_params.rbi +248 -18
- data/rbi/context_dev/models/web_scrape_response.rbi +702 -30
- data/rbi/context_dev/models.rbi +2 -0
- data/rbi/context_dev/resources/feedback.rbi +42 -0
- data/rbi/context_dev/resources/news.rbi +7 -4
- data/rbi/context_dev/resources/web.rbi +38 -12
- data/sig/context_dev/client.rbs +2 -0
- data/sig/context_dev/models/feedback_submit_params.rbs +73 -0
- data/sig/context_dev/models/feedback_submit_response.rbs +58 -0
- data/sig/context_dev/models/web_scrape_params.rbs +91 -0
- data/sig/context_dev/models/web_scrape_response.rbs +302 -18
- data/sig/context_dev/models.rbs +2 -0
- data/sig/context_dev/resources/feedback.rbs +16 -0
- data/sig/context_dev/resources/web.rbs +3 -0
- metadata +11 -2
|
@@ -19,6 +19,14 @@ module ContextDev
|
|
|
19
19
|
# @return [ContextDev::Models::WebScrapeResponse::CacheMetadata]
|
|
20
20
|
required :cache_metadata, -> { ContextDev::Models::WebScrapeResponse::CacheMetadata }
|
|
21
21
|
|
|
22
|
+
# @!attribute highlights
|
|
23
|
+
# Relevant Markdown excerpts for your question or topic, in page order. Headings
|
|
24
|
+
# in square brackets supply necessary context; ellipses mark omitted portions.
|
|
25
|
+
# Empty when the page has no text.
|
|
26
|
+
#
|
|
27
|
+
# @return [ContextDev::Models::WebScrapeResponse::Highlights]
|
|
28
|
+
required :highlights, -> { ContextDev::Models::WebScrapeResponse::Highlights }
|
|
29
|
+
|
|
22
30
|
# @!attribute html
|
|
23
31
|
# Rendered HTML after content filters.
|
|
24
32
|
#
|
|
@@ -31,6 +39,12 @@ module ContextDev
|
|
|
31
39
|
# @return [ContextDev::Models::WebScrapeResponse::Images]
|
|
32
40
|
required :images, -> { ContextDev::Models::WebScrapeResponse::Images }
|
|
33
41
|
|
|
42
|
+
# @!attribute json
|
|
43
|
+
# Page data extracted using your schema.
|
|
44
|
+
#
|
|
45
|
+
# @return [ContextDev::Models::WebScrapeResponse::Json]
|
|
46
|
+
required :json, -> { ContextDev::Models::WebScrapeResponse::Json }
|
|
47
|
+
|
|
34
48
|
# @!attribute markdown
|
|
35
49
|
# Markdown after content filters.
|
|
36
50
|
#
|
|
@@ -49,6 +63,12 @@ module ContextDev
|
|
|
49
63
|
# @return [ContextDev::Models::WebScrapeResponse::Parsed]
|
|
50
64
|
required :parsed, -> { ContextDev::Models::WebScrapeResponse::Parsed }
|
|
51
65
|
|
|
66
|
+
# @!attribute product
|
|
67
|
+
# Product details found on the page.
|
|
68
|
+
#
|
|
69
|
+
# @return [ContextDev::Models::WebScrapeResponse::Product]
|
|
70
|
+
required :product, -> { ContextDev::Models::WebScrapeResponse::Product }
|
|
71
|
+
|
|
52
72
|
# @!attribute request_id
|
|
53
73
|
# Unique id of this API call, also sent in the X-Request-Id response header. Quote
|
|
54
74
|
# it when contacting support about a failed request.
|
|
@@ -69,8 +89,11 @@ module ContextDev
|
|
|
69
89
|
required :url, String
|
|
70
90
|
|
|
71
91
|
# @!attribute is_partial
|
|
72
|
-
# Present when
|
|
73
|
-
#
|
|
92
|
+
# Present when at least one requested output succeeds while another fails, or when
|
|
93
|
+
# successful outputs come from a page that is still loading or images returned
|
|
94
|
+
# before processing finished. Absent when every requested output fails. Check each
|
|
95
|
+
# output's success field for its result. Valid captured pieces may be cached
|
|
96
|
+
# independently; failed retrievals and incomplete captures are not cached.
|
|
74
97
|
#
|
|
75
98
|
# @return [Boolean, ContextDev::Models::WebScrapeResponse::IsPartial, nil]
|
|
76
99
|
optional :is_partial, enum: -> { ContextDev::Models::WebScrapeResponse::IsPartial }, api_name: :isPartial
|
|
@@ -81,7 +104,7 @@ module ContextDev
|
|
|
81
104
|
# @return [ContextDev::Models::WebScrapeResponse::KeyMetadata, nil]
|
|
82
105
|
optional :key_metadata, -> { ContextDev::Models::WebScrapeResponse::KeyMetadata }
|
|
83
106
|
|
|
84
|
-
# @!method initialize(bytes:, cache_metadata:, html:, images:, markdown:, metadata:, parsed:, request_id:, screenshot:, url:, is_partial: nil, key_metadata: nil)
|
|
107
|
+
# @!method initialize(bytes:, cache_metadata:, highlights:, html:, images:, json:, markdown:, metadata:, parsed:, product:, request_id:, screenshot:, url:, is_partial: nil, key_metadata: nil)
|
|
85
108
|
# Some parameter documentations has been truncated, see
|
|
86
109
|
# {ContextDev::Models::WebScrapeResponse} for more details.
|
|
87
110
|
#
|
|
@@ -89,23 +112,29 @@ module ContextDev
|
|
|
89
112
|
#
|
|
90
113
|
# @param cache_metadata [ContextDev::Models::WebScrapeResponse::CacheMetadata] Cache outcome for this response. Composite responses are hits only when every ca
|
|
91
114
|
#
|
|
115
|
+
# @param highlights [ContextDev::Models::WebScrapeResponse::Highlights] Relevant Markdown excerpts for your question or topic, in page order. Headings i
|
|
116
|
+
#
|
|
92
117
|
# @param html [ContextDev::Models::WebScrapeResponse::HTML] Rendered HTML after content filters.
|
|
93
118
|
#
|
|
94
119
|
# @param images [ContextDev::Models::WebScrapeResponse::Images] Images after content filters. Empty when none are found.
|
|
95
120
|
#
|
|
121
|
+
# @param json [ContextDev::Models::WebScrapeResponse::Json] Page data extracted using your schema.
|
|
122
|
+
#
|
|
96
123
|
# @param markdown [ContextDev::Models::WebScrapeResponse::Markdown] Markdown after content filters.
|
|
97
124
|
#
|
|
98
125
|
# @param metadata [ContextDev::Models::WebScrapeResponse::Metadata] Page details, when available.
|
|
99
126
|
#
|
|
100
127
|
# @param parsed [ContextDev::Models::WebScrapeResponse::Parsed] Fields produced by parseParams.rules, after shared content filters.
|
|
101
128
|
#
|
|
129
|
+
# @param product [ContextDev::Models::WebScrapeResponse::Product] Product details found on the page.
|
|
130
|
+
#
|
|
102
131
|
# @param request_id [String] Unique id of this API call, also sent in the X-Request-Id response header. Quote
|
|
103
132
|
#
|
|
104
133
|
# @param screenshot [ContextDev::Models::WebScrapeResponse::Screenshot] An image data URL. Use directly as an image src.
|
|
105
134
|
#
|
|
106
135
|
# @param url [String] Final URL after redirects and browser actions.
|
|
107
136
|
#
|
|
108
|
-
# @param is_partial [Boolean, ContextDev::Models::WebScrapeResponse::IsPartial] Present when
|
|
137
|
+
# @param is_partial [Boolean, ContextDev::Models::WebScrapeResponse::IsPartial] Present when at least one requested output succeeds while another fails, or when
|
|
109
138
|
#
|
|
110
139
|
# @param key_metadata [ContextDev::Models::WebScrapeResponse::KeyMetadata] Credit usage, included whenever a valid API key is provided.
|
|
111
140
|
|
|
@@ -121,12 +150,21 @@ module ContextDev
|
|
|
121
150
|
# @return [Boolean]
|
|
122
151
|
required :requested, ContextDev::Internal::Type::Boolean
|
|
123
152
|
|
|
124
|
-
# @!
|
|
153
|
+
# @!attribute success
|
|
154
|
+
# True when retrieved, false when retrieval failed, and null when not requested.
|
|
155
|
+
#
|
|
156
|
+
# @return [Boolean, nil]
|
|
157
|
+
required :success, ContextDev::Internal::Type::Boolean, nil?: true
|
|
158
|
+
|
|
159
|
+
# @!method initialize(data:, requested:, success:)
|
|
125
160
|
# Original HTTP response body. Waiting, actions, and content filters never change
|
|
126
161
|
# it.
|
|
127
162
|
#
|
|
128
163
|
# @param data [ContextDev::Models::WebScrapeResponse::Bytes::Data, nil]
|
|
164
|
+
#
|
|
129
165
|
# @param requested [Boolean]
|
|
166
|
+
#
|
|
167
|
+
# @param success [Boolean, nil] True when retrieved, false when retrieval failed, and null when not requested.
|
|
130
168
|
|
|
131
169
|
# @see ContextDev::Models::WebScrapeResponse::Bytes#data
|
|
132
170
|
class Data < ContextDev::Internal::Type::BaseModel
|
|
@@ -195,6 +233,36 @@ module ContextDev
|
|
|
195
233
|
end
|
|
196
234
|
end
|
|
197
235
|
|
|
236
|
+
# @see ContextDev::Models::WebScrapeResponse#highlights
|
|
237
|
+
class Highlights < ContextDev::Internal::Type::BaseModel
|
|
238
|
+
# @!attribute data
|
|
239
|
+
#
|
|
240
|
+
# @return [Array<String>, nil]
|
|
241
|
+
required :data, ContextDev::Internal::Type::ArrayOf[String], nil?: true
|
|
242
|
+
|
|
243
|
+
# @!attribute requested
|
|
244
|
+
#
|
|
245
|
+
# @return [Boolean]
|
|
246
|
+
required :requested, ContextDev::Internal::Type::Boolean
|
|
247
|
+
|
|
248
|
+
# @!attribute success
|
|
249
|
+
# True when retrieved, false when retrieval failed, and null when not requested.
|
|
250
|
+
#
|
|
251
|
+
# @return [Boolean, nil]
|
|
252
|
+
required :success, ContextDev::Internal::Type::Boolean, nil?: true
|
|
253
|
+
|
|
254
|
+
# @!method initialize(data:, requested:, success:)
|
|
255
|
+
# Relevant Markdown excerpts for your question or topic, in page order. Headings
|
|
256
|
+
# in square brackets supply necessary context; ellipses mark omitted portions.
|
|
257
|
+
# Empty when the page has no text.
|
|
258
|
+
#
|
|
259
|
+
# @param data [Array<String>, nil]
|
|
260
|
+
#
|
|
261
|
+
# @param requested [Boolean]
|
|
262
|
+
#
|
|
263
|
+
# @param success [Boolean, nil] True when retrieved, false when retrieval failed, and null when not requested.
|
|
264
|
+
end
|
|
265
|
+
|
|
198
266
|
# @see ContextDev::Models::WebScrapeResponse#html
|
|
199
267
|
class HTML < ContextDev::Internal::Type::BaseModel
|
|
200
268
|
# @!attribute data
|
|
@@ -207,11 +275,20 @@ module ContextDev
|
|
|
207
275
|
# @return [Boolean]
|
|
208
276
|
required :requested, ContextDev::Internal::Type::Boolean
|
|
209
277
|
|
|
210
|
-
# @!
|
|
278
|
+
# @!attribute success
|
|
279
|
+
# True when retrieved, false when retrieval failed, and null when not requested.
|
|
280
|
+
#
|
|
281
|
+
# @return [Boolean, nil]
|
|
282
|
+
required :success, ContextDev::Internal::Type::Boolean, nil?: true
|
|
283
|
+
|
|
284
|
+
# @!method initialize(data:, requested:, success:)
|
|
211
285
|
# Rendered HTML after content filters.
|
|
212
286
|
#
|
|
213
287
|
# @param data [String, nil]
|
|
288
|
+
#
|
|
214
289
|
# @param requested [Boolean]
|
|
290
|
+
#
|
|
291
|
+
# @param success [Boolean, nil] True when retrieved, false when retrieval failed, and null when not requested.
|
|
215
292
|
end
|
|
216
293
|
|
|
217
294
|
# @see ContextDev::Models::WebScrapeResponse#images
|
|
@@ -228,11 +305,20 @@ module ContextDev
|
|
|
228
305
|
# @return [Boolean]
|
|
229
306
|
required :requested, ContextDev::Internal::Type::Boolean
|
|
230
307
|
|
|
231
|
-
# @!
|
|
308
|
+
# @!attribute success
|
|
309
|
+
# True when retrieved, false when retrieval failed, and null when not requested.
|
|
310
|
+
#
|
|
311
|
+
# @return [Boolean, nil]
|
|
312
|
+
required :success, ContextDev::Internal::Type::Boolean, nil?: true
|
|
313
|
+
|
|
314
|
+
# @!method initialize(data:, requested:, success:)
|
|
232
315
|
# Images after content filters. Empty when none are found.
|
|
233
316
|
#
|
|
234
317
|
# @param data [Array<ContextDev::Models::WebScrapeResponse::Images::Data>, nil]
|
|
318
|
+
#
|
|
235
319
|
# @param requested [Boolean]
|
|
320
|
+
#
|
|
321
|
+
# @param success [Boolean, nil] True when retrieved, false when retrieval failed, and null when not requested.
|
|
236
322
|
|
|
237
323
|
class Data < ContextDev::Internal::Type::BaseModel
|
|
238
324
|
# @!attribute alt
|
|
@@ -304,6 +390,34 @@ module ContextDev
|
|
|
304
390
|
end
|
|
305
391
|
end
|
|
306
392
|
|
|
393
|
+
# @see ContextDev::Models::WebScrapeResponse#json
|
|
394
|
+
class Json < ContextDev::Internal::Type::BaseModel
|
|
395
|
+
# @!attribute data
|
|
396
|
+
#
|
|
397
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
398
|
+
required :data, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown], nil?: true
|
|
399
|
+
|
|
400
|
+
# @!attribute requested
|
|
401
|
+
#
|
|
402
|
+
# @return [Boolean]
|
|
403
|
+
required :requested, ContextDev::Internal::Type::Boolean
|
|
404
|
+
|
|
405
|
+
# @!attribute success
|
|
406
|
+
# True when retrieved, false when retrieval failed, and null when not requested.
|
|
407
|
+
#
|
|
408
|
+
# @return [Boolean, nil]
|
|
409
|
+
required :success, ContextDev::Internal::Type::Boolean, nil?: true
|
|
410
|
+
|
|
411
|
+
# @!method initialize(data:, requested:, success:)
|
|
412
|
+
# Page data extracted using your schema.
|
|
413
|
+
#
|
|
414
|
+
# @param data [Hash{Symbol=>Object}, nil]
|
|
415
|
+
#
|
|
416
|
+
# @param requested [Boolean]
|
|
417
|
+
#
|
|
418
|
+
# @param success [Boolean, nil] True when retrieved, false when retrieval failed, and null when not requested.
|
|
419
|
+
end
|
|
420
|
+
|
|
307
421
|
# @see ContextDev::Models::WebScrapeResponse#markdown
|
|
308
422
|
class Markdown < ContextDev::Internal::Type::BaseModel
|
|
309
423
|
# @!attribute data
|
|
@@ -316,11 +430,20 @@ module ContextDev
|
|
|
316
430
|
# @return [Boolean]
|
|
317
431
|
required :requested, ContextDev::Internal::Type::Boolean
|
|
318
432
|
|
|
319
|
-
# @!
|
|
433
|
+
# @!attribute success
|
|
434
|
+
# True when retrieved, false when retrieval failed, and null when not requested.
|
|
435
|
+
#
|
|
436
|
+
# @return [Boolean, nil]
|
|
437
|
+
required :success, ContextDev::Internal::Type::Boolean, nil?: true
|
|
438
|
+
|
|
439
|
+
# @!method initialize(data:, requested:, success:)
|
|
320
440
|
# Markdown after content filters.
|
|
321
441
|
#
|
|
322
442
|
# @param data [String, nil]
|
|
443
|
+
#
|
|
323
444
|
# @param requested [Boolean]
|
|
445
|
+
#
|
|
446
|
+
# @param success [Boolean, nil] True when retrieved, false when retrieval failed, and null when not requested.
|
|
324
447
|
end
|
|
325
448
|
|
|
326
449
|
# @see ContextDev::Models::WebScrapeResponse#metadata
|
|
@@ -594,11 +717,268 @@ module ContextDev
|
|
|
594
717
|
# @return [Boolean]
|
|
595
718
|
required :requested, ContextDev::Internal::Type::Boolean
|
|
596
719
|
|
|
597
|
-
# @!
|
|
720
|
+
# @!attribute success
|
|
721
|
+
# True when retrieved, false when retrieval failed, and null when not requested.
|
|
722
|
+
#
|
|
723
|
+
# @return [Boolean, nil]
|
|
724
|
+
required :success, ContextDev::Internal::Type::Boolean, nil?: true
|
|
725
|
+
|
|
726
|
+
# @!method initialize(data:, requested:, success:)
|
|
598
727
|
# Fields produced by parseParams.rules, after shared content filters.
|
|
599
728
|
#
|
|
600
729
|
# @param data [Hash{Symbol=>Object}, nil]
|
|
730
|
+
#
|
|
601
731
|
# @param requested [Boolean]
|
|
732
|
+
#
|
|
733
|
+
# @param success [Boolean, nil] True when retrieved, false when retrieval failed, and null when not requested.
|
|
734
|
+
end
|
|
735
|
+
|
|
736
|
+
# @see ContextDev::Models::WebScrapeResponse#product
|
|
737
|
+
class Product < ContextDev::Internal::Type::BaseModel
|
|
738
|
+
# @!attribute data
|
|
739
|
+
#
|
|
740
|
+
# @return [ContextDev::Models::WebScrapeResponse::Product::Data, nil]
|
|
741
|
+
required :data, -> { ContextDev::Models::WebScrapeResponse::Product::Data }, nil?: true
|
|
742
|
+
|
|
743
|
+
# @!attribute requested
|
|
744
|
+
#
|
|
745
|
+
# @return [Boolean]
|
|
746
|
+
required :requested, ContextDev::Internal::Type::Boolean
|
|
747
|
+
|
|
748
|
+
# @!attribute success
|
|
749
|
+
# True when retrieved, false when retrieval failed, and null when not requested.
|
|
750
|
+
#
|
|
751
|
+
# @return [Boolean, nil]
|
|
752
|
+
required :success, ContextDev::Internal::Type::Boolean, nil?: true
|
|
753
|
+
|
|
754
|
+
# @!method initialize(data:, requested:, success:)
|
|
755
|
+
# Product details found on the page.
|
|
756
|
+
#
|
|
757
|
+
# @param data [ContextDev::Models::WebScrapeResponse::Product::Data, nil]
|
|
758
|
+
#
|
|
759
|
+
# @param requested [Boolean]
|
|
760
|
+
#
|
|
761
|
+
# @param success [Boolean, nil] True when retrieved, false when retrieval failed, and null when not requested.
|
|
762
|
+
|
|
763
|
+
# @see ContextDev::Models::WebScrapeResponse::Product#data
|
|
764
|
+
class Data < ContextDev::Internal::Type::BaseModel
|
|
765
|
+
# @!attribute is_product_page
|
|
766
|
+
# Whether the page is a product detail page.
|
|
767
|
+
#
|
|
768
|
+
# @return [Boolean]
|
|
769
|
+
required :is_product_page, ContextDev::Internal::Type::Boolean, api_name: :isProductPage
|
|
770
|
+
|
|
771
|
+
# @!attribute product
|
|
772
|
+
# The extracted product, or null when the page is not a product detail page.
|
|
773
|
+
#
|
|
774
|
+
# @return [ContextDev::Models::WebScrapeResponse::Product::Data::Product, nil]
|
|
775
|
+
required :product, -> { ContextDev::Models::WebScrapeResponse::Product::Data::Product }, nil?: true
|
|
776
|
+
|
|
777
|
+
# @!method initialize(is_product_page:, product:)
|
|
778
|
+
# @param is_product_page [Boolean] Whether the page is a product detail page.
|
|
779
|
+
#
|
|
780
|
+
# @param product [ContextDev::Models::WebScrapeResponse::Product::Data::Product, nil] The extracted product, or null when the page is not a product detail page.
|
|
781
|
+
|
|
782
|
+
# @see ContextDev::Models::WebScrapeResponse::Product::Data#product
|
|
783
|
+
class Product < ContextDev::Internal::Type::BaseModel
|
|
784
|
+
# @!attribute availability
|
|
785
|
+
# Stock or ordering availability.
|
|
786
|
+
#
|
|
787
|
+
# @return [Symbol, ContextDev::Models::WebScrapeResponse::Product::Data::Product::Availability, nil]
|
|
788
|
+
required :availability,
|
|
789
|
+
enum: -> { ContextDev::Models::WebScrapeResponse::Product::Data::Product::Availability },
|
|
790
|
+
nil?: true
|
|
791
|
+
|
|
792
|
+
# @!attribute brand
|
|
793
|
+
# Brand or vendor.
|
|
794
|
+
#
|
|
795
|
+
# @return [String, nil]
|
|
796
|
+
required :brand, String, nil?: true
|
|
797
|
+
|
|
798
|
+
# @!attribute category
|
|
799
|
+
# Product category.
|
|
800
|
+
#
|
|
801
|
+
# @return [String, nil]
|
|
802
|
+
required :category, String, nil?: true
|
|
803
|
+
|
|
804
|
+
# @!attribute currency
|
|
805
|
+
# ISO 4217 currency code.
|
|
806
|
+
#
|
|
807
|
+
# @return [String, nil]
|
|
808
|
+
required :currency, String, nil?: true
|
|
809
|
+
|
|
810
|
+
# @!attribute description
|
|
811
|
+
# Product description.
|
|
812
|
+
#
|
|
813
|
+
# @return [String, nil]
|
|
814
|
+
required :description, String, nil?: true
|
|
815
|
+
|
|
816
|
+
# @!attribute dimensions
|
|
817
|
+
# Product dimensions as shown on the page.
|
|
818
|
+
#
|
|
819
|
+
# @return [Array<String>]
|
|
820
|
+
required :dimensions, ContextDev::Internal::Type::ArrayOf[String]
|
|
821
|
+
|
|
822
|
+
# @!attribute features
|
|
823
|
+
# Key features and specifications.
|
|
824
|
+
#
|
|
825
|
+
# @return [Array<String>]
|
|
826
|
+
required :features, ContextDev::Internal::Type::ArrayOf[String]
|
|
827
|
+
|
|
828
|
+
# @!attribute images
|
|
829
|
+
# Product image URLs, main image first.
|
|
830
|
+
#
|
|
831
|
+
# @return [Array<String>]
|
|
832
|
+
required :images, ContextDev::Internal::Type::ArrayOf[String]
|
|
833
|
+
|
|
834
|
+
# @!attribute image_url
|
|
835
|
+
# Main product image URL.
|
|
836
|
+
#
|
|
837
|
+
# @return [String, nil]
|
|
838
|
+
required :image_url, String, api_name: :imageUrl, nil?: true
|
|
839
|
+
|
|
840
|
+
# @!attribute name
|
|
841
|
+
# Product name.
|
|
842
|
+
#
|
|
843
|
+
# @return [String]
|
|
844
|
+
required :name, String
|
|
845
|
+
|
|
846
|
+
# @!attribute price
|
|
847
|
+
# Current price.
|
|
848
|
+
#
|
|
849
|
+
# @return [Float, nil]
|
|
850
|
+
required :price, Float, nil?: true
|
|
851
|
+
|
|
852
|
+
# @!attribute regular_price
|
|
853
|
+
# List price before any discount.
|
|
854
|
+
#
|
|
855
|
+
# @return [Float, nil]
|
|
856
|
+
required :regular_price, Float, api_name: :regularPrice, nil?: true
|
|
857
|
+
|
|
858
|
+
# @!attribute sku
|
|
859
|
+
# Product identifier such as a SKU or model number.
|
|
860
|
+
#
|
|
861
|
+
# @return [String, nil]
|
|
862
|
+
required :sku, String, nil?: true
|
|
863
|
+
|
|
864
|
+
# @!attribute tags
|
|
865
|
+
# Product tags.
|
|
866
|
+
#
|
|
867
|
+
# @return [Array<String>]
|
|
868
|
+
required :tags, ContextDev::Internal::Type::ArrayOf[String]
|
|
869
|
+
|
|
870
|
+
# @!attribute target_audience
|
|
871
|
+
# Intended audience.
|
|
872
|
+
#
|
|
873
|
+
# @return [Array<String>]
|
|
874
|
+
required :target_audience, ContextDev::Internal::Type::ArrayOf[String], api_name: :targetAudience
|
|
875
|
+
|
|
876
|
+
# @!attribute variants
|
|
877
|
+
# Product variations, such as different colors or sizes, with their attributes and
|
|
878
|
+
# images. Empty if none are found. May not include every variation offered by the
|
|
879
|
+
# store.
|
|
880
|
+
#
|
|
881
|
+
# @return [Array<ContextDev::Models::WebScrapeResponse::Product::Data::Product::Variant>]
|
|
882
|
+
required :variants,
|
|
883
|
+
-> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::WebScrapeResponse::Product::Data::Product::Variant] }
|
|
884
|
+
|
|
885
|
+
# @!method initialize(availability:, brand:, category:, currency:, description:, dimensions:, features:, images:, image_url:, name:, price:, regular_price:, sku:, tags:, target_audience:, variants:)
|
|
886
|
+
# Some parameter documentations has been truncated, see
|
|
887
|
+
# {ContextDev::Models::WebScrapeResponse::Product::Data::Product} for more
|
|
888
|
+
# details.
|
|
889
|
+
#
|
|
890
|
+
# The extracted product, or null when the page is not a product detail page.
|
|
891
|
+
#
|
|
892
|
+
# @param availability [Symbol, ContextDev::Models::WebScrapeResponse::Product::Data::Product::Availability, nil] Stock or ordering availability.
|
|
893
|
+
#
|
|
894
|
+
# @param brand [String, nil] Brand or vendor.
|
|
895
|
+
#
|
|
896
|
+
# @param category [String, nil] Product category.
|
|
897
|
+
#
|
|
898
|
+
# @param currency [String, nil] ISO 4217 currency code.
|
|
899
|
+
#
|
|
900
|
+
# @param description [String, nil] Product description.
|
|
901
|
+
#
|
|
902
|
+
# @param dimensions [Array<String>] Product dimensions as shown on the page.
|
|
903
|
+
#
|
|
904
|
+
# @param features [Array<String>] Key features and specifications.
|
|
905
|
+
#
|
|
906
|
+
# @param images [Array<String>] Product image URLs, main image first.
|
|
907
|
+
#
|
|
908
|
+
# @param image_url [String, nil] Main product image URL.
|
|
909
|
+
#
|
|
910
|
+
# @param name [String] Product name.
|
|
911
|
+
#
|
|
912
|
+
# @param price [Float, nil] Current price.
|
|
913
|
+
#
|
|
914
|
+
# @param regular_price [Float, nil] List price before any discount.
|
|
915
|
+
#
|
|
916
|
+
# @param sku [String, nil] Product identifier such as a SKU or model number.
|
|
917
|
+
#
|
|
918
|
+
# @param tags [Array<String>] Product tags.
|
|
919
|
+
#
|
|
920
|
+
# @param target_audience [Array<String>] Intended audience.
|
|
921
|
+
#
|
|
922
|
+
# @param variants [Array<ContextDev::Models::WebScrapeResponse::Product::Data::Product::Variant>] Product variations, such as different colors or sizes, with their attributes and
|
|
923
|
+
|
|
924
|
+
# Stock or ordering availability.
|
|
925
|
+
#
|
|
926
|
+
# @see ContextDev::Models::WebScrapeResponse::Product::Data::Product#availability
|
|
927
|
+
module Availability
|
|
928
|
+
extend ContextDev::Internal::Type::Enum
|
|
929
|
+
|
|
930
|
+
IN_STOCK = :in_stock
|
|
931
|
+
OUT_OF_STOCK = :out_of_stock
|
|
932
|
+
LIMITED_AVAILABILITY = :limited_availability
|
|
933
|
+
PREORDER = :preorder
|
|
934
|
+
BACKORDER = :backorder
|
|
935
|
+
MADE_TO_ORDER = :made_to_order
|
|
936
|
+
DISCONTINUED = :discontinued
|
|
937
|
+
|
|
938
|
+
# @!method self.values
|
|
939
|
+
# @return [Array<Symbol>]
|
|
940
|
+
end
|
|
941
|
+
|
|
942
|
+
class Variant < ContextDev::Internal::Type::BaseModel
|
|
943
|
+
# @!attribute attributes
|
|
944
|
+
# Explicit variant attributes such as color, size, material, pattern and
|
|
945
|
+
# properties declared by page.
|
|
946
|
+
#
|
|
947
|
+
# @return [Hash{Symbol=>String}]
|
|
948
|
+
required :attributes, ContextDev::Internal::Type::HashOf[String]
|
|
949
|
+
|
|
950
|
+
# @!attribute images
|
|
951
|
+
# Original source image URLs explicitly attached to this variant.
|
|
952
|
+
#
|
|
953
|
+
# @return [Array<String>]
|
|
954
|
+
required :images, ContextDev::Internal::Type::ArrayOf[String]
|
|
955
|
+
|
|
956
|
+
# @!attribute sku
|
|
957
|
+
#
|
|
958
|
+
# @return [String, nil]
|
|
959
|
+
required :sku, String, nil?: true
|
|
960
|
+
|
|
961
|
+
# @!attribute url
|
|
962
|
+
# Variant or offer URL when provided by the source. May be shared by variants.
|
|
963
|
+
#
|
|
964
|
+
# @return [String, nil]
|
|
965
|
+
required :url, String, nil?: true
|
|
966
|
+
|
|
967
|
+
# @!method initialize(attributes:, images:, sku:, url:)
|
|
968
|
+
# Some parameter documentations has been truncated, see
|
|
969
|
+
# {ContextDev::Models::WebScrapeResponse::Product::Data::Product::Variant} for
|
|
970
|
+
# more details.
|
|
971
|
+
#
|
|
972
|
+
# @param attributes [Hash{Symbol=>String}] Explicit variant attributes such as color, size, material, pattern and propertie
|
|
973
|
+
#
|
|
974
|
+
# @param images [Array<String>] Original source image URLs explicitly attached to this variant.
|
|
975
|
+
#
|
|
976
|
+
# @param sku [String, nil]
|
|
977
|
+
#
|
|
978
|
+
# @param url [String, nil] Variant or offer URL when provided by the source. May be shared by variants.
|
|
979
|
+
end
|
|
980
|
+
end
|
|
981
|
+
end
|
|
602
982
|
end
|
|
603
983
|
|
|
604
984
|
# @see ContextDev::Models::WebScrapeResponse#screenshot
|
|
@@ -613,15 +993,27 @@ module ContextDev
|
|
|
613
993
|
# @return [Boolean]
|
|
614
994
|
required :requested, ContextDev::Internal::Type::Boolean
|
|
615
995
|
|
|
616
|
-
# @!
|
|
996
|
+
# @!attribute success
|
|
997
|
+
# True when retrieved, false when retrieval failed, and null when not requested.
|
|
998
|
+
#
|
|
999
|
+
# @return [Boolean, nil]
|
|
1000
|
+
required :success, ContextDev::Internal::Type::Boolean, nil?: true
|
|
1001
|
+
|
|
1002
|
+
# @!method initialize(data:, requested:, success:)
|
|
617
1003
|
# An image data URL. Use directly as an image src.
|
|
618
1004
|
#
|
|
619
1005
|
# @param data [String, nil]
|
|
1006
|
+
#
|
|
620
1007
|
# @param requested [Boolean]
|
|
1008
|
+
#
|
|
1009
|
+
# @param success [Boolean, nil] True when retrieved, false when retrieval failed, and null when not requested.
|
|
621
1010
|
end
|
|
622
1011
|
|
|
623
|
-
# Present when
|
|
624
|
-
#
|
|
1012
|
+
# Present when at least one requested output succeeds while another fails, or when
|
|
1013
|
+
# successful outputs come from a page that is still loading or images returned
|
|
1014
|
+
# before processing finished. Absent when every requested output fails. Check each
|
|
1015
|
+
# output's success field for its result. Valid captured pieces may be cached
|
|
1016
|
+
# independently; failed retrievals and incomplete captures are not cached.
|
|
625
1017
|
#
|
|
626
1018
|
# @see ContextDev::Models::WebScrapeResponse#is_partial
|
|
627
1019
|
module IsPartial
|
data/lib/context_dev/models.rb
CHANGED
|
@@ -59,6 +59,8 @@ module ContextDev
|
|
|
59
59
|
|
|
60
60
|
Failure = ContextDev::Models::Failure
|
|
61
61
|
|
|
62
|
+
FeedbackSubmitParams = ContextDev::Models::FeedbackSubmitParams
|
|
63
|
+
|
|
62
64
|
IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams
|
|
63
65
|
|
|
64
66
|
IndustryRetrieveSicParams = ContextDev::Models::IndustryRetrieveSicParams
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Resources
|
|
5
|
+
# Report bugs, docs mismatches, and friction with any Context.dev API. Submissions
|
|
6
|
+
# cost no credits and use a separate rate limit.
|
|
7
|
+
class Feedback
|
|
8
|
+
# Some parameter documentations has been truncated, see
|
|
9
|
+
# {ContextDev::Models::FeedbackSubmitParams} for more details.
|
|
10
|
+
#
|
|
11
|
+
# Report a problem with a Context.dev API call, docs page, SDK, or CLI. Include
|
|
12
|
+
# request_id, url, or both.
|
|
13
|
+
#
|
|
14
|
+
# @overload submit(category:, note:, request_id: nil, tags: nil, url: nil, request_options: {})
|
|
15
|
+
#
|
|
16
|
+
# @param category [Symbol, ContextDev::Models::FeedbackSubmitParams::Category] Kind of issue.
|
|
17
|
+
#
|
|
18
|
+
# @param note [String] What went wrong and what you expected instead.
|
|
19
|
+
#
|
|
20
|
+
# @param request_id [String] The request_id of the API call the feedback is about, from its response body or
|
|
21
|
+
#
|
|
22
|
+
# @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
23
|
+
#
|
|
24
|
+
# @param url [String] The page the feedback is about, such as one page of a crawl or a docs page.
|
|
25
|
+
#
|
|
26
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
27
|
+
#
|
|
28
|
+
# @return [ContextDev::Models::FeedbackSubmitResponse]
|
|
29
|
+
#
|
|
30
|
+
# @see ContextDev::Models::FeedbackSubmitParams
|
|
31
|
+
def submit(params)
|
|
32
|
+
parsed, options = ContextDev::FeedbackSubmitParams.dump_request(params)
|
|
33
|
+
@client.request(
|
|
34
|
+
method: :post,
|
|
35
|
+
path: "feedback",
|
|
36
|
+
body: parsed,
|
|
37
|
+
model: ContextDev::Models::FeedbackSubmitResponse,
|
|
38
|
+
options: options
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# @api private
|
|
43
|
+
#
|
|
44
|
+
# @param client [ContextDev::Client]
|
|
45
|
+
def initialize(client:)
|
|
46
|
+
@client = client
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -4,11 +4,15 @@ module ContextDev
|
|
|
4
4
|
module Resources
|
|
5
5
|
# Search live first-party RSS and free historical news data by company identity.
|
|
6
6
|
class News
|
|
7
|
+
# Some parameter documentations has been truncated, see
|
|
8
|
+
# {ContextDev::Models::NewsSearchParams} for more details.
|
|
9
|
+
#
|
|
7
10
|
# Searches live and historical company news for one company, identified in
|
|
8
11
|
# searchBy by name, domain, ticker (optionally disambiguated by exchange), or
|
|
9
|
-
# ISIN. Results can be filtered by publisher domain, publisher country,
|
|
10
|
-
# language, article type,
|
|
11
|
-
# source metadata, verified entity relevance,
|
|
12
|
+
# ISIN. Results can be filtered by one of publisher domain, publisher country,
|
|
13
|
+
# article language, or article type, optionally combined with a published-at date
|
|
14
|
+
# range, and include stable story IDs, source metadata, verified entity relevance,
|
|
15
|
+
# and cursor pagination.
|
|
12
16
|
#
|
|
13
17
|
# @overload search(search_by:, cursor: nil, filter_by: nil, limit: nil, sort_by: nil, tags: nil, request_options: {})
|
|
14
18
|
#
|
|
@@ -16,7 +20,7 @@ module ContextDev
|
|
|
16
20
|
#
|
|
17
21
|
# @param cursor [String, nil] Opaque next_cursor from the previous response, or null for the first page.
|
|
18
22
|
#
|
|
19
|
-
# @param filter_by [ContextDev::Models::NewsSearchParams::FilterBy] Optional result filters.
|
|
23
|
+
# @param filter_by [ContextDev::Models::NewsSearchParams::FilterBy] Optional result filters. Use at most one of sourceDomain, sourceCountry, article
|
|
20
24
|
#
|
|
21
25
|
# @param limit [Integer] Maximum results to return. Defaults to 10.
|
|
22
26
|
#
|