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 @@
{
".": "0.21.0"
".": "0.22.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-737dbedd830e2c989387e90a9bb5baa3915306ecfef2e46b09d02cb1879f043c.yml
openapi_spec_hash: 7bc21f4c6d5fd39c1a3b22626846ca87
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-73562e26b663cf10185b9e98966accf5f151c6d3cf99b5e060ce5a847045e383.yml
openapi_spec_hash: bf5994966b84f9dda998ad5059ff8318
config_hash: 6f10592c7d0c3bafefc1271472283217
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 0.22.0 (2026-02-07)

Full Changelog: [v0.21.0...v0.22.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.21.0...v0.22.0)

### Features

* **api:** api update ([f61453c](https://github.com/brand-dot-dev/ruby-sdk/commit/f61453cacff28784915b193547f730b8eb76cf92))


### Bug Fixes

* **client:** always add content-length to post body, even when empty ([6d12b11](https://github.com/brand-dot-dev/ruby-sdk/commit/6d12b114daabfd7ca3afc167a18adbe1fe347a36))
* **client:** loosen json header parsing ([3739920](https://github.com/brand-dot-dev/ruby-sdk/commit/37399200e8e055ed11e83489cdf2674a2a9e6aa8))


### Chores

* **docs:** remove www prefix ([5b8d2c8](https://github.com/brand-dot-dev/ruby-sdk/commit/5b8d2c8b141d6bc47c5ac75aa640d620bfd3ada2))

## 0.21.0 (2026-02-02)

Full Changelog: [v0.20.0...v0.21.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.20.0...v0.21.0)
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ If you’d like to use the repository from source, you can either install from g
To install via git in your `Gemfile`:

```ruby
gem "brand.dev", git: "https://www.github.com/brand-dot-dev/ruby-sdk"
gem "brand.dev", git: "https://github.com/brand-dot-dev/ruby-sdk"
```

Alternatively, reference local copy of the repo:

```bash
$ git clone -- 'https://www.github.com/brand-dot-dev/ruby-sdk' '<path-to-repo>'
$ git clone -- 'https://github.com/brand-dot-dev/ruby-sdk' '<path-to-repo>'
```

```ruby
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:
brand.dev (0.21.0)
brand.dev (0.22.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 "brand.dev", "~> 0.21.0"
gem "brand.dev", "~> 0.22.0"
```

<!-- x-release-please-end -->
Expand Down
2 changes: 1 addition & 1 deletion lib/brand_dev/internal/transport/pooled_net_requester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def build_request(request, &blk)

case body
in nil
nil
req["content-length"] ||= 0 unless req["transfer-encoding"]
in String
req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"]
req.body_stream = BrandDev::Internal::Util::ReadIOAdapter.new(body, &blk)
Expand Down
2 changes: 1 addition & 1 deletion lib/brand_dev/internal/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def writable_enum(&blk)
end

# @type [Regexp]
JSON_CONTENT = %r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}
JSON_CONTENT = %r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}
# @type [Regexp]
JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}

Expand Down
22 changes: 17 additions & 5 deletions lib/brand_dev/models/brand_ai_products_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@ class BrandAIProductsParams < BrandDev::Internal::Type::BaseModel
extend BrandDev::Internal::Type::RequestParameters::Converter
include BrandDev::Internal::Type::RequestParameters

# @!attribute direct_url
# A specific URL to use directly as the starting point for extraction without
# domain resolution. Useful when you want to extract products from a specific page
# rather than discovering the site's product pages automatically. Either 'domain'
# or 'directUrl' must be provided, but not both.
#
# @return [String, nil]
optional :direct_url, String, api_name: :directUrl

# @!attribute domain
# The domain name to analyze
# The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
# not both.
#
# @return [String]
required :domain, String
# @return [String, nil]
optional :domain, String

# @!attribute max_products
# Maximum number of products to extract.
Expand All @@ -27,11 +37,13 @@ class BrandAIProductsParams < BrandDev::Internal::Type::BaseModel
# @return [Integer, nil]
optional :timeout_ms, Integer, api_name: :timeoutMS

# @!method initialize(domain:, max_products: nil, timeout_ms: nil, request_options: {})
# @!method initialize(direct_url: nil, domain: nil, max_products: nil, timeout_ms: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {BrandDev::Models::BrandAIProductsParams} for more details.
#
# @param domain [String] The domain name to analyze
# @param direct_url [String] A specific URL to use directly as the starting point for extraction without doma
#
# @param domain [String] The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
#
# @param max_products [Integer] Maximum number of products to extract.
#
Expand Down
8 changes: 5 additions & 3 deletions lib/brand_dev/resources/brand.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ def retrieve(params)
# analyze the website and return a list of products with details such as name,
# description, image, pricing, features, and more.
#
# @overload ai_products(domain:, max_products: nil, timeout_ms: nil, request_options: {})
# @overload ai_products(direct_url: nil, domain: nil, max_products: nil, timeout_ms: nil, request_options: {})
#
# @param domain [String] The domain name to analyze
# @param direct_url [String] A specific URL to use directly as the starting point for extraction without doma
#
# @param domain [String] The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
#
# @param max_products [Integer] Maximum number of products to extract.
#
Expand All @@ -55,7 +57,7 @@ def retrieve(params)
# @return [BrandDev::Models::BrandAIProductsResponse]
#
# @see BrandDev::Models::BrandAIProductsParams
def ai_products(params)
def ai_products(params = {})
parsed, options = BrandDev::BrandAIProductsParams.dump_request(params)
@client.request(
method: :post,
Expand Down
2 changes: 1 addition & 1 deletion lib/brand_dev/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module BrandDev
VERSION = "0.21.0"
VERSION = "0.22.0"
end
2 changes: 1 addition & 1 deletion rbi/brand_dev/internal/util.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ module BrandDev
end

JSON_CONTENT =
T.let(%r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}, Regexp)
T.let(%r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}, Regexp)
JSONL_CONTENT =
T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp)

Expand Down
32 changes: 27 additions & 5 deletions rbi/brand_dev/models/brand_ai_products_params.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,23 @@ module BrandDev
T.any(BrandDev::BrandAIProductsParams, BrandDev::Internal::AnyHash)
end

# The domain name to analyze
sig { returns(String) }
attr_accessor :domain
# A specific URL to use directly as the starting point for extraction without
# domain resolution. Useful when you want to extract products from a specific page
# rather than discovering the site's product pages automatically. Either 'domain'
# or 'directUrl' must be provided, but not both.
sig { returns(T.nilable(String)) }
attr_reader :direct_url

sig { params(direct_url: String).void }
attr_writer :direct_url

# The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
# not both.
sig { returns(T.nilable(String)) }
attr_reader :domain

sig { params(domain: String).void }
attr_writer :domain

# Maximum number of products to extract.
sig { returns(T.nilable(Integer)) }
Expand All @@ -33,15 +47,22 @@ module BrandDev

sig do
params(
direct_url: String,
domain: String,
max_products: Integer,
timeout_ms: Integer,
request_options: BrandDev::RequestOptions::OrHash
).returns(T.attached_class)
end
def self.new(
# The domain name to analyze
domain:,
# A specific URL to use directly as the starting point for extraction without
# domain resolution. Useful when you want to extract products from a specific page
# rather than discovering the site's product pages automatically. Either 'domain'
# or 'directUrl' must be provided, but not both.
direct_url: nil,
# The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
# not both.
domain: nil,
# Maximum number of products to extract.
max_products: nil,
# Optional timeout in milliseconds for the request. If the request takes longer
Expand All @@ -55,6 +76,7 @@ module BrandDev
sig do
override.returns(
{
direct_url: String,
domain: String,
max_products: Integer,
timeout_ms: Integer,
Expand Down
11 changes: 9 additions & 2 deletions rbi/brand_dev/resources/brand.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,22 @@ module BrandDev
# description, image, pricing, features, and more.
sig do
params(
direct_url: String,
domain: String,
max_products: Integer,
timeout_ms: Integer,
request_options: BrandDev::RequestOptions::OrHash
).returns(BrandDev::Models::BrandAIProductsResponse)
end
def ai_products(
# The domain name to analyze
domain:,
# A specific URL to use directly as the starting point for extraction without
# domain resolution. Useful when you want to extract products from a specific page
# rather than discovering the site's product pages automatically. Either 'domain'
# or 'directUrl' must be provided, but not both.
direct_url: nil,
# The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
# not both.
domain: nil,
# Maximum number of products to extract.
max_products: nil,
# Optional timeout in milliseconds for the request. If the request takes longer
Expand Down
19 changes: 16 additions & 3 deletions sig/brand_dev/models/brand_ai_products_params.rbs
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
module BrandDev
module Models
type brand_ai_products_params =
{ domain: String, max_products: Integer, timeout_ms: Integer }
{
direct_url: String,
domain: String,
max_products: Integer,
timeout_ms: Integer
}
& BrandDev::Internal::Type::request_parameters

class BrandAIProductsParams < BrandDev::Internal::Type::BaseModel
extend BrandDev::Internal::Type::RequestParameters::Converter
include BrandDev::Internal::Type::RequestParameters

attr_accessor domain: String
attr_reader direct_url: String?

def direct_url=: (String) -> String

attr_reader domain: String?

def domain=: (String) -> String

attr_reader max_products: Integer?

Expand All @@ -19,13 +30,15 @@ module BrandDev
def timeout_ms=: (Integer) -> Integer

def initialize: (
domain: String,
?direct_url: String,
?domain: String,
?max_products: Integer,
?timeout_ms: Integer,
?request_options: BrandDev::request_opts
) -> void

def to_hash: -> {
direct_url: String,
domain: String,
max_products: Integer,
timeout_ms: Integer,
Expand Down
3 changes: 2 additions & 1 deletion sig/brand_dev/resources/brand.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module BrandDev
) -> BrandDev::Models::BrandRetrieveResponse

def ai_products: (
domain: String,
?direct_url: String,
?domain: String,
?max_products: Integer,
?timeout_ms: Integer,
?request_options: BrandDev::request_opts
Expand Down
2 changes: 2 additions & 0 deletions test/brand_dev/internal/util_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ def test_json_content
cases = {
"application/json" => true,
"application/jsonl" => false,
"application/arbitrary+json" => true,
"application/ARBITRARY+json" => true,
"application/vnd.github.v3+json" => true,
"application/vnd.api+json" => true
}
Expand Down
4 changes: 2 additions & 2 deletions test/brand_dev/resources/brand_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def test_retrieve_required_params
end
end

def test_ai_products_required_params
def test_ai_products
skip("Prism tests are disabled")

response = @brand_dev.brand.ai_products(domain: "domain")
response = @brand_dev.brand.ai_products

assert_pattern do
response => BrandDev::Models::BrandAIProductsResponse
Expand Down
Loading