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 @@
{
".": "2.2.0"
".": "2.3.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: 29
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-ecb277557634e2f0838ea196e2b21f11924f65e133c7977e8c2e1a603b8df466.yml
openapi_spec_hash: 798ce4cb042389a1179bf9af6fc1173d
config_hash: ff35e224e809656528c44163aa41bebd
configured_endpoints: 30
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-c90f13e3cf4b9ae6a1d8f22c0e7285ab12d412d3a659a51a247a97adc7f08121.yml
openapi_spec_hash: bf7879be38ebf3397a939c80b261a47a
config_hash: daabb160675d86b354711da1e77e5129
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 2.3.0 (2026-07-12)

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

### Features

* **api:** api update ([3fd9604](https://github.com/context-dot-dev/context-ruby-sdk/commit/3fd960488c341f082b6d312dda927aeee23dccff))
* **api:** api update ([bdd3176](https://github.com/context-dot-dev/context-ruby-sdk/commit/bdd3176c7f507880adb7becae314b816c6bbe9bc))
* **api:** api update ([d68d31d](https://github.com/context-dot-dev/context-ruby-sdk/commit/d68d31dc5aa77ad154789b6cf91e0b8558353214))
* **api:** api update ([d4c601e](https://github.com/context-dot-dev/context-ruby-sdk/commit/d4c601ea30aa1d47ef041d0439ab8b5d976cc8e2))
* **api:** api update ([03fa3ac](https://github.com/context-dot-dev/context-ruby-sdk/commit/03fa3ac3c7c61aba88846db890bf4d3fd22d1086))
* **api:** api update ([626d105](https://github.com/context-dot-dev/context-ruby-sdk/commit/626d1054da9622e88469bb9c3b755f43d1d75280))
* **api:** manual updates ([b7f6b2c](https://github.com/context-dot-dev/context-ruby-sdk/commit/b7f6b2c0a5bb91cc065bcc2ef497c9999414262c))

## 2.2.0 (2026-07-10)

Full Changelog: [v2.1.0...v2.2.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v2.1.0...v2.2.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 (2.2.0)
context.dev (2.3.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", "~> 2.2.0"
gem "context.dev", "~> 2.3.0"
```

<!-- x-release-please-end -->
Expand Down
4 changes: 4 additions & 0 deletions lib/context_dev.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
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/parse_handle_params"
require_relative "context_dev/models/parse_handle_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 All @@ -96,6 +98,7 @@
require_relative "context_dev/models/web_extract_response"
require_relative "context_dev/models/web_extract_styleguide_params"
require_relative "context_dev/models/web_extract_styleguide_response"
require_relative "context_dev/models/webhook_delivery"
require_relative "context_dev/models/web_screenshot_params"
require_relative "context_dev/models/web_screenshot_response"
require_relative "context_dev/models/web_search_params"
Expand All @@ -115,5 +118,6 @@
require_relative "context_dev/resources/brand"
require_relative "context_dev/resources/industry"
require_relative "context_dev/resources/monitors"
require_relative "context_dev/resources/parse"
require_relative "context_dev/resources/utility"
require_relative "context_dev/resources/web"
9 changes: 7 additions & 2 deletions lib/context_dev/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class Client < ContextDev::Internal::Transport::BaseClient
# @return [String]
attr_reader :api_key

# @return [ContextDev::Resources::Parse]
attr_reader :parse

# @return [ContextDev::Resources::Web]
attr_reader :web

Expand All @@ -34,8 +37,9 @@ class Client < ContextDev::Internal::Transport::BaseClient
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.
# changes. Webhook payloads are documented by the
# MonitorsChangeDetectedWebhookPayload and MonitorsRunCompletedWebhookPayload
# schemas.
# @return [ContextDev::Resources::Monitors]
attr_reader :monitors

Expand Down Expand Up @@ -100,6 +104,7 @@ def initialize(
headers: headers
)

@parse = ContextDev::Resources::Parse.new(client: self)
@web = ContextDev::Resources::Web.new(client: self)
@ai = ContextDev::Resources::AI.new(client: self)
@brand = ContextDev::Resources::Brand.new(client: self)
Expand Down
10 changes: 5 additions & 5 deletions lib/context_dev/internal/type/base_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,11 @@ def deep_to_h = self.class.recursively_to_h(@data, convert: false)
# @return [Hash{Symbol=>Object}]
#
# @example
# # `web_extract_response` is a `ContextDev::Models::WebExtractResponse`
# web_extract_response => {
# data: data,
# metadata: metadata,
# status: status
# # `parse_handle_response` is a `ContextDev::Models::ParseHandleResponse`
# parse_handle_response => {
# markdown: markdown,
# success: success,
# type: type
# }
def deconstruct_keys(keys)
(keys || self.class.known_fields.keys)
Expand Down
4 changes: 4 additions & 0 deletions lib/context_dev/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ module ContextDev

MonitorUpdateParams = ContextDev::Models::MonitorUpdateParams

ParseHandleParams = ContextDev::Models::ParseHandleParams

UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams

WebExtractCompetitorsParams = ContextDev::Models::WebExtractCompetitorsParams
Expand All @@ -83,6 +85,8 @@ module ContextDev

WebExtractStyleguideParams = ContextDev::Models::WebExtractStyleguideParams

WebhookDelivery = ContextDev::Models::WebhookDelivery

WebScreenshotParams = ContextDev::Models::WebScreenshotParams

WebSearchParams = ContextDev::Models::WebSearchParams
Expand Down
31 changes: 28 additions & 3 deletions lib/context_dev/models/monitor_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,38 @@ module Mode

class Webhook < ContextDev::Internal::Type::BaseModel
# @!attribute url
# Webhook URL called when a change is detected.
# Webhook URL events are delivered to.
#
# @return [String]
required :url, String

# @!method initialize(url:)
# @param url [String] Webhook URL called when a change is detected.
# @!attribute events
# Events delivered to this endpoint. `change.detected` fires only when a run
# detects a change; `run.completed` fires on every completed run — including runs
# that detected no change — and embeds the change when one was detected. Defaults
# to `["change.detected"]` when omitted.
#
# @return [Array<Symbol, ContextDev::Models::MonitorCreateParams::Webhook::Event>, nil]
optional :events,
-> { ContextDev::Internal::Type::ArrayOf[enum: ContextDev::MonitorCreateParams::Webhook::Event] }

# @!method initialize(url:, events: nil)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::MonitorCreateParams::Webhook} for more details.
#
# @param url [String] Webhook URL events are delivered to.
#
# @param events [Array<Symbol, ContextDev::Models::MonitorCreateParams::Webhook::Event>] Events delivered to this endpoint. `change.detected` fires only when a run detec

module Event
extend ContextDev::Internal::Type::Enum

CHANGE_DETECTED = :"change.detected"
RUN_COMPLETED = :"run.completed"

# @!method self.values
# @return [Array<Symbol>]
end
end
end
end
Expand Down
100 changes: 96 additions & 4 deletions lib/context_dev/models/monitor_create_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,15 @@ class MonitorCreateResponse < ContextDev::Internal::Type::BaseModel
# @return [ContextDev::Models::MonitorCreateResponse::Webhook, nil]
optional :webhook, -> { ContextDev::Models::MonitorCreateResponse::Webhook }, nil?: true

# @!method initialize(id:, change_detection:, created_at:, mode:, name:, schedule:, status:, target:, updated_at:, baseline: nil, last_change_at: nil, last_error: nil, last_run_at: nil, next_run_at: nil, tags: nil, webhook: nil)
# @!attribute webhook_failure
# Present while webhook deliveries are failing consecutively; null when deliveries
# are healthy or no webhook is configured. Cleared on the next successful delivery
# and when the webhook URL changes.
#
# @return [ContextDev::Models::MonitorCreateResponse::WebhookFailure, nil]
optional :webhook_failure, -> { ContextDev::Models::MonitorCreateResponse::WebhookFailure }, nil?: true

# @!method initialize(id:, change_detection:, created_at:, mode:, name:, schedule:, status:, target:, updated_at:, baseline: nil, last_change_at: nil, last_error: nil, last_run_at: nil, next_run_at: nil, tags: nil, webhook: nil, webhook_failure: nil)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::MonitorCreateResponse} for more details.
#
Expand Down Expand Up @@ -141,6 +149,8 @@ class MonitorCreateResponse < ContextDev::Internal::Type::BaseModel
# @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes.
#
# @param webhook [ContextDev::Models::MonitorCreateResponse::Webhook, nil]
#
# @param webhook_failure [ContextDev::Models::MonitorCreateResponse::WebhookFailure, nil] Present while webhook deliveries are failing consecutively; null when deliveries

# Discriminated union describing how changes are detected.
#
Expand Down Expand Up @@ -583,11 +593,21 @@ class LastError < ContextDev::Internal::Type::BaseModel
# @see ContextDev::Models::MonitorCreateResponse#webhook
class Webhook < ContextDev::Internal::Type::BaseModel
# @!attribute url
# Webhook URL called when a change is detected.
# Webhook URL events are delivered to.
#
# @return [String]
required :url, String

# @!attribute events
# Events delivered to this endpoint. `change.detected` fires only when a run
# detects a change; `run.completed` fires on every completed run — including runs
# that detected no change — and embeds the change when one was detected. Defaults
# to `["change.detected"]` when omitted.
#
# @return [Array<Symbol, ContextDev::Models::MonitorCreateResponse::Webhook::Event>, nil]
optional :events,
-> { ContextDev::Internal::Type::ArrayOf[enum: ContextDev::Models::MonitorCreateResponse::Webhook::Event] }

response_only do
# @!attribute secret
# Signing secret used to verify webhook authenticity. Each delivery includes an
Expand All @@ -600,13 +620,85 @@ class Webhook < ContextDev::Internal::Type::BaseModel
optional :secret, String
end

# @!method initialize(url:, secret: nil)
# @!method initialize(url:, events: nil, secret: nil)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::MonitorCreateResponse::Webhook} for more details.
#
# @param url [String] Webhook URL called when a change is detected.
# @param url [String] Webhook URL events are delivered to.
#
# @param events [Array<Symbol, ContextDev::Models::MonitorCreateResponse::Webhook::Event>] Events delivered to this endpoint. `change.detected` fires only when a run detec
#
# @param secret [String] Signing secret used to verify webhook authenticity. Each delivery includes an `X

module Event
extend ContextDev::Internal::Type::Enum

CHANGE_DETECTED = :"change.detected"
RUN_COMPLETED = :"run.completed"

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

# @see ContextDev::Models::MonitorCreateResponse#webhook_failure
class WebhookFailure < ContextDev::Internal::Type::BaseModel
# @!attribute consecutive_failures
# Number of consecutive delivery attempts that did not succeed.
#
# @return [Integer]
required :consecutive_failures, Integer

# @!attribute last_failed_at
#
# @return [Time]
required :last_failed_at, Time

# @!attribute last_message
# Human-readable description of the most recent failure.
#
# @return [String]
required :last_message, String

# @!attribute last_status
# Outcome of the most recent failed delivery. rejected means a non-2xx response;
# failed means no HTTP response was received; skipped_unsafe_url means the URL
# failed the public-endpoint safety check.
#
# @return [Symbol, ContextDev::Models::MonitorCreateResponse::WebhookFailure::LastStatus]
required :last_status, enum: -> { ContextDev::Models::MonitorCreateResponse::WebhookFailure::LastStatus }

# @!method initialize(consecutive_failures:, last_failed_at:, last_message:, last_status:)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::MonitorCreateResponse::WebhookFailure} for more details.
#
# Present while webhook deliveries are failing consecutively; null when deliveries
# are healthy or no webhook is configured. Cleared on the next successful delivery
# and when the webhook URL changes.
#
# @param consecutive_failures [Integer] Number of consecutive delivery attempts that did not succeed.
#
# @param last_failed_at [Time]
#
# @param last_message [String] Human-readable description of the most recent failure.
#
# @param last_status [Symbol, ContextDev::Models::MonitorCreateResponse::WebhookFailure::LastStatus] Outcome of the most recent failed delivery. rejected means a non-2xx response; f

# Outcome of the most recent failed delivery. rejected means a non-2xx response;
# failed means no HTTP response was received; skipped_unsafe_url means the URL
# failed the public-endpoint safety check.
#
# @see ContextDev::Models::MonitorCreateResponse::WebhookFailure#last_status
module LastStatus
extend ContextDev::Internal::Type::Enum

REJECTED = :rejected
FAILED = :failed
SKIPPED_UNSAFE_URL = :skipped_unsafe_url

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