Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.26.0"
".": "1.27.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 24
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-1785aa93e6fb2784640a4c32eb0221f0b31aa06644d090f72f8533524aeef7c6.yml
configured_endpoints: 25
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-30ba67603321f69c2ba0432320c45caa4727ebbe353bea8874c9e7db8b95b09e.yml
openapi_spec_hash: 7dc1fadcec32637e795f641a0e97c63e
config_hash: cf2c7f48b329e0a61612b30cd2755ad1
config_hash: f86a4e06ae5ed725aa79d58d7a8dc27c
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.27.0 (2026-06-01)

Full Changelog: [v1.26.0...v1.27.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.26.0...v1.27.0)

### Features

* **api:** manual updates ([e3971dc](https://github.com/context-dot-dev/context-ruby-sdk/commit/e3971dcc3b94f5b998562f8ecb82a292cc8f00bd))

## 1.26.0 (2026-06-01)

Full Changelog: [v1.25.0...v1.26.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.25.0...v1.26.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
context.dev (1.26.0)
context.dev (1.27.0)
cgi
connection_pool

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "context.dev", "~> 1.26.0"
gem "context.dev", "~> 1.27.0"
```

<!-- x-release-please-end -->
Expand Down
2 changes: 2 additions & 0 deletions lib/context_dev.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
require_relative "context_dev/models/utility_prefetch_by_email_response"
require_relative "context_dev/models/utility_prefetch_params"
require_relative "context_dev/models/utility_prefetch_response"
require_relative "context_dev/models/web_extract_competitors_params"
require_relative "context_dev/models/web_extract_competitors_response"
require_relative "context_dev/models/web_extract_fonts_params"
require_relative "context_dev/models/web_extract_fonts_response"
require_relative "context_dev/models/web_extract_params"
Expand Down
2 changes: 2 additions & 0 deletions lib/context_dev/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ module ContextDev

UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams

WebExtractCompetitorsParams = ContextDev::Models::WebExtractCompetitorsParams

WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams

WebExtractParams = ContextDev::Models::WebExtractParams
Expand Down
44 changes: 44 additions & 0 deletions lib/context_dev/models/web_extract_competitors_params.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# frozen_string_literal: true

module ContextDev
module Models
# @see ContextDev::Resources::Web#extract_competitors
class WebExtractCompetitorsParams < ContextDev::Internal::Type::BaseModel
extend ContextDev::Internal::Type::RequestParameters::Converter
include ContextDev::Internal::Type::RequestParameters

# @!attribute domain
# Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
# and normalized to their domain.
#
# @return [String]
required :domain, String

# @!attribute num_competitors
# Exact number of direct competitors to return. Defaults to 5.
#
# @return [Integer, nil]
optional :num_competitors, Integer

# @!attribute timeout_ms
# Optional timeout in milliseconds for the request. If the request takes longer
# than this value, it will be aborted with a 408 status code. Maximum allowed
# value is 300000ms (5 minutes).
#
# @return [Integer, nil]
optional :timeout_ms, Integer

# @!method initialize(domain:, num_competitors: nil, timeout_ms: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {ContextDev::Models::WebExtractCompetitorsParams} for more details.
#
# @param domain [String] Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
#
# @param num_competitors [Integer] Exact number of direct competitors to return. Defaults to 5.
#
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
#
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
end
end
end
157 changes: 157 additions & 0 deletions lib/context_dev/models/web_extract_competitors_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# frozen_string_literal: true

module ContextDev
module Models
# @see ContextDev::Resources::Web#extract_competitors
class WebExtractCompetitorsResponse < ContextDev::Internal::Type::BaseModel
# @!attribute competitors
# Direct competitors ordered by relevance and confidence.
#
# @return [Array<ContextDev::Models::WebExtractCompetitorsResponse::Competitor>]
required :competitors,
-> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::WebExtractCompetitorsResponse::Competitor] }

# @!attribute domain
# Normalized input domain.
#
# @return [String]
required :domain, String

# @!attribute status
# Status of the response.
#
# @return [Symbol, ContextDev::Models::WebExtractCompetitorsResponse::Status]
required :status, enum: -> { ContextDev::Models::WebExtractCompetitorsResponse::Status }

# @!attribute target
# Target company profile inferred from the landing page.
#
# @return [ContextDev::Models::WebExtractCompetitorsResponse::Target]
required :target, -> { ContextDev::Models::WebExtractCompetitorsResponse::Target }

# @!method initialize(competitors:, domain:, status:, target:)
# @param competitors [Array<ContextDev::Models::WebExtractCompetitorsResponse::Competitor>] Direct competitors ordered by relevance and confidence.
#
# @param domain [String] Normalized input domain.
#
# @param status [Symbol, ContextDev::Models::WebExtractCompetitorsResponse::Status] Status of the response.
#
# @param target [ContextDev::Models::WebExtractCompetitorsResponse::Target] Target company profile inferred from the landing page.

class Competitor < ContextDev::Internal::Type::BaseModel
# @!attribute confidence
# Confidence that this company is a direct competitor.
#
# @return [Symbol, ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence]
required :confidence,
enum: -> { ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence }

# @!attribute description
# Short description of the competitor.
#
# @return [String]
required :description, String

# @!attribute domain
# Competitor's normalized official domain.
#
# @return [String]
required :domain, String

# @!attribute name
# Competitor company or product name.
#
# @return [String]
required :name, String

# @!attribute source_urls
# Search result URLs used as evidence for this competitor.
#
# @return [Array<String>]
required :source_urls, ContextDev::Internal::Type::ArrayOf[String], api_name: :sourceUrls

# @!attribute url
# Competitor website URL.
#
# @return [String]
required :url, String

# @!method initialize(confidence:, description:, domain:, name:, source_urls:, url:)
# @param confidence [Symbol, ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence] Confidence that this company is a direct competitor.
#
# @param description [String] Short description of the competitor.
#
# @param domain [String] Competitor's normalized official domain.
#
# @param name [String] Competitor company or product name.
#
# @param source_urls [Array<String>] Search result URLs used as evidence for this competitor.
#
# @param url [String] Competitor website URL.

# Confidence that this company is a direct competitor.
#
# @see ContextDev::Models::WebExtractCompetitorsResponse::Competitor#confidence
module Confidence
extend ContextDev::Internal::Type::Enum

HIGH = :high
MEDIUM = :medium

# @!method self.values
# @return [Array<Symbol>]
end
end

# Status of the response.
#
# @see ContextDev::Models::WebExtractCompetitorsResponse#status
module Status
extend ContextDev::Internal::Type::Enum

OK = :ok

# @!method self.values
# @return [Array<Symbol>]
end

# @see ContextDev::Models::WebExtractCompetitorsResponse#target
class Target < ContextDev::Internal::Type::BaseModel
# @!attribute company_name
# Company or product name inferred from the landing page.
#
# @return [String]
required :company_name, String, api_name: :companyName

# @!attribute field
# Specific operating field, product category, or market.
#
# @return [String]
required :field, String

# @!attribute field_description
# One-sentence description of what the target company sells and who it serves.
#
# @return [String]
required :field_description, String, api_name: :fieldDescription

# @!attribute website_url
# Resolved URL used for the landing page analysis.
#
# @return [String]
required :website_url, String, api_name: :websiteUrl

# @!method initialize(company_name:, field:, field_description:, website_url:)
# Target company profile inferred from the landing page.
#
# @param company_name [String] Company or product name inferred from the landing page.
#
# @param field [String] Specific operating field, product category, or market.
#
# @param field_description [String] One-sentence description of what the target company sells and who it serves.
#
# @param website_url [String] Resolved URL used for the landing page analysis.
end
end
end
end
31 changes: 31 additions & 0 deletions lib/context_dev/resources/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,37 @@ def extract(params)
)
end

# Some parameter documentations has been truncated, see
# {ContextDev::Models::WebExtractCompetitorsParams} for more details.
#
# Analyze a company's landing page and web search evidence to return direct
# competitors for the same product or market.
#
# @overload extract_competitors(domain:, num_competitors: nil, timeout_ms: nil, request_options: {})
#
# @param domain [String] Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
#
# @param num_competitors [Integer] Exact number of direct competitors to return. Defaults to 5.
#
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
#
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
#
# @return [ContextDev::Models::WebExtractCompetitorsResponse]
#
# @see ContextDev::Models::WebExtractCompetitorsParams
def extract_competitors(params)
parsed, options = ContextDev::WebExtractCompetitorsParams.dump_request(params)
query = ContextDev::Internal::Util.encode_query_params(parsed)
@client.request(
method: :get,
path: "web/competitors",
query: query.transform_keys(num_competitors: "numCompetitors", timeout_ms: "timeoutMS"),
model: ContextDev::Models::WebExtractCompetitorsResponse,
options: options
)
end

# Some parameter documentations has been truncated, see
# {ContextDev::Models::WebExtractFontsParams} for more details.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/context_dev/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ContextDev
VERSION = "1.26.0"
VERSION = "1.27.0"
end
2 changes: 2 additions & 0 deletions rbi/context_dev/models.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module ContextDev

UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams

WebExtractCompetitorsParams = ContextDev::Models::WebExtractCompetitorsParams

WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams

WebExtractParams = ContextDev::Models::WebExtractParams
Expand Down
74 changes: 74 additions & 0 deletions rbi/context_dev/models/web_extract_competitors_params.rbi
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# typed: strong

module ContextDev
module Models
class WebExtractCompetitorsParams < ContextDev::Internal::Type::BaseModel
extend ContextDev::Internal::Type::RequestParameters::Converter
include ContextDev::Internal::Type::RequestParameters

OrHash =
T.type_alias do
T.any(
ContextDev::WebExtractCompetitorsParams,
ContextDev::Internal::AnyHash
)
end

# Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
# and normalized to their domain.
sig { returns(String) }
attr_accessor :domain

# Exact number of direct competitors to return. Defaults to 5.
sig { returns(T.nilable(Integer)) }
attr_reader :num_competitors

sig { params(num_competitors: Integer).void }
attr_writer :num_competitors

# Optional timeout in milliseconds for the request. If the request takes longer
# than this value, it will be aborted with a 408 status code. Maximum allowed
# value is 300000ms (5 minutes).
sig { returns(T.nilable(Integer)) }
attr_reader :timeout_ms

sig { params(timeout_ms: Integer).void }
attr_writer :timeout_ms

sig do
params(
domain: String,
num_competitors: Integer,
timeout_ms: Integer,
request_options: ContextDev::RequestOptions::OrHash
).returns(T.attached_class)
end
def self.new(
# Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
# and normalized to their domain.
domain:,
# Exact number of direct competitors to return. Defaults to 5.
num_competitors: nil,
# Optional timeout in milliseconds for the request. If the request takes longer
# than this value, it will be aborted with a 408 status code. Maximum allowed
# value is 300000ms (5 minutes).
timeout_ms: nil,
request_options: {}
)
end

sig do
override.returns(
{
domain: String,
num_competitors: Integer,
timeout_ms: Integer,
request_options: ContextDev::RequestOptions
}
)
end
def to_hash
end
end
end
end
Loading
Loading