Skip to content

Commit 46a70f4

Browse files
release: 0.1.0-alpha.9 (#130)
* chore(internal): version bump * chore: add README docs for using solargraph when installing gem from git (#131) * feat: use Pathname alongside raw IO handles for file uploads (#132) * fix: raise connection error for errors that result from HTTP transports (#133) * chore: loosen const and integer coercion rules (#134) * chore: ensure readme.md is bumped when release please updates versions (#135) * feat(api): api update (#136) * fix(internal): update release-please to use ruby strategy for README.md (#137) * chore(internal): expand CI branch coverage (#138) * feat(api): benefits mutation API endpoints (create benefit, update benefit, enroll individual, unenroll individual) now properly return async response types (#139) * chore: fix typo (#140) * feat(api): add models for hrs benefits individuals async responses * chore: fix typo * chore(internal): reduce CI branch coverage * chore: fix lsp configuration file for local development * release: 0.1.0-alpha.9 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 03183c9 commit 46a70f4

File tree

79 files changed

+1247
-746
lines changed

Some content is hidden

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

79 files changed

+1247
-746
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ jobs:
1212
lint:
1313
name: lint
1414
runs-on: ubuntu-latest
15-
16-
1715
steps:
1816
- uses: actions/checkout@v4
1917
- name: Set up Ruby
@@ -29,7 +27,6 @@ jobs:
2927
test:
3028
name: test
3129
runs-on: ubuntu-latest
32-
3330
steps:
3431
- uses: actions/checkout@v4
3532
- name: Set up Ruby

.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.8"
2+
".": "0.1.0-alpha.9"
33
}

.solargraph.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include:
55
- 'Rakefile'
66
- 'examples/**/*.rb'
77
- 'lib/**/*.rb'
8-
- 'test/finch-api/resource_namespaces.rb'
9-
- 'test/finch-api/test_helper.rb'
8+
- 'test/finch_api/resource_namespaces.rb'
9+
- 'test/finch_api/test_helper.rb'
1010
exclude:
1111
- 'rbi/**/*'

.stats.yml

Lines changed: 3 additions & 3 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-14d375aab89e6b212fe459805a42d6ea7d7da8eae2037ae710a187d06911be1d.yml
3-
openapi_spec_hash: 08b86ecbec3323717d48e4aaee48ed54
4-
config_hash: ce10384813f68ba3fed61c7b601b396b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-bf858f37d7ab420841ddc6329dad8c46377308b6a5c8e935908011d0f9845e22.yml
3+
openapi_spec_hash: 2523952a32436e3c7fd3b55508c2e7ee
4+
config_hash: 53778a0b839c4f6ad34fbba051f5e8a6

CHANGELOG.md

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

3+
## 0.1.0-alpha.9 (2025-04-10)
4+
5+
Full Changelog: [v0.1.0-alpha.8...v0.1.0-alpha.9](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.8...v0.1.0-alpha.9)
6+
7+
### Features
8+
9+
* **api:** add models for hrs benefits individuals async responses ([7492eec](https://github.com/Finch-API/finch-api-ruby/commit/7492eec6cc2c2b3434126b3f6e79291d5badebaa))
10+
* **api:** api update ([#136](https://github.com/Finch-API/finch-api-ruby/issues/136)) ([e1bd1b5](https://github.com/Finch-API/finch-api-ruby/commit/e1bd1b517f2ef5acba32de6490c581cde6b5a88f))
11+
* **api:** benefits mutation API endpoints (create benefit, update benefit, enroll individual, unenroll individual) now properly return async response types ([#139](https://github.com/Finch-API/finch-api-ruby/issues/139)) ([f6b269c](https://github.com/Finch-API/finch-api-ruby/commit/f6b269cdc764e317bf5c3622bac66d625222d1db))
12+
* use Pathname alongside raw IO handles for file uploads ([#132](https://github.com/Finch-API/finch-api-ruby/issues/132)) ([ca140ed](https://github.com/Finch-API/finch-api-ruby/commit/ca140ed7e0ba64dab0532c07e54c1fd3c74ee887))
13+
14+
15+
### Bug Fixes
16+
17+
* **internal:** update release-please to use ruby strategy for README.md ([#137](https://github.com/Finch-API/finch-api-ruby/issues/137)) ([8a2f9b4](https://github.com/Finch-API/finch-api-ruby/commit/8a2f9b4b2ee02513530d25a86eff44ee66b6c47d))
18+
* raise connection error for errors that result from HTTP transports ([#133](https://github.com/Finch-API/finch-api-ruby/issues/133)) ([908b8ba](https://github.com/Finch-API/finch-api-ruby/commit/908b8bab442d72e3061461b66b130f852e09949d))
19+
20+
21+
### Chores
22+
23+
* add README docs for using solargraph when installing gem from git ([#131](https://github.com/Finch-API/finch-api-ruby/issues/131)) ([7bec93f](https://github.com/Finch-API/finch-api-ruby/commit/7bec93f44da855671b5c1be8ca11cb57f30d5cc7))
24+
* ensure readme.md is bumped when release please updates versions ([#135](https://github.com/Finch-API/finch-api-ruby/issues/135)) ([52953bd](https://github.com/Finch-API/finch-api-ruby/commit/52953bd7d499b595d8632c67db0a2c4ec418be7d))
25+
* fix lsp configuration file for local development ([ff3d47c](https://github.com/Finch-API/finch-api-ruby/commit/ff3d47c157613223fdafd0f953f5ab72f647a30a))
26+
* fix typo ([48e4f10](https://github.com/Finch-API/finch-api-ruby/commit/48e4f106285126601f9b60296d589f82b775e19b))
27+
* fix typo ([#140](https://github.com/Finch-API/finch-api-ruby/issues/140)) ([176f00b](https://github.com/Finch-API/finch-api-ruby/commit/176f00bd5ce8b85cec38d381b0c8c68a144060cf))
28+
* **internal:** expand CI branch coverage ([#138](https://github.com/Finch-API/finch-api-ruby/issues/138)) ([e699355](https://github.com/Finch-API/finch-api-ruby/commit/e699355e6db0fbf1853fdb7d9769eec8f6043fca))
29+
* **internal:** reduce CI branch coverage ([ff0aa81](https://github.com/Finch-API/finch-api-ruby/commit/ff0aa81561a53763a8ac6fdf373969991b193580))
30+
* **internal:** version bump ([508a2f6](https://github.com/Finch-API/finch-api-ruby/commit/508a2f6cc90a990e2ef220e9dcf41afde861f464))
31+
* loosen const and integer coercion rules ([#134](https://github.com/Finch-API/finch-api-ruby/issues/134)) ([954fa16](https://github.com/Finch-API/finch-api-ruby/commit/954fa162fb447df7392082c5b7676f205701b18a))
32+
333
## 0.1.0-alpha.8 (2025-04-08)
434

535
Full Changelog: [v0.1.0-alpha.7...v0.1.0-alpha.8](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.7...v0.1.0-alpha.8)

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

1717
GEM

README.md

Lines changed: 8 additions & 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.7"
20+
gem "finch-api", "~> 0.1.0.pre.alpha.9"
2121
```
2222

2323
<!-- x-release-please-end -->
@@ -140,6 +140,13 @@ After Solargraph is installed, **you must populate its index** either via the pr
140140
bundle exec solargraph gems
141141
```
142142

143+
Note: if you had installed the gem either using a `git:` or `github:` URL, or had vendored the gem using bundler, you will need to set up your [`.solargraph.yml`](https://solargraph.org/guides/configuration) to include the path to the gem's `lib` directory.
144+
145+
```yaml
146+
include:
147+
- 'vendor/bundle/ruby/*/gems/finch-api-*/lib/**/*.rb'
148+
```
149+
143150
Otherwise Solargraph will not be able to provide type information or auto-completion for any non-indexed libraries.
144151
145152
### Sorbet

lib/finch_api.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
require_relative "finch_api/internal/type/converter"
4141
require_relative "finch_api/internal/type/unknown"
4242
require_relative "finch_api/internal/type/boolean"
43+
require_relative "finch_api/internal/type/io_like"
4344
require_relative "finch_api/internal/type/enum"
4445
require_relative "finch_api/internal/type/union"
4546
require_relative "finch_api/internal/type/array_of"
@@ -79,15 +80,16 @@
7980
require_relative "finch_api/models/hris/benefit_frequency"
8081
require_relative "finch_api/models/hris/benefit_list_params"
8182
require_relative "finch_api/models/hris/benefit_list_supported_benefits_params"
83+
require_relative "finch_api/models/hris/benefit_list_supported_benefits_response"
8284
require_relative "finch_api/models/hris/benefit_retrieve_params"
83-
require_relative "finch_api/models/hris/benefits/enrolled_individual"
85+
require_relative "finch_api/models/hris/benefits/enrolled_individual_benefit_response"
8486
require_relative "finch_api/models/hris/benefits/individual_benefit"
8587
require_relative "finch_api/models/hris/benefits/individual_enrolled_ids_params"
8688
require_relative "finch_api/models/hris/benefits/individual_enrolled_ids_response"
8789
require_relative "finch_api/models/hris/benefits/individual_enroll_many_params"
8890
require_relative "finch_api/models/hris/benefits/individual_retrieve_many_benefits_params"
8991
require_relative "finch_api/models/hris/benefits/individual_unenroll_many_params"
90-
require_relative "finch_api/models/hris/benefits/unenrolled_individual"
92+
require_relative "finch_api/models/hris/benefits/unenrolled_individual_benefit_response"
9193
require_relative "finch_api/models/hris/benefits_support"
9294
require_relative "finch_api/models/hris/benefit_type"
9395
require_relative "finch_api/models/hris/benefit_update_params"

lib/finch_api/internal/transport/base_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def initialize(
380380
in (400..) | FinchAPI::Errors::APIConnectionError
381381
self.class.reap_connection!(status, stream: stream)
382382

383-
delay = retry_delay(response, retry_count: retry_count)
383+
delay = retry_delay(response || {}, retry_count: retry_count)
384384
sleep(delay)
385385

386386
send_request(

lib/finch_api/internal/transport/pooled_net_requester.rb

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def calibrate_socket_timeout(conn, deadline)
5454
# @param blk [Proc]
5555
#
5656
# @yieldparam [String]
57-
# @return [Net::HTTPGenericRequest]
57+
# @return [Array(Net::HTTPGenericRequest, Proc)]
5858
def build_request(request, &blk)
5959
method, url, headers, body = request.fetch_values(:method, :url, :headers, :body)
6060
req = Net::HTTPGenericRequest.new(
@@ -75,12 +75,12 @@ def build_request(request, &blk)
7575
in StringIO
7676
req["content-length"] ||= body.size.to_s unless req["transfer-encoding"]
7777
req.body_stream = FinchAPI::Internal::Util::ReadIOAdapter.new(body, &blk)
78-
in IO | Enumerator
78+
in Pathname | IO | Enumerator
7979
req["transfer-encoding"] ||= "chunked" unless req["content-length"]
8080
req.body_stream = FinchAPI::Internal::Util::ReadIOAdapter.new(body, &blk)
8181
end
8282

83-
req
83+
[req, req.body_stream&.method(:close)]
8484
end
8585
end
8686

@@ -123,13 +123,17 @@ def build_request(request, &blk)
123123
def execute(request)
124124
url, deadline = request.fetch_values(:url, :deadline)
125125

126+
req = nil
126127
eof = false
127128
finished = false
129+
closing = nil
130+
131+
# rubocop:disable Metrics/BlockLength
128132
enum = Enumerator.new do |y|
129133
with_pool(url, deadline: deadline) do |conn|
130134
next if finished
131135

132-
req = self.class.build_request(request) do
136+
req, closing = self.class.build_request(request) do
133137
self.class.calibrate_socket_timeout(conn, deadline)
134138
end
135139

@@ -154,8 +158,11 @@ def execute(request)
154158
end
155159
end
156160
rescue Timeout::Error
157-
raise FinchAPI::Errors::APITimeoutError
161+
raise FinchAPI::Errors::APITimeoutError.new(url: url, request: req)
162+
rescue StandardError
163+
raise FinchAPI::Errors::APIConnectionError.new(url: url, request: req)
158164
end
165+
# rubocop:enable Metrics/BlockLength
159166

160167
conn, _, response = enum.next
161168
body = FinchAPI::Internal::Util.fused_enum(enum, external: true) do
@@ -165,7 +172,9 @@ def execute(request)
165172
rescue StopIteration
166173
nil
167174
end
175+
ensure
168176
conn.finish if !eof && conn&.started?
177+
closing&.call
169178
end
170179
[Integer(response.code), response, (response.body = body)]
171180
end

0 commit comments

Comments
 (0)