context.dev 1.26.0 → 1.27.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb1eb49bd2c33309910f98a48b129a07a32707a85e5a832277226ee555d22780
4
- data.tar.gz: 4c7410af11f9f6f69145a70f37e1c613fe9a90d6b2ea99acc061c10ae9119716
3
+ metadata.gz: 8f2f6c8c373d61ab07f5969d5f7f9bb52539093279b41b09a5e7bbefc6d4bd9e
4
+ data.tar.gz: d4afbf2bb5144a50a0b9930321c3ab8b3d193fd1a01da993ae2285a226a32597
5
5
  SHA512:
6
- metadata.gz: 13e5b25d98899a354e90fdf559ea5b3ed8d1140a543f538a7909691a92ecb49917e87398f2da8b3759aad2751487c02e4b89e4738f15febe9bc10995825c4660
7
- data.tar.gz: b82dee66dd6c01d5a4edb347097a978708714164cbe4460b7da394f0440b297afcc602bf52cc3cf597e3fe8638559b953bafe0288512e883f1d3b2957fc62cea
6
+ metadata.gz: 6e38d8989d26cecb219a1dcbb39d29c4f7bc92d9dda81de355959267ceeaa1c1587ea778163a1ce5267afcff70d36ac666b6b442226ba359ca0c82465b8bb05a
7
+ data.tar.gz: b9a94c13fc5cc8bf84c84bfbd46277e519d878bfc74f6d82f4e941bf01adf4bb9b9197f2eb32f06d722624a410ee703b351beb7f1d0ff51f7228f7addd5ea75d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.27.0 (2026-06-01)
4
+
5
+ Full Changelog: [v1.26.0...v1.27.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.26.0...v1.27.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** manual updates ([e3971dc](https://github.com/context-dot-dev/context-ruby-sdk/commit/e3971dcc3b94f5b998562f8ecb82a292cc8f00bd))
10
+
3
11
  ## 1.26.0 (2026-06-01)
4
12
 
5
13
  Full Changelog: [v1.25.0...v1.26.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.25.0...v1.26.0)
data/README.md CHANGED
@@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
26
26
  <!-- x-release-please-start-version -->
27
27
 
28
28
  ```ruby
29
- gem "context.dev", "~> 1.26.0"
29
+ gem "context.dev", "~> 1.27.0"
30
30
  ```
31
31
 
32
32
  <!-- x-release-please-end -->
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ContextDev
4
+ module Models
5
+ # @see ContextDev::Resources::Web#extract_competitors
6
+ class WebExtractCompetitorsParams < ContextDev::Internal::Type::BaseModel
7
+ extend ContextDev::Internal::Type::RequestParameters::Converter
8
+ include ContextDev::Internal::Type::RequestParameters
9
+
10
+ # @!attribute domain
11
+ # Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
12
+ # and normalized to their domain.
13
+ #
14
+ # @return [String]
15
+ required :domain, String
16
+
17
+ # @!attribute num_competitors
18
+ # Exact number of direct competitors to return. Defaults to 5.
19
+ #
20
+ # @return [Integer, nil]
21
+ optional :num_competitors, Integer
22
+
23
+ # @!attribute timeout_ms
24
+ # Optional timeout in milliseconds for the request. If the request takes longer
25
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
26
+ # value is 300000ms (5 minutes).
27
+ #
28
+ # @return [Integer, nil]
29
+ optional :timeout_ms, Integer
30
+
31
+ # @!method initialize(domain:, num_competitors: nil, timeout_ms: nil, request_options: {})
32
+ # Some parameter documentations has been truncated, see
33
+ # {ContextDev::Models::WebExtractCompetitorsParams} for more details.
34
+ #
35
+ # @param domain [String] Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
36
+ #
37
+ # @param num_competitors [Integer] Exact number of direct competitors to return. Defaults to 5.
38
+ #
39
+ # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
40
+ #
41
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,157 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ContextDev
4
+ module Models
5
+ # @see ContextDev::Resources::Web#extract_competitors
6
+ class WebExtractCompetitorsResponse < ContextDev::Internal::Type::BaseModel
7
+ # @!attribute competitors
8
+ # Direct competitors ordered by relevance and confidence.
9
+ #
10
+ # @return [Array<ContextDev::Models::WebExtractCompetitorsResponse::Competitor>]
11
+ required :competitors,
12
+ -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::WebExtractCompetitorsResponse::Competitor] }
13
+
14
+ # @!attribute domain
15
+ # Normalized input domain.
16
+ #
17
+ # @return [String]
18
+ required :domain, String
19
+
20
+ # @!attribute status
21
+ # Status of the response.
22
+ #
23
+ # @return [Symbol, ContextDev::Models::WebExtractCompetitorsResponse::Status]
24
+ required :status, enum: -> { ContextDev::Models::WebExtractCompetitorsResponse::Status }
25
+
26
+ # @!attribute target
27
+ # Target company profile inferred from the landing page.
28
+ #
29
+ # @return [ContextDev::Models::WebExtractCompetitorsResponse::Target]
30
+ required :target, -> { ContextDev::Models::WebExtractCompetitorsResponse::Target }
31
+
32
+ # @!method initialize(competitors:, domain:, status:, target:)
33
+ # @param competitors [Array<ContextDev::Models::WebExtractCompetitorsResponse::Competitor>] Direct competitors ordered by relevance and confidence.
34
+ #
35
+ # @param domain [String] Normalized input domain.
36
+ #
37
+ # @param status [Symbol, ContextDev::Models::WebExtractCompetitorsResponse::Status] Status of the response.
38
+ #
39
+ # @param target [ContextDev::Models::WebExtractCompetitorsResponse::Target] Target company profile inferred from the landing page.
40
+
41
+ class Competitor < ContextDev::Internal::Type::BaseModel
42
+ # @!attribute confidence
43
+ # Confidence that this company is a direct competitor.
44
+ #
45
+ # @return [Symbol, ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence]
46
+ required :confidence,
47
+ enum: -> { ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence }
48
+
49
+ # @!attribute description
50
+ # Short description of the competitor.
51
+ #
52
+ # @return [String]
53
+ required :description, String
54
+
55
+ # @!attribute domain
56
+ # Competitor's normalized official domain.
57
+ #
58
+ # @return [String]
59
+ required :domain, String
60
+
61
+ # @!attribute name
62
+ # Competitor company or product name.
63
+ #
64
+ # @return [String]
65
+ required :name, String
66
+
67
+ # @!attribute source_urls
68
+ # Search result URLs used as evidence for this competitor.
69
+ #
70
+ # @return [Array<String>]
71
+ required :source_urls, ContextDev::Internal::Type::ArrayOf[String], api_name: :sourceUrls
72
+
73
+ # @!attribute url
74
+ # Competitor website URL.
75
+ #
76
+ # @return [String]
77
+ required :url, String
78
+
79
+ # @!method initialize(confidence:, description:, domain:, name:, source_urls:, url:)
80
+ # @param confidence [Symbol, ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence] Confidence that this company is a direct competitor.
81
+ #
82
+ # @param description [String] Short description of the competitor.
83
+ #
84
+ # @param domain [String] Competitor's normalized official domain.
85
+ #
86
+ # @param name [String] Competitor company or product name.
87
+ #
88
+ # @param source_urls [Array<String>] Search result URLs used as evidence for this competitor.
89
+ #
90
+ # @param url [String] Competitor website URL.
91
+
92
+ # Confidence that this company is a direct competitor.
93
+ #
94
+ # @see ContextDev::Models::WebExtractCompetitorsResponse::Competitor#confidence
95
+ module Confidence
96
+ extend ContextDev::Internal::Type::Enum
97
+
98
+ HIGH = :high
99
+ MEDIUM = :medium
100
+
101
+ # @!method self.values
102
+ # @return [Array<Symbol>]
103
+ end
104
+ end
105
+
106
+ # Status of the response.
107
+ #
108
+ # @see ContextDev::Models::WebExtractCompetitorsResponse#status
109
+ module Status
110
+ extend ContextDev::Internal::Type::Enum
111
+
112
+ OK = :ok
113
+
114
+ # @!method self.values
115
+ # @return [Array<Symbol>]
116
+ end
117
+
118
+ # @see ContextDev::Models::WebExtractCompetitorsResponse#target
119
+ class Target < ContextDev::Internal::Type::BaseModel
120
+ # @!attribute company_name
121
+ # Company or product name inferred from the landing page.
122
+ #
123
+ # @return [String]
124
+ required :company_name, String, api_name: :companyName
125
+
126
+ # @!attribute field
127
+ # Specific operating field, product category, or market.
128
+ #
129
+ # @return [String]
130
+ required :field, String
131
+
132
+ # @!attribute field_description
133
+ # One-sentence description of what the target company sells and who it serves.
134
+ #
135
+ # @return [String]
136
+ required :field_description, String, api_name: :fieldDescription
137
+
138
+ # @!attribute website_url
139
+ # Resolved URL used for the landing page analysis.
140
+ #
141
+ # @return [String]
142
+ required :website_url, String, api_name: :websiteUrl
143
+
144
+ # @!method initialize(company_name:, field:, field_description:, website_url:)
145
+ # Target company profile inferred from the landing page.
146
+ #
147
+ # @param company_name [String] Company or product name inferred from the landing page.
148
+ #
149
+ # @param field [String] Specific operating field, product category, or market.
150
+ #
151
+ # @param field_description [String] One-sentence description of what the target company sells and who it serves.
152
+ #
153
+ # @param website_url [String] Resolved URL used for the landing page analysis.
154
+ end
155
+ end
156
+ end
157
+ end
@@ -67,6 +67,8 @@ module ContextDev
67
67
 
68
68
  UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams
69
69
 
70
+ WebExtractCompetitorsParams = ContextDev::Models::WebExtractCompetitorsParams
71
+
70
72
  WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams
71
73
 
72
74
  WebExtractParams = ContextDev::Models::WebExtractParams
@@ -49,6 +49,37 @@ module ContextDev
49
49
  )
50
50
  end
51
51
 
52
+ # Some parameter documentations has been truncated, see
53
+ # {ContextDev::Models::WebExtractCompetitorsParams} for more details.
54
+ #
55
+ # Analyze a company's landing page and web search evidence to return direct
56
+ # competitors for the same product or market.
57
+ #
58
+ # @overload extract_competitors(domain:, num_competitors: nil, timeout_ms: nil, request_options: {})
59
+ #
60
+ # @param domain [String] Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
61
+ #
62
+ # @param num_competitors [Integer] Exact number of direct competitors to return. Defaults to 5.
63
+ #
64
+ # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
65
+ #
66
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
67
+ #
68
+ # @return [ContextDev::Models::WebExtractCompetitorsResponse]
69
+ #
70
+ # @see ContextDev::Models::WebExtractCompetitorsParams
71
+ def extract_competitors(params)
72
+ parsed, options = ContextDev::WebExtractCompetitorsParams.dump_request(params)
73
+ query = ContextDev::Internal::Util.encode_query_params(parsed)
74
+ @client.request(
75
+ method: :get,
76
+ path: "web/competitors",
77
+ query: query.transform_keys(num_competitors: "numCompetitors", timeout_ms: "timeoutMS"),
78
+ model: ContextDev::Models::WebExtractCompetitorsResponse,
79
+ options: options
80
+ )
81
+ end
82
+
52
83
  # Some parameter documentations has been truncated, see
53
84
  # {ContextDev::Models::WebExtractFontsParams} for more details.
54
85
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContextDev
4
- VERSION = "1.26.0"
4
+ VERSION = "1.27.0"
5
5
  end
data/lib/context_dev.rb CHANGED
@@ -80,6 +80,8 @@ require_relative "context_dev/models/utility_prefetch_by_email_params"
80
80
  require_relative "context_dev/models/utility_prefetch_by_email_response"
81
81
  require_relative "context_dev/models/utility_prefetch_params"
82
82
  require_relative "context_dev/models/utility_prefetch_response"
83
+ require_relative "context_dev/models/web_extract_competitors_params"
84
+ require_relative "context_dev/models/web_extract_competitors_response"
83
85
  require_relative "context_dev/models/web_extract_fonts_params"
84
86
  require_relative "context_dev/models/web_extract_fonts_response"
85
87
  require_relative "context_dev/models/web_extract_params"
@@ -0,0 +1,74 @@
1
+ # typed: strong
2
+
3
+ module ContextDev
4
+ module Models
5
+ class WebExtractCompetitorsParams < 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(
12
+ ContextDev::WebExtractCompetitorsParams,
13
+ ContextDev::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
18
+ # and normalized to their domain.
19
+ sig { returns(String) }
20
+ attr_accessor :domain
21
+
22
+ # Exact number of direct competitors to return. Defaults to 5.
23
+ sig { returns(T.nilable(Integer)) }
24
+ attr_reader :num_competitors
25
+
26
+ sig { params(num_competitors: Integer).void }
27
+ attr_writer :num_competitors
28
+
29
+ # Optional timeout in milliseconds for the request. If the request takes longer
30
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
31
+ # value is 300000ms (5 minutes).
32
+ sig { returns(T.nilable(Integer)) }
33
+ attr_reader :timeout_ms
34
+
35
+ sig { params(timeout_ms: Integer).void }
36
+ attr_writer :timeout_ms
37
+
38
+ sig do
39
+ params(
40
+ domain: String,
41
+ num_competitors: Integer,
42
+ timeout_ms: Integer,
43
+ request_options: ContextDev::RequestOptions::OrHash
44
+ ).returns(T.attached_class)
45
+ end
46
+ def self.new(
47
+ # Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
48
+ # and normalized to their domain.
49
+ domain:,
50
+ # Exact number of direct competitors to return. Defaults to 5.
51
+ num_competitors: nil,
52
+ # Optional timeout in milliseconds for the request. If the request takes longer
53
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
54
+ # value is 300000ms (5 minutes).
55
+ timeout_ms: nil,
56
+ request_options: {}
57
+ )
58
+ end
59
+
60
+ sig do
61
+ override.returns(
62
+ {
63
+ domain: String,
64
+ num_competitors: Integer,
65
+ timeout_ms: Integer,
66
+ request_options: ContextDev::RequestOptions
67
+ }
68
+ )
69
+ end
70
+ def to_hash
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,297 @@
1
+ # typed: strong
2
+
3
+ module ContextDev
4
+ module Models
5
+ class WebExtractCompetitorsResponse < ContextDev::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ ContextDev::Models::WebExtractCompetitorsResponse,
10
+ ContextDev::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # Direct competitors ordered by relevance and confidence.
15
+ sig do
16
+ returns(
17
+ T::Array[
18
+ ContextDev::Models::WebExtractCompetitorsResponse::Competitor
19
+ ]
20
+ )
21
+ end
22
+ attr_accessor :competitors
23
+
24
+ # Normalized input domain.
25
+ sig { returns(String) }
26
+ attr_accessor :domain
27
+
28
+ # Status of the response.
29
+ sig do
30
+ returns(
31
+ ContextDev::Models::WebExtractCompetitorsResponse::Status::TaggedSymbol
32
+ )
33
+ end
34
+ attr_accessor :status
35
+
36
+ # Target company profile inferred from the landing page.
37
+ sig { returns(ContextDev::Models::WebExtractCompetitorsResponse::Target) }
38
+ attr_reader :target
39
+
40
+ sig do
41
+ params(
42
+ target:
43
+ ContextDev::Models::WebExtractCompetitorsResponse::Target::OrHash
44
+ ).void
45
+ end
46
+ attr_writer :target
47
+
48
+ sig do
49
+ params(
50
+ competitors:
51
+ T::Array[
52
+ ContextDev::Models::WebExtractCompetitorsResponse::Competitor::OrHash
53
+ ],
54
+ domain: String,
55
+ status:
56
+ ContextDev::Models::WebExtractCompetitorsResponse::Status::OrSymbol,
57
+ target:
58
+ ContextDev::Models::WebExtractCompetitorsResponse::Target::OrHash
59
+ ).returns(T.attached_class)
60
+ end
61
+ def self.new(
62
+ # Direct competitors ordered by relevance and confidence.
63
+ competitors:,
64
+ # Normalized input domain.
65
+ domain:,
66
+ # Status of the response.
67
+ status:,
68
+ # Target company profile inferred from the landing page.
69
+ target:
70
+ )
71
+ end
72
+
73
+ sig do
74
+ override.returns(
75
+ {
76
+ competitors:
77
+ T::Array[
78
+ ContextDev::Models::WebExtractCompetitorsResponse::Competitor
79
+ ],
80
+ domain: String,
81
+ status:
82
+ ContextDev::Models::WebExtractCompetitorsResponse::Status::TaggedSymbol,
83
+ target: ContextDev::Models::WebExtractCompetitorsResponse::Target
84
+ }
85
+ )
86
+ end
87
+ def to_hash
88
+ end
89
+
90
+ class Competitor < ContextDev::Internal::Type::BaseModel
91
+ OrHash =
92
+ T.type_alias do
93
+ T.any(
94
+ ContextDev::Models::WebExtractCompetitorsResponse::Competitor,
95
+ ContextDev::Internal::AnyHash
96
+ )
97
+ end
98
+
99
+ # Confidence that this company is a direct competitor.
100
+ sig do
101
+ returns(
102
+ ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence::TaggedSymbol
103
+ )
104
+ end
105
+ attr_accessor :confidence
106
+
107
+ # Short description of the competitor.
108
+ sig { returns(String) }
109
+ attr_accessor :description
110
+
111
+ # Competitor's normalized official domain.
112
+ sig { returns(String) }
113
+ attr_accessor :domain
114
+
115
+ # Competitor company or product name.
116
+ sig { returns(String) }
117
+ attr_accessor :name
118
+
119
+ # Search result URLs used as evidence for this competitor.
120
+ sig { returns(T::Array[String]) }
121
+ attr_accessor :source_urls
122
+
123
+ # Competitor website URL.
124
+ sig { returns(String) }
125
+ attr_accessor :url
126
+
127
+ sig do
128
+ params(
129
+ confidence:
130
+ ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence::OrSymbol,
131
+ description: String,
132
+ domain: String,
133
+ name: String,
134
+ source_urls: T::Array[String],
135
+ url: String
136
+ ).returns(T.attached_class)
137
+ end
138
+ def self.new(
139
+ # Confidence that this company is a direct competitor.
140
+ confidence:,
141
+ # Short description of the competitor.
142
+ description:,
143
+ # Competitor's normalized official domain.
144
+ domain:,
145
+ # Competitor company or product name.
146
+ name:,
147
+ # Search result URLs used as evidence for this competitor.
148
+ source_urls:,
149
+ # Competitor website URL.
150
+ url:
151
+ )
152
+ end
153
+
154
+ sig do
155
+ override.returns(
156
+ {
157
+ confidence:
158
+ ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence::TaggedSymbol,
159
+ description: String,
160
+ domain: String,
161
+ name: String,
162
+ source_urls: T::Array[String],
163
+ url: String
164
+ }
165
+ )
166
+ end
167
+ def to_hash
168
+ end
169
+
170
+ # Confidence that this company is a direct competitor.
171
+ module Confidence
172
+ extend ContextDev::Internal::Type::Enum
173
+
174
+ TaggedSymbol =
175
+ T.type_alias do
176
+ T.all(
177
+ Symbol,
178
+ ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence
179
+ )
180
+ end
181
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
182
+
183
+ HIGH =
184
+ T.let(
185
+ :high,
186
+ ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence::TaggedSymbol
187
+ )
188
+ MEDIUM =
189
+ T.let(
190
+ :medium,
191
+ ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence::TaggedSymbol
192
+ )
193
+
194
+ sig do
195
+ override.returns(
196
+ T::Array[
197
+ ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence::TaggedSymbol
198
+ ]
199
+ )
200
+ end
201
+ def self.values
202
+ end
203
+ end
204
+ end
205
+
206
+ # Status of the response.
207
+ module Status
208
+ extend ContextDev::Internal::Type::Enum
209
+
210
+ TaggedSymbol =
211
+ T.type_alias do
212
+ T.all(
213
+ Symbol,
214
+ ContextDev::Models::WebExtractCompetitorsResponse::Status
215
+ )
216
+ end
217
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
218
+
219
+ OK =
220
+ T.let(
221
+ :ok,
222
+ ContextDev::Models::WebExtractCompetitorsResponse::Status::TaggedSymbol
223
+ )
224
+
225
+ sig do
226
+ override.returns(
227
+ T::Array[
228
+ ContextDev::Models::WebExtractCompetitorsResponse::Status::TaggedSymbol
229
+ ]
230
+ )
231
+ end
232
+ def self.values
233
+ end
234
+ end
235
+
236
+ class Target < ContextDev::Internal::Type::BaseModel
237
+ OrHash =
238
+ T.type_alias do
239
+ T.any(
240
+ ContextDev::Models::WebExtractCompetitorsResponse::Target,
241
+ ContextDev::Internal::AnyHash
242
+ )
243
+ end
244
+
245
+ # Company or product name inferred from the landing page.
246
+ sig { returns(String) }
247
+ attr_accessor :company_name
248
+
249
+ # Specific operating field, product category, or market.
250
+ sig { returns(String) }
251
+ attr_accessor :field
252
+
253
+ # One-sentence description of what the target company sells and who it serves.
254
+ sig { returns(String) }
255
+ attr_accessor :field_description
256
+
257
+ # Resolved URL used for the landing page analysis.
258
+ sig { returns(String) }
259
+ attr_accessor :website_url
260
+
261
+ # Target company profile inferred from the landing page.
262
+ sig do
263
+ params(
264
+ company_name: String,
265
+ field: String,
266
+ field_description: String,
267
+ website_url: String
268
+ ).returns(T.attached_class)
269
+ end
270
+ def self.new(
271
+ # Company or product name inferred from the landing page.
272
+ company_name:,
273
+ # Specific operating field, product category, or market.
274
+ field:,
275
+ # One-sentence description of what the target company sells and who it serves.
276
+ field_description:,
277
+ # Resolved URL used for the landing page analysis.
278
+ website_url:
279
+ )
280
+ end
281
+
282
+ sig do
283
+ override.returns(
284
+ {
285
+ company_name: String,
286
+ field: String,
287
+ field_description: String,
288
+ website_url: String
289
+ }
290
+ )
291
+ end
292
+ def to_hash
293
+ end
294
+ end
295
+ end
296
+ end
297
+ end
@@ -32,6 +32,8 @@ module ContextDev
32
32
 
33
33
  UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams
34
34
 
35
+ WebExtractCompetitorsParams = ContextDev::Models::WebExtractCompetitorsParams
36
+
35
37
  WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams
36
38
 
37
39
  WebExtractParams = ContextDev::Models::WebExtractParams
@@ -60,6 +60,30 @@ module ContextDev
60
60
  )
61
61
  end
62
62
 
63
+ # Analyze a company's landing page and web search evidence to return direct
64
+ # competitors for the same product or market.
65
+ sig do
66
+ params(
67
+ domain: String,
68
+ num_competitors: Integer,
69
+ timeout_ms: Integer,
70
+ request_options: ContextDev::RequestOptions::OrHash
71
+ ).returns(ContextDev::Models::WebExtractCompetitorsResponse)
72
+ end
73
+ def extract_competitors(
74
+ # Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
75
+ # and normalized to their domain.
76
+ domain:,
77
+ # Exact number of direct competitors to return. Defaults to 5.
78
+ num_competitors: nil,
79
+ # Optional timeout in milliseconds for the request. If the request takes longer
80
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
81
+ # value is 300000ms (5 minutes).
82
+ timeout_ms: nil,
83
+ request_options: {}
84
+ )
85
+ end
86
+
63
87
  # Scrape font information from a website including font families, usage
64
88
  # statistics, fallbacks, and element/word counts.
65
89
  sig do
@@ -0,0 +1,36 @@
1
+ module ContextDev
2
+ module Models
3
+ type web_extract_competitors_params =
4
+ { domain: String, num_competitors: Integer, timeout_ms: Integer }
5
+ & ContextDev::Internal::Type::request_parameters
6
+
7
+ class WebExtractCompetitorsParams < ContextDev::Internal::Type::BaseModel
8
+ extend ContextDev::Internal::Type::RequestParameters::Converter
9
+ include ContextDev::Internal::Type::RequestParameters
10
+
11
+ attr_accessor domain: String
12
+
13
+ attr_reader num_competitors: Integer?
14
+
15
+ def num_competitors=: (Integer) -> Integer
16
+
17
+ attr_reader timeout_ms: Integer?
18
+
19
+ def timeout_ms=: (Integer) -> Integer
20
+
21
+ def initialize: (
22
+ domain: String,
23
+ ?num_competitors: Integer,
24
+ ?timeout_ms: Integer,
25
+ ?request_options: ContextDev::request_opts
26
+ ) -> void
27
+
28
+ def to_hash: -> {
29
+ domain: String,
30
+ num_competitors: Integer,
31
+ timeout_ms: Integer,
32
+ request_options: ContextDev::RequestOptions
33
+ }
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,130 @@
1
+ module ContextDev
2
+ module Models
3
+ type web_extract_competitors_response =
4
+ {
5
+ competitors: ::Array[ContextDev::Models::WebExtractCompetitorsResponse::Competitor],
6
+ domain: String,
7
+ status: ContextDev::Models::WebExtractCompetitorsResponse::status,
8
+ target: ContextDev::Models::WebExtractCompetitorsResponse::Target
9
+ }
10
+
11
+ class WebExtractCompetitorsResponse < ContextDev::Internal::Type::BaseModel
12
+ attr_accessor competitors: ::Array[ContextDev::Models::WebExtractCompetitorsResponse::Competitor]
13
+
14
+ attr_accessor domain: String
15
+
16
+ attr_accessor status: ContextDev::Models::WebExtractCompetitorsResponse::status
17
+
18
+ attr_accessor target: ContextDev::Models::WebExtractCompetitorsResponse::Target
19
+
20
+ def initialize: (
21
+ competitors: ::Array[ContextDev::Models::WebExtractCompetitorsResponse::Competitor],
22
+ domain: String,
23
+ status: ContextDev::Models::WebExtractCompetitorsResponse::status,
24
+ target: ContextDev::Models::WebExtractCompetitorsResponse::Target
25
+ ) -> void
26
+
27
+ def to_hash: -> {
28
+ competitors: ::Array[ContextDev::Models::WebExtractCompetitorsResponse::Competitor],
29
+ domain: String,
30
+ status: ContextDev::Models::WebExtractCompetitorsResponse::status,
31
+ target: ContextDev::Models::WebExtractCompetitorsResponse::Target
32
+ }
33
+
34
+ type competitor =
35
+ {
36
+ confidence: ContextDev::Models::WebExtractCompetitorsResponse::Competitor::confidence,
37
+ description: String,
38
+ domain: String,
39
+ name: String,
40
+ source_urls: ::Array[String],
41
+ url: String
42
+ }
43
+
44
+ class Competitor < ContextDev::Internal::Type::BaseModel
45
+ attr_accessor confidence: ContextDev::Models::WebExtractCompetitorsResponse::Competitor::confidence
46
+
47
+ attr_accessor description: String
48
+
49
+ attr_accessor domain: String
50
+
51
+ attr_accessor name: String
52
+
53
+ attr_accessor source_urls: ::Array[String]
54
+
55
+ attr_accessor url: String
56
+
57
+ def initialize: (
58
+ confidence: ContextDev::Models::WebExtractCompetitorsResponse::Competitor::confidence,
59
+ description: String,
60
+ domain: String,
61
+ name: String,
62
+ source_urls: ::Array[String],
63
+ url: String
64
+ ) -> void
65
+
66
+ def to_hash: -> {
67
+ confidence: ContextDev::Models::WebExtractCompetitorsResponse::Competitor::confidence,
68
+ description: String,
69
+ domain: String,
70
+ name: String,
71
+ source_urls: ::Array[String],
72
+ url: String
73
+ }
74
+
75
+ type confidence = :high | :medium
76
+
77
+ module Confidence
78
+ extend ContextDev::Internal::Type::Enum
79
+
80
+ HIGH: :high
81
+ MEDIUM: :medium
82
+
83
+ def self?.values: -> ::Array[ContextDev::Models::WebExtractCompetitorsResponse::Competitor::confidence]
84
+ end
85
+ end
86
+
87
+ type status = :ok
88
+
89
+ module Status
90
+ extend ContextDev::Internal::Type::Enum
91
+
92
+ OK: :ok
93
+
94
+ def self?.values: -> ::Array[ContextDev::Models::WebExtractCompetitorsResponse::status]
95
+ end
96
+
97
+ type target =
98
+ {
99
+ company_name: String,
100
+ field: String,
101
+ field_description: String,
102
+ website_url: String
103
+ }
104
+
105
+ class Target < ContextDev::Internal::Type::BaseModel
106
+ attr_accessor company_name: String
107
+
108
+ attr_accessor field: String
109
+
110
+ attr_accessor field_description: String
111
+
112
+ attr_accessor website_url: String
113
+
114
+ def initialize: (
115
+ company_name: String,
116
+ field: String,
117
+ field_description: String,
118
+ website_url: String
119
+ ) -> void
120
+
121
+ def to_hash: -> {
122
+ company_name: String,
123
+ field: String,
124
+ field_description: String,
125
+ website_url: String
126
+ }
127
+ end
128
+ end
129
+ end
130
+ end
@@ -27,6 +27,8 @@ module ContextDev
27
27
 
28
28
  class UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams
29
29
 
30
+ class WebExtractCompetitorsParams = ContextDev::Models::WebExtractCompetitorsParams
31
+
30
32
  class WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams
31
33
 
32
34
  class WebExtractParams = ContextDev::Models::WebExtractParams
@@ -16,6 +16,13 @@ module ContextDev
16
16
  ?request_options: ContextDev::request_opts
17
17
  ) -> ContextDev::Models::WebExtractResponse
18
18
 
19
+ def extract_competitors: (
20
+ domain: String,
21
+ ?num_competitors: Integer,
22
+ ?timeout_ms: Integer,
23
+ ?request_options: ContextDev::request_opts
24
+ ) -> ContextDev::Models::WebExtractCompetitorsResponse
25
+
19
26
  def extract_fonts: (
20
27
  ?direct_url: String,
21
28
  ?domain: String,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: context.dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.26.0
4
+ version: 1.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Context Dev
@@ -97,6 +97,8 @@ files:
97
97
  - lib/context_dev/models/utility_prefetch_by_email_response.rb
98
98
  - lib/context_dev/models/utility_prefetch_params.rb
99
99
  - lib/context_dev/models/utility_prefetch_response.rb
100
+ - lib/context_dev/models/web_extract_competitors_params.rb
101
+ - lib/context_dev/models/web_extract_competitors_response.rb
100
102
  - lib/context_dev/models/web_extract_fonts_params.rb
101
103
  - lib/context_dev/models/web_extract_fonts_response.rb
102
104
  - lib/context_dev/models/web_extract_params.rb
@@ -172,6 +174,8 @@ files:
172
174
  - rbi/context_dev/models/utility_prefetch_by_email_response.rbi
173
175
  - rbi/context_dev/models/utility_prefetch_params.rbi
174
176
  - rbi/context_dev/models/utility_prefetch_response.rbi
177
+ - rbi/context_dev/models/web_extract_competitors_params.rbi
178
+ - rbi/context_dev/models/web_extract_competitors_response.rbi
175
179
  - rbi/context_dev/models/web_extract_fonts_params.rbi
176
180
  - rbi/context_dev/models/web_extract_fonts_response.rbi
177
181
  - rbi/context_dev/models/web_extract_params.rbi
@@ -246,6 +250,8 @@ files:
246
250
  - sig/context_dev/models/utility_prefetch_by_email_response.rbs
247
251
  - sig/context_dev/models/utility_prefetch_params.rbs
248
252
  - sig/context_dev/models/utility_prefetch_response.rbs
253
+ - sig/context_dev/models/web_extract_competitors_params.rbs
254
+ - sig/context_dev/models/web_extract_competitors_response.rbs
249
255
  - sig/context_dev/models/web_extract_fonts_params.rbs
250
256
  - sig/context_dev/models/web_extract_fonts_response.rbs
251
257
  - sig/context_dev/models/web_extract_params.rbs