context.dev 2.8.0 → 2.10.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 +28 -0
- data/README.md +1 -1
- data/lib/context_dev/client.rb +10 -0
- data/lib/context_dev/models/batch_delete_params.rb +22 -0
- data/lib/context_dev/models/batch_delete_response.rb +60 -0
- data/lib/context_dev/models/batch_get_results_response.rb +46 -4
- data/lib/context_dev/models/batch_list_response.rb +13 -4
- data/lib/context_dev/models/batch_retrieve_response.rb +13 -4
- data/lib/context_dev/models/batch_submit_params.rb +2080 -26
- data/lib/context_dev/models/batch_submit_response.rb +125 -531
- data/lib/context_dev/models/brand_retrieve_response.rb +50 -1
- data/lib/context_dev/models/brand_search_params.rb +41 -3
- data/lib/context_dev/models/brand_search_response.rb +3 -2
- data/lib/context_dev/models/crawl_controls.rb +21 -15
- data/lib/context_dev/models/news_search_params.rb +467 -0
- data/lib/context_dev/models/news_search_response.rb +238 -0
- data/lib/context_dev/models/parse_handle_params.rb +20 -147
- data/lib/context_dev/models/person_enrich_params.rb +176 -0
- data/lib/context_dev/models/person_enrich_response.rb +641 -0
- data/lib/context_dev/models/utility_prefetch_params.rb +19 -16
- data/lib/context_dev/models/utility_prefetch_response.rb +4 -5
- data/lib/context_dev/models/web_screenshot_params.rb +3 -30
- data/lib/context_dev/models/web_search_response.rb +1 -0
- data/lib/context_dev/models/web_web_crawl_md_params.rb +5 -4
- data/lib/context_dev/models/web_web_crawl_md_response.rb +30 -1
- data/lib/context_dev/models/web_web_scrape_html_params.rb +20 -156
- data/lib/context_dev/models/web_web_scrape_html_response.rb +30 -1
- data/lib/context_dev/models/web_web_scrape_images_params.rb +12 -124
- data/lib/context_dev/models/web_web_scrape_md_params.rb +40 -241
- data/lib/context_dev/models/web_web_scrape_md_response.rb +41 -2
- data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +11 -1
- data/lib/context_dev/models/web_web_scrape_sitemap_response.rb +3 -2
- data/lib/context_dev/models.rb +6 -0
- data/lib/context_dev/resources/batch.rb +33 -7
- data/lib/context_dev/resources/brand.rb +10 -10
- data/lib/context_dev/resources/news.rb +51 -0
- data/lib/context_dev/resources/parse.rb +5 -5
- data/lib/context_dev/resources/people.rb +56 -0
- data/lib/context_dev/resources/utility.rb +7 -6
- data/lib/context_dev/resources/web.rb +46 -24
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +8 -0
- data/rbi/context_dev/client.rbi +8 -0
- data/rbi/context_dev/models/batch_delete_params.rbi +40 -0
- data/rbi/context_dev/models/batch_delete_response.rbi +116 -0
- data/rbi/context_dev/models/batch_get_results_response.rbi +85 -3
- data/rbi/context_dev/models/batch_list_response.rbi +24 -8
- data/rbi/context_dev/models/batch_retrieve_response.rbi +24 -8
- data/rbi/context_dev/models/batch_submit_params.rbi +6421 -44
- data/rbi/context_dev/models/batch_submit_response.rbi +184 -1151
- data/rbi/context_dev/models/brand_retrieve_response.rbi +152 -0
- data/rbi/context_dev/models/brand_search_params.rbi +71 -2
- data/rbi/context_dev/models/brand_search_response.rbi +4 -2
- data/rbi/context_dev/models/crawl_controls.rbi +22 -28
- data/rbi/context_dev/models/news_search_params.rbi +1294 -0
- data/rbi/context_dev/models/news_search_response.rbi +423 -0
- data/rbi/context_dev/models/parse_handle_params.rbi +30 -323
- data/rbi/context_dev/models/person_enrich_params.rbi +332 -0
- data/rbi/context_dev/models/person_enrich_response.rbi +1295 -0
- data/rbi/context_dev/models/utility_prefetch_params.rbi +24 -16
- data/rbi/context_dev/models/utility_prefetch_response.rbi +8 -6
- data/rbi/context_dev/models/web_screenshot_params.rbi +4 -71
- data/rbi/context_dev/models/web_search_response.rbi +5 -0
- data/rbi/context_dev/models/web_web_crawl_md_params.rbi +8 -6
- data/rbi/context_dev/models/web_web_crawl_md_response.rbi +67 -0
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +30 -363
- data/rbi/context_dev/models/web_web_scrape_html_response.rbi +65 -0
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +16 -287
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +57 -558
- data/rbi/context_dev/models/web_web_scrape_md_response.rbi +80 -0
- data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +15 -0
- data/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi +4 -2
- data/rbi/context_dev/models.rbi +6 -0
- data/rbi/context_dev/resources/batch.rbi +32 -10
- data/rbi/context_dev/resources/brand.rbi +14 -8
- data/rbi/context_dev/resources/news.rbi +46 -0
- data/rbi/context_dev/resources/parse.rbi +10 -26
- data/rbi/context_dev/resources/people.rbi +47 -0
- data/rbi/context_dev/resources/utility.rbi +8 -6
- data/rbi/context_dev/resources/web.rbi +49 -66
- data/sig/context_dev/client.rbs +4 -0
- data/sig/context_dev/models/batch_delete_params.rbs +23 -0
- data/sig/context_dev/models/batch_delete_response.rbs +57 -0
- data/sig/context_dev/models/batch_get_results_response.rbs +30 -2
- data/sig/context_dev/models/batch_list_response.rbs +16 -2
- data/sig/context_dev/models/batch_retrieve_response.rbs +16 -2
- data/sig/context_dev/models/batch_submit_params.rbs +2666 -15
- data/sig/context_dev/models/batch_submit_response.rbs +78 -466
- data/sig/context_dev/models/brand_retrieve_response.rbs +62 -0
- data/sig/context_dev/models/brand_search_params.rbs +38 -1
- data/sig/context_dev/models/crawl_controls.rbs +16 -16
- data/sig/context_dev/models/news_search_params.rbs +532 -0
- data/sig/context_dev/models/news_search_response.rbs +206 -0
- data/sig/context_dev/models/parse_handle_params.rbs +25 -90
- data/sig/context_dev/models/person_enrich_params.rbs +199 -0
- data/sig/context_dev/models/person_enrich_response.rbs +638 -0
- data/sig/context_dev/models/utility_prefetch_params.rbs +2 -1
- data/sig/context_dev/models/utility_prefetch_response.rbs +2 -1
- data/sig/context_dev/models/web_screenshot_params.rbs +5 -18
- data/sig/context_dev/models/web_search_response.rbs +2 -0
- data/sig/context_dev/models/web_web_crawl_md_response.rbs +21 -0
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +24 -94
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +21 -0
- data/sig/context_dev/models/web_web_scrape_images_params.rbs +20 -72
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +46 -148
- data/sig/context_dev/models/web_web_scrape_md_response.rbs +28 -0
- data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +7 -0
- data/sig/context_dev/models.rbs +6 -0
- data/sig/context_dev/resources/batch.rbs +8 -2
- data/sig/context_dev/resources/brand.rbs +3 -0
- data/sig/context_dev/resources/news.rbs +17 -0
- data/sig/context_dev/resources/parse.rbs +5 -5
- data/sig/context_dev/resources/people.rbs +19 -0
- data/sig/context_dev/resources/web.rbs +13 -11
- metadata +26 -2
|
@@ -72,6 +72,15 @@ module ContextDev
|
|
|
72
72
|
sig { params(actions_html_stale: T::Boolean).void }
|
|
73
73
|
attr_writer :actions_html_stale
|
|
74
74
|
|
|
75
|
+
# Only present when includeHTML=true: the page HTML the Markdown was converted
|
|
76
|
+
# from — the same body the Scrape HTML endpoint returns for the equivalent
|
|
77
|
+
# request.
|
|
78
|
+
sig { returns(T.nilable(String)) }
|
|
79
|
+
attr_reader :html
|
|
80
|
+
|
|
81
|
+
sig { params(html: String).void }
|
|
82
|
+
attr_writer :html
|
|
83
|
+
|
|
75
84
|
# Metadata about the API key used for the request. Included in every response
|
|
76
85
|
# whenever a valid API key is provided, even when the response status is not 200.
|
|
77
86
|
sig do
|
|
@@ -103,6 +112,7 @@ module ContextDev
|
|
|
103
112
|
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied::OrHash
|
|
104
113
|
],
|
|
105
114
|
actions_html_stale: T::Boolean,
|
|
115
|
+
html: String,
|
|
106
116
|
key_metadata:
|
|
107
117
|
ContextDev::Models::WebWebScrapeMdResponse::KeyMetadata::OrHash
|
|
108
118
|
).returns(T.attached_class)
|
|
@@ -125,6 +135,10 @@ module ContextDev
|
|
|
125
135
|
# True when an action was applied but the returned content could not be refreshed
|
|
126
136
|
# afterward.
|
|
127
137
|
actions_html_stale: nil,
|
|
138
|
+
# Only present when includeHTML=true: the page HTML the Markdown was converted
|
|
139
|
+
# from — the same body the Scrape HTML endpoint returns for the equivalent
|
|
140
|
+
# request.
|
|
141
|
+
html: nil,
|
|
128
142
|
# Metadata about the API key used for the request. Included in every response
|
|
129
143
|
# whenever a valid API key is provided, even when the response status is not 200.
|
|
130
144
|
key_metadata: nil
|
|
@@ -145,6 +159,7 @@ module ContextDev
|
|
|
145
159
|
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied
|
|
146
160
|
],
|
|
147
161
|
actions_html_stale: T::Boolean,
|
|
162
|
+
html: String,
|
|
148
163
|
key_metadata:
|
|
149
164
|
ContextDev::Models::WebWebScrapeMdResponse::KeyMetadata
|
|
150
165
|
}
|
|
@@ -245,6 +260,29 @@ module ContextDev
|
|
|
245
260
|
sig { params(favicon: String).void }
|
|
246
261
|
attr_writer :favicon
|
|
247
262
|
|
|
263
|
+
# Page headings (h1–h6) in document order, extracted from the unfiltered document.
|
|
264
|
+
# Capped at the first 500 headings. Omitted when the page has none.
|
|
265
|
+
sig do
|
|
266
|
+
returns(
|
|
267
|
+
T.nilable(
|
|
268
|
+
T::Array[
|
|
269
|
+
ContextDev::Models::WebWebScrapeMdResponse::Metadata::Heading
|
|
270
|
+
]
|
|
271
|
+
)
|
|
272
|
+
)
|
|
273
|
+
end
|
|
274
|
+
attr_reader :headings
|
|
275
|
+
|
|
276
|
+
sig do
|
|
277
|
+
params(
|
|
278
|
+
headings:
|
|
279
|
+
T::Array[
|
|
280
|
+
ContextDev::Models::WebWebScrapeMdResponse::Metadata::Heading::OrHash
|
|
281
|
+
]
|
|
282
|
+
).void
|
|
283
|
+
end
|
|
284
|
+
attr_writer :headings
|
|
285
|
+
|
|
248
286
|
# Primary resolved preview image from Open Graph, Twitter, or image metadata.
|
|
249
287
|
sig { returns(T.nilable(String)) }
|
|
250
288
|
attr_reader :image
|
|
@@ -374,6 +412,10 @@ module ContextDev
|
|
|
374
412
|
canonical_url: String,
|
|
375
413
|
description: String,
|
|
376
414
|
favicon: String,
|
|
415
|
+
headings:
|
|
416
|
+
T::Array[
|
|
417
|
+
ContextDev::Models::WebWebScrapeMdResponse::Metadata::Heading::OrHash
|
|
418
|
+
],
|
|
377
419
|
image: String,
|
|
378
420
|
json_ld: T::Array[T::Hash[Symbol, T.anything]],
|
|
379
421
|
keywords: T::Array[String],
|
|
@@ -413,6 +455,9 @@ module ContextDev
|
|
|
413
455
|
description: nil,
|
|
414
456
|
# Resolved favicon URL, when present.
|
|
415
457
|
favicon: nil,
|
|
458
|
+
# Page headings (h1–h6) in document order, extracted from the unfiltered document.
|
|
459
|
+
# Capped at the first 500 headings. Omitted when the page has none.
|
|
460
|
+
headings: nil,
|
|
416
461
|
# Primary resolved preview image from Open Graph, Twitter, or image metadata.
|
|
417
462
|
image: nil,
|
|
418
463
|
# JSON-LD structured data blocks parsed from the page.
|
|
@@ -456,6 +501,10 @@ module ContextDev
|
|
|
456
501
|
canonical_url: String,
|
|
457
502
|
description: String,
|
|
458
503
|
favicon: String,
|
|
504
|
+
headings:
|
|
505
|
+
T::Array[
|
|
506
|
+
ContextDev::Models::WebWebScrapeMdResponse::Metadata::Heading
|
|
507
|
+
],
|
|
459
508
|
image: String,
|
|
460
509
|
json_ld: T::Array[T::Hash[Symbol, T.anything]],
|
|
461
510
|
keywords: T::Array[String],
|
|
@@ -566,6 +615,37 @@ module ContextDev
|
|
|
566
615
|
end
|
|
567
616
|
end
|
|
568
617
|
|
|
618
|
+
class Heading < ContextDev::Internal::Type::BaseModel
|
|
619
|
+
OrHash =
|
|
620
|
+
T.type_alias do
|
|
621
|
+
T.any(
|
|
622
|
+
ContextDev::Models::WebWebScrapeMdResponse::Metadata::Heading,
|
|
623
|
+
ContextDev::Internal::AnyHash
|
|
624
|
+
)
|
|
625
|
+
end
|
|
626
|
+
|
|
627
|
+
# Heading level, 1–6 (from h1–h6).
|
|
628
|
+
sig { returns(Integer) }
|
|
629
|
+
attr_accessor :level
|
|
630
|
+
|
|
631
|
+
# Heading text with whitespace collapsed, truncated to 1000 characters.
|
|
632
|
+
sig { returns(String) }
|
|
633
|
+
attr_accessor :text
|
|
634
|
+
|
|
635
|
+
sig { params(level: Integer, text: String).returns(T.attached_class) }
|
|
636
|
+
def self.new(
|
|
637
|
+
# Heading level, 1–6 (from h1–h6).
|
|
638
|
+
level:,
|
|
639
|
+
# Heading text with whitespace collapsed, truncated to 1000 characters.
|
|
640
|
+
text:
|
|
641
|
+
)
|
|
642
|
+
end
|
|
643
|
+
|
|
644
|
+
sig { override.returns({ level: Integer, text: String }) }
|
|
645
|
+
def to_hash
|
|
646
|
+
end
|
|
647
|
+
end
|
|
648
|
+
|
|
569
649
|
module OpenGraph
|
|
570
650
|
extend ContextDev::Internal::Type::Union
|
|
571
651
|
|
|
@@ -35,6 +35,15 @@ module ContextDev
|
|
|
35
35
|
sig { params(max_links: Integer).void }
|
|
36
36
|
attr_writer :max_links
|
|
37
37
|
|
|
38
|
+
# Optional search phrase. When provided, the crawled sitemap is filtered to the
|
|
39
|
+
# pages whose URLs are about that phrase, most relevant first, and the request
|
|
40
|
+
# costs 2 credits instead of 1.
|
|
41
|
+
sig { returns(T.nilable(String)) }
|
|
42
|
+
attr_reader :search
|
|
43
|
+
|
|
44
|
+
sig { params(search: String).void }
|
|
45
|
+
attr_writer :search
|
|
46
|
+
|
|
38
47
|
# Optional explicit sitemap URL. When provided, exactly this sitemap is crawled
|
|
39
48
|
# instead of discovering the domain's sitemaps.
|
|
40
49
|
sig { returns(T.nilable(String)) }
|
|
@@ -88,6 +97,7 @@ module ContextDev
|
|
|
88
97
|
domain: String,
|
|
89
98
|
headers: T::Hash[Symbol, String],
|
|
90
99
|
max_links: Integer,
|
|
100
|
+
search: String,
|
|
91
101
|
sitemap_url: String,
|
|
92
102
|
tags: T::Array[String],
|
|
93
103
|
timeout_ms: Integer,
|
|
@@ -106,6 +116,10 @@ module ContextDev
|
|
|
106
116
|
# Maximum number of links to return from the sitemap crawl. Defaults to 10,000.
|
|
107
117
|
# Minimum is 1, maximum is 100,000.
|
|
108
118
|
max_links: nil,
|
|
119
|
+
# Optional search phrase. When provided, the crawled sitemap is filtered to the
|
|
120
|
+
# pages whose URLs are about that phrase, most relevant first, and the request
|
|
121
|
+
# costs 2 credits instead of 1.
|
|
122
|
+
search: nil,
|
|
109
123
|
# Optional explicit sitemap URL. When provided, exactly this sitemap is crawled
|
|
110
124
|
# instead of discovering the domain's sitemaps.
|
|
111
125
|
sitemap_url: nil,
|
|
@@ -135,6 +149,7 @@ module ContextDev
|
|
|
135
149
|
domain: String,
|
|
136
150
|
headers: T::Hash[Symbol, String],
|
|
137
151
|
max_links: Integer,
|
|
152
|
+
search: String,
|
|
138
153
|
sitemap_url: String,
|
|
139
154
|
tags: T::Array[String],
|
|
140
155
|
timeout_ms: Integer,
|
|
@@ -34,7 +34,8 @@ module ContextDev
|
|
|
34
34
|
end
|
|
35
35
|
attr_accessor :success
|
|
36
36
|
|
|
37
|
-
#
|
|
37
|
+
# Discovered page URLs from the sitemap, up to `maxLinks`. When `search` is set
|
|
38
|
+
# these are only the matching pages, most relevant first.
|
|
38
39
|
sig { returns(T::Array[String]) }
|
|
39
40
|
attr_accessor :urls
|
|
40
41
|
|
|
@@ -75,7 +76,8 @@ module ContextDev
|
|
|
75
76
|
meta:,
|
|
76
77
|
# Indicates success
|
|
77
78
|
success:,
|
|
78
|
-
#
|
|
79
|
+
# Discovered page URLs from the sitemap, up to `maxLinks`. When `search` is set
|
|
80
|
+
# these are only the matching pages, most relevant first.
|
|
79
81
|
urls:,
|
|
80
82
|
# Metadata about the API key used for the request. Included in every response
|
|
81
83
|
# whenever a valid API key is provided, even when the response status is not 200.
|
data/rbi/context_dev/models.rbi
CHANGED
|
@@ -7,6 +7,8 @@ module ContextDev
|
|
|
7
7
|
|
|
8
8
|
BatchCancelParams = ContextDev::Models::BatchCancelParams
|
|
9
9
|
|
|
10
|
+
BatchDeleteParams = ContextDev::Models::BatchDeleteParams
|
|
11
|
+
|
|
10
12
|
BatchGetResultsParams = ContextDev::Models::BatchGetResultsParams
|
|
11
13
|
|
|
12
14
|
BatchListParams = ContextDev::Models::BatchListParams
|
|
@@ -60,10 +62,14 @@ module ContextDev
|
|
|
60
62
|
|
|
61
63
|
MonitorUpdateParams = ContextDev::Models::MonitorUpdateParams
|
|
62
64
|
|
|
65
|
+
NewsSearchParams = ContextDev::Models::NewsSearchParams
|
|
66
|
+
|
|
63
67
|
PageErrorCount = ContextDev::Models::PageErrorCount
|
|
64
68
|
|
|
65
69
|
ParseHandleParams = ContextDev::Models::ParseHandleParams
|
|
66
70
|
|
|
71
|
+
PersonEnrichParams = ContextDev::Models::PersonEnrichParams
|
|
72
|
+
|
|
67
73
|
UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams
|
|
68
74
|
|
|
69
75
|
WebExtractCompetitorsParams = ContextDev::Models::WebExtractCompetitorsParams
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Resources
|
|
5
|
+
# Scrape many pages or crawl a site asynchronously.
|
|
5
6
|
class Batch
|
|
6
7
|
# Check progress, and get download links once the batch finishes.
|
|
7
8
|
sig do
|
|
@@ -49,6 +50,21 @@ module ContextDev
|
|
|
49
50
|
)
|
|
50
51
|
end
|
|
51
52
|
|
|
53
|
+
# Permanently delete a finished batch and its stored results. Active batches must
|
|
54
|
+
# settle first.
|
|
55
|
+
sig do
|
|
56
|
+
params(
|
|
57
|
+
batch_id: String,
|
|
58
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
59
|
+
).returns(ContextDev::Models::BatchDeleteResponse)
|
|
60
|
+
end
|
|
61
|
+
def delete(
|
|
62
|
+
# ID of the batch to retrieve or cancel.
|
|
63
|
+
batch_id,
|
|
64
|
+
request_options: {}
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
|
|
52
68
|
# Stop a batch from starting new pages. In-progress pages finish, and unused
|
|
53
69
|
# credits are refunded.
|
|
54
70
|
sig do
|
|
@@ -86,24 +102,30 @@ module ContextDev
|
|
|
86
102
|
)
|
|
87
103
|
end
|
|
88
104
|
|
|
89
|
-
#
|
|
105
|
+
# Scrape 25K URLs or crawl large websites asynchronously.
|
|
90
106
|
sig do
|
|
91
107
|
params(
|
|
92
|
-
|
|
108
|
+
input:
|
|
109
|
+
T.any(
|
|
110
|
+
ContextDev::BatchSubmitParams::Input::Scrape::OrHash,
|
|
111
|
+
ContextDev::BatchSubmitParams::Input::Crawl::OrHash
|
|
112
|
+
),
|
|
93
113
|
tags: T::Array[String],
|
|
94
|
-
|
|
114
|
+
webhook_url: String,
|
|
115
|
+
idempotency_key: String,
|
|
95
116
|
request_options: ContextDev::RequestOptions::OrHash
|
|
96
117
|
).returns(ContextDev::Models::BatchSubmitResponse)
|
|
97
118
|
end
|
|
98
119
|
def submit(
|
|
99
|
-
#
|
|
100
|
-
|
|
101
|
-
#
|
|
120
|
+
# Body param: Choose a URL list or a site crawl.
|
|
121
|
+
input:,
|
|
122
|
+
# Body param: Tags stored on the batch. Filter the batch list by them later.
|
|
102
123
|
tags: nil,
|
|
103
|
-
#
|
|
104
|
-
|
|
105
|
-
#
|
|
106
|
-
|
|
124
|
+
# Body param: URL notified when the batch finishes.
|
|
125
|
+
webhook_url: nil,
|
|
126
|
+
# Header param: Any string unique to this submission. Retries with the same key
|
|
127
|
+
# return the original batch.
|
|
128
|
+
idempotency_key: nil,
|
|
107
129
|
request_options: {}
|
|
108
130
|
)
|
|
109
131
|
end
|
|
@@ -64,28 +64,34 @@ module ContextDev
|
|
|
64
64
|
)
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
-
# Search brands by name or domain
|
|
68
|
-
# (domain, name, logo), most popular first: by Tranco rank, then market cap for
|
|
69
|
-
# brands outside the Tranco list, with text relevance breaking ties. Matching is
|
|
70
|
-
# prefix-based with no typo tolerance, so it is suited to autocomplete. Only
|
|
71
|
-
# brands already in the Context.dev index are returned — use /brand/retrieve to
|
|
72
|
-
# fetch (and index) a specific domain. Free on Pro and Scale plans; costs 1 credit
|
|
73
|
-
# per request on the Free and Starter plans.
|
|
67
|
+
# Search indexed brands by name or domain
|
|
74
68
|
sig do
|
|
75
69
|
params(
|
|
76
70
|
query: String,
|
|
71
|
+
autocomplete: T::Boolean,
|
|
72
|
+
query_by: T::Array[ContextDev::BrandSearchParams::QueryBy::OrSymbol],
|
|
77
73
|
tags: T::Array[String],
|
|
74
|
+
typo_tolerance: Integer,
|
|
78
75
|
request_options: ContextDev::RequestOptions::OrHash
|
|
79
76
|
).returns(ContextDev::Models::BrandSearchResponse)
|
|
80
77
|
end
|
|
81
78
|
def search(
|
|
82
|
-
# Search term, matched against
|
|
79
|
+
# Search term, matched against the fields selected by queryBy (e.g. 'nike',
|
|
83
80
|
# 'nike.com', 'nik').
|
|
84
81
|
query:,
|
|
82
|
+
# Whether the search term matches by prefix, so partial words match as they are
|
|
83
|
+
# typed (e.g. 'nik' matches Nike). Set to false to match whole words only.
|
|
84
|
+
autocomplete: nil,
|
|
85
|
+
# Fields to match the search term against, as a comma-separated list or repeated
|
|
86
|
+
# parameter: 'name', 'domain', or both. Defaults to both.
|
|
87
|
+
query_by: nil,
|
|
85
88
|
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
86
89
|
# recorded on the request's usage log and can be used to filter usage on the
|
|
87
90
|
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
88
91
|
tags: nil,
|
|
92
|
+
# Maximum number of typos tolerated when matching, from 0 to 2. Defaults to 0 (no
|
|
93
|
+
# typo tolerance).
|
|
94
|
+
typo_tolerance: nil,
|
|
89
95
|
request_options: {}
|
|
90
96
|
)
|
|
91
97
|
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Resources
|
|
5
|
+
# Search live first-party RSS and free historical news data by company identity.
|
|
6
|
+
class News
|
|
7
|
+
# Searches live and historical company news for one company, identified in
|
|
8
|
+
# searchBy by name, domain, ticker (optionally disambiguated by exchange), or
|
|
9
|
+
# ISIN. Results can be filtered by publisher domain, publisher country, article
|
|
10
|
+
# language, article type, and published-at date, and include stable story IDs,
|
|
11
|
+
# source metadata, verified entity relevance, and cursor pagination.
|
|
12
|
+
sig do
|
|
13
|
+
params(
|
|
14
|
+
search_by: ContextDev::NewsSearchParams::SearchBy::OrHash,
|
|
15
|
+
cursor: T.nilable(String),
|
|
16
|
+
filter_by: ContextDev::NewsSearchParams::FilterBy::OrHash,
|
|
17
|
+
limit: Integer,
|
|
18
|
+
sort_by: ContextDev::NewsSearchParams::SortBy::OrHash,
|
|
19
|
+
tags: T::Array[String],
|
|
20
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
21
|
+
).returns(ContextDev::Models::NewsSearchResponse)
|
|
22
|
+
end
|
|
23
|
+
def search(
|
|
24
|
+
# What to search for.
|
|
25
|
+
search_by:,
|
|
26
|
+
# Opaque next_cursor from the previous response, or null for the first page.
|
|
27
|
+
cursor: nil,
|
|
28
|
+
# Optional result filters.
|
|
29
|
+
filter_by: nil,
|
|
30
|
+
# Maximum results to return. Defaults to 10.
|
|
31
|
+
limit: nil,
|
|
32
|
+
# Result ordering. Defaults to newest.
|
|
33
|
+
sort_by: nil,
|
|
34
|
+
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
35
|
+
tags: nil,
|
|
36
|
+
request_options: {}
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# @api private
|
|
41
|
+
sig { params(client: ContextDev::Client).returns(T.attached_class) }
|
|
42
|
+
def self.new(client:)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -10,29 +10,13 @@ module ContextDev
|
|
|
10
10
|
body: ContextDev::Internal::FileInput,
|
|
11
11
|
client: String,
|
|
12
12
|
extension: ContextDev::ParseHandleParams::Extension::OrSymbol,
|
|
13
|
-
include_images:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
ContextDev::ParseHandleParams::IncludeImages::OrSymbol
|
|
17
|
-
),
|
|
18
|
-
include_links:
|
|
19
|
-
T.any(
|
|
20
|
-
T::Boolean,
|
|
21
|
-
ContextDev::ParseHandleParams::IncludeLinks::OrSymbol
|
|
22
|
-
),
|
|
23
|
-
ocr: T.any(T::Boolean, ContextDev::ParseHandleParams::Ocr::OrSymbol),
|
|
13
|
+
include_images: T::Boolean,
|
|
14
|
+
include_links: T::Boolean,
|
|
15
|
+
ocr: T::Boolean,
|
|
24
16
|
pdf: ContextDev::ParseHandleParams::Pdf::OrHash,
|
|
25
|
-
shorten_base64_images:
|
|
26
|
-
T.any(
|
|
27
|
-
T::Boolean,
|
|
28
|
-
ContextDev::ParseHandleParams::ShortenBase64Images::OrSymbol
|
|
29
|
-
),
|
|
17
|
+
shorten_base64_images: T::Boolean,
|
|
30
18
|
tags: T::Array[String],
|
|
31
|
-
use_main_content_only:
|
|
32
|
-
T.any(
|
|
33
|
-
T::Boolean,
|
|
34
|
-
ContextDev::ParseHandleParams::UseMainContentOnly::OrSymbol
|
|
35
|
-
),
|
|
19
|
+
use_main_content_only: T::Boolean,
|
|
36
20
|
zdr: ContextDev::ParseHandleParams::Zdr::OrSymbol,
|
|
37
21
|
request_options: ContextDev::RequestOptions::OrHash
|
|
38
22
|
).returns(ContextDev::Models::ParseHandleResponse)
|
|
@@ -49,11 +33,11 @@ module ContextDev
|
|
|
49
33
|
include_images: nil,
|
|
50
34
|
# Query param: Preserve hyperlinks in Markdown output
|
|
51
35
|
include_links: nil,
|
|
52
|
-
# Query param: When true for PDF inputs,
|
|
53
|
-
#
|
|
54
|
-
#
|
|
55
|
-
# inclusive page range.
|
|
56
|
-
#
|
|
36
|
+
# Query param: When true for PDF inputs, OCR the selected pages that have no
|
|
37
|
+
# usable text layer (scans), replacing each recovered page's text with the OCR
|
|
38
|
+
# result while pages with a real text layer keep it. pdf.start/pdf.end limit the
|
|
39
|
+
# inclusive page range. Billed at 1 credit per page OCR actually recovered, on top
|
|
40
|
+
# of the base request cost. When false, no OCR runs.
|
|
57
41
|
ocr: nil,
|
|
58
42
|
# Query param: PDF page-range options as a JSON object, e.g. {"start": 2, "end":
|
|
59
43
|
# 5}.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Resources
|
|
5
|
+
class People
|
|
6
|
+
# Finds and normalizes the best available person candidate from additive identity
|
|
7
|
+
# clues, then assigns an identity match score from 0 to 100. Available on all paid
|
|
8
|
+
# plans. Successful requests cost 20 credits. Disposable and free email addresses
|
|
9
|
+
# (like gmail.com, yahoo.com) will throw a 422 error.
|
|
10
|
+
sig do
|
|
11
|
+
params(
|
|
12
|
+
company: ContextDev::PersonEnrichParams::Company::OrHash,
|
|
13
|
+
education:
|
|
14
|
+
T::Array[ContextDev::PersonEnrichParams::Education::OrHash],
|
|
15
|
+
email: String,
|
|
16
|
+
location: ContextDev::PersonEnrichParams::Location::OrHash,
|
|
17
|
+
name: ContextDev::PersonEnrichParams::Name::OrHash,
|
|
18
|
+
social_urls: T::Array[String],
|
|
19
|
+
tags: T::Array[String],
|
|
20
|
+
timeout_ms: Integer,
|
|
21
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
22
|
+
).returns(ContextDev::Models::PersonEnrichResponse)
|
|
23
|
+
end
|
|
24
|
+
def enrich(
|
|
25
|
+
company: nil,
|
|
26
|
+
education: nil,
|
|
27
|
+
email: nil,
|
|
28
|
+
location: nil,
|
|
29
|
+
name: nil,
|
|
30
|
+
social_urls: nil,
|
|
31
|
+
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
32
|
+
tags: nil,
|
|
33
|
+
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
34
|
+
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
35
|
+
# value is 300000ms (5 minutes).
|
|
36
|
+
timeout_ms: nil,
|
|
37
|
+
request_options: {}
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# @api private
|
|
42
|
+
sig { params(client: ContextDev::Client).returns(T.attached_class) }
|
|
43
|
+
def self.new(client:)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Resources
|
|
5
5
|
class Utility
|
|
6
|
-
# Signal that you may fetch
|
|
7
|
-
#
|
|
8
|
-
# one lookup key: a domain,
|
|
9
|
-
#
|
|
6
|
+
# Signal that you may fetch data soon to improve latency. The type field selects
|
|
7
|
+
# what to prefetch ('brand' queues a brand data fetch, 'styleguide' queues a
|
|
8
|
+
# styleguide extraction) and identifier carries exactly one lookup key: a domain,
|
|
9
|
+
# or an email whose domain is extracted and validated (free email providers and
|
|
10
|
+
# disposable email addresses are not allowed).
|
|
10
11
|
sig do
|
|
11
12
|
params(
|
|
12
13
|
identifier:
|
|
@@ -21,9 +22,10 @@ module ContextDev
|
|
|
21
22
|
).returns(ContextDev::Models::UtilityPrefetchResponse)
|
|
22
23
|
end
|
|
23
24
|
def prefetch(
|
|
24
|
-
# Identifier of the
|
|
25
|
+
# Identifier of the target to prefetch. Provide exactly one of domain or email.
|
|
25
26
|
identifier:,
|
|
26
|
-
# What to prefetch
|
|
27
|
+
# What to prefetch: 'brand' warms the brand data cache, 'styleguide' warms the
|
|
28
|
+
# styleguide cache.
|
|
27
29
|
type:,
|
|
28
30
|
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
29
31
|
tags: nil,
|