Skip to content

Commit 98f0e75

Browse files
authored
Merge pull request #4 from brand-dot-dev/release-please--branches--main--changes--next
release: 0.1.0-alpha.2
2 parents 9dba32a + fcb7cf1 commit 98f0e75

File tree

17 files changed

+323
-43
lines changed

17 files changed

+323
-43
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.1"
2+
".": "0.1.0-alpha.2"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 6
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-d5cf52f21333b8216b73e9659b4a1e8e0675404f0ae3d15bdd7ef368ccfa94cf.yml
3-
openapi_spec_hash: c70cbc2e38e7aeaf2173574a13e9ca55
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-c921d60adf854da13dbb83d547cbd8a32fd86d625fb12a325b7d305da7f3a93a.yml
3+
openapi_spec_hash: c02b88f26faaf9fd04177b77d34fd5c3
44
config_hash: 372b187172495fc2f76f05ba016b4a45

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 0.1.0-alpha.2 (2025-06-05)
4+
5+
Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
6+
7+
### Features
8+
9+
* **api:** manual updates ([6613bcd](https://github.com/brand-dot-dev/ruby-sdk/commit/6613bcdddf846a0dbcb1e507da7ec58c93e4125d))
10+
11+
12+
### Bug Fixes
13+
14+
* `to_sorbet_type` should not return branded types ([0047f7c](https://github.com/brand-dot-dev/ruby-sdk/commit/0047f7ce754514e6c5ac04546aa262d1e4df68f5))
15+
* default content-type for text in multi-part formdata uploads should be text/plain ([c39a8a7](https://github.com/brand-dot-dev/ruby-sdk/commit/c39a8a78f5445fa88de3b9f765d6211889ba78ef))
16+
317
## 0.1.0-alpha.1 (2025-06-02)
418

519
Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GIT
1111
PATH
1212
remote: .
1313
specs:
14-
brand.dev (0.0.1.pre.alpha.0)
14+
brand.dev (0.1.0.pre.alpha.1)
1515
connection_pool
1616

1717
GEM

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
1515
<!-- x-release-please-start-version -->
1616

1717
```ruby
18-
gem "brand.dev", "~> 0.1.0.pre.alpha.1"
18+
gem "brand.dev", "~> 0.1.0.pre.alpha.2"
1919
```
2020

2121
<!-- x-release-please-end -->

lib/brand_dev/internal/type/enum.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,14 @@ def coerce(value, state:)
9191
#
9292
# @return [Object]
9393
def to_sorbet_type
94-
case values
94+
types = values.map { BrandDev::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq
95+
case types
9596
in []
9697
T.noreturn
97-
in [value, *_]
98-
T.all(BrandDev::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(value), self)
98+
in [type]
99+
type
100+
else
101+
T.any(*types)
99102
end
100103
end
101104

lib/brand_dev/internal/type/union.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,14 @@ def dump(value, state:)
195195
#
196196
# @return [Object]
197197
def to_sorbet_type
198-
case (v = variants)
198+
types = variants.map { BrandDev::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq
199+
case types
199200
in []
200201
T.noreturn
202+
in [type]
203+
type
201204
else
202-
T.any(*v.map { BrandDev::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) })
205+
T.any(*types)
203206
end
204207
end
205208

lib/brand_dev/internal/util.rb

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ class << self
497497
# @param closing [Array<Proc>]
498498
# @param content_type [String, nil]
499499
private def write_multipart_content(y, val:, closing:, content_type: nil)
500-
content_type ||= "application/octet-stream"
500+
content_line = "Content-Type: %s\r\n\r\n"
501501

502502
case val
503503
in BrandDev::FilePart
@@ -508,24 +508,21 @@ class << self
508508
content_type: val.content_type
509509
)
510510
in Pathname
511-
y << "Content-Type: #{content_type}\r\n\r\n"
511+
y << format(content_line, content_type || "application/octet-stream")
512512
io = val.open(binmode: true)
513513
closing << io.method(:close)
514514
IO.copy_stream(io, y)
515515
in IO
516-
y << "Content-Type: #{content_type}\r\n\r\n"
516+
y << format(content_line, content_type || "application/octet-stream")
517517
IO.copy_stream(val, y)
518518
in StringIO
519-
y << "Content-Type: #{content_type}\r\n\r\n"
519+
y << format(content_line, content_type || "application/octet-stream")
520520
y << val.string
521-
in String
522-
y << "Content-Type: #{content_type}\r\n\r\n"
523-
y << val.to_s
524521
in -> { primitive?(_1) }
525-
y << "Content-Type: text/plain\r\n\r\n"
522+
y << format(content_line, content_type || "text/plain")
526523
y << val.to_s
527524
else
528-
y << "Content-Type: application/json\r\n\r\n"
525+
y << format(content_line, content_type || "application/json")
529526
y << JSON.generate(val)
530527
end
531528
y << "\r\n"
@@ -563,6 +560,8 @@ class << self
563560

564561
# @api private
565562
#
563+
# https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#special-considerations-for-multipart-content
564+
#
566565
# @param body [Object]
567566
#
568567
# @return [Array(String, Enumerable<String>)]

lib/brand_dev/models.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ module BrandDev
1111
mod.constants.each do |name|
1212
case mod.const_get(name)
1313
in true | false
14-
mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T.all(T::Boolean, mod) } }
14+
mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T::Boolean } }
1515
mod.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } }
1616
in Integer
17-
mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { T.all(Integer, mod) } }
17+
mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { Integer } }
1818
mod.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } }
1919
in Float
20-
mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { T.all(Float, mod) } }
20+
mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { Float } }
2121
mod.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } }
2222
in Symbol
23-
mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { T.all(Symbol, mod) } }
23+
mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { Symbol } }
2424
mod.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } }
2525
else
2626
end

lib/brand_dev/models/brand_ai_query_params.rb

Lines changed: 73 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ class BrandAIQueryParams < BrandDev::Internal::Type::BaseModel
2121
required :domain, String
2222

2323
# @!attribute specific_pages
24-
# Optional array of specific pages to analyze
24+
# Optional object specifying which pages to analyze
2525
#
26-
# @return [Array<String>, nil]
27-
optional :specific_pages, BrandDev::Internal::Type::ArrayOf[String]
26+
# @return [BrandDev::Models::BrandAIQueryParams::SpecificPages, nil]
27+
optional :specific_pages, -> { BrandDev::BrandAIQueryParams::SpecificPages }
2828

2929
# @!method initialize(data_to_extract:, domain:, specific_pages: nil, request_options: {})
3030
# @param data_to_extract [Array<BrandDev::Models::BrandAIQueryParams::DataToExtract>] Array of data points to extract from the website
3131
#
3232
# @param domain [String] The domain name to analyze
3333
#
34-
# @param specific_pages [Array<String>] Optional array of specific pages to analyze
34+
# @param specific_pages [BrandDev::Models::BrandAIQueryParams::SpecificPages] Optional object specifying which pages to analyze
3535
#
3636
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
3737

@@ -86,6 +86,75 @@ module DatapointType
8686
# @return [Array<Symbol>]
8787
end
8888
end
89+
90+
class SpecificPages < BrandDev::Internal::Type::BaseModel
91+
# @!attribute about_us
92+
# Whether to analyze the about us page
93+
#
94+
# @return [Boolean, nil]
95+
optional :about_us, BrandDev::Internal::Type::Boolean
96+
97+
# @!attribute blog
98+
# Whether to analyze the blog
99+
#
100+
# @return [Boolean, nil]
101+
optional :blog, BrandDev::Internal::Type::Boolean
102+
103+
# @!attribute careers
104+
# Whether to analyze the careers page
105+
#
106+
# @return [Boolean, nil]
107+
optional :careers, BrandDev::Internal::Type::Boolean
108+
109+
# @!attribute contact_us
110+
# Whether to analyze the contact us page
111+
#
112+
# @return [Boolean, nil]
113+
optional :contact_us, BrandDev::Internal::Type::Boolean
114+
115+
# @!attribute faq
116+
# Whether to analyze the FAQ page
117+
#
118+
# @return [Boolean, nil]
119+
optional :faq, BrandDev::Internal::Type::Boolean
120+
121+
# @!attribute home_page
122+
# Whether to analyze the home page
123+
#
124+
# @return [Boolean, nil]
125+
optional :home_page, BrandDev::Internal::Type::Boolean
126+
127+
# @!attribute privacy_policy
128+
# Whether to analyze the privacy policy page
129+
#
130+
# @return [Boolean, nil]
131+
optional :privacy_policy, BrandDev::Internal::Type::Boolean
132+
133+
# @!attribute terms_and_conditions
134+
# Whether to analyze the terms and conditions page
135+
#
136+
# @return [Boolean, nil]
137+
optional :terms_and_conditions, BrandDev::Internal::Type::Boolean
138+
139+
# @!method initialize(about_us: nil, blog: nil, careers: nil, contact_us: nil, faq: nil, home_page: nil, privacy_policy: nil, terms_and_conditions: nil)
140+
# Optional object specifying which pages to analyze
141+
#
142+
# @param about_us [Boolean] Whether to analyze the about us page
143+
#
144+
# @param blog [Boolean] Whether to analyze the blog
145+
#
146+
# @param careers [Boolean] Whether to analyze the careers page
147+
#
148+
# @param contact_us [Boolean] Whether to analyze the contact us page
149+
#
150+
# @param faq [Boolean] Whether to analyze the FAQ page
151+
#
152+
# @param home_page [Boolean] Whether to analyze the home page
153+
#
154+
# @param privacy_policy [Boolean] Whether to analyze the privacy policy page
155+
#
156+
# @param terms_and_conditions [Boolean] Whether to analyze the terms and conditions page
157+
end
89158
end
90159
end
91160
end

0 commit comments

Comments
 (0)