Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
89de302
fix: invalid enum names
stainless-app[bot] Apr 25, 2025
2238283
chore(internal): remove unnecessary `rbi/lib` folder
stainless-app[bot] Apr 26, 2025
b6d3a80
chore: more accurate type annotations and aliases
stainless-app[bot] Apr 26, 2025
6f63db8
chore(internal): annotate request options with type aliases in sorbet
stainless-app[bot] Apr 26, 2025
7e8da29
chore: add generator safe directory
stainless-app[bot] Apr 28, 2025
106335f
feat(api): api update
stainless-app[bot] Apr 28, 2025
b0bc9bb
feat(api): api update
stainless-app[bot] Apr 28, 2025
7dcee57
feat(api): api update
stainless-app[bot] Apr 28, 2025
9c98649
feat(api): api update
stainless-app[bot] Apr 28, 2025
9f9b600
feat(api): api update
stainless-app[bot] Apr 28, 2025
b5ceabb
feat(api): api update
stainless-app[bot] Apr 29, 2025
a8916c9
feat(api): api update
stainless-app[bot] Apr 29, 2025
e8ea0b2
feat(api): api update
stainless-app[bot] Apr 29, 2025
6699ec0
chore: loosen rubocop rules that don't always make sense
stainless-app[bot] Apr 29, 2025
2763397
feat(api): api update
stainless-app[bot] Apr 29, 2025
2577678
Merge remote-tracking branch 'origin/main' into next
stainless-app[bot] Apr 30, 2025
f328b3a
chore(internal): codegen related update
stainless-app[bot] Apr 30, 2025
15960ca
docs(readme): fix typo
stainless-app[bot] Apr 30, 2025
6a383f0
chore: remove Gemfile.lock during bootstrap
stainless-app[bot] May 1, 2025
e527e5d
chore: reorganize type aliases
stainless-app[bot] May 1, 2025
bdab477
feat(api): api update
stainless-app[bot] May 1, 2025
f4d4ab0
feat(api): api update
stainless-app[bot] May 1, 2025
e8cc430
chore: re-export top level models under library namespace
stainless-app[bot] May 1, 2025
89f7522
chore: always check if current page is empty in `next_page?`
stainless-app[bot] May 1, 2025
41e068d
chore: validate request option coercion correctness
stainless-app[bot] May 1, 2025
bcaecfa
chore(internal): codegen related update
stainless-app[bot] May 2, 2025
664ac2e
feat(api): api update
stainless-app[bot] May 2, 2025
15d107c
chore(internal): codegen related update
stainless-app[bot] May 5, 2025
0cb263a
feat(api): api update
stainless-app[bot] May 5, 2025
131b860
feat(api): api update
stainless-app[bot] May 5, 2025
53a8863
chore: accept all nd-json mimetype variants
stainless-app[bot] May 5, 2025
a1e63ab
feat(api): api update
stainless-app[bot] May 6, 2025
549b415
fix(internal): fix formatting script for macos
stainless-app[bot] May 6, 2025
8abcd39
chore: revert ignoring Gemfile.lock
stainless-app[bot] May 6, 2025
4b68a42
fix(internal): ensure formatting always uses c.utf-8 locale
stainless-app[bot] May 7, 2025
46cb63f
release: 0.1.0-alpha.14
stainless-app[bot] May 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
ruby-version: '3.1'
- run: |-
bundle install

Expand All @@ -36,7 +35,6 @@ jobs:
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
ruby-version: '3.1'
- run: |-
bundle install

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
ruby-version: '3.1'
- run: |-
bundle install

Expand Down
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.13"
".": "0.1.0-alpha.14"
}
10 changes: 10 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ Layout/MultilineMethodParameterLineBreaks:
# Prefer compact hash literals.
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space
Exclude:
- "**/*.rbi"

Lint/BooleanSymbol:
Enabled: false
Expand Down Expand Up @@ -90,6 +92,10 @@ Lint/MissingSuper:
Exclude:
- "**/*.rbi"

Lint/SymbolConversion:
Exclude:
- "**/*.rbi"

# Disabled for safety reasons, this option changes code semantics.
Lint/UnusedMethodArgument:
AutoCorrect: false
Expand Down Expand Up @@ -244,6 +250,10 @@ Style/RedundantInitialize:
Exclude:
- "**/*.rbi"

Style/RedundantParentheses:
Exclude:
- "**/*.rbi"

# Prefer slashes for regex literals.
Style/RegexpLiteral:
EnforcedStyle: slashes
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.0
3.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: 46
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-e5ab676f0996530fe4c702d8cbb88862ab8382792d01197a9576e06f5a359d00.yml
openapi_spec_hash: 5c0dec3d2e1fea26d5f99560b226aedd
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-f09e5f2c555d7ee764478b7bc73e92cd21f403d6ec189be14574c8367bc131ce.yml
openapi_spec_hash: bd0a8e001f14132c105992d40149909a
config_hash: 53778a0b839c4f6ad34fbba051f5e8a6
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# Changelog

## 0.1.0-alpha.14 (2025-05-07)

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

### Features

* **api:** api update ([a1e63ab](https://github.com/Finch-API/finch-api-ruby/commit/a1e63ab1e953ca1a3745ec158e5cbba3336e8cc4))
* **api:** api update ([131b860](https://github.com/Finch-API/finch-api-ruby/commit/131b8600623807e6f9fe61eec0008f466ea9bf51))
* **api:** api update ([0cb263a](https://github.com/Finch-API/finch-api-ruby/commit/0cb263a792ddcd544d4b790dcb87a49af23798de))
* **api:** api update ([664ac2e](https://github.com/Finch-API/finch-api-ruby/commit/664ac2e40a5f79294e19f2536241e3e3080b35bd))
* **api:** api update ([f4d4ab0](https://github.com/Finch-API/finch-api-ruby/commit/f4d4ab0dcfb81d75e0f7fe5bee9583a616e39ac6))
* **api:** api update ([bdab477](https://github.com/Finch-API/finch-api-ruby/commit/bdab47770cdc398d71349734d214d365569311a0))


### Bug Fixes

* **internal:** ensure formatting always uses c.utf-8 locale ([4b68a42](https://github.com/Finch-API/finch-api-ruby/commit/4b68a42729fba915f1d778b306f9a1120f936012))
* **internal:** fix formatting script for macos ([549b415](https://github.com/Finch-API/finch-api-ruby/commit/549b415b8fbb8baf6de342de32798d3096085a3c))


### Chores

* accept all nd-json mimetype variants ([53a8863](https://github.com/Finch-API/finch-api-ruby/commit/53a8863036254bd052c47fb283c82798784859f6))
* always check if current page is empty in `next_page?` ([89f7522](https://github.com/Finch-API/finch-api-ruby/commit/89f7522c76cbf4cb79a171b842fdb9db8ca0fb1f))
* **internal:** codegen related update ([15d107c](https://github.com/Finch-API/finch-api-ruby/commit/15d107cee7ff974a750f1cbfa812392ac1b7fc47))
* **internal:** codegen related update ([bcaecfa](https://github.com/Finch-API/finch-api-ruby/commit/bcaecfa4b137a6a767d69ea15c77885185d8368c))
* **internal:** codegen related update ([f328b3a](https://github.com/Finch-API/finch-api-ruby/commit/f328b3a5c3ea6ffeb01186ea929b4eb6f70ef1aa))
* re-export top level models under library namespace ([e8cc430](https://github.com/Finch-API/finch-api-ruby/commit/e8cc430134d053ce8e3e5d31aea2c43270eb2ffa))
* remove Gemfile.lock during bootstrap ([6a383f0](https://github.com/Finch-API/finch-api-ruby/commit/6a383f0228803c29f1a22658821311ad3239aa97))
* reorganize type aliases ([e527e5d](https://github.com/Finch-API/finch-api-ruby/commit/e527e5d5d118f2d00611a2f790e9fcc67a4794b0))
* revert ignoring Gemfile.lock ([8abcd39](https://github.com/Finch-API/finch-api-ruby/commit/8abcd39a9a0ba36ac5e1a8b65e69762c174408e4))
* validate request option coercion correctness ([41e068d](https://github.com/Finch-API/finch-api-ruby/commit/41e068d7304cd25e4e250a2c724cb99b1bf9d9b8))


### Documentation

* **readme:** fix typo ([15960ca](https://github.com/Finch-API/finch-api-ruby/commit/15960caf4fd7cfd3596326a0605ab61a64441558))

## 0.1.0-alpha.13 (2025-04-29)

Full Changelog: [v0.1.0-alpha.12...v0.1.0-alpha.13](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.12...v0.1.0-alpha.13)
Expand Down
51 changes: 26 additions & 25 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/stainless-api/syntax_tree-rbs.git
revision: 140eb3ba2ff4b959b345ac2a7927cd758a9f1284
revision: c30b50219918be7cfe3ef803a00b59d1e77fcada
branch: main
specs:
syntax_tree-rbs (1.0.0)
Expand All @@ -11,13 +11,13 @@ GIT
PATH
remote: .
specs:
finch-api (0.1.0.pre.alpha.12)
finch-api (0.1.0.pre.alpha.13)
connection_pool

GEM
remote: https://rubygems.org/
specs:
activesupport (7.2.2.1)
activesupport (8.0.2)
base64
benchmark (>= 0.3)
bigdecimal
Expand All @@ -29,10 +29,11 @@ GEM
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.3)
async (2.23.1)
async (2.24.0)
console (~> 1.29)
fiber-annotation
io-event (~> 1.9)
Expand All @@ -42,28 +43,28 @@ GEM
benchmark (0.4.0)
bigdecimal (3.1.9)
concurrent-ruby (1.3.5)
connection_pool (2.5.0)
connection_pool (2.5.3)
console (1.30.2)
fiber-annotation
fiber-local (~> 1.1)
json
crack (1.0.0)
bigdecimal
rexml
csv (3.3.3)
csv (3.3.4)
drb (2.2.1)
erubi (1.13.1)
ffi (1.17.1)
ffi (1.17.2-x86_64-linux-gnu)
fiber-annotation (0.2.0)
fiber-local (1.1.0)
fiber-storage
fiber-storage (1.0.0)
fiber-storage (1.0.1)
fileutils (1.7.3)
hashdiff (1.1.2)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
io-event (1.10.0)
json (2.10.2)
json (2.11.3)
language_server-protocol (3.17.0.4)
lint_roller (1.1.0)
listen (3.9.0)
Expand All @@ -82,20 +83,20 @@ GEM
minitest (~> 5.0)
mutex_m (0.3.0)
netrc (0.11.0)
parallel (1.26.3)
parser (3.3.7.4)
parallel (1.27.0)
parser (3.3.8.0)
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
prism (1.4.0)
public_suffix (6.0.1)
public_suffix (6.0.2)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rbi (0.3.1)
rbi (0.3.2)
prism (~> 1.0)
rbs (>= 3.4.4)
sorbet-runtime (>= 0.5.9204)
Expand All @@ -104,29 +105,29 @@ GEM
redcarpet (3.6.1)
regexp_parser (2.10.0)
rexml (3.4.1)
rubocop (1.75.1)
rubocop (1.75.5)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.43.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.43.0)
rubocop-ast (1.44.1)
parser (>= 3.3.7.2)
prism (~> 1.4)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
sorbet (0.5.11966)
sorbet-static (= 0.5.11966)
sorbet-runtime (0.5.11966)
sorbet-static (0.5.11966-x86_64-linux)
sorbet-static-and-runtime (0.5.11966)
sorbet (= 0.5.11966)
sorbet-runtime (= 0.5.11966)
sorbet (0.5.12067)
sorbet-static (= 0.5.12067)
sorbet-runtime (0.5.12067)
sorbet-static (0.5.12067-x86_64-linux)
sorbet-static-and-runtime (0.5.12067)
sorbet (= 0.5.12067)
sorbet-runtime (= 0.5.12067)
spoom (1.6.1)
erubi (>= 1.10.0)
prism (>= 0.28.0)
Expand All @@ -150,7 +151,7 @@ GEM
strscan (>= 1.0.0)
terminal-table (>= 2, < 5)
uri (>= 0.12.0)
strscan (3.1.2)
strscan (3.1.5)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
tapioca (0.16.11)
Expand Down Expand Up @@ -208,4 +209,4 @@ DEPENDENCIES
yard

BUNDLED WITH
2.3.3
2.4.1
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Finch Ruby API library

The Finch Ruby library provides convenient access to the Finch REST API from any Ruby 3.1.0+ application.
The Finch Ruby library provides convenient access to the Finch REST API from any Ruby 3.2.0+ application.

It is generated with [Stainless](https://www.stainless.com/).

Expand All @@ -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.13"
gem "finch-api", "~> 0.1.0.pre.alpha.14"
```

<!-- x-release-please-end -->
Expand Down Expand Up @@ -76,7 +76,7 @@ rescue FinchAPI::Errors::APIError => e
end
```

Error codes are as followed:
Error codes are as follows:

| Cause | Error Type |
| ---------------- | -------------------------- |
Expand Down Expand Up @@ -191,9 +191,9 @@ Sorbet's typed enums require sub-classing of the [`T::Enum` class](https://sorbe
Since this library does not depend on `sorbet-runtime`, it uses a [`T.all` intersection type](https://sorbet.org/docs/intersection-types) with a ruby primitive type to construct a "tagged alias" instead.

```ruby
module FinchAPI::Models::ConnectionStatusType
module FinchAPI::ConnectionStatusType
# This alias aids language service driven navigation.
TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::ConnectionStatusType) }
TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::ConnectionStatusType) }
end
```

Expand All @@ -214,7 +214,7 @@ This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` typ

## Requirements

Ruby 3.1.0 or higher.
Ruby 3.2.0 or higher.

## Contributing

Expand Down
34 changes: 23 additions & 11 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,51 @@ multitask(:test) do
.map { "require_relative(#{_1.dump});" }
.join

ruby(*%w[-e], rb, verbose: false) { fail unless _1 }
ruby(*%w[-w -e], rb, verbose: false) { fail unless _1 }
end

rubo_find = %w[find ./lib ./test ./rbi -type f -and ( -name *.rb -or -name *.rbi ) -print0]
xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --]
locale = {"LC_ALL" => "C.UTF-8"}

desc("Lint `*.rb(i)`")
multitask(:"lint:rubocop") do
find = %w[find ./lib ./test ./rbi -type f -and ( -name *.rb -or -name *.rbi ) -print0]

rubocop = %w[rubocop --fail-level E]
rubocop += %w[--format github] if ENV.key?("CI")

# some lines cannot be shortened
rubocop += %w[--except Lint/RedundantCopDisableDirective,Layout/LineLength]

lint = xargs + rubocop
sh("#{rubo_find.shelljoin} | #{lint.shelljoin}")
sh("#{find.shelljoin} | #{lint.shelljoin}")
end

desc("Format `*.rb(i)`")
multitask(:"format:rubocop") do
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 -type f -and -name *.rb -print0]
fmt = xargs + %w[rubocop --fail-level F --autocorrect --format simple --]
sh("#{rubo_find.shelljoin} | #{fmt.shelljoin}")
sh("#{find.shelljoin} | #{fmt.shelljoin}")
end

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

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

# `syntax_tree` has trouble with `rbs`'s class & module aliases

sed = xargs + %w[sed -E] + inplace + %w[-e]
sed_bin = /darwin/ =~ RUBY_PLATFORM ? "/usr/bin/sed" : "sed"
sed = xargs + [sed_bin, "-E", *inplace, "-e"]
# annotate unprocessable aliases with a unique comment
pre = sed + ["s/(class|module) ([^ ]+) = (.+$)/# \\1 #{uuid}\\n\\2: \\3/", "--"]
fmt = xargs + %w[stree write --plugin=rbs --]
Expand All @@ -87,7 +99,7 @@ multitask(:"format:syntax_tree") do
# transform class aliases to type aliases, which syntax tree has no trouble with
sh("#{find.shelljoin} | #{pre.shelljoin}")
# run syntax tree to format `*.rbs` files
sh("#{find.shelljoin} | #{fmt.shelljoin}") do
sh(locale, "#{find.shelljoin} | #{fmt.shelljoin}") do
success = _1
end
# transform type aliases back to class aliases
Expand All @@ -98,7 +110,7 @@ multitask(:"format:syntax_tree") do
end

desc("Format everything")
multitask(format: [:"format:rubocop", :"format:syntax_tree"])
multitask(format: [:"format:rb", :"format:rbi", :"format:rbs"])

desc("Typecheck `*.rbs`")
multitask(:"typecheck:steep") do
Expand Down
Loading