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.1.0"
".": "1.2.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: 20
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-c91b0567307b069c250d073074b7c861b64e632a8380b24925e15d981846bb43.yml
openapi_spec_hash: e479aa097b1283c2acf19d6360787449
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-05a30711e18b0023520a660352d75595a050d1299bf0e3ee4a8cf55ded36aea2.yml
openapi_spec_hash: 8d0e1115a7d864f27c55cec3255d1e77
config_hash: 91cf2dcefb99c39eb9cd3e98e15d6011
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 1.2.0 (2026-04-03)

Full Changelog: [v1.1.0...v1.2.0](https://github.com/context-dot-dev/deprecated-brand-ruby-sdk/compare/v1.1.0...v1.2.0)

### Features

* **api:** api update ([31fce97](https://github.com/context-dot-dev/deprecated-brand-ruby-sdk/commit/31fce97412ff85c3c00d97941c75c7abcb52ac3f))


### Bug Fixes

* align path encoding with RFC 3986 section 3.3 ([d7380ea](https://github.com/context-dot-dev/deprecated-brand-ruby-sdk/commit/d7380ea2e73abf9d87f40dad634fb8d542dc7e52))
* variable name typo ([83f277c](https://github.com/context-dot-dev/deprecated-brand-ruby-sdk/commit/83f277c8837aff78ec010a77040a33dc42771bca))

## 1.1.0 (2026-03-28)

Full Changelog: [v1.0.0...v1.1.0](https://github.com/context-dot-dev/deprecated-brand-ruby-sdk/compare/v1.0.0...v1.1.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:
brand.dev (1.1.0)
brand.dev (1.2.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", "~> 1.1.0"
gem "brand.dev", "~> 1.2.0"
```

<!-- x-release-please-end -->
Expand Down
22 changes: 18 additions & 4 deletions lib/brand_dev/internal/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def coerce_hash!(input)
in Hash | nil => coerced
coerced
else
message = "Expected a #{Hash} or #{BrandDev::Internal::Type::BaseModel}, got #{data.inspect}"
message = "Expected a #{Hash} or #{BrandDev::Internal::Type::BaseModel}, got #{input.inspect}"
raise ArgumentError.new(message)
end
end
Expand Down Expand Up @@ -237,6 +237,11 @@ def dig(data, pick, &blk)
end
end

# @type [Regexp]
#
# https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/

class << self
# @api private
#
Expand All @@ -247,6 +252,15 @@ def uri_origin(uri)
"#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
end

# @api private
#
# @param path [String, Integer]
#
# @return [String]
def encode_path(path)
path.to_s.gsub(BrandDev::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) }
end

# @api private
#
# @param path [String, Array<String>]
Expand All @@ -259,7 +273,7 @@ def interpolate_path(path)
in []
""
in [String => p, *interpolations]
encoded = interpolations.map { ERB::Util.url_encode(_1) }
encoded = interpolations.map { encode_path(_1) }
format(p, *encoded)
end
end
Expand Down Expand Up @@ -576,10 +590,10 @@ def encode_query_params(query)

case val
in BrandDev::FilePart unless val.filename.nil?
filename = ERB::Util.url_encode(val.filename)
filename = encode_path(val.filename)
y << "; filename=\"#{filename}\""
in Pathname | IO
filename = ERB::Util.url_encode(::File.basename(val.to_path))
filename = encode_path(::File.basename(val.to_path))
y << "; filename=\"#{filename}\""
else
end
Expand Down
27 changes: 1 addition & 26 deletions lib/brand_dev/models/brand_styleguide_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ class BrandStyleguideParams < BrandDev::Internal::Type::BaseModel
# @return [String, nil]
optional :domain, String

# @!attribute prioritize
# Optional parameter to prioritize screenshot capture for styleguide extraction.
# If 'speed', optimizes for faster capture with basic quality. If 'quality',
# optimizes for higher quality with longer wait times. Defaults to 'quality' if
# not provided.
#
# @return [Symbol, BrandDev::Models::BrandStyleguideParams::Prioritize, nil]
optional :prioritize, enum: -> { BrandDev::BrandStyleguideParams::Prioritize }

# @!attribute timeout_ms
# Optional timeout in milliseconds for the request. If the request takes longer
# than this value, it will be aborted with a 408 status code. Maximum allowed
Expand All @@ -38,33 +29,17 @@ class BrandStyleguideParams < BrandDev::Internal::Type::BaseModel
# @return [Integer, nil]
optional :timeout_ms, Integer

# @!method initialize(direct_url: nil, domain: nil, prioritize: nil, timeout_ms: nil, request_options: {})
# @!method initialize(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {BrandDev::Models::BrandStyleguideParams} for more details.
#
# @param direct_url [String] A specific URL to fetch the styleguide from directly, bypassing domain resolutio
#
# @param domain [String] Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The
#
# @param prioritize [Symbol, BrandDev::Models::BrandStyleguideParams::Prioritize] Optional parameter to prioritize screenshot capture for styleguide extraction. I
#
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
#
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]

# Optional parameter to prioritize screenshot capture for styleguide extraction.
# If 'speed', optimizes for faster capture with basic quality. If 'quality',
# optimizes for higher quality with longer wait times. Defaults to 'quality' if
# not provided.
module Prioritize
extend BrandDev::Internal::Type::Enum

SPEED = :speed
QUALITY = :quality

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