context.dev 2.9.0 → 2.11.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.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/client.rb +5 -0
  5. data/lib/context_dev/models/batch_get_results_response.rb +33 -3
  6. data/lib/context_dev/models/batch_submit_params.rb +44 -316
  7. data/lib/context_dev/models/brand_retrieve_response.rb +29 -1
  8. data/lib/context_dev/models/brand_retrieve_simplified_response.rb +30 -1
  9. data/lib/context_dev/models/brand_search_params.rb +41 -3
  10. data/lib/context_dev/models/news_search_params.rb +467 -0
  11. data/lib/context_dev/models/news_search_response.rb +284 -0
  12. data/lib/context_dev/models/parse_handle_params.rb +15 -144
  13. data/lib/context_dev/models/person_enrich_response.rb +61 -1
  14. data/lib/context_dev/models/utility_prefetch_params.rb +19 -16
  15. data/lib/context_dev/models/utility_prefetch_response.rb +4 -5
  16. data/lib/context_dev/models/web_screenshot_params.rb +16 -31
  17. data/lib/context_dev/models/web_web_crawl_md_response.rb +30 -1
  18. data/lib/context_dev/models/web_web_scrape_html_params.rb +15 -153
  19. data/lib/context_dev/models/web_web_scrape_html_response.rb +30 -1
  20. data/lib/context_dev/models/web_web_scrape_images_params.rb +12 -124
  21. data/lib/context_dev/models/web_web_scrape_md_params.rb +35 -238
  22. data/lib/context_dev/models/web_web_scrape_md_response.rb +41 -2
  23. data/lib/context_dev/models.rb +2 -0
  24. data/lib/context_dev/resources/brand.rb +10 -11
  25. data/lib/context_dev/resources/news.rb +51 -0
  26. data/lib/context_dev/resources/parse.rb +5 -5
  27. data/lib/context_dev/resources/utility.rb +7 -6
  28. data/lib/context_dev/resources/web.rb +30 -24
  29. data/lib/context_dev/version.rb +1 -1
  30. data/lib/context_dev.rb +3 -0
  31. data/rbi/context_dev/client.rbi +4 -0
  32. data/rbi/context_dev/models/batch_get_results_response.rbi +71 -2
  33. data/rbi/context_dev/models/batch_submit_params.rbi +58 -592
  34. data/rbi/context_dev/models/brand_retrieve_response.rbi +80 -3
  35. data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +80 -3
  36. data/rbi/context_dev/models/brand_search_params.rbi +71 -2
  37. data/rbi/context_dev/models/news_search_params.rbi +1294 -0
  38. data/rbi/context_dev/models/news_search_response.rbi +489 -0
  39. data/rbi/context_dev/models/parse_handle_params.rbi +20 -316
  40. data/rbi/context_dev/models/person_enrich_response.rbi +87 -0
  41. data/rbi/context_dev/models/utility_prefetch_params.rbi +24 -16
  42. data/rbi/context_dev/models/utility_prefetch_response.rbi +8 -6
  43. data/rbi/context_dev/models/web_screenshot_params.rbi +23 -71
  44. data/rbi/context_dev/models/web_web_crawl_md_response.rbi +67 -0
  45. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +20 -356
  46. data/rbi/context_dev/models/web_web_scrape_html_response.rbi +65 -0
  47. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +16 -287
  48. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +47 -551
  49. data/rbi/context_dev/models/web_web_scrape_md_response.rbi +80 -0
  50. data/rbi/context_dev/models.rbi +2 -0
  51. data/rbi/context_dev/resources/brand.rbi +14 -9
  52. data/rbi/context_dev/resources/news.rbi +46 -0
  53. data/rbi/context_dev/resources/parse.rbi +5 -21
  54. data/rbi/context_dev/resources/utility.rbi +8 -6
  55. data/rbi/context_dev/resources/web.rbi +34 -66
  56. data/sig/context_dev/client.rbs +2 -0
  57. data/sig/context_dev/models/batch_get_results_response.rbs +21 -0
  58. data/sig/context_dev/models/batch_submit_params.rbs +54 -144
  59. data/sig/context_dev/models/brand_retrieve_response.rbs +33 -3
  60. data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +33 -3
  61. data/sig/context_dev/models/brand_search_params.rbs +38 -1
  62. data/sig/context_dev/models/news_search_params.rbs +532 -0
  63. data/sig/context_dev/models/news_search_response.rbs +206 -0
  64. data/sig/context_dev/models/parse_handle_params.rbs +25 -90
  65. data/sig/context_dev/models/person_enrich_response.rbs +31 -0
  66. data/sig/context_dev/models/utility_prefetch_params.rbs +2 -1
  67. data/sig/context_dev/models/utility_prefetch_response.rbs +2 -1
  68. data/sig/context_dev/models/web_screenshot_params.rbs +12 -18
  69. data/sig/context_dev/models/web_web_crawl_md_response.rbs +21 -0
  70. data/sig/context_dev/models/web_web_scrape_html_params.rbs +24 -94
  71. data/sig/context_dev/models/web_web_scrape_html_response.rbs +21 -0
  72. data/sig/context_dev/models/web_web_scrape_images_params.rbs +20 -72
  73. data/sig/context_dev/models/web_web_scrape_md_params.rbs +46 -148
  74. data/sig/context_dev/models/web_web_scrape_md_response.rbs +28 -0
  75. data/sig/context_dev/models.rbs +2 -0
  76. data/sig/context_dev/resources/brand.rbs +3 -0
  77. data/sig/context_dev/resources/news.rbs +17 -0
  78. data/sig/context_dev/resources/parse.rbs +5 -5
  79. data/sig/context_dev/resources/web.rbs +13 -11
  80. metadata +11 -2
@@ -0,0 +1,489 @@
1
+ # typed: strong
2
+
3
+ module ContextDev
4
+ module Models
5
+ class NewsSearchResponse < ContextDev::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ ContextDev::Models::NewsSearchResponse,
10
+ ContextDev::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # Articles matching the search, in the requested order.
15
+ sig { returns(T::Array[ContextDev::Models::NewsSearchResponse::Data]) }
16
+ attr_accessor :data
17
+
18
+ # True when more results are available beyond this page.
19
+ sig { returns(T::Boolean) }
20
+ attr_accessor :has_more
21
+
22
+ # Summary information about this response.
23
+ sig { returns(ContextDev::Models::NewsSearchResponse::Meta) }
24
+ attr_reader :meta
25
+
26
+ sig do
27
+ params(meta: ContextDev::Models::NewsSearchResponse::Meta::OrHash).void
28
+ end
29
+ attr_writer :meta
30
+
31
+ # Pass as cursor in the next request to fetch the following page. Null when there
32
+ # are no more results.
33
+ sig { returns(T.nilable(String)) }
34
+ attr_accessor :next_cursor
35
+
36
+ # Metadata about the API key used for the request. Included in every response
37
+ # whenever a valid API key is provided, even when the response status is not 200.
38
+ sig do
39
+ returns(T.nilable(ContextDev::Models::NewsSearchResponse::KeyMetadata))
40
+ end
41
+ attr_reader :key_metadata
42
+
43
+ sig do
44
+ params(
45
+ key_metadata:
46
+ ContextDev::Models::NewsSearchResponse::KeyMetadata::OrHash
47
+ ).void
48
+ end
49
+ attr_writer :key_metadata
50
+
51
+ sig do
52
+ params(
53
+ data: T::Array[ContextDev::Models::NewsSearchResponse::Data::OrHash],
54
+ has_more: T::Boolean,
55
+ meta: ContextDev::Models::NewsSearchResponse::Meta::OrHash,
56
+ next_cursor: T.nilable(String),
57
+ key_metadata:
58
+ ContextDev::Models::NewsSearchResponse::KeyMetadata::OrHash
59
+ ).returns(T.attached_class)
60
+ end
61
+ def self.new(
62
+ # Articles matching the search, in the requested order.
63
+ data:,
64
+ # True when more results are available beyond this page.
65
+ has_more:,
66
+ # Summary information about this response.
67
+ meta:,
68
+ # Pass as cursor in the next request to fetch the following page. Null when there
69
+ # are no more results.
70
+ next_cursor:,
71
+ # Metadata about the API key used for the request. Included in every response
72
+ # whenever a valid API key is provided, even when the response status is not 200.
73
+ key_metadata: nil
74
+ )
75
+ end
76
+
77
+ sig do
78
+ override.returns(
79
+ {
80
+ data: T::Array[ContextDev::Models::NewsSearchResponse::Data],
81
+ has_more: T::Boolean,
82
+ meta: ContextDev::Models::NewsSearchResponse::Meta,
83
+ next_cursor: T.nilable(String),
84
+ key_metadata: ContextDev::Models::NewsSearchResponse::KeyMetadata
85
+ }
86
+ )
87
+ end
88
+ def to_hash
89
+ end
90
+
91
+ class Data < ContextDev::Internal::Type::BaseModel
92
+ OrHash =
93
+ T.type_alias do
94
+ T.any(
95
+ ContextDev::Models::NewsSearchResponse::Data,
96
+ ContextDev::Internal::AnyHash
97
+ )
98
+ end
99
+
100
+ # Stable unique identifier for this article. Use it to deduplicate or reference an
101
+ # article across requests.
102
+ sig { returns(String) }
103
+ attr_accessor :id
104
+
105
+ # Bylined authors. Empty when no byline is available.
106
+ sig { returns(T::Array[String]) }
107
+ attr_accessor :authors
108
+
109
+ # Short summary or excerpt of the article, when the publisher provides one.
110
+ sig { returns(T.nilable(String)) }
111
+ attr_accessor :description
112
+
113
+ # Lead image for the article, when one is available.
114
+ sig { returns(T.nilable(String)) }
115
+ attr_accessor :image_url
116
+
117
+ # Language the article is written in, as a lowercase ISO 639-1 code such as en.
118
+ # Null when unknown.
119
+ sig { returns(T.nilable(String)) }
120
+ attr_accessor :language
121
+
122
+ # How the article relates to the company you searched for.
123
+ sig { returns(ContextDev::Models::NewsSearchResponse::Data::Match) }
124
+ attr_reader :match
125
+
126
+ sig do
127
+ params(
128
+ match: ContextDev::Models::NewsSearchResponse::Data::Match::OrHash
129
+ ).void
130
+ end
131
+ attr_writer :match
132
+
133
+ # When the article was published, as an ISO 8601 timestamp. Null when the
134
+ # publisher does not state a reliable date.
135
+ sig { returns(T.nilable(Time)) }
136
+ attr_accessor :published_at
137
+
138
+ # The publication that published the article.
139
+ sig { returns(ContextDev::Models::NewsSearchResponse::Data::Source) }
140
+ attr_reader :source
141
+
142
+ sig do
143
+ params(
144
+ source: ContextDev::Models::NewsSearchResponse::Data::Source::OrHash
145
+ ).void
146
+ end
147
+ attr_writer :source
148
+
149
+ # Shared by articles covering the same story on the same day. Use it to group or
150
+ # collapse syndicated copies of one announcement across outlets.
151
+ sig { returns(String) }
152
+ attr_accessor :story_id
153
+
154
+ # Article headline.
155
+ sig { returns(String) }
156
+ attr_accessor :title
157
+
158
+ # Kind of coverage. Use it to separate independent reporting (editorial) from
159
+ # company-issued content (press_release, regulatory_filing, advisory).
160
+ sig do
161
+ returns(
162
+ ContextDev::Models::NewsSearchResponse::Data::Type::TaggedSymbol
163
+ )
164
+ end
165
+ attr_accessor :type
166
+
167
+ # Link to the article on the publisher site.
168
+ sig { returns(String) }
169
+ attr_accessor :url
170
+
171
+ sig do
172
+ params(
173
+ id: String,
174
+ authors: T::Array[String],
175
+ description: T.nilable(String),
176
+ image_url: T.nilable(String),
177
+ language: T.nilable(String),
178
+ match: ContextDev::Models::NewsSearchResponse::Data::Match::OrHash,
179
+ published_at: T.nilable(Time),
180
+ source:
181
+ ContextDev::Models::NewsSearchResponse::Data::Source::OrHash,
182
+ story_id: String,
183
+ title: String,
184
+ type: ContextDev::Models::NewsSearchResponse::Data::Type::OrSymbol,
185
+ url: String
186
+ ).returns(T.attached_class)
187
+ end
188
+ def self.new(
189
+ # Stable unique identifier for this article. Use it to deduplicate or reference an
190
+ # article across requests.
191
+ id:,
192
+ # Bylined authors. Empty when no byline is available.
193
+ authors:,
194
+ # Short summary or excerpt of the article, when the publisher provides one.
195
+ description:,
196
+ # Lead image for the article, when one is available.
197
+ image_url:,
198
+ # Language the article is written in, as a lowercase ISO 639-1 code such as en.
199
+ # Null when unknown.
200
+ language:,
201
+ # How the article relates to the company you searched for.
202
+ match:,
203
+ # When the article was published, as an ISO 8601 timestamp. Null when the
204
+ # publisher does not state a reliable date.
205
+ published_at:,
206
+ # The publication that published the article.
207
+ source:,
208
+ # Shared by articles covering the same story on the same day. Use it to group or
209
+ # collapse syndicated copies of one announcement across outlets.
210
+ story_id:,
211
+ # Article headline.
212
+ title:,
213
+ # Kind of coverage. Use it to separate independent reporting (editorial) from
214
+ # company-issued content (press_release, regulatory_filing, advisory).
215
+ type:,
216
+ # Link to the article on the publisher site.
217
+ url:
218
+ )
219
+ end
220
+
221
+ sig do
222
+ override.returns(
223
+ {
224
+ id: String,
225
+ authors: T::Array[String],
226
+ description: T.nilable(String),
227
+ image_url: T.nilable(String),
228
+ language: T.nilable(String),
229
+ match: ContextDev::Models::NewsSearchResponse::Data::Match,
230
+ published_at: T.nilable(Time),
231
+ source: ContextDev::Models::NewsSearchResponse::Data::Source,
232
+ story_id: String,
233
+ title: String,
234
+ type:
235
+ ContextDev::Models::NewsSearchResponse::Data::Type::TaggedSymbol,
236
+ url: String
237
+ }
238
+ )
239
+ end
240
+ def to_hash
241
+ end
242
+
243
+ class Match < ContextDev::Internal::Type::BaseModel
244
+ OrHash =
245
+ T.type_alias do
246
+ T.any(
247
+ ContextDev::Models::NewsSearchResponse::Data::Match,
248
+ ContextDev::Internal::AnyHash
249
+ )
250
+ end
251
+
252
+ # How confident the match is, from 0 to 1. Null when a score is unavailable.
253
+ sig { returns(T.nilable(Float)) }
254
+ attr_accessor :confidence
255
+
256
+ # primary when the article is mainly about the company, secondary when the company
257
+ # is mentioned but is not the main subject.
258
+ sig do
259
+ returns(
260
+ ContextDev::Models::NewsSearchResponse::Data::Match::Level::TaggedSymbol
261
+ )
262
+ end
263
+ attr_accessor :level
264
+
265
+ # How the article relates to the company you searched for.
266
+ sig do
267
+ params(
268
+ confidence: T.nilable(Float),
269
+ level:
270
+ ContextDev::Models::NewsSearchResponse::Data::Match::Level::OrSymbol
271
+ ).returns(T.attached_class)
272
+ end
273
+ def self.new(
274
+ # How confident the match is, from 0 to 1. Null when a score is unavailable.
275
+ confidence:,
276
+ # primary when the article is mainly about the company, secondary when the company
277
+ # is mentioned but is not the main subject.
278
+ level:
279
+ )
280
+ end
281
+
282
+ sig do
283
+ override.returns(
284
+ {
285
+ confidence: T.nilable(Float),
286
+ level:
287
+ ContextDev::Models::NewsSearchResponse::Data::Match::Level::TaggedSymbol
288
+ }
289
+ )
290
+ end
291
+ def to_hash
292
+ end
293
+
294
+ # primary when the article is mainly about the company, secondary when the company
295
+ # is mentioned but is not the main subject.
296
+ module Level
297
+ extend ContextDev::Internal::Type::Enum
298
+
299
+ TaggedSymbol =
300
+ T.type_alias do
301
+ T.all(
302
+ Symbol,
303
+ ContextDev::Models::NewsSearchResponse::Data::Match::Level
304
+ )
305
+ end
306
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
307
+
308
+ PRIMARY =
309
+ T.let(
310
+ :primary,
311
+ ContextDev::Models::NewsSearchResponse::Data::Match::Level::TaggedSymbol
312
+ )
313
+ SECONDARY =
314
+ T.let(
315
+ :secondary,
316
+ ContextDev::Models::NewsSearchResponse::Data::Match::Level::TaggedSymbol
317
+ )
318
+
319
+ sig do
320
+ override.returns(
321
+ T::Array[
322
+ ContextDev::Models::NewsSearchResponse::Data::Match::Level::TaggedSymbol
323
+ ]
324
+ )
325
+ end
326
+ def self.values
327
+ end
328
+ end
329
+ end
330
+
331
+ class Source < ContextDev::Internal::Type::BaseModel
332
+ OrHash =
333
+ T.type_alias do
334
+ T.any(
335
+ ContextDev::Models::NewsSearchResponse::Data::Source,
336
+ ContextDev::Internal::AnyHash
337
+ )
338
+ end
339
+
340
+ # True when Context observed this article in the publisher-owned feed.
341
+ sig { returns(T::Boolean) }
342
+ attr_accessor :direct
343
+
344
+ # Website domain of the publication.
345
+ sig { returns(String) }
346
+ attr_accessor :domain
347
+
348
+ # Name of the publication, such as Reuters.
349
+ sig { returns(String) }
350
+ attr_accessor :name
351
+
352
+ # The publication that published the article.
353
+ sig do
354
+ params(direct: T::Boolean, domain: String, name: String).returns(
355
+ T.attached_class
356
+ )
357
+ end
358
+ def self.new(
359
+ # True when Context observed this article in the publisher-owned feed.
360
+ direct:,
361
+ # Website domain of the publication.
362
+ domain:,
363
+ # Name of the publication, such as Reuters.
364
+ name:
365
+ )
366
+ end
367
+
368
+ sig do
369
+ override.returns(
370
+ { direct: T::Boolean, domain: String, name: String }
371
+ )
372
+ end
373
+ def to_hash
374
+ end
375
+ end
376
+
377
+ # Kind of coverage. Use it to separate independent reporting (editorial) from
378
+ # company-issued content (press_release, regulatory_filing, advisory).
379
+ module Type
380
+ extend ContextDev::Internal::Type::Enum
381
+
382
+ TaggedSymbol =
383
+ T.type_alias do
384
+ T.all(Symbol, ContextDev::Models::NewsSearchResponse::Data::Type)
385
+ end
386
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
387
+
388
+ EDITORIAL =
389
+ T.let(
390
+ :editorial,
391
+ ContextDev::Models::NewsSearchResponse::Data::Type::TaggedSymbol
392
+ )
393
+ PRESS_RELEASE =
394
+ T.let(
395
+ :press_release,
396
+ ContextDev::Models::NewsSearchResponse::Data::Type::TaggedSymbol
397
+ )
398
+ REGULATORY_FILING =
399
+ T.let(
400
+ :regulatory_filing,
401
+ ContextDev::Models::NewsSearchResponse::Data::Type::TaggedSymbol
402
+ )
403
+ ADVISORY =
404
+ T.let(
405
+ :advisory,
406
+ ContextDev::Models::NewsSearchResponse::Data::Type::TaggedSymbol
407
+ )
408
+
409
+ sig do
410
+ override.returns(
411
+ T::Array[
412
+ ContextDev::Models::NewsSearchResponse::Data::Type::TaggedSymbol
413
+ ]
414
+ )
415
+ end
416
+ def self.values
417
+ end
418
+ end
419
+ end
420
+
421
+ class Meta < ContextDev::Internal::Type::BaseModel
422
+ OrHash =
423
+ T.type_alias do
424
+ T.any(
425
+ ContextDev::Models::NewsSearchResponse::Meta,
426
+ ContextDev::Internal::AnyHash
427
+ )
428
+ end
429
+
430
+ # Number of articles in this page.
431
+ sig { returns(Integer) }
432
+ attr_accessor :count
433
+
434
+ # Summary information about this response.
435
+ sig { params(count: Integer).returns(T.attached_class) }
436
+ def self.new(
437
+ # Number of articles in this page.
438
+ count:
439
+ )
440
+ end
441
+
442
+ sig { override.returns({ count: Integer }) }
443
+ def to_hash
444
+ end
445
+ end
446
+
447
+ class KeyMetadata < ContextDev::Internal::Type::BaseModel
448
+ OrHash =
449
+ T.type_alias do
450
+ T.any(
451
+ ContextDev::Models::NewsSearchResponse::KeyMetadata,
452
+ ContextDev::Internal::AnyHash
453
+ )
454
+ end
455
+
456
+ # The number of credits consumed by this request.
457
+ sig { returns(Integer) }
458
+ attr_accessor :credits_consumed
459
+
460
+ # The number of credits remaining for your organization after this request.
461
+ sig { returns(Integer) }
462
+ attr_accessor :credits_remaining
463
+
464
+ # Metadata about the API key used for the request. Included in every response
465
+ # whenever a valid API key is provided, even when the response status is not 200.
466
+ sig do
467
+ params(credits_consumed: Integer, credits_remaining: Integer).returns(
468
+ T.attached_class
469
+ )
470
+ end
471
+ def self.new(
472
+ # The number of credits consumed by this request.
473
+ credits_consumed:,
474
+ # The number of credits remaining for your organization after this request.
475
+ credits_remaining:
476
+ )
477
+ end
478
+
479
+ sig do
480
+ override.returns(
481
+ { credits_consumed: Integer, credits_remaining: Integer }
482
+ )
483
+ end
484
+ def to_hash
485
+ end
486
+ end
487
+ end
488
+ end
489
+ end