Skip to content

Commit 180530f

Browse files
release: 0.1.0-alpha.31 (#163)
* feat: expose response headers for both streams and errors * chore: do not install brew dependencies in ./scripts/bootstrap by default * codegen metadata * perf: faster code formatting * fix(internal): use null byte as file separator in the fast formatting script * fix: shorten multipart boundary sep to less than RFC specificed max length * codegen metadata * chore: allow fast-format to use bsd sed as well * feat(api): api update * fix: always send `filename=...` for multipart requests where a file is expected * codegen metadata * fix: coroutine leaks from connection pool * feat(api): api update * feat(api): api update * chore: ignore linter error for tests having large collections * codegen metadata * feat(api): api update * fix: should not reuse buffers for `IO.copy_stream` interop * feat(api): api update * feat(api): api update * fix: absolutely qualified uris should always override the default * feat(api): api update * feat: handle thread interrupts in the core HTTP client * feat(api): api update * feat(api): api update * release: 0.1.0-alpha.31 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 97eec0f commit 180530f

File tree

217 files changed

+4826
-6480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+4826
-6480
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.30"
2+
".": "0.1.0-alpha.31"
33
}

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ Metrics/BlockLength:
121121
Metrics/ClassLength:
122122
Enabled: false
123123

124+
Metrics/CollectionLiteralLength:
125+
Exclude:
126+
- "test/**/*"
127+
124128
Metrics/CyclomaticComplexity:
125129
Enabled: false
126130

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 46
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-bb50c0ae41ff5036adf72344d33057941f6de67c5fae811eba2e758bfa4ffd31.yml
3-
openapi_spec_hash: 1b21e4bfc46daeef1613e410e5aa8f28
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-0105d239fcaf84750c886dfa6c2cfbf2b2087f89a48f8827c4cbe28479ebfb13.yml
3+
openapi_spec_hash: 34895c3d3c137fb9f5a019ac5370afbb
44
config_hash: 6d3585c0032e08d723d077d660fc8448

CHANGELOG.md

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

3+
## 0.1.0-alpha.31 (2025-10-27)
4+
5+
Full Changelog: [v0.1.0-alpha.30...v0.1.0-alpha.31](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.30...v0.1.0-alpha.31)
6+
7+
### Features
8+
9+
* **api:** api update ([2c193f3](https://github.com/Finch-API/finch-api-ruby/commit/2c193f3efeec2a63a845a399a8ed678a95e14dd9))
10+
* **api:** api update ([a463808](https://github.com/Finch-API/finch-api-ruby/commit/a4638080bfdd91ed19083a7cf3f43b1cee5a8568))
11+
* **api:** api update ([4e526be](https://github.com/Finch-API/finch-api-ruby/commit/4e526befab7e3cc48a0b13cd869ff81df27f9469))
12+
* **api:** api update ([78a45f9](https://github.com/Finch-API/finch-api-ruby/commit/78a45f95a0ad4dbed56b70c66427c9158933383e))
13+
* **api:** api update ([61d827e](https://github.com/Finch-API/finch-api-ruby/commit/61d827e756ba40a17532ac75694370b666eed062))
14+
* **api:** api update ([0d1e8ba](https://github.com/Finch-API/finch-api-ruby/commit/0d1e8baa59306512f78750f4c5bfef9f2d66e0e6))
15+
* **api:** api update ([31c3661](https://github.com/Finch-API/finch-api-ruby/commit/31c3661fa11d6f74224e9c0af9b5dcee877183ee))
16+
* **api:** api update ([ab22783](https://github.com/Finch-API/finch-api-ruby/commit/ab2278377aae4058398fa1540df2a16f5cbaf704))
17+
* **api:** api update ([66b8a64](https://github.com/Finch-API/finch-api-ruby/commit/66b8a6446d12b5222a2408af0de686b94afff297))
18+
* expose response headers for both streams and errors ([45672bb](https://github.com/Finch-API/finch-api-ruby/commit/45672bb5a1b70d8fc1ea4acf2fa89044284d7fab))
19+
* handle thread interrupts in the core HTTP client ([97627a2](https://github.com/Finch-API/finch-api-ruby/commit/97627a28d523f0554075ca469e94aae6cc111def))
20+
21+
22+
### Bug Fixes
23+
24+
* absolutely qualified uris should always override the default ([96b3cd9](https://github.com/Finch-API/finch-api-ruby/commit/96b3cd9ab133c0bb0b30cc151c9c1e3e1493d97e))
25+
* always send `filename=...` for multipart requests where a file is expected ([ee2e0ed](https://github.com/Finch-API/finch-api-ruby/commit/ee2e0ed334b365dbc89ec602402310695d48922b))
26+
* coroutine leaks from connection pool ([ed8c82c](https://github.com/Finch-API/finch-api-ruby/commit/ed8c82c1de78c5416bf2704b2c7208289d5526d6))
27+
* **internal:** use null byte as file separator in the fast formatting script ([8387c75](https://github.com/Finch-API/finch-api-ruby/commit/8387c751006f4e9832bbfcd87fc22a0e10c1e7cf))
28+
* shorten multipart boundary sep to less than RFC specificed max length ([df686c5](https://github.com/Finch-API/finch-api-ruby/commit/df686c5b25b82c9f4f44966e087812be37007fbf))
29+
* should not reuse buffers for `IO.copy_stream` interop ([8ad8c9d](https://github.com/Finch-API/finch-api-ruby/commit/8ad8c9dc1429b38df047ac7a17ebf33eafe84a10))
30+
31+
32+
### Performance Improvements
33+
34+
* faster code formatting ([69f9d97](https://github.com/Finch-API/finch-api-ruby/commit/69f9d97f9f857b3b9912e733cb37d8e9ca41af3a))
35+
36+
37+
### Chores
38+
39+
* allow fast-format to use bsd sed as well ([b7c6223](https://github.com/Finch-API/finch-api-ruby/commit/b7c6223003113460bef7064164ae2590940c984b))
40+
* do not install brew dependencies in ./scripts/bootstrap by default ([6faa93e](https://github.com/Finch-API/finch-api-ruby/commit/6faa93ee15839976d987e97701c988940e2a134e))
41+
* ignore linter error for tests having large collections ([d3f05ab](https://github.com/Finch-API/finch-api-ruby/commit/d3f05ab04c2a228488f57933ea8643913bfa6260))
42+
343
## 0.1.0-alpha.30 (2025-09-08)
444

545
Full Changelog: [v0.1.0-alpha.29...v0.1.0-alpha.30](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.29...v0.1.0-alpha.30)

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-
finch-api (0.1.0.pre.alpha.30)
14+
finch-api (0.1.0.pre.alpha.31)
1515
connection_pool
1616

1717
GEM

README.md

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

1919
```ruby
20-
gem "finch-api", "~> 0.1.0.pre.alpha.30"
20+
gem "finch-api", "~> 0.1.0.pre.alpha.31"
2121
```
2222

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

Rakefile

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ tapioca = "sorbet/tapioca"
1212
examples = "examples"
1313
ignore_file = ".ignore"
1414

15+
FILES_ENV = "FORMAT_FILE"
16+
1517
CLEAN.push(*%w[.idea/ .ruby-lsp/ .yardoc/ doc/], *FileList["*.gem"], ignore_file)
1618

1719
CLOBBER.push(*%w[sorbet/rbi/annotations/ sorbet/rbi/gems/], tapioca)
@@ -38,6 +40,14 @@ end
3840
xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --]
3941
ruby_opt = {"RUBYOPT" => [ENV["RUBYOPT"], "--encoding=UTF-8"].compact.join(" ")}
4042

43+
filtered = ->(ext, dirs) do
44+
if ENV.key?(FILES_ENV)
45+
%w[sed -E -n -e] << "/\\.#{ext}$/p" << "--" << ENV.fetch(FILES_ENV)
46+
else
47+
(%w[find] + dirs + %w[-type f -and -name]) << "*.#{ext}" << "-print0"
48+
end
49+
end
50+
4151
desc("Lint `*.rb(i)`")
4252
multitask(:"lint:rubocop") do
4353
find = %w[find ./lib ./test ./rbi ./examples -type f -and ( -name *.rb -or -name *.rbi ) -print0]
@@ -52,24 +62,26 @@ multitask(:"lint:rubocop") do
5262
sh("#{find.shelljoin} | #{lint.shelljoin}")
5363
end
5464

65+
norm_lines = %w[tr -- \n \0].shelljoin
66+
5567
desc("Format `*.rb`")
5668
multitask(:"format:rb") do
5769
# while `syntax_tree` is much faster than `rubocop`, `rubocop` is the only formatter with full syntax support
58-
find = %w[find ./lib ./test ./examples -type f -and -name *.rb -print0]
70+
files = filtered["rb", %w[./lib ./test ./examples]]
5971
fmt = xargs + %w[rubocop --fail-level F --autocorrect --format simple --]
60-
sh("#{find.shelljoin} | #{fmt.shelljoin}")
72+
sh("#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}")
6173
end
6274

6375
desc("Format `*.rbi`")
6476
multitask(:"format:rbi") do
65-
find = %w[find ./rbi -type f -and -name *.rbi -print0]
77+
files = filtered["rbi", %w[./rbi]]
6678
fmt = xargs + %w[stree write --]
67-
sh(ruby_opt, "#{find.shelljoin} | #{fmt.shelljoin}")
79+
sh(ruby_opt, "#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}")
6880
end
6981

7082
desc("Format `*.rbs`")
7183
multitask(:"format:rbs") do
72-
find = %w[find ./sig -type f -name *.rbs -print0]
84+
files = filtered["rbs", %w[./sig]]
7385
inplace = /darwin|bsd/ =~ RUBY_PLATFORM ? ["-i", ""] : %w[-i]
7486
uuid = SecureRandom.uuid
7587

@@ -98,13 +110,13 @@ multitask(:"format:rbs") do
98110
success = false
99111

100112
# transform class aliases to type aliases, which syntax tree has no trouble with
101-
sh("#{find.shelljoin} | #{pre.shelljoin}")
113+
sh("#{files.shelljoin} | #{norm_lines} | #{pre.shelljoin}")
102114
# run syntax tree to format `*.rbs` files
103-
sh(ruby_opt, "#{find.shelljoin} | #{fmt.shelljoin}") do
115+
sh(ruby_opt, "#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}") do
104116
success = _1
105117
end
106118
# transform type aliases back to class aliases
107-
sh("#{find.shelljoin} | #{pst.shelljoin}")
119+
sh("#{files.shelljoin} | #{norm_lines} | #{pst.shelljoin}")
108120

109121
# always run post-processing to remove comment marker
110122
fail unless success

lib/finch_api.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
require_relative "finch_api/models/pay_statement_event"
155155
require_relative "finch_api/models/provider"
156156
require_relative "finch_api/models/provider_list_params"
157+
require_relative "finch_api/models/provider_list_response"
157158
require_relative "finch_api/models/request_forwarding_forward_params"
158159
require_relative "finch_api/models/request_forwarding_forward_response"
159160
require_relative "finch_api/models/sandbox/company_update_params"

lib/finch_api/errors.rb

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,25 @@ class APIError < FinchAPI::Errors::Error
4040
# @return [Integer, nil]
4141
attr_accessor :status
4242

43+
# @return [Hash{String=>String}, nil]
44+
attr_accessor :headers
45+
4346
# @return [Object, nil]
4447
attr_accessor :body
4548

4649
# @api private
4750
#
4851
# @param url [URI::Generic]
4952
# @param status [Integer, nil]
53+
# @param headers [Hash{String=>String}, nil]
5054
# @param body [Object, nil]
5155
# @param request [nil]
5256
# @param response [nil]
5357
# @param message [String, nil]
54-
def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil)
58+
def initialize(url:, status: nil, headers: nil, body: nil, request: nil, response: nil, message: nil)
5559
@url = url
5660
@status = status
61+
@headers = headers
5762
@body = body
5863
@request = request
5964
@response = response
@@ -74,13 +79,15 @@ class APIConnectionError < FinchAPI::Errors::APIError
7479
#
7580
# @param url [URI::Generic]
7681
# @param status [nil]
82+
# @param headers [Hash{String=>String}, nil]
7783
# @param body [nil]
7884
# @param request [nil]
7985
# @param response [nil]
8086
# @param message [String, nil]
8187
def initialize(
8288
url:,
8389
status: nil,
90+
headers: nil,
8491
body: nil,
8592
request: nil,
8693
response: nil,
@@ -95,13 +102,15 @@ class APITimeoutError < FinchAPI::Errors::APIConnectionError
95102
#
96103
# @param url [URI::Generic]
97104
# @param status [nil]
105+
# @param headers [Hash{String=>String}, nil]
98106
# @param body [nil]
99107
# @param request [nil]
100108
# @param response [nil]
101109
# @param message [String, nil]
102110
def initialize(
103111
url:,
104112
status: nil,
113+
headers: nil,
105114
body: nil,
106115
request: nil,
107116
response: nil,
@@ -116,21 +125,24 @@ class APIStatusError < FinchAPI::Errors::APIError
116125
#
117126
# @param url [URI::Generic]
118127
# @param status [Integer]
128+
# @param headers [Hash{String=>String}, nil]
119129
# @param body [Object, nil]
120130
# @param request [nil]
121131
# @param response [nil]
122132
# @param message [String, nil]
123133
#
124134
# @return [self]
125-
def self.for(url:, status:, body:, request:, response:, message: nil)
126-
kwargs = {
127-
url: url,
128-
status: status,
129-
body: body,
130-
request: request,
131-
response: response,
132-
message: message
133-
}
135+
def self.for(url:, status:, headers:, body:, request:, response:, message: nil)
136+
kwargs =
137+
{
138+
url: url,
139+
status: status,
140+
headers: headers,
141+
body: body,
142+
request: request,
143+
response: response,
144+
message: message
145+
}
134146

135147
case status
136148
in 400
@@ -162,15 +174,17 @@ def self.for(url:, status:, body:, request:, response:, message: nil)
162174
#
163175
# @param url [URI::Generic]
164176
# @param status [Integer]
177+
# @param headers [Hash{String=>String}, nil]
165178
# @param body [Object, nil]
166179
# @param request [nil]
167180
# @param response [nil]
168181
# @param message [String, nil]
169-
def initialize(url:, status:, body:, request:, response:, message: nil)
182+
def initialize(url:, status:, headers:, body:, request:, response:, message: nil)
170183
message ||= {url: url.to_s, status: status, body: body}
171184
super(
172185
url: url,
173186
status: status,
187+
headers: headers,
174188
body: body,
175189
request: request,
176190
response: response,

lib/finch_api/file_part.rb

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,21 @@ def to_json(*a) = read.to_json(*a)
3838
def to_yaml(*a) = read.to_yaml(*a)
3939

4040
# @param content [Pathname, StringIO, IO, String]
41-
# @param filename [String, nil]
41+
# @param filename [Pathname, String, nil]
4242
# @param content_type [String, nil]
4343
def initialize(content, filename: nil, content_type: nil)
44-
@content = content
44+
@content_type = content_type
4545
@filename =
46-
case content
47-
in Pathname
48-
filename.nil? ? content.basename.to_path : ::File.basename(filename)
46+
case [filename, (@content = content)]
47+
in [String | Pathname, _]
48+
::File.basename(filename)
49+
in [nil, Pathname]
50+
content.basename.to_path
51+
in [nil, IO]
52+
content.to_path
4953
else
50-
filename.nil? ? nil : ::File.basename(filename)
54+
filename
5155
end
52-
@content_type = content_type
5356
end
5457
end
5558
end

0 commit comments

Comments
 (0)