context.dev 2.7.0 → 2.8.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 +8 -0
- data/README.md +1 -1
- data/lib/context_dev/models/brand_search_params.rb +36 -0
- data/lib/context_dev/models/brand_search_response.rb +84 -0
- data/lib/context_dev/models.rb +2 -0
- data/lib/context_dev/resources/brand.rb +34 -0
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +2 -0
- data/rbi/context_dev/models/brand_search_params.rbi +60 -0
- data/rbi/context_dev/models/brand_search_response.rbi +146 -0
- data/rbi/context_dev/models.rbi +2 -0
- data/rbi/context_dev/resources/brand.rbi +26 -0
- data/sig/context_dev/models/brand_search_params.rbs +30 -0
- data/sig/context_dev/models/brand_search_response.rbs +62 -0
- data/sig/context_dev/models.rbs +2 -0
- data/sig/context_dev/resources/brand.rbs +6 -0
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 00c5f92b8b65317b72386a6582682ef62851cef787995be6a72be151b4aa40fb
|
|
4
|
+
data.tar.gz: 3e3a50df8e1e9d2cebdfb69de6f5c4ca0f29fee113b9c616c12b12f73515a29c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ce4193c612f2b34aced1bd14795a8e914b1aac8fd89178a654249db944163516ed7abde812992c6b070f4b1c05ff3dc74b0c3a3157645394f05b39a3b18c50ba
|
|
7
|
+
data.tar.gz: 62118c6e0913a9653616fd42121f3bacbc4b473f187430c0be61fd6fe496a046b4f1f831c1df748a14f4bde33fbcfe532f0afd92e13ae11bf604bea5207efdc7
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.8.0 (2026-08-05)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.7.0...v2.8.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v2.7.0...v2.8.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([054713e](https://github.com/context-dot-dev/context-ruby-sdk/commit/054713ecd7a6c12c29a2aaf0df0ea0eeb0ff61fc))
|
|
10
|
+
|
|
3
11
|
## 2.7.0 (2026-08-01)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v2.6.0...v2.7.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v2.6.0...v2.7.0)
|
data/README.md
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Models
|
|
5
|
+
# @see ContextDev::Resources::Brand#search
|
|
6
|
+
class BrandSearchParams < ContextDev::Internal::Type::BaseModel
|
|
7
|
+
extend ContextDev::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include ContextDev::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute query
|
|
11
|
+
# Search term, matched against brand names and domains by prefix (e.g. 'nike',
|
|
12
|
+
# 'nike.com', 'nik').
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
required :query, String
|
|
16
|
+
|
|
17
|
+
# @!attribute tags
|
|
18
|
+
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
19
|
+
# recorded on the request's usage log and can be used to filter usage on the
|
|
20
|
+
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
21
|
+
#
|
|
22
|
+
# @return [Array<String>, nil]
|
|
23
|
+
optional :tags, ContextDev::Internal::Type::ArrayOf[String]
|
|
24
|
+
|
|
25
|
+
# @!method initialize(query:, tags: nil, request_options: {})
|
|
26
|
+
# Some parameter documentations has been truncated, see
|
|
27
|
+
# {ContextDev::Models::BrandSearchParams} for more details.
|
|
28
|
+
#
|
|
29
|
+
# @param query [String] Search term, matched against brand names and domains by prefix (e.g. 'nike', 'ni
|
|
30
|
+
#
|
|
31
|
+
# @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
32
|
+
#
|
|
33
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Models
|
|
5
|
+
# @see ContextDev::Resources::Brand#search
|
|
6
|
+
class BrandSearchResponse < ContextDev::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute results
|
|
8
|
+
# Up to 10 matching brands, most popular first. Empty when nothing matches.
|
|
9
|
+
#
|
|
10
|
+
# @return [Array<ContextDev::Models::BrandSearchResponse::Result>]
|
|
11
|
+
required :results,
|
|
12
|
+
-> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::BrandSearchResponse::Result] }
|
|
13
|
+
|
|
14
|
+
# @!attribute key_metadata
|
|
15
|
+
# Metadata about the API key used for the request. Included in every response
|
|
16
|
+
# whenever a valid API key is provided, even when the response status is not 200.
|
|
17
|
+
#
|
|
18
|
+
# @return [ContextDev::Models::BrandSearchResponse::KeyMetadata, nil]
|
|
19
|
+
optional :key_metadata, -> { ContextDev::Models::BrandSearchResponse::KeyMetadata }
|
|
20
|
+
|
|
21
|
+
# @!method initialize(results:, key_metadata: nil)
|
|
22
|
+
# Some parameter documentations has been truncated, see
|
|
23
|
+
# {ContextDev::Models::BrandSearchResponse} for more details.
|
|
24
|
+
#
|
|
25
|
+
# @param results [Array<ContextDev::Models::BrandSearchResponse::Result>] Up to 10 matching brands, most popular first. Empty when nothing matches.
|
|
26
|
+
#
|
|
27
|
+
# @param key_metadata [ContextDev::Models::BrandSearchResponse::KeyMetadata] Metadata about the API key used for the request. Included in every response when
|
|
28
|
+
|
|
29
|
+
class Result < ContextDev::Internal::Type::BaseModel
|
|
30
|
+
# @!attribute domain
|
|
31
|
+
# The brand's domain.
|
|
32
|
+
#
|
|
33
|
+
# @return [String]
|
|
34
|
+
required :domain, String
|
|
35
|
+
|
|
36
|
+
# @!attribute logo
|
|
37
|
+
# Logo link URL that serves the brand's logo, generated per request for the
|
|
38
|
+
# calling organization.
|
|
39
|
+
#
|
|
40
|
+
# @return [String]
|
|
41
|
+
required :logo, String
|
|
42
|
+
|
|
43
|
+
# @!attribute name
|
|
44
|
+
# The brand's name. Empty string when unknown.
|
|
45
|
+
#
|
|
46
|
+
# @return [String]
|
|
47
|
+
required :name, String
|
|
48
|
+
|
|
49
|
+
# @!method initialize(domain:, logo:, name:)
|
|
50
|
+
# Some parameter documentations has been truncated, see
|
|
51
|
+
# {ContextDev::Models::BrandSearchResponse::Result} for more details.
|
|
52
|
+
#
|
|
53
|
+
# @param domain [String] The brand's domain.
|
|
54
|
+
#
|
|
55
|
+
# @param logo [String] Logo link URL that serves the brand's logo, generated per request for the callin
|
|
56
|
+
#
|
|
57
|
+
# @param name [String] The brand's name. Empty string when unknown.
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# @see ContextDev::Models::BrandSearchResponse#key_metadata
|
|
61
|
+
class KeyMetadata < ContextDev::Internal::Type::BaseModel
|
|
62
|
+
# @!attribute credits_consumed
|
|
63
|
+
# The number of credits consumed by this request.
|
|
64
|
+
#
|
|
65
|
+
# @return [Integer]
|
|
66
|
+
required :credits_consumed, Integer
|
|
67
|
+
|
|
68
|
+
# @!attribute credits_remaining
|
|
69
|
+
# The number of credits remaining for your organization after this request.
|
|
70
|
+
#
|
|
71
|
+
# @return [Integer]
|
|
72
|
+
required :credits_remaining, Integer
|
|
73
|
+
|
|
74
|
+
# @!method initialize(credits_consumed:, credits_remaining:)
|
|
75
|
+
# Metadata about the API key used for the request. Included in every response
|
|
76
|
+
# whenever a valid API key is provided, even when the response status is not 200.
|
|
77
|
+
#
|
|
78
|
+
# @param credits_consumed [Integer] The number of credits consumed by this request.
|
|
79
|
+
#
|
|
80
|
+
# @param credits_remaining [Integer] The number of credits remaining for your organization after this request.
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
data/lib/context_dev/models.rb
CHANGED
|
@@ -57,6 +57,8 @@ module ContextDev
|
|
|
57
57
|
|
|
58
58
|
BrandRetrieveSimplifiedParams = ContextDev::Models::BrandRetrieveSimplifiedParams
|
|
59
59
|
|
|
60
|
+
BrandSearchParams = ContextDev::Models::BrandSearchParams
|
|
61
|
+
|
|
60
62
|
CrawlControls = ContextDev::Models::CrawlControls
|
|
61
63
|
|
|
62
64
|
Failure = ContextDev::Models::Failure
|
|
@@ -65,6 +65,40 @@ module ContextDev
|
|
|
65
65
|
)
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
+
# Some parameter documentations has been truncated, see
|
|
69
|
+
# {ContextDev::Models::BrandSearchParams} for more details.
|
|
70
|
+
#
|
|
71
|
+
# Search brands by name or domain and get back up to 10 lightweight matches
|
|
72
|
+
# (domain, name, logo), most popular first: by Tranco rank, then market cap for
|
|
73
|
+
# brands outside the Tranco list, with text relevance breaking ties. Matching is
|
|
74
|
+
# prefix-based with no typo tolerance, so it is suited to autocomplete. Only
|
|
75
|
+
# brands already in the Context.dev index are returned — use /brand/retrieve to
|
|
76
|
+
# fetch (and index) a specific domain. Free on Pro and Scale plans; costs 1 credit
|
|
77
|
+
# per request on the Free and Starter plans.
|
|
78
|
+
#
|
|
79
|
+
# @overload search(query:, tags: nil, request_options: {})
|
|
80
|
+
#
|
|
81
|
+
# @param query [String] Search term, matched against brand names and domains by prefix (e.g. 'nike', 'ni
|
|
82
|
+
#
|
|
83
|
+
# @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
84
|
+
#
|
|
85
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
86
|
+
#
|
|
87
|
+
# @return [ContextDev::Models::BrandSearchResponse]
|
|
88
|
+
#
|
|
89
|
+
# @see ContextDev::Models::BrandSearchParams
|
|
90
|
+
def search(params)
|
|
91
|
+
parsed, options = ContextDev::BrandSearchParams.dump_request(params)
|
|
92
|
+
query = ContextDev::Internal::Util.encode_query_params(parsed)
|
|
93
|
+
@client.request(
|
|
94
|
+
method: :get,
|
|
95
|
+
path: "brand/search",
|
|
96
|
+
query: query,
|
|
97
|
+
model: ContextDev::Models::BrandSearchResponse,
|
|
98
|
+
options: options
|
|
99
|
+
)
|
|
100
|
+
end
|
|
101
|
+
|
|
68
102
|
# @api private
|
|
69
103
|
#
|
|
70
104
|
# @param client [ContextDev::Client]
|
data/lib/context_dev/version.rb
CHANGED
data/lib/context_dev.rb
CHANGED
|
@@ -70,6 +70,8 @@ require_relative "context_dev/models/brand_retrieve_params"
|
|
|
70
70
|
require_relative "context_dev/models/brand_retrieve_response"
|
|
71
71
|
require_relative "context_dev/models/brand_retrieve_simplified_params"
|
|
72
72
|
require_relative "context_dev/models/brand_retrieve_simplified_response"
|
|
73
|
+
require_relative "context_dev/models/brand_search_params"
|
|
74
|
+
require_relative "context_dev/models/brand_search_response"
|
|
73
75
|
require_relative "context_dev/models/crawl_controls"
|
|
74
76
|
require_relative "context_dev/models/failure"
|
|
75
77
|
require_relative "context_dev/models/industry_retrieve_naics_params"
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Models
|
|
5
|
+
class BrandSearchParams < ContextDev::Internal::Type::BaseModel
|
|
6
|
+
extend ContextDev::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include ContextDev::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(ContextDev::BrandSearchParams, ContextDev::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Search term, matched against brand names and domains by prefix (e.g. 'nike',
|
|
15
|
+
# 'nike.com', 'nik').
|
|
16
|
+
sig { returns(String) }
|
|
17
|
+
attr_accessor :query
|
|
18
|
+
|
|
19
|
+
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
20
|
+
# recorded on the request's usage log and can be used to filter usage on the
|
|
21
|
+
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
22
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
23
|
+
attr_reader :tags
|
|
24
|
+
|
|
25
|
+
sig { params(tags: T::Array[String]).void }
|
|
26
|
+
attr_writer :tags
|
|
27
|
+
|
|
28
|
+
sig do
|
|
29
|
+
params(
|
|
30
|
+
query: String,
|
|
31
|
+
tags: T::Array[String],
|
|
32
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
33
|
+
).returns(T.attached_class)
|
|
34
|
+
end
|
|
35
|
+
def self.new(
|
|
36
|
+
# Search term, matched against brand names and domains by prefix (e.g. 'nike',
|
|
37
|
+
# 'nike.com', 'nik').
|
|
38
|
+
query:,
|
|
39
|
+
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
40
|
+
# recorded on the request's usage log and can be used to filter usage on the
|
|
41
|
+
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
42
|
+
tags: nil,
|
|
43
|
+
request_options: {}
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
sig do
|
|
48
|
+
override.returns(
|
|
49
|
+
{
|
|
50
|
+
query: String,
|
|
51
|
+
tags: T::Array[String],
|
|
52
|
+
request_options: ContextDev::RequestOptions
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
def to_hash
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Models
|
|
5
|
+
class BrandSearchResponse < ContextDev::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
ContextDev::Models::BrandSearchResponse,
|
|
10
|
+
ContextDev::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Up to 10 matching brands, most popular first. Empty when nothing matches.
|
|
15
|
+
sig { returns(T::Array[ContextDev::Models::BrandSearchResponse::Result]) }
|
|
16
|
+
attr_accessor :results
|
|
17
|
+
|
|
18
|
+
# Metadata about the API key used for the request. Included in every response
|
|
19
|
+
# whenever a valid API key is provided, even when the response status is not 200.
|
|
20
|
+
sig do
|
|
21
|
+
returns(T.nilable(ContextDev::Models::BrandSearchResponse::KeyMetadata))
|
|
22
|
+
end
|
|
23
|
+
attr_reader :key_metadata
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
params(
|
|
27
|
+
key_metadata:
|
|
28
|
+
ContextDev::Models::BrandSearchResponse::KeyMetadata::OrHash
|
|
29
|
+
).void
|
|
30
|
+
end
|
|
31
|
+
attr_writer :key_metadata
|
|
32
|
+
|
|
33
|
+
sig do
|
|
34
|
+
params(
|
|
35
|
+
results:
|
|
36
|
+
T::Array[ContextDev::Models::BrandSearchResponse::Result::OrHash],
|
|
37
|
+
key_metadata:
|
|
38
|
+
ContextDev::Models::BrandSearchResponse::KeyMetadata::OrHash
|
|
39
|
+
).returns(T.attached_class)
|
|
40
|
+
end
|
|
41
|
+
def self.new(
|
|
42
|
+
# Up to 10 matching brands, most popular first. Empty when nothing matches.
|
|
43
|
+
results:,
|
|
44
|
+
# Metadata about the API key used for the request. Included in every response
|
|
45
|
+
# whenever a valid API key is provided, even when the response status is not 200.
|
|
46
|
+
key_metadata: nil
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
sig do
|
|
51
|
+
override.returns(
|
|
52
|
+
{
|
|
53
|
+
results: T::Array[ContextDev::Models::BrandSearchResponse::Result],
|
|
54
|
+
key_metadata: ContextDev::Models::BrandSearchResponse::KeyMetadata
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
def to_hash
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
class Result < ContextDev::Internal::Type::BaseModel
|
|
62
|
+
OrHash =
|
|
63
|
+
T.type_alias do
|
|
64
|
+
T.any(
|
|
65
|
+
ContextDev::Models::BrandSearchResponse::Result,
|
|
66
|
+
ContextDev::Internal::AnyHash
|
|
67
|
+
)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# The brand's domain.
|
|
71
|
+
sig { returns(String) }
|
|
72
|
+
attr_accessor :domain
|
|
73
|
+
|
|
74
|
+
# Logo link URL that serves the brand's logo, generated per request for the
|
|
75
|
+
# calling organization.
|
|
76
|
+
sig { returns(String) }
|
|
77
|
+
attr_accessor :logo
|
|
78
|
+
|
|
79
|
+
# The brand's name. Empty string when unknown.
|
|
80
|
+
sig { returns(String) }
|
|
81
|
+
attr_accessor :name
|
|
82
|
+
|
|
83
|
+
sig do
|
|
84
|
+
params(domain: String, logo: String, name: String).returns(
|
|
85
|
+
T.attached_class
|
|
86
|
+
)
|
|
87
|
+
end
|
|
88
|
+
def self.new(
|
|
89
|
+
# The brand's domain.
|
|
90
|
+
domain:,
|
|
91
|
+
# Logo link URL that serves the brand's logo, generated per request for the
|
|
92
|
+
# calling organization.
|
|
93
|
+
logo:,
|
|
94
|
+
# The brand's name. Empty string when unknown.
|
|
95
|
+
name:
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
sig { override.returns({ domain: String, logo: String, name: String }) }
|
|
100
|
+
def to_hash
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
class KeyMetadata < ContextDev::Internal::Type::BaseModel
|
|
105
|
+
OrHash =
|
|
106
|
+
T.type_alias do
|
|
107
|
+
T.any(
|
|
108
|
+
ContextDev::Models::BrandSearchResponse::KeyMetadata,
|
|
109
|
+
ContextDev::Internal::AnyHash
|
|
110
|
+
)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# The number of credits consumed by this request.
|
|
114
|
+
sig { returns(Integer) }
|
|
115
|
+
attr_accessor :credits_consumed
|
|
116
|
+
|
|
117
|
+
# The number of credits remaining for your organization after this request.
|
|
118
|
+
sig { returns(Integer) }
|
|
119
|
+
attr_accessor :credits_remaining
|
|
120
|
+
|
|
121
|
+
# Metadata about the API key used for the request. Included in every response
|
|
122
|
+
# whenever a valid API key is provided, even when the response status is not 200.
|
|
123
|
+
sig do
|
|
124
|
+
params(credits_consumed: Integer, credits_remaining: Integer).returns(
|
|
125
|
+
T.attached_class
|
|
126
|
+
)
|
|
127
|
+
end
|
|
128
|
+
def self.new(
|
|
129
|
+
# The number of credits consumed by this request.
|
|
130
|
+
credits_consumed:,
|
|
131
|
+
# The number of credits remaining for your organization after this request.
|
|
132
|
+
credits_remaining:
|
|
133
|
+
)
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
sig do
|
|
137
|
+
override.returns(
|
|
138
|
+
{ credits_consumed: Integer, credits_remaining: Integer }
|
|
139
|
+
)
|
|
140
|
+
end
|
|
141
|
+
def to_hash
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|
data/rbi/context_dev/models.rbi
CHANGED
|
@@ -20,6 +20,8 @@ module ContextDev
|
|
|
20
20
|
BrandRetrieveSimplifiedParams =
|
|
21
21
|
ContextDev::Models::BrandRetrieveSimplifiedParams
|
|
22
22
|
|
|
23
|
+
BrandSearchParams = ContextDev::Models::BrandSearchParams
|
|
24
|
+
|
|
23
25
|
CrawlControls = ContextDev::Models::CrawlControls
|
|
24
26
|
|
|
25
27
|
Failure = ContextDev::Models::Failure
|
|
@@ -64,6 +64,32 @@ module ContextDev
|
|
|
64
64
|
)
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
+
# Search brands by name or domain and get back up to 10 lightweight matches
|
|
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.
|
|
74
|
+
sig do
|
|
75
|
+
params(
|
|
76
|
+
query: String,
|
|
77
|
+
tags: T::Array[String],
|
|
78
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
79
|
+
).returns(ContextDev::Models::BrandSearchResponse)
|
|
80
|
+
end
|
|
81
|
+
def search(
|
|
82
|
+
# Search term, matched against brand names and domains by prefix (e.g. 'nike',
|
|
83
|
+
# 'nike.com', 'nik').
|
|
84
|
+
query:,
|
|
85
|
+
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
86
|
+
# recorded on the request's usage log and can be used to filter usage on the
|
|
87
|
+
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
88
|
+
tags: nil,
|
|
89
|
+
request_options: {}
|
|
90
|
+
)
|
|
91
|
+
end
|
|
92
|
+
|
|
67
93
|
# @api private
|
|
68
94
|
sig { params(client: ContextDev::Client).returns(T.attached_class) }
|
|
69
95
|
def self.new(client:)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module ContextDev
|
|
2
|
+
module Models
|
|
3
|
+
type brand_search_params =
|
|
4
|
+
{ query: String, tags: ::Array[String] }
|
|
5
|
+
& ContextDev::Internal::Type::request_parameters
|
|
6
|
+
|
|
7
|
+
class BrandSearchParams < ContextDev::Internal::Type::BaseModel
|
|
8
|
+
extend ContextDev::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include ContextDev::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
attr_accessor query: String
|
|
12
|
+
|
|
13
|
+
attr_reader tags: ::Array[String]?
|
|
14
|
+
|
|
15
|
+
def tags=: (::Array[String]) -> ::Array[String]
|
|
16
|
+
|
|
17
|
+
def initialize: (
|
|
18
|
+
query: String,
|
|
19
|
+
?tags: ::Array[String],
|
|
20
|
+
?request_options: ContextDev::request_opts
|
|
21
|
+
) -> void
|
|
22
|
+
|
|
23
|
+
def to_hash: -> {
|
|
24
|
+
query: String,
|
|
25
|
+
tags: ::Array[String],
|
|
26
|
+
request_options: ContextDev::RequestOptions
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
module ContextDev
|
|
2
|
+
module Models
|
|
3
|
+
type brand_search_response =
|
|
4
|
+
{
|
|
5
|
+
results: ::Array[ContextDev::Models::BrandSearchResponse::Result],
|
|
6
|
+
key_metadata: ContextDev::Models::BrandSearchResponse::KeyMetadata
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
class BrandSearchResponse < ContextDev::Internal::Type::BaseModel
|
|
10
|
+
attr_accessor results: ::Array[ContextDev::Models::BrandSearchResponse::Result]
|
|
11
|
+
|
|
12
|
+
attr_reader key_metadata: ContextDev::Models::BrandSearchResponse::KeyMetadata?
|
|
13
|
+
|
|
14
|
+
def key_metadata=: (
|
|
15
|
+
ContextDev::Models::BrandSearchResponse::KeyMetadata
|
|
16
|
+
) -> ContextDev::Models::BrandSearchResponse::KeyMetadata
|
|
17
|
+
|
|
18
|
+
def initialize: (
|
|
19
|
+
results: ::Array[ContextDev::Models::BrandSearchResponse::Result],
|
|
20
|
+
?key_metadata: ContextDev::Models::BrandSearchResponse::KeyMetadata
|
|
21
|
+
) -> void
|
|
22
|
+
|
|
23
|
+
def to_hash: -> {
|
|
24
|
+
results: ::Array[ContextDev::Models::BrandSearchResponse::Result],
|
|
25
|
+
key_metadata: ContextDev::Models::BrandSearchResponse::KeyMetadata
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
type result = { domain: String, logo: String, name: String }
|
|
29
|
+
|
|
30
|
+
class Result < ContextDev::Internal::Type::BaseModel
|
|
31
|
+
attr_accessor domain: String
|
|
32
|
+
|
|
33
|
+
attr_accessor logo: String
|
|
34
|
+
|
|
35
|
+
attr_accessor name: String
|
|
36
|
+
|
|
37
|
+
def initialize: (domain: String, logo: String, name: String) -> void
|
|
38
|
+
|
|
39
|
+
def to_hash: -> { domain: String, logo: String, name: String }
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
type key_metadata =
|
|
43
|
+
{ credits_consumed: Integer, credits_remaining: Integer }
|
|
44
|
+
|
|
45
|
+
class KeyMetadata < ContextDev::Internal::Type::BaseModel
|
|
46
|
+
attr_accessor credits_consumed: Integer
|
|
47
|
+
|
|
48
|
+
attr_accessor credits_remaining: Integer
|
|
49
|
+
|
|
50
|
+
def initialize: (
|
|
51
|
+
credits_consumed: Integer,
|
|
52
|
+
credits_remaining: Integer
|
|
53
|
+
) -> void
|
|
54
|
+
|
|
55
|
+
def to_hash: -> {
|
|
56
|
+
credits_consumed: Integer,
|
|
57
|
+
credits_remaining: Integer
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
data/sig/context_dev/models.rbs
CHANGED
|
@@ -17,6 +17,8 @@ module ContextDev
|
|
|
17
17
|
|
|
18
18
|
class BrandRetrieveSimplifiedParams = ContextDev::Models::BrandRetrieveSimplifiedParams
|
|
19
19
|
|
|
20
|
+
class BrandSearchParams = ContextDev::Models::BrandSearchParams
|
|
21
|
+
|
|
20
22
|
class CrawlControls = ContextDev::Models::CrawlControls
|
|
21
23
|
|
|
22
24
|
class Failure = ContextDev::Models::Failure
|
|
@@ -15,6 +15,12 @@ module ContextDev
|
|
|
15
15
|
?request_options: ContextDev::request_opts
|
|
16
16
|
) -> ContextDev::Models::BrandRetrieveSimplifiedResponse
|
|
17
17
|
|
|
18
|
+
def search: (
|
|
19
|
+
query: String,
|
|
20
|
+
?tags: ::Array[String],
|
|
21
|
+
?request_options: ContextDev::request_opts
|
|
22
|
+
) -> ContextDev::Models::BrandSearchResponse
|
|
23
|
+
|
|
18
24
|
def initialize: (client: ContextDev::Client) -> void
|
|
19
25
|
end
|
|
20
26
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: context.dev
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Context Dev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-08-
|
|
11
|
+
date: 2026-08-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|
|
@@ -87,6 +87,8 @@ files:
|
|
|
87
87
|
- lib/context_dev/models/brand_retrieve_response.rb
|
|
88
88
|
- lib/context_dev/models/brand_retrieve_simplified_params.rb
|
|
89
89
|
- lib/context_dev/models/brand_retrieve_simplified_response.rb
|
|
90
|
+
- lib/context_dev/models/brand_search_params.rb
|
|
91
|
+
- lib/context_dev/models/brand_search_response.rb
|
|
90
92
|
- lib/context_dev/models/crawl_controls.rb
|
|
91
93
|
- lib/context_dev/models/failure.rb
|
|
92
94
|
- lib/context_dev/models/industry_retrieve_naics_params.rb
|
|
@@ -196,6 +198,8 @@ files:
|
|
|
196
198
|
- rbi/context_dev/models/brand_retrieve_response.rbi
|
|
197
199
|
- rbi/context_dev/models/brand_retrieve_simplified_params.rbi
|
|
198
200
|
- rbi/context_dev/models/brand_retrieve_simplified_response.rbi
|
|
201
|
+
- rbi/context_dev/models/brand_search_params.rbi
|
|
202
|
+
- rbi/context_dev/models/brand_search_response.rbi
|
|
199
203
|
- rbi/context_dev/models/crawl_controls.rbi
|
|
200
204
|
- rbi/context_dev/models/failure.rbi
|
|
201
205
|
- rbi/context_dev/models/industry_retrieve_naics_params.rbi
|
|
@@ -304,6 +308,8 @@ files:
|
|
|
304
308
|
- sig/context_dev/models/brand_retrieve_response.rbs
|
|
305
309
|
- sig/context_dev/models/brand_retrieve_simplified_params.rbs
|
|
306
310
|
- sig/context_dev/models/brand_retrieve_simplified_response.rbs
|
|
311
|
+
- sig/context_dev/models/brand_search_params.rbs
|
|
312
|
+
- sig/context_dev/models/brand_search_response.rbs
|
|
307
313
|
- sig/context_dev/models/crawl_controls.rbs
|
|
308
314
|
- sig/context_dev/models/failure.rbs
|
|
309
315
|
- sig/context_dev/models/industry_retrieve_naics_params.rbs
|