brand.dev 0.21.0 → 0.22.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: 11f1f35e06b0194753dff02bf2e8575c1546c118f385b5c0c3c697fdaaa1a3f6
4
- data.tar.gz: 1507ba4818bb1bc5c6ddbc75ceaabc9552a4e22422d768d23a13ea3e1717726e
3
+ metadata.gz: 73bfa839e4a462bc79f8d9fe6b6d8120ffff7ccc4f9da829328bb081eee1f9ac
4
+ data.tar.gz: 9e8e4646335f5c229cfa63c93e192a76dd767965df8714b807f218fed1e65de0
5
5
  SHA512:
6
- metadata.gz: cd0e28af31b9db038d2552ada9c70740ccc1ed201a87a18c1d078e1cb2429deb2992fdfaeeb3a1dcbe235291338bba960b0e7673147abfdb1eceed0c68dc3629
7
- data.tar.gz: 79fbd2becf76b76a4039cdcab3f39a4475fda8c8abf03ab8f4e0e9beea85031a66d18c4a621cfe5d902cb414d62a2b9f61265c5812766707d74d5704a24b725b
6
+ metadata.gz: 3b2512f8069a014412a4f323863a6ef5d4c9a5b9f871758e0990aaac655059cae0168e96d76e34cebf871d018fc905288597df757b01e3a32468ad43497ca4d6
7
+ data.tar.gz: 3ba4231e77f884b787073607b2454bc146cf175a44541e5a0c49f406f9e0bfb7332e8711a2dada8ce10c28ed0265c5b422c72d8b396d34631aab24af0b2f9409
data/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.22.0 (2026-02-07)
4
+
5
+ Full Changelog: [v0.21.0...v0.22.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.21.0...v0.22.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([f61453c](https://github.com/brand-dot-dev/ruby-sdk/commit/f61453cacff28784915b193547f730b8eb76cf92))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **client:** always add content-length to post body, even when empty ([6d12b11](https://github.com/brand-dot-dev/ruby-sdk/commit/6d12b114daabfd7ca3afc167a18adbe1fe347a36))
15
+ * **client:** loosen json header parsing ([3739920](https://github.com/brand-dot-dev/ruby-sdk/commit/37399200e8e055ed11e83489cdf2674a2a9e6aa8))
16
+
17
+
18
+ ### Chores
19
+
20
+ * **docs:** remove www prefix ([5b8d2c8](https://github.com/brand-dot-dev/ruby-sdk/commit/5b8d2c8b141d6bc47c5ac75aa640d620bfd3ada2))
21
+
3
22
  ## 0.21.0 (2026-02-02)
4
23
 
5
24
  Full Changelog: [v0.20.0...v0.21.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.20.0...v0.21.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 "brand.dev", "~> 0.21.0"
29
+ gem "brand.dev", "~> 0.22.0"
30
30
  ```
31
31
 
32
32
  <!-- x-release-please-end -->
@@ -75,7 +75,7 @@ module BrandDev
75
75
 
76
76
  case body
77
77
  in nil
78
- nil
78
+ req["content-length"] ||= 0 unless req["transfer-encoding"]
79
79
  in String
80
80
  req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"]
81
81
  req.body_stream = BrandDev::Internal::Util::ReadIOAdapter.new(body, &blk)
@@ -485,7 +485,7 @@ module BrandDev
485
485
  end
486
486
 
487
487
  # @type [Regexp]
488
- JSON_CONTENT = %r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}
488
+ JSON_CONTENT = %r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}
489
489
  # @type [Regexp]
490
490
  JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
491
491
 
@@ -7,11 +7,21 @@ module BrandDev
7
7
  extend BrandDev::Internal::Type::RequestParameters::Converter
8
8
  include BrandDev::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute direct_url
11
+ # A specific URL to use directly as the starting point for extraction without
12
+ # domain resolution. Useful when you want to extract products from a specific page
13
+ # rather than discovering the site's product pages automatically. Either 'domain'
14
+ # or 'directUrl' must be provided, but not both.
15
+ #
16
+ # @return [String, nil]
17
+ optional :direct_url, String, api_name: :directUrl
18
+
10
19
  # @!attribute domain
11
- # The domain name to analyze
20
+ # The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
21
+ # not both.
12
22
  #
13
- # @return [String]
14
- required :domain, String
23
+ # @return [String, nil]
24
+ optional :domain, String
15
25
 
16
26
  # @!attribute max_products
17
27
  # Maximum number of products to extract.
@@ -27,11 +37,13 @@ module BrandDev
27
37
  # @return [Integer, nil]
28
38
  optional :timeout_ms, Integer, api_name: :timeoutMS
29
39
 
30
- # @!method initialize(domain:, max_products: nil, timeout_ms: nil, request_options: {})
40
+ # @!method initialize(direct_url: nil, domain: nil, max_products: nil, timeout_ms: nil, request_options: {})
31
41
  # Some parameter documentations has been truncated, see
32
42
  # {BrandDev::Models::BrandAIProductsParams} for more details.
33
43
  #
34
- # @param domain [String] The domain name to analyze
44
+ # @param direct_url [String] A specific URL to use directly as the starting point for extraction without doma
45
+ #
46
+ # @param domain [String] The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
35
47
  #
36
48
  # @param max_products [Integer] Maximum number of products to extract.
37
49
  #
@@ -42,9 +42,11 @@ module BrandDev
42
42
  # analyze the website and return a list of products with details such as name,
43
43
  # description, image, pricing, features, and more.
44
44
  #
45
- # @overload ai_products(domain:, max_products: nil, timeout_ms: nil, request_options: {})
45
+ # @overload ai_products(direct_url: nil, domain: nil, max_products: nil, timeout_ms: nil, request_options: {})
46
46
  #
47
- # @param domain [String] The domain name to analyze
47
+ # @param direct_url [String] A specific URL to use directly as the starting point for extraction without doma
48
+ #
49
+ # @param domain [String] The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
48
50
  #
49
51
  # @param max_products [Integer] Maximum number of products to extract.
50
52
  #
@@ -55,7 +57,7 @@ module BrandDev
55
57
  # @return [BrandDev::Models::BrandAIProductsResponse]
56
58
  #
57
59
  # @see BrandDev::Models::BrandAIProductsParams
58
- def ai_products(params)
60
+ def ai_products(params = {})
59
61
  parsed, options = BrandDev::BrandAIProductsParams.dump_request(params)
60
62
  @client.request(
61
63
  method: :post,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BrandDev
4
- VERSION = "0.21.0"
4
+ VERSION = "0.22.0"
5
5
  end
@@ -296,7 +296,7 @@ module BrandDev
296
296
  end
297
297
 
298
298
  JSON_CONTENT =
299
- T.let(%r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}, Regexp)
299
+ T.let(%r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}, Regexp)
300
300
  JSONL_CONTENT =
301
301
  T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp)
302
302
 
@@ -11,9 +11,23 @@ module BrandDev
11
11
  T.any(BrandDev::BrandAIProductsParams, BrandDev::Internal::AnyHash)
12
12
  end
13
13
 
14
- # The domain name to analyze
15
- sig { returns(String) }
16
- attr_accessor :domain
14
+ # A specific URL to use directly as the starting point for extraction without
15
+ # domain resolution. Useful when you want to extract products from a specific page
16
+ # rather than discovering the site's product pages automatically. Either 'domain'
17
+ # or 'directUrl' must be provided, but not both.
18
+ sig { returns(T.nilable(String)) }
19
+ attr_reader :direct_url
20
+
21
+ sig { params(direct_url: String).void }
22
+ attr_writer :direct_url
23
+
24
+ # The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
25
+ # not both.
26
+ sig { returns(T.nilable(String)) }
27
+ attr_reader :domain
28
+
29
+ sig { params(domain: String).void }
30
+ attr_writer :domain
17
31
 
18
32
  # Maximum number of products to extract.
19
33
  sig { returns(T.nilable(Integer)) }
@@ -33,6 +47,7 @@ module BrandDev
33
47
 
34
48
  sig do
35
49
  params(
50
+ direct_url: String,
36
51
  domain: String,
37
52
  max_products: Integer,
38
53
  timeout_ms: Integer,
@@ -40,8 +55,14 @@ module BrandDev
40
55
  ).returns(T.attached_class)
41
56
  end
42
57
  def self.new(
43
- # The domain name to analyze
44
- domain:,
58
+ # A specific URL to use directly as the starting point for extraction without
59
+ # domain resolution. Useful when you want to extract products from a specific page
60
+ # rather than discovering the site's product pages automatically. Either 'domain'
61
+ # or 'directUrl' must be provided, but not both.
62
+ direct_url: nil,
63
+ # The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
64
+ # not both.
65
+ domain: nil,
45
66
  # Maximum number of products to extract.
46
67
  max_products: nil,
47
68
  # Optional timeout in milliseconds for the request. If the request takes longer
@@ -55,6 +76,7 @@ module BrandDev
55
76
  sig do
56
77
  override.returns(
57
78
  {
79
+ direct_url: String,
58
80
  domain: String,
59
81
  max_products: Integer,
60
82
  timeout_ms: Integer,
@@ -39,6 +39,7 @@ module BrandDev
39
39
  # description, image, pricing, features, and more.
40
40
  sig do
41
41
  params(
42
+ direct_url: String,
42
43
  domain: String,
43
44
  max_products: Integer,
44
45
  timeout_ms: Integer,
@@ -46,8 +47,14 @@ module BrandDev
46
47
  ).returns(BrandDev::Models::BrandAIProductsResponse)
47
48
  end
48
49
  def ai_products(
49
- # The domain name to analyze
50
- domain:,
50
+ # A specific URL to use directly as the starting point for extraction without
51
+ # domain resolution. Useful when you want to extract products from a specific page
52
+ # rather than discovering the site's product pages automatically. Either 'domain'
53
+ # or 'directUrl' must be provided, but not both.
54
+ direct_url: nil,
55
+ # The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
56
+ # not both.
57
+ domain: nil,
51
58
  # Maximum number of products to extract.
52
59
  max_products: nil,
53
60
  # Optional timeout in milliseconds for the request. If the request takes longer
@@ -1,14 +1,25 @@
1
1
  module BrandDev
2
2
  module Models
3
3
  type brand_ai_products_params =
4
- { domain: String, max_products: Integer, timeout_ms: Integer }
4
+ {
5
+ direct_url: String,
6
+ domain: String,
7
+ max_products: Integer,
8
+ timeout_ms: Integer
9
+ }
5
10
  & BrandDev::Internal::Type::request_parameters
6
11
 
7
12
  class BrandAIProductsParams < BrandDev::Internal::Type::BaseModel
8
13
  extend BrandDev::Internal::Type::RequestParameters::Converter
9
14
  include BrandDev::Internal::Type::RequestParameters
10
15
 
11
- attr_accessor domain: String
16
+ attr_reader direct_url: String?
17
+
18
+ def direct_url=: (String) -> String
19
+
20
+ attr_reader domain: String?
21
+
22
+ def domain=: (String) -> String
12
23
 
13
24
  attr_reader max_products: Integer?
14
25
 
@@ -19,13 +30,15 @@ module BrandDev
19
30
  def timeout_ms=: (Integer) -> Integer
20
31
 
21
32
  def initialize: (
22
- domain: String,
33
+ ?direct_url: String,
34
+ ?domain: String,
23
35
  ?max_products: Integer,
24
36
  ?timeout_ms: Integer,
25
37
  ?request_options: BrandDev::request_opts
26
38
  ) -> void
27
39
 
28
40
  def to_hash: -> {
41
+ direct_url: String,
29
42
  domain: String,
30
43
  max_products: Integer,
31
44
  timeout_ms: Integer,
@@ -10,7 +10,8 @@ module BrandDev
10
10
  ) -> BrandDev::Models::BrandRetrieveResponse
11
11
 
12
12
  def ai_products: (
13
- domain: String,
13
+ ?direct_url: String,
14
+ ?domain: String,
14
15
  ?max_products: Integer,
15
16
  ?timeout_ms: Integer,
16
17
  ?request_options: BrandDev::request_opts
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brand.dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brand Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-02 00:00:00.000000000 Z
11
+ date: 2026-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi