Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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.3"
".": "0.1.0-alpha.4"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 199
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-2f220d665fe0014a15369e084c2ad554dc9dbe6758e079b40af056153807fe1f.yml
openapi_spec_hash: 280b322bc7ae0fc3eb4ea18d73fa01ae
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-49cf09bfa8351df7daf0d1062d57dc1338c8882c7614ccabbf4903806d9b102e.yml
openapi_spec_hash: c2ae776a3a8e619c33606f2d14716ffe
config_hash: 20a463ecd33bd32b7b9bc6f4990907ac
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.1.0-alpha.4 (2025-04-04)

Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/Increase/increase-ruby/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)

### Features

* **api:** api update ([#17](https://github.com/Increase/increase-ruby/issues/17)) ([a3f4158](https://github.com/Increase/increase-ruby/commit/a3f415870ca066d5a5554351d4aebffdefe6535e))
* support solargraph generics ([#15](https://github.com/Increase/increase-ruby/issues/15)) ([8555967](https://github.com/Increase/increase-ruby/commit/8555967605a0c2fdc50660beb8e6bea1d3434cf8))


### Chores

* do not use literals for version in type definitions ([#18](https://github.com/Increase/increase-ruby/issues/18)) ([d88128c](https://github.com/Increase/increase-ruby/commit/d88128c03e8171ba2803eeb53548ddd5db4ecc0d))
* **internal:** version bump ([#13](https://github.com/Increase/increase-ruby/issues/13)) ([2a3a20f](https://github.com/Increase/increase-ruby/commit/2a3a20f1966c32215616997de572c2e3ef9c743d))

## 0.1.0-alpha.3 (2025-04-03)

Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/Increase/increase-ruby/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
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:
increase (0.1.0.pre.alpha.3)
increase (0.1.0.pre.alpha.4)
connection_pool

GEM
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ The underlying REST API documentation can be found on [increase.com](https://inc

To use this gem, install via Bundler by adding the following to your application's `Gemfile`:

<!-- x-release-please-start-version -->

```ruby
gem "increase", "~> 0.1.0.pre.alpha.2"
gem "increase", "~> 0.1.0.pre.alpha.3"
```

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

To fetch an initial copy of the gem:

```sh
Expand Down
6 changes: 5 additions & 1 deletion lib/increase/internal/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

module Increase
module Internal
# @generic Elem
#
# @example
# if page.has_next?
# page = page.next_page
Expand All @@ -14,7 +16,7 @@ module Internal
class Page
include Increase::Internal::Type::BasePage

# @return [Array<Object>, nil]
# @return [Array<generic<Elem>>, nil]
attr_accessor :data

# @return [String, nil]
Expand Down Expand Up @@ -61,6 +63,8 @@ def next_page
end

# @param blk [Proc]
#
# @yieldparam [generic<Elem>]
def auto_paging_each(&blk)
unless block_given?
raise ArgumentError.new("A block must be given to ##{__method__}")
Expand Down
4 changes: 2 additions & 2 deletions lib/increase/internal/transport/base_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def follow_redirect(request, status:, response_headers:)
# @api private
#
# @param status [Integer, Increase::Errors::APIConnectionError]
# @param stream [Enumerable, nil]
# @param stream [Enumerable<String>, nil]
def reap_connection!(status, stream:)
case status
in (..199) | (300..499)
Expand Down Expand Up @@ -328,7 +328,7 @@ def initialize(
# @param send_retry_header [Boolean]
#
# @raise [Increase::Errors::APIError]
# @return [Array(Integer, Net::HTTPResponse, Enumerable)]
# @return [Array(Integer, Net::HTTPResponse, Enumerable<String>)]
private def send_request(request, redirect_count:, retry_count:, send_retry_header:)
url, headers, max_retries, timeout = request.fetch_values(:url, :headers, :max_retries, :timeout)
input = {**request.except(:timeout), deadline: Increase::Internal::Util.monotonic_secs + timeout}
Expand Down
2 changes: 1 addition & 1 deletion lib/increase/internal/transport/pooled_net_requester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def build_request(request, &blk)
#
# @option request [Float] :deadline
#
# @return [Array(Integer, Net::HTTPResponse, Enumerable)]
# @return [Array(Integer, Net::HTTPResponse, Enumerable<String>)]
def execute(request)
url, deadline = request.fetch_values(:url, :deadline)

Expand Down
8 changes: 5 additions & 3 deletions lib/increase/internal/type/array_of.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ module Type
#
# @abstract
#
# @generic Elem
#
# Array of items of a given type.
class ArrayOf
include Increase::Internal::Type::Converter
Expand Down Expand Up @@ -40,7 +42,7 @@ def ==(other)

# @api private
#
# @param value [Enumerable, Object]
# @param value [Array<Object>, Object]
#
# @param state [Hash{Symbol=>Object}] .
#
Expand Down Expand Up @@ -75,7 +77,7 @@ def coerce(value, state:)

# @api private
#
# @param value [Enumerable, Object]
# @param value [Array<Object>, Object]
#
# @return [Array<Object>, Object]
def dump(value)
Expand All @@ -91,7 +93,7 @@ def dump(value)

# @api private
#
# @return [Increase::Internal::Type::Converter, Class]
# @return [generic<Elem>]
protected def item_type = @item_type_fn.call

# @api private
Expand Down
5 changes: 4 additions & 1 deletion lib/increase/internal/type/base_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
module Increase
module Internal
module Type
# @generic Elem
#
# This module provides a base implementation for paginated responses in the SDK.
module BasePage
# rubocop:disable Lint/UnusedMethodArgument
Expand All @@ -16,10 +18,11 @@ def next_page = (raise NotImplementedError)

# @param blk [Proc]
#
# @yieldparam [generic<Elem>]
# @return [void]
def auto_paging_each(&blk) = (raise NotImplementedError)

# @return [Enumerable]
# @return [Enumerable<generic<Elem>>]
def to_enum = super(:auto_paging_each)

alias_method :enum_for, :to_enum
Expand Down
4 changes: 3 additions & 1 deletion lib/increase/internal/type/hash_of.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ module Type
#
# @abstract
#
# @generic Elem
#
# Hash of items of a given type.
class HashOf
include Increase::Internal::Type::Converter
Expand Down Expand Up @@ -111,7 +113,7 @@ def dump(value)

# @api private
#
# @return [Increase::Internal::Type::Converter, Class]
# @return [generic<Elem>]
protected def item_type = @item_type_fn.call

# @api private
Expand Down
24 changes: 12 additions & 12 deletions lib/increase/internal/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def read(max_len = nil, out_string = nil)

# @api private
#
# @param stream [String, IO, StringIO, Enumerable]
# @param stream [String, IO, StringIO, Enumerable<String>]
# @param blk [Proc]
#
# @yieldparam [String]
Expand All @@ -434,7 +434,7 @@ class << self
# @param blk [Proc]
#
# @yieldparam [Enumerator::Yielder]
# @return [Enumerable]
# @return [Enumerable<String>]
def writable_enum(&blk)
Enumerator.new do |y|
y.define_singleton_method(:write) do
Expand Down Expand Up @@ -490,7 +490,7 @@ class << self
#
# @param body [Object]
#
# @return [Array(String, Enumerable)]
# @return [Array(String, Enumerable<String>)]
private def encode_multipart_streaming(body)
boundary = SecureRandom.urlsafe_base64(60)

Expand Down Expand Up @@ -543,7 +543,7 @@ def encode_content(headers, body)
# @api private
#
# @param headers [Hash{String=>String}, Net::HTTPHeader]
# @param stream [Enumerable]
# @param stream [Enumerable<String>]
# @param suppress_error [Boolean]
#
# @raise [JSON::ParserError]
Expand Down Expand Up @@ -580,11 +580,11 @@ class << self
#
# https://doc.rust-lang.org/std/iter/trait.FusedIterator.html
#
# @param enum [Enumerable]
# @param enum [Enumerable<Object>]
# @param external [Boolean]
# @param close [Proc]
#
# @return [Enumerable]
# @return [Enumerable<Object>]
def fused_enum(enum, external: false, &close)
fused = false
iter = Enumerator.new do |y|
Expand All @@ -610,7 +610,7 @@ def fused_enum(enum, external: false, &close)

# @api private
#
# @param enum [Enumerable, nil]
# @param enum [Enumerable<Object>, nil]
def close_fused!(enum)
return unless enum.is_a?(Enumerator)

Expand All @@ -621,11 +621,11 @@ def close_fused!(enum)

# @api private
#
# @param enum [Enumerable, nil]
# @param enum [Enumerable<Object>, nil]
# @param blk [Proc]
#
# @yieldparam [Enumerator::Yielder]
# @return [Enumerable]
# @return [Enumerable<Object>]
def chain_fused(enum, &blk)
iter = Enumerator.new { blk.call(_1) }
fused_enum(iter) { close_fused!(enum) }
Expand All @@ -635,9 +635,9 @@ def chain_fused(enum, &blk)
class << self
# @api private
#
# @param enum [Enumerable]
# @param enum [Enumerable<String>]
#
# @return [Enumerable]
# @return [Enumerable<String>]
def decode_lines(enum)
re = /(\r\n|\r|\n)/
buffer = String.new.b
Expand Down Expand Up @@ -671,7 +671,7 @@ def decode_lines(enum)
#
# https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream
#
# @param lines [Enumerable]
# @param lines [Enumerable<String>]
#
# @return [Hash{Symbol=>Object}]
def decode_sse(lines)
Expand Down
8 changes: 4 additions & 4 deletions lib/increase/models/card_payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ module VerificationMethod
# The one-time code was sent via email.
EMAIL = :email

# The one-time code was not successfully delievered.
# The one-time code was not successfully delivered.
NONE_AVAILABLE = :none_available

finalize!
Expand Down Expand Up @@ -1394,7 +1394,7 @@ class CardholderAddress < Increase::Internal::Type::BaseModel
module Result
extend Increase::Internal::Type::Enum

# No adress was provided in the authorization request.
# No address was provided in the authorization request.
NOT_CHECKED = :not_checked

# Postal code matches, but the street address was not verified.
Expand Down Expand Up @@ -2367,7 +2367,7 @@ class CardholderAddress < Increase::Internal::Type::BaseModel
module Result
extend Increase::Internal::Type::Enum

# No adress was provided in the authorization request.
# No address was provided in the authorization request.
NOT_CHECKED = :not_checked

# Postal code matches, but the street address was not verified.
Expand Down Expand Up @@ -6595,7 +6595,7 @@ class CardholderAddress < Increase::Internal::Type::BaseModel
module Result
extend Increase::Internal::Type::Enum

# No adress was provided in the authorization request.
# No address was provided in the authorization request.
NOT_CHECKED = :not_checked

# Postal code matches, but the street address was not verified.
Expand Down
2 changes: 1 addition & 1 deletion lib/increase/models/declined_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ class CardholderAddress < Increase::Internal::Type::BaseModel
module Result
extend Increase::Internal::Type::Enum

# No adress was provided in the authorization request.
# No address was provided in the authorization request.
NOT_CHECKED = :not_checked

# Postal code matches, but the street address was not verified.
Expand Down
2 changes: 1 addition & 1 deletion lib/increase/models/pending_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ class CardholderAddress < Increase::Internal::Type::BaseModel
module Result
extend Increase::Internal::Type::Enum

# No adress was provided in the authorization request.
# No address was provided in the authorization request.
NOT_CHECKED = :not_checked

# Postal code matches, but the street address was not verified.
Expand Down
2 changes: 1 addition & 1 deletion lib/increase/models/real_time_decision.rb
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ class CardholderAddress < Increase::Internal::Type::BaseModel
module Result
extend Increase::Internal::Type::Enum

# No adress was provided in the authorization request.
# No address was provided in the authorization request.
NOT_CHECKED = :not_checked

# Postal code matches, but the street address was not verified.
Expand Down
2 changes: 1 addition & 1 deletion lib/increase/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Increase
VERSION = "0.1.0-alpha.3"
VERSION = "0.1.0-alpha.4"
end
4 changes: 2 additions & 2 deletions rbi/lib/increase/internal/page.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
module Increase
module Internal
class Page
include Increase::Internal::Type::BasePage

Elem = type_member

include Increase::Internal::Type::BasePage

sig { returns(T.nilable(T::Array[Elem])) }
attr_accessor :data

Expand Down
4 changes: 2 additions & 2 deletions rbi/lib/increase/internal/type/array_of.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module Increase
sig(:final) do
override
.params(value: T.any(
T::Enumerable[Elem],
T::Array[T.anything],
T.anything
),
state: Increase::Internal::Type::Converter::State)
Expand All @@ -52,7 +52,7 @@ module Increase
# @api private
sig(:final) do
override
.params(value: T.any(T::Enumerable[Elem], T.anything))
.params(value: T.any(T::Array[T.anything], T.anything))
.returns(T.any(T::Array[T.anything], T.anything))
end
def dump(value)
Expand Down
Loading
Loading