brand.dev 0.10.0 → 0.11.1

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: 0ef03e7b6853ec28ff9e849eefdddb67833cca59c7425eed236c940c2734ee9a
4
- data.tar.gz: c9fed285665ae840bc83604781fa85440938d6870d1bb76afb2526cd7016bf1e
3
+ metadata.gz: 80f2543fcc4bea83a179705a9859488ab375dda0c090f19bb2f60a1977c8c623
4
+ data.tar.gz: 305854a6e398aea7dca9727c02936ac99a6cc87b65ecad87d5f4856eed950903
5
5
  SHA512:
6
- metadata.gz: c50034c0f2ed5f2f5d262fc62df5622d9ca9c9af7fb1948c1f9398271e9573c47e48543a89737fefb2edd4f965b9b803f9bdf1539f3913a567206a66e1afd1fd
7
- data.tar.gz: a77bac67dd721824b3c1196d05d137f757f42094f2aa4d15deb10dc63373ea48a3dfa047548bc4027e2aaaa5f689c606cca7151462ab441992cb002e14a38b79
6
+ metadata.gz: b20da8940735c566bd19934c3a4abb9b9c52fe977eaf6c91c2b76888ee0b75a5d00e329d4258e8fa327995b13a7ffd2d0083d746f2576411dc3415c15271457d
7
+ data.tar.gz: 998d1d4008117fe497e8a7c18606c9ff1a490cc6b5ee4ea2cfe98384475c9c9d4b8ae0da49a2cc2a0d54298e294221f2ba76c320b31161882607b749801d6493
data/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.1 (2025-11-05)
4
+
5
+ Full Changelog: [v0.11.0...v0.11.1](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.11.0...v0.11.1)
6
+
7
+ ### Bug Fixes
8
+
9
+ * better thread safety via early initializing SSL store during HTTP client creation ([4d074e6](https://github.com/brand-dot-dev/ruby-sdk/commit/4d074e601b62e52f7a429814a79b5d8d0441e739))
10
+
11
+
12
+ ### Chores
13
+
14
+ * bump dependency version and update sorbet types ([2d84b58](https://github.com/brand-dot-dev/ruby-sdk/commit/2d84b5889d2314fb948ca765364195f584f87dc7))
15
+
16
+ ## 0.11.0 (2025-10-31)
17
+
18
+ Full Changelog: [v0.10.0...v0.11.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.10.0...v0.11.0)
19
+
20
+ ### Features
21
+
22
+ * **api:** manual updates ([f8b29b1](https://github.com/brand-dot-dev/ruby-sdk/commit/f8b29b1ab6d654d4fd664ad46c19dd5cb0073972))
23
+
3
24
  ## 0.10.0 (2025-10-30)
4
25
 
5
26
  Full Changelog: [v0.9.0...v0.10.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.9.0...v0.10.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "brand.dev", "~> 0.10.0"
20
+ gem "brand.dev", "~> 0.11.1"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -201,7 +201,8 @@ module BrandDev
201
201
  self.class::PLATFORM_HEADERS,
202
202
  {
203
203
  "accept" => "application/json",
204
- "content-type" => "application/json"
204
+ "content-type" => "application/json",
205
+ "user-agent" => user_agent
205
206
  },
206
207
  headers
207
208
  )
@@ -219,6 +220,11 @@ module BrandDev
219
220
  # @return [Hash{String=>String}]
220
221
  private def auth_headers = {}
221
222
 
223
+ # @api private
224
+ #
225
+ # @return [String]
226
+ private def user_agent = "#{self.class.name}/Ruby #{BrandDev::VERSION}"
227
+
222
228
  # @api private
223
229
  #
224
230
  # @return [String]
@@ -16,10 +16,11 @@ module BrandDev
16
16
  class << self
17
17
  # @api private
18
18
  #
19
+ # @param cert_store [OpenSSL::X509::Store]
19
20
  # @param url [URI::Generic]
20
21
  #
21
22
  # @return [Net::HTTP]
22
- def connect(url)
23
+ def connect(cert_store:, url:)
23
24
  port =
24
25
  case [url.port, url.scheme]
25
26
  in [Integer, _]
@@ -33,6 +34,8 @@ module BrandDev
33
34
  Net::HTTP.new(url.host, port).tap do
34
35
  _1.use_ssl = %w[https wss].include?(url.scheme)
35
36
  _1.max_retries = 0
37
+
38
+ (_1.cert_store = cert_store) if _1.use_ssl?
36
39
  end
37
40
  end
38
41
 
@@ -102,7 +105,7 @@ module BrandDev
102
105
  pool =
103
106
  @mutex.synchronize do
104
107
  @pools[origin] ||= ConnectionPool.new(size: @size) do
105
- self.class.connect(url)
108
+ self.class.connect(cert_store: @cert_store, url: url)
106
109
  end
107
110
  end
108
111
 
@@ -192,6 +195,7 @@ module BrandDev
192
195
  def initialize(size: self.class::DEFAULT_MAX_CONNECTIONS)
193
196
  @mutex = Mutex.new
194
197
  @size = size
198
+ @cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths)
195
199
  @pools = {}
196
200
  end
197
201
 
@@ -0,0 +1,116 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BrandDev
4
+ module Models
5
+ # @see BrandDev::Resources::Brand#retrieve_by_email
6
+ class BrandRetrieveByEmailParams < BrandDev::Internal::Type::BaseModel
7
+ extend BrandDev::Internal::Type::RequestParameters::Converter
8
+ include BrandDev::Internal::Type::RequestParameters
9
+
10
+ # @!attribute email
11
+ # Email address to retrieve brand data for (e.g., 'contact@example.com'). The
12
+ # domain will be extracted from the email. Free email providers (gmail.com,
13
+ # yahoo.com, etc.) and disposable email addresses are not allowed.
14
+ #
15
+ # @return [String]
16
+ required :email, String
17
+
18
+ # @!attribute force_language
19
+ # Optional parameter to force the language of the retrieved brand data.
20
+ #
21
+ # @return [Symbol, BrandDev::Models::BrandRetrieveByEmailParams::ForceLanguage, nil]
22
+ optional :force_language, enum: -> { BrandDev::BrandRetrieveByEmailParams::ForceLanguage }
23
+
24
+ # @!attribute max_speed
25
+ # Optional parameter to optimize the API call for maximum speed. When set to true,
26
+ # the API will skip time-consuming operations for faster response at the cost of
27
+ # less comprehensive data.
28
+ #
29
+ # @return [Boolean, nil]
30
+ optional :max_speed, BrandDev::Internal::Type::Boolean
31
+
32
+ # @!attribute timeout_ms
33
+ # Optional timeout in milliseconds for the request. If the request takes longer
34
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
35
+ # value is 300000ms (5 minutes).
36
+ #
37
+ # @return [Integer, nil]
38
+ optional :timeout_ms, Integer
39
+
40
+ # @!method initialize(email:, force_language: nil, max_speed: nil, timeout_ms: nil, request_options: {})
41
+ # Some parameter documentations has been truncated, see
42
+ # {BrandDev::Models::BrandRetrieveByEmailParams} for more details.
43
+ #
44
+ # @param email [String] Email address to retrieve brand data for (e.g., 'contact@example.com'). The doma
45
+ #
46
+ # @param force_language [Symbol, BrandDev::Models::BrandRetrieveByEmailParams::ForceLanguage] Optional parameter to force the language of the retrieved brand data.
47
+ #
48
+ # @param max_speed [Boolean] Optional parameter to optimize the API call for maximum speed. When set to true,
49
+ #
50
+ # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
51
+ #
52
+ # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
53
+
54
+ # Optional parameter to force the language of the retrieved brand data.
55
+ module ForceLanguage
56
+ extend BrandDev::Internal::Type::Enum
57
+
58
+ ALBANIAN = :albanian
59
+ ARABIC = :arabic
60
+ AZERI = :azeri
61
+ BENGALI = :bengali
62
+ BULGARIAN = :bulgarian
63
+ CEBUANO = :cebuano
64
+ CROATIAN = :croatian
65
+ CZECH = :czech
66
+ DANISH = :danish
67
+ DUTCH = :dutch
68
+ ENGLISH = :english
69
+ ESTONIAN = :estonian
70
+ FARSI = :farsi
71
+ FINNISH = :finnish
72
+ FRENCH = :french
73
+ GERMAN = :german
74
+ HAUSA = :hausa
75
+ HAWAIIAN = :hawaiian
76
+ HINDI = :hindi
77
+ HUNGARIAN = :hungarian
78
+ ICELANDIC = :icelandic
79
+ INDONESIAN = :indonesian
80
+ ITALIAN = :italian
81
+ KAZAKH = :kazakh
82
+ KYRGYZ = :kyrgyz
83
+ LATIN = :latin
84
+ LATVIAN = :latvian
85
+ LITHUANIAN = :lithuanian
86
+ MACEDONIAN = :macedonian
87
+ MONGOLIAN = :mongolian
88
+ NEPALI = :nepali
89
+ NORWEGIAN = :norwegian
90
+ PASHTO = :pashto
91
+ PIDGIN = :pidgin
92
+ POLISH = :polish
93
+ PORTUGUESE = :portuguese
94
+ ROMANIAN = :romanian
95
+ RUSSIAN = :russian
96
+ SERBIAN = :serbian
97
+ SLOVAK = :slovak
98
+ SLOVENE = :slovene
99
+ SOMALI = :somali
100
+ SPANISH = :spanish
101
+ SWAHILI = :swahili
102
+ SWEDISH = :swedish
103
+ TAGALOG = :tagalog
104
+ TURKISH = :turkish
105
+ UKRAINIAN = :ukrainian
106
+ URDU = :urdu
107
+ UZBEK = :uzbek
108
+ VIETNAMESE = :vietnamese
109
+ WELSH = :welsh
110
+
111
+ # @!method self.values
112
+ # @return [Array<Symbol>]
113
+ end
114
+ end
115
+ end
116
+ end