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.36.0"
".": "2.0.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 25
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-021b48afe1d6e3f54c4ebe3d0da4beb3fb8b69a6d384a4aeadbc5bab7f967603.yml
openapi_spec_hash: 2aa5b59d78c708b094acf29cc0d9a68a
config_hash: c7b0cdaba3b9797b77efd89e1754d803
configured_endpoints: 29
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-7dbd739a81e6aaf7fc7ef1858606e7d572d309af55082a66431d9292e655e66f.yml
openapi_spec_hash: a6374d5d718a7bd9d3d54fb657e2bd9d
config_hash: ff35e224e809656528c44163aa41bebd
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## 2.0.0 (2026-07-06)

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

### Features

* **api:** api update ([b0511d9](https://github.com/context-dot-dev/context-ruby-sdk/commit/b0511d905641a19d59391ff26ac27d474016ac26))
* **api:** api update ([a146323](https://github.com/context-dot-dev/context-ruby-sdk/commit/a14632340e78b4b21be6c742f3792a7f14ca4fae))
* **api:** api update ([4a4a076](https://github.com/context-dot-dev/context-ruby-sdk/commit/4a4a0762b6c422c5507f847bb06b9ac0fb11e605))
* **api:** api update ([4682d0b](https://github.com/context-dot-dev/context-ruby-sdk/commit/4682d0b50170440ce7a3b60beadad10cefff3168))
* **api:** api update ([0026695](https://github.com/context-dot-dev/context-ruby-sdk/commit/00266958beb99d8747e4e5422a122792e0cb8080))
* **api:** api update ([3393a00](https://github.com/context-dot-dev/context-ruby-sdk/commit/3393a0047608f81e85a7c011ff3fd6356d7433a3))
* **api:** api update ([ab547fb](https://github.com/context-dot-dev/context-ruby-sdk/commit/ab547fb83535a1184f2aa1414b86022e4550704f))
* **api:** api update ([d71fbde](https://github.com/context-dot-dev/context-ruby-sdk/commit/d71fbde94bc39245091db193f120fa383efea82f))
* **api:** api update ([8fb393a](https://github.com/context-dot-dev/context-ruby-sdk/commit/8fb393a6a53d4ec6867efe8d9daf8458d9fa3cc8))
* **api:** manual updates ([b18f464](https://github.com/context-dot-dev/context-ruby-sdk/commit/b18f46485bf70c10b0a20459ed38b2991ea5add0))
* **api:** manual updates ([fa7f5bf](https://github.com/context-dot-dev/context-ruby-sdk/commit/fa7f5bfa1e892a7dff26b169bd3ea7a6d0863048))
* **api:** manual updates ([7277672](https://github.com/context-dot-dev/context-ruby-sdk/commit/7277672e289e4d8a54791a154e989ec6ba25e3b2))


### Chores

* **internal:** bound formatter parallelism to CPU count ([8b73d53](https://github.com/context-dot-dev/context-ruby-sdk/commit/8b73d53426ce571223386b1decabcb0bf58eaa37))

## 1.36.0 (2026-06-27)

Full Changelog: [v1.35.0...v1.36.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.35.0...v1.36.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.36.0)
context.dev (2.0.0)
cgi
connection_pool

Expand Down
25 changes: 16 additions & 9 deletions 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.36.0"
gem "context.dev", "~> 2.0.0"
```

<!-- x-release-please-end -->
Expand All @@ -41,7 +41,7 @@ context_dev = ContextDev::Client.new(
api_key: ENV["CONTEXT_DEV_API_KEY"] # This is the default and can be omitted
)

brand = context_dev.brand.retrieve(domain: "REPLACE_ME")
brand = context_dev.brand.retrieve(body: {domain: "stripe.com", type: "by_domain"})

puts(brand.brand)
```
Expand All @@ -52,7 +52,7 @@ When the library is unable to connect to the API, or if the API returns a non-su

```ruby
begin
brand = context_dev.brand.retrieve(domain: "REPLACE_ME")
brand = context_dev.brand.retrieve(body: {domain: "stripe.com", type: "by_domain"})
rescue ContextDev::Errors::APIConnectionError => e
puts("The server could not be reached")
puts(e.cause) # an underlying Exception, likely raised within `net/http`
Expand Down Expand Up @@ -95,7 +95,10 @@ context_dev = ContextDev::Client.new(
)

# Or, configure per-request:
context_dev.brand.retrieve(domain: "REPLACE_ME", request_options: {max_retries: 5})
context_dev.brand.retrieve(
body: {domain: "stripe.com", type: "by_domain"},
request_options: {max_retries: 5}
)
```

### Timeouts
Expand All @@ -109,7 +112,7 @@ context_dev = ContextDev::Client.new(
)

# Or, configure per-request:
context_dev.brand.retrieve(domain: "REPLACE_ME", request_options: {timeout: 5})
context_dev.brand.retrieve(body: {domain: "stripe.com", type: "by_domain"}, request_options: {timeout: 5})
```

On timeout, `ContextDev::Errors::APITimeoutError` is raised.
Expand Down Expand Up @@ -141,7 +144,7 @@ Note: the `extra_` parameters of the same name overrides the documented paramete
```ruby
brand =
context_dev.brand.retrieve(
domain: "REPLACE_ME",
body: {domain: "stripe.com", type: "by_domain"},
request_options: {
extra_query: {my_query_parameter: value},
extra_body: {my_body_parameter: value},
Expand Down Expand Up @@ -187,17 +190,21 @@ This library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitio
You can provide typesafe request parameters like so:

```ruby
context_dev.brand.retrieve(domain: "REPLACE_ME")
context_dev.brand.retrieve(
body: ContextDev::BrandRetrieveParams::Body::ByDomain.new(domain: "stripe.com")
)
```

Or, equivalently:

```ruby
# Hashes work, but are not typesafe:
context_dev.brand.retrieve(domain: "REPLACE_ME")
context_dev.brand.retrieve(body: {domain: "stripe.com", type: "by_domain"})

# You can also splat a full Params class:
params = ContextDev::BrandRetrieveParams.new(domain: "REPLACE_ME")
params = ContextDev::BrandRetrieveParams.new(
body: ContextDev::BrandRetrieveParams::Body::ByDomain.new(domain: "stripe.com")
)
context_dev.brand.retrieve(**params)
```

Expand Down
7 changes: 6 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require "etc"
require "pathname"
require "securerandom"
require "shellwords"
Expand Down Expand Up @@ -37,7 +38,11 @@ multitask(:test) do
ruby(*%w[-w -e], rb, verbose: false) { fail unless _1 }
end

xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --]
# Cap parallelism at the CPU count. `--max-procs=0` spawns one process per
# 300-file batch with no upper bound; on large SDKs (thousands of files) that
# oversubscribes CPUs and stacks up rubocop processes, exhausting memory and
# slowing CI to the point of timing out.
xargs = %W[xargs --no-run-if-empty --null --max-procs=#{Etc.nprocessors} --max-args=300 --]
ruby_opt = {"RUBYOPT" => [ENV["RUBYOPT"], "--encoding=UTF-8"].compact.join(" ")}

filtered = ->(ext, dirs) do
Expand Down
37 changes: 23 additions & 14 deletions lib/context_dev.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,10 @@
require_relative "context_dev/internal/transport/base_client"
require_relative "context_dev/internal/transport/pooled_net_requester"
require_relative "context_dev/client"
require_relative "context_dev/models/ai_ai_query_params"
require_relative "context_dev/models/ai_ai_query_response"
require_relative "context_dev/models/ai_extract_product_params"
require_relative "context_dev/models/ai_extract_product_response"
require_relative "context_dev/models/ai_extract_products_params"
require_relative "context_dev/models/ai_extract_products_response"
require_relative "context_dev/models/brand_identify_from_transaction_params"
require_relative "context_dev/models/brand_identify_from_transaction_response"
require_relative "context_dev/models/brand_retrieve_by_email_params"
require_relative "context_dev/models/brand_retrieve_by_email_response"
require_relative "context_dev/models/brand_retrieve_by_isin_params"
require_relative "context_dev/models/brand_retrieve_by_isin_response"
require_relative "context_dev/models/brand_retrieve_by_name_params"
require_relative "context_dev/models/brand_retrieve_by_name_response"
require_relative "context_dev/models/brand_retrieve_by_ticker_params"
require_relative "context_dev/models/brand_retrieve_by_ticker_response"
require_relative "context_dev/models/brand_retrieve_params"
require_relative "context_dev/models/brand_retrieve_response"
require_relative "context_dev/models/brand_retrieve_simplified_params"
Expand All @@ -76,8 +64,28 @@
require_relative "context_dev/models/industry_retrieve_naics_response"
require_relative "context_dev/models/industry_retrieve_sic_params"
require_relative "context_dev/models/industry_retrieve_sic_response"
require_relative "context_dev/models/utility_prefetch_by_email_params"
require_relative "context_dev/models/utility_prefetch_by_email_response"
require_relative "context_dev/models/monitor_create_params"
require_relative "context_dev/models/monitor_create_response"
require_relative "context_dev/models/monitor_delete_params"
require_relative "context_dev/models/monitor_delete_response"
require_relative "context_dev/models/monitor_list_account_changes_params"
require_relative "context_dev/models/monitor_list_account_changes_response"
require_relative "context_dev/models/monitor_list_account_runs_params"
require_relative "context_dev/models/monitor_list_account_runs_response"
require_relative "context_dev/models/monitor_list_changes_params"
require_relative "context_dev/models/monitor_list_changes_response"
require_relative "context_dev/models/monitor_list_params"
require_relative "context_dev/models/monitor_list_response"
require_relative "context_dev/models/monitor_list_runs_params"
require_relative "context_dev/models/monitor_list_runs_response"
require_relative "context_dev/models/monitor_retrieve_change_params"
require_relative "context_dev/models/monitor_retrieve_change_response"
require_relative "context_dev/models/monitor_retrieve_params"
require_relative "context_dev/models/monitor_retrieve_response"
require_relative "context_dev/models/monitor_run_params"
require_relative "context_dev/models/monitor_run_response"
require_relative "context_dev/models/monitor_update_params"
require_relative "context_dev/models/monitor_update_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"
Expand Down Expand Up @@ -106,5 +114,6 @@
require_relative "context_dev/resources/ai"
require_relative "context_dev/resources/brand"
require_relative "context_dev/resources/industry"
require_relative "context_dev/resources/monitors"
require_relative "context_dev/resources/utility"
require_relative "context_dev/resources/web"
7 changes: 7 additions & 0 deletions lib/context_dev/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ class Client < ContextDev::Internal::Transport::BaseClient
# @return [ContextDev::Resources::Utility]
attr_reader :utility

# Monitor pages, sitemaps, and extracted website data for exact or semantic
# changes. The change.detected webhook payload is documented by the
# MonitorsChangeDetectedWebhookPayload schema.
# @return [ContextDev::Resources::Monitors]
attr_reader :monitors

# @api private
#
# @return [Hash{String=>String}]
Expand Down Expand Up @@ -99,6 +105,7 @@ def initialize(
@brand = ContextDev::Resources::Brand.new(client: self)
@industry = ContextDev::Resources::Industry.new(client: self)
@utility = ContextDev::Resources::Utility.new(client: self)
@monitors = ContextDev::Resources::Monitors.new(client: self)
end
end
end
32 changes: 20 additions & 12 deletions lib/context_dev/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,39 @@ module ContextDev
mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
end

AIAIQueryParams = ContextDev::Models::AIAIQueryParams

AIExtractProductParams = ContextDev::Models::AIExtractProductParams

AIExtractProductsParams = ContextDev::Models::AIExtractProductsParams

BrandIdentifyFromTransactionParams = ContextDev::Models::BrandIdentifyFromTransactionParams
BrandRetrieveParams = ContextDev::Models::BrandRetrieveParams

BrandRetrieveByEmailParams = ContextDev::Models::BrandRetrieveByEmailParams
BrandRetrieveSimplifiedParams = ContextDev::Models::BrandRetrieveSimplifiedParams

BrandRetrieveByIsinParams = ContextDev::Models::BrandRetrieveByIsinParams
IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams

BrandRetrieveByNameParams = ContextDev::Models::BrandRetrieveByNameParams
IndustryRetrieveSicParams = ContextDev::Models::IndustryRetrieveSicParams

BrandRetrieveByTickerParams = ContextDev::Models::BrandRetrieveByTickerParams
MonitorCreateParams = ContextDev::Models::MonitorCreateParams

BrandRetrieveParams = ContextDev::Models::BrandRetrieveParams
MonitorDeleteParams = ContextDev::Models::MonitorDeleteParams

BrandRetrieveSimplifiedParams = ContextDev::Models::BrandRetrieveSimplifiedParams
MonitorListAccountChangesParams = ContextDev::Models::MonitorListAccountChangesParams

IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams
MonitorListAccountRunsParams = ContextDev::Models::MonitorListAccountRunsParams

IndustryRetrieveSicParams = ContextDev::Models::IndustryRetrieveSicParams
MonitorListChangesParams = ContextDev::Models::MonitorListChangesParams

MonitorListParams = ContextDev::Models::MonitorListParams

MonitorListRunsParams = ContextDev::Models::MonitorListRunsParams

MonitorRetrieveChangeParams = ContextDev::Models::MonitorRetrieveChangeParams

MonitorRetrieveParams = ContextDev::Models::MonitorRetrieveParams

MonitorRunParams = ContextDev::Models::MonitorRunParams

UtilityPrefetchByEmailParams = ContextDev::Models::UtilityPrefetchByEmailParams
MonitorUpdateParams = ContextDev::Models::MonitorUpdateParams

UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams

Expand Down
Loading