Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
45672bb
feat: expose response headers for both streams and errors
stainless-app[bot] Sep 17, 2025
6faa93e
chore: do not install brew dependencies in ./scripts/bootstrap by def…
stainless-app[bot] Sep 19, 2025
5d966de
codegen metadata
stainless-app[bot] Sep 23, 2025
69f9d97
perf: faster code formatting
stainless-app[bot] Sep 25, 2025
8387c75
fix(internal): use null byte as file separator in the fast formatting…
stainless-app[bot] Sep 26, 2025
df686c5
fix: shorten multipart boundary sep to less than RFC specificed max l…
stainless-app[bot] Sep 26, 2025
23be115
codegen metadata
stainless-app[bot] Sep 26, 2025
b7c6223
chore: allow fast-format to use bsd sed as well
stainless-app[bot] Sep 26, 2025
66b8a64
feat(api): api update
stainless-app[bot] Sep 26, 2025
ee2e0ed
fix: always send `filename=...` for multipart requests where a file i…
stainless-app[bot] Sep 29, 2025
6bc1d70
codegen metadata
stainless-app[bot] Sep 30, 2025
ed8c82c
fix: coroutine leaks from connection pool
stainless-app[bot] Sep 30, 2025
ab22783
feat(api): api update
stainless-app[bot] Oct 7, 2025
31c3661
feat(api): api update
stainless-app[bot] Oct 7, 2025
d3f05ab
chore: ignore linter error for tests having large collections
stainless-app[bot] Oct 8, 2025
c1c1d9b
codegen metadata
stainless-app[bot] Oct 9, 2025
0d1e8ba
feat(api): api update
stainless-app[bot] Oct 9, 2025
8ad8c9d
fix: should not reuse buffers for `IO.copy_stream` interop
stainless-app[bot] Oct 14, 2025
61d827e
feat(api): api update
stainless-app[bot] Oct 14, 2025
78a45f9
feat(api): api update
stainless-app[bot] Oct 14, 2025
96b3cd9
fix: absolutely qualified uris should always override the default
stainless-app[bot] Oct 15, 2025
4e526be
feat(api): api update
stainless-app[bot] Oct 20, 2025
97627a2
feat: handle thread interrupts in the core HTTP client
stainless-app[bot] Oct 23, 2025
a463808
feat(api): api update
stainless-app[bot] Oct 25, 2025
2c193f3
feat(api): api update
stainless-app[bot] Oct 27, 2025
c71171c
release: 0.1.0-alpha.31
stainless-app[bot] Oct 27, 2025
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 @@
{
".": "0.1.0-alpha.30"
".": "0.1.0-alpha.31"
}
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ Metrics/BlockLength:
Metrics/ClassLength:
Enabled: false

Metrics/CollectionLiteralLength:
Exclude:
- "test/**/*"

Metrics/CyclomaticComplexity:
Enabled: false

Expand Down
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 46
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-bb50c0ae41ff5036adf72344d33057941f6de67c5fae811eba2e758bfa4ffd31.yml
openapi_spec_hash: 1b21e4bfc46daeef1613e410e5aa8f28
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-0105d239fcaf84750c886dfa6c2cfbf2b2087f89a48f8827c4cbe28479ebfb13.yml
openapi_spec_hash: 34895c3d3c137fb9f5a019ac5370afbb
config_hash: 6d3585c0032e08d723d077d660fc8448
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# Changelog

## 0.1.0-alpha.31 (2025-10-27)

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)

### Features

* **api:** api update ([2c193f3](https://github.com/Finch-API/finch-api-ruby/commit/2c193f3efeec2a63a845a399a8ed678a95e14dd9))
* **api:** api update ([a463808](https://github.com/Finch-API/finch-api-ruby/commit/a4638080bfdd91ed19083a7cf3f43b1cee5a8568))
* **api:** api update ([4e526be](https://github.com/Finch-API/finch-api-ruby/commit/4e526befab7e3cc48a0b13cd869ff81df27f9469))
* **api:** api update ([78a45f9](https://github.com/Finch-API/finch-api-ruby/commit/78a45f95a0ad4dbed56b70c66427c9158933383e))
* **api:** api update ([61d827e](https://github.com/Finch-API/finch-api-ruby/commit/61d827e756ba40a17532ac75694370b666eed062))
* **api:** api update ([0d1e8ba](https://github.com/Finch-API/finch-api-ruby/commit/0d1e8baa59306512f78750f4c5bfef9f2d66e0e6))
* **api:** api update ([31c3661](https://github.com/Finch-API/finch-api-ruby/commit/31c3661fa11d6f74224e9c0af9b5dcee877183ee))
* **api:** api update ([ab22783](https://github.com/Finch-API/finch-api-ruby/commit/ab2278377aae4058398fa1540df2a16f5cbaf704))
* **api:** api update ([66b8a64](https://github.com/Finch-API/finch-api-ruby/commit/66b8a6446d12b5222a2408af0de686b94afff297))
* expose response headers for both streams and errors ([45672bb](https://github.com/Finch-API/finch-api-ruby/commit/45672bb5a1b70d8fc1ea4acf2fa89044284d7fab))
* handle thread interrupts in the core HTTP client ([97627a2](https://github.com/Finch-API/finch-api-ruby/commit/97627a28d523f0554075ca469e94aae6cc111def))


### Bug Fixes

* absolutely qualified uris should always override the default ([96b3cd9](https://github.com/Finch-API/finch-api-ruby/commit/96b3cd9ab133c0bb0b30cc151c9c1e3e1493d97e))
* always send `filename=...` for multipart requests where a file is expected ([ee2e0ed](https://github.com/Finch-API/finch-api-ruby/commit/ee2e0ed334b365dbc89ec602402310695d48922b))
* coroutine leaks from connection pool ([ed8c82c](https://github.com/Finch-API/finch-api-ruby/commit/ed8c82c1de78c5416bf2704b2c7208289d5526d6))
* **internal:** use null byte as file separator in the fast formatting script ([8387c75](https://github.com/Finch-API/finch-api-ruby/commit/8387c751006f4e9832bbfcd87fc22a0e10c1e7cf))
* shorten multipart boundary sep to less than RFC specificed max length ([df686c5](https://github.com/Finch-API/finch-api-ruby/commit/df686c5b25b82c9f4f44966e087812be37007fbf))
* should not reuse buffers for `IO.copy_stream` interop ([8ad8c9d](https://github.com/Finch-API/finch-api-ruby/commit/8ad8c9dc1429b38df047ac7a17ebf33eafe84a10))


### Performance Improvements

* faster code formatting ([69f9d97](https://github.com/Finch-API/finch-api-ruby/commit/69f9d97f9f857b3b9912e733cb37d8e9ca41af3a))


### Chores

* allow fast-format to use bsd sed as well ([b7c6223](https://github.com/Finch-API/finch-api-ruby/commit/b7c6223003113460bef7064164ae2590940c984b))
* do not install brew dependencies in ./scripts/bootstrap by default ([6faa93e](https://github.com/Finch-API/finch-api-ruby/commit/6faa93ee15839976d987e97701c988940e2a134e))
* ignore linter error for tests having large collections ([d3f05ab](https://github.com/Finch-API/finch-api-ruby/commit/d3f05ab04c2a228488f57933ea8643913bfa6260))

## 0.1.0-alpha.30 (2025-09-08)

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)
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:
finch-api (0.1.0.pre.alpha.30)
finch-api (0.1.0.pre.alpha.31)
connection_pool

GEM
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "finch-api", "~> 0.1.0.pre.alpha.30"
gem "finch-api", "~> 0.1.0.pre.alpha.31"
```

<!-- x-release-please-end -->
Expand Down
28 changes: 20 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ tapioca = "sorbet/tapioca"
examples = "examples"
ignore_file = ".ignore"

FILES_ENV = "FORMAT_FILE"

CLEAN.push(*%w[.idea/ .ruby-lsp/ .yardoc/ doc/], *FileList["*.gem"], ignore_file)

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

filtered = ->(ext, dirs) do
if ENV.key?(FILES_ENV)
%w[sed -E -n -e] << "/\\.#{ext}$/p" << "--" << ENV.fetch(FILES_ENV)
else
(%w[find] + dirs + %w[-type f -and -name]) << "*.#{ext}" << "-print0"
end
end

desc("Lint `*.rb(i)`")
multitask(:"lint:rubocop") do
find = %w[find ./lib ./test ./rbi ./examples -type f -and ( -name *.rb -or -name *.rbi ) -print0]
Expand All @@ -52,24 +62,26 @@ multitask(:"lint:rubocop") do
sh("#{find.shelljoin} | #{lint.shelljoin}")
end

norm_lines = %w[tr -- \n \0].shelljoin

desc("Format `*.rb`")
multitask(:"format:rb") do
# while `syntax_tree` is much faster than `rubocop`, `rubocop` is the only formatter with full syntax support
find = %w[find ./lib ./test ./examples -type f -and -name *.rb -print0]
files = filtered["rb", %w[./lib ./test ./examples]]
fmt = xargs + %w[rubocop --fail-level F --autocorrect --format simple --]
sh("#{find.shelljoin} | #{fmt.shelljoin}")
sh("#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}")
end

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

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

Expand Down Expand Up @@ -98,13 +110,13 @@ multitask(:"format:rbs") do
success = false

# transform class aliases to type aliases, which syntax tree has no trouble with
sh("#{find.shelljoin} | #{pre.shelljoin}")
sh("#{files.shelljoin} | #{norm_lines} | #{pre.shelljoin}")
# run syntax tree to format `*.rbs` files
sh(ruby_opt, "#{find.shelljoin} | #{fmt.shelljoin}") do
sh(ruby_opt, "#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}") do
success = _1
end
# transform type aliases back to class aliases
sh("#{find.shelljoin} | #{pst.shelljoin}")
sh("#{files.shelljoin} | #{norm_lines} | #{pst.shelljoin}")

# always run post-processing to remove comment marker
fail unless success
Expand Down
1 change: 1 addition & 0 deletions lib/finch_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
require_relative "finch_api/models/pay_statement_event"
require_relative "finch_api/models/provider"
require_relative "finch_api/models/provider_list_params"
require_relative "finch_api/models/provider_list_response"
require_relative "finch_api/models/request_forwarding_forward_params"
require_relative "finch_api/models/request_forwarding_forward_response"
require_relative "finch_api/models/sandbox/company_update_params"
Expand Down
36 changes: 25 additions & 11 deletions lib/finch_api/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,25 @@ class APIError < FinchAPI::Errors::Error
# @return [Integer, nil]
attr_accessor :status

# @return [Hash{String=>String}, nil]
attr_accessor :headers

# @return [Object, nil]
attr_accessor :body

# @api private
#
# @param url [URI::Generic]
# @param status [Integer, nil]
# @param headers [Hash{String=>String}, nil]
# @param body [Object, nil]
# @param request [nil]
# @param response [nil]
# @param message [String, nil]
def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil)
def initialize(url:, status: nil, headers: nil, body: nil, request: nil, response: nil, message: nil)
@url = url
@status = status
@headers = headers
@body = body
@request = request
@response = response
Expand All @@ -74,13 +79,15 @@ class APIConnectionError < FinchAPI::Errors::APIError
#
# @param url [URI::Generic]
# @param status [nil]
# @param headers [Hash{String=>String}, nil]
# @param body [nil]
# @param request [nil]
# @param response [nil]
# @param message [String, nil]
def initialize(
url:,
status: nil,
headers: nil,
body: nil,
request: nil,
response: nil,
Expand All @@ -95,13 +102,15 @@ class APITimeoutError < FinchAPI::Errors::APIConnectionError
#
# @param url [URI::Generic]
# @param status [nil]
# @param headers [Hash{String=>String}, nil]
# @param body [nil]
# @param request [nil]
# @param response [nil]
# @param message [String, nil]
def initialize(
url:,
status: nil,
headers: nil,
body: nil,
request: nil,
response: nil,
Expand All @@ -116,21 +125,24 @@ class APIStatusError < FinchAPI::Errors::APIError
#
# @param url [URI::Generic]
# @param status [Integer]
# @param headers [Hash{String=>String}, nil]
# @param body [Object, nil]
# @param request [nil]
# @param response [nil]
# @param message [String, nil]
#
# @return [self]
def self.for(url:, status:, body:, request:, response:, message: nil)
kwargs = {
url: url,
status: status,
body: body,
request: request,
response: response,
message: message
}
def self.for(url:, status:, headers:, body:, request:, response:, message: nil)
kwargs =
{
url: url,
status: status,
headers: headers,
body: body,
request: request,
response: response,
message: message
}

case status
in 400
Expand Down Expand Up @@ -162,15 +174,17 @@ def self.for(url:, status:, body:, request:, response:, message: nil)
#
# @param url [URI::Generic]
# @param status [Integer]
# @param headers [Hash{String=>String}, nil]
# @param body [Object, nil]
# @param request [nil]
# @param response [nil]
# @param message [String, nil]
def initialize(url:, status:, body:, request:, response:, message: nil)
def initialize(url:, status:, headers:, body:, request:, response:, message: nil)
message ||= {url: url.to_s, status: status, body: body}
super(
url: url,
status: status,
headers: headers,
body: body,
request: request,
response: response,
Expand Down
17 changes: 10 additions & 7 deletions lib/finch_api/file_part.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,21 @@ def to_json(*a) = read.to_json(*a)
def to_yaml(*a) = read.to_yaml(*a)

# @param content [Pathname, StringIO, IO, String]
# @param filename [String, nil]
# @param filename [Pathname, String, nil]
# @param content_type [String, nil]
def initialize(content, filename: nil, content_type: nil)
@content = content
@content_type = content_type
@filename =
case content
in Pathname
filename.nil? ? content.basename.to_path : ::File.basename(filename)
case [filename, (@content = content)]
in [String | Pathname, _]
::File.basename(filename)
in [nil, Pathname]
content.basename.to_path
in [nil, IO]
content.to_path
else
filename.nil? ? nil : ::File.basename(filename)
filename
end
@content_type = content_type
end
end
end
2 changes: 1 addition & 1 deletion lib/finch_api/internal/individuals_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def auto_paging_each(&blk)
#
# @param client [FinchAPI::Internal::Transport::BaseClient]
# @param req [Hash{Symbol=>Object}]
# @param headers [Hash{String=>String}, Net::HTTPHeader]
# @param headers [Hash{String=>String}]
# @param page_data [Hash{Symbol=>Object}]
def initialize(client:, req:, headers:, page_data:)
super
Expand Down
2 changes: 1 addition & 1 deletion lib/finch_api/internal/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def auto_paging_each(&blk)
#
# @param client [FinchAPI::Internal::Transport::BaseClient]
# @param req [Hash{Symbol=>Object}]
# @param headers [Hash{String=>String}, Net::HTTPHeader]
# @param headers [Hash{String=>String}]
# @param page_data [Hash{Symbol=>Object}]
def initialize(client:, req:, headers:, page_data:)
super
Expand Down
2 changes: 1 addition & 1 deletion lib/finch_api/internal/responses_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def auto_paging_each(&blk)
#
# @param client [FinchAPI::Internal::Transport::BaseClient]
# @param req [Hash{Symbol=>Object}]
# @param headers [Hash{String=>String}, Net::HTTPHeader]
# @param headers [Hash{String=>String}]
# @param page_data [Array<Object>]
def initialize(client:, req:, headers:, page_data:)
super
Expand Down
2 changes: 1 addition & 1 deletion lib/finch_api/internal/single_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def auto_paging_each(&blk)
#
# @param client [FinchAPI::Internal::Transport::BaseClient]
# @param req [Hash{Symbol=>Object}]
# @param headers [Hash{String=>String}, Net::HTTPHeader]
# @param headers [Hash{String=>String}]
# @param page_data [Array<Object>]
def initialize(client:, req:, headers:, page_data:)
super
Expand Down
Loading