diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2761166..631daab8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/lithic-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 @@ -33,6 +34,7 @@ jobs: timeout-minutes: 10 name: test runs-on: ${{ github.repository == 'stainless-sdks/lithic-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 - name: Set up Ruby diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a696b6a7..154a6970 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.36" + ".": "0.1.0-alpha.37" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 9d2eb250..0ba2e3d4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 165 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-cf48017e61eb3ac8aeaaa9d933186532f476b2f3c7e12fa9c962d52e5a9a272b.yml -openapi_spec_hash: b58989fdc04768fc1eb758e180c5f128 -config_hash: e4d87bd83b304f6ab3f032db994e0093 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-bc4173417a899a1519326ae60cb481186c1a1c976f3d00b2b305278808db44cd.yml +openapi_spec_hash: 1c1dd981efeffb5276544baa34cf3d17 +config_hash: 1a83dceb58f6f525b19a5775018db7e8 diff --git a/CHANGELOG.md b/CHANGELOG.md index 811fc350..b0f8897c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.1.0-alpha.37 (2025-07-02) + +Full Changelog: [v0.1.0-alpha.36...v0.1.0-alpha.37](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.36...v0.1.0-alpha.37) + +### Features + +* **api:** api update ([95e6f93](https://github.com/lithic-com/lithic-ruby/commit/95e6f93cf300b9b2b96adaacc238da151d76bf06)) + + +### Chores + +* **ci:** only run for pushes and fork pull requests ([5e19b24](https://github.com/lithic-com/lithic-ruby/commit/5e19b24fcad22d51f01f3c26c82da029af648a3e)) +* **internal:** allow streams to also be unwrapped on a per-row basis ([99c6f00](https://github.com/lithic-com/lithic-ruby/commit/99c6f001da13f61889cd29108f5ac6f49d875263)) +* **internal:** manual updates ([05f1d5c](https://github.com/lithic-com/lithic-ruby/commit/05f1d5ceec90714c132c664035d658492c806653)) + ## 0.1.0-alpha.36 (2025-06-27) Full Changelog: [v0.1.0-alpha.35...v0.1.0-alpha.36](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.35...v0.1.0-alpha.36) diff --git a/Gemfile.lock b/Gemfile.lock index 002382d3..9bdef26d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - lithic (0.1.0.pre.alpha.36) + lithic (0.1.0.pre.alpha.37) connection_pool GEM diff --git a/README.md b/README.md index 9f3a7cb6..3ab52fcd 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "lithic", "~> 0.1.0.pre.alpha.36" +gem "lithic", "~> 0.1.0.pre.alpha.37" ``` diff --git a/lib/lithic/internal/transport/base_client.rb b/lib/lithic/internal/transport/base_client.rb index d5cbdcc0..f9354a95 100644 --- a/lib/lithic/internal/transport/base_client.rb +++ b/lib/lithic/internal/transport/base_client.rb @@ -471,6 +471,7 @@ def request(req) self.class.validate!(req) model = req.fetch(:model) { Lithic::Internal::Type::Unknown } opts = req[:options].to_h + unwrap = req[:unwrap] Lithic::RequestOptions.validate!(opts) request = build_request(req.except(:options), opts) url = request.fetch(:url) @@ -487,11 +488,18 @@ def request(req) decoded = Lithic::Internal::Util.decode_content(response, stream: stream) case req in {stream: Class => st} - st.new(model: model, url: url, status: status, response: response, stream: decoded) + st.new( + model: model, + url: url, + status: status, + response: response, + unwrap: unwrap, + stream: decoded + ) in {page: Class => page} page.new(client: self, req: req, headers: response, page_data: decoded) else - unwrapped = Lithic::Internal::Util.dig(decoded, req[:unwrap]) + unwrapped = Lithic::Internal::Util.dig(decoded, unwrap) Lithic::Internal::Type::Converter.coerce(model, unwrapped) end end diff --git a/lib/lithic/models/transaction.rb b/lib/lithic/models/transaction.rb index ea311143..aa92dc2c 100644 --- a/lib/lithic/models/transaction.rb +++ b/lib/lithic/models/transaction.rb @@ -1086,12 +1086,17 @@ class Event < Lithic::Internal::Type::BaseModel # @return [Symbol, Lithic::Models::Transaction::Event::Type] required :type, enum: -> { Lithic::Transaction::Event::Type } + # @!attribute account_type + # + # @return [Symbol, Lithic::Models::Transaction::Event::AccountType, nil] + optional :account_type, enum: -> { Lithic::Transaction::Event::AccountType } + # @!attribute network_specific_data # # @return [Lithic::Models::Transaction::Event::NetworkSpecificData, nil] optional :network_specific_data, -> { Lithic::Transaction::Event::NetworkSpecificData } - # @!method initialize(token:, amount:, amounts:, created:, detailed_results:, effective_polarity:, network_info:, result:, rule_results:, type:, network_specific_data: nil) + # @!method initialize(token:, amount:, amounts:, created:, detailed_results:, effective_polarity:, network_info:, result:, rule_results:, type:, account_type: nil, network_specific_data: nil) # Some parameter documentations has been truncated, see # {Lithic::Models::Transaction::Event} for more details. # @@ -1115,6 +1120,8 @@ class Event < Lithic::Internal::Type::BaseModel # # @param type [Symbol, Lithic::Models::Transaction::Event::Type] Type of transaction event # + # @param account_type [Symbol, Lithic::Models::Transaction::Event::AccountType] + # # @param network_specific_data [Lithic::Models::Transaction::Event::NetworkSpecificData] # @see Lithic::Models::Transaction::Event#amounts @@ -1633,6 +1640,17 @@ module Type # @return [Array] end + # @see Lithic::Models::Transaction::Event#account_type + module AccountType + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + # @see Lithic::Models::Transaction::Event#network_specific_data class NetworkSpecificData < Lithic::Internal::Type::BaseModel # @!attribute mastercard diff --git a/lib/lithic/version.rb b/lib/lithic/version.rb index 8f05cd7f..053026ec 100644 --- a/lib/lithic/version.rb +++ b/lib/lithic/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Lithic - VERSION = "0.1.0.pre.alpha.36" + VERSION = "0.1.0.pre.alpha.37" end diff --git a/rbi/lithic/models/transaction.rbi b/rbi/lithic/models/transaction.rbi index d11c8bd2..cc0f7935 100644 --- a/rbi/lithic/models/transaction.rbi +++ b/rbi/lithic/models/transaction.rbi @@ -2087,6 +2087,20 @@ module Lithic sig { returns(Lithic::Transaction::Event::Type::TaggedSymbol) } attr_accessor :type + sig do + returns( + T.nilable(Lithic::Transaction::Event::AccountType::TaggedSymbol) + ) + end + attr_reader :account_type + + sig do + params( + account_type: Lithic::Transaction::Event::AccountType::OrSymbol + ).void + end + attr_writer :account_type + sig do returns(T.nilable(Lithic::Transaction::Event::NetworkSpecificData)) end @@ -2116,6 +2130,7 @@ module Lithic rule_results: T::Array[Lithic::Transaction::Event::RuleResult::OrHash], type: Lithic::Transaction::Event::Type::OrSymbol, + account_type: Lithic::Transaction::Event::AccountType::OrSymbol, network_specific_data: Lithic::Transaction::Event::NetworkSpecificData::OrHash ).returns(T.attached_class) @@ -2145,6 +2160,7 @@ module Lithic rule_results:, # Type of transaction event type:, + account_type: nil, network_specific_data: nil ) end @@ -2166,6 +2182,8 @@ module Lithic result: Lithic::Transaction::Event::Result::TaggedSymbol, rule_results: T::Array[Lithic::Transaction::Event::RuleResult], type: Lithic::Transaction::Event::Type::TaggedSymbol, + account_type: + Lithic::Transaction::Event::AccountType::TaggedSymbol, network_specific_data: Lithic::Transaction::Event::NetworkSpecificData } @@ -3612,6 +3630,35 @@ module Lithic end end + module AccountType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Transaction::Event::AccountType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let( + :CHECKING, + Lithic::Transaction::Event::AccountType::TaggedSymbol + ) + SAVINGS = + T.let( + :SAVINGS, + Lithic::Transaction::Event::AccountType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::Transaction::Event::AccountType::TaggedSymbol] + ) + end + def self.values + end + end + class NetworkSpecificData < Lithic::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/sig/lithic/models/transaction.rbs b/sig/lithic/models/transaction.rbs index eb3281ff..aec1cc15 100644 --- a/sig/lithic/models/transaction.rbs +++ b/sig/lithic/models/transaction.rbs @@ -876,6 +876,7 @@ module Lithic result: Lithic::Models::Transaction::Event::result, rule_results: ::Array[Lithic::Transaction::Event::RuleResult], type: Lithic::Models::Transaction::Event::type_, + account_type: Lithic::Models::Transaction::Event::account_type, network_specific_data: Lithic::Transaction::Event::NetworkSpecificData } @@ -900,6 +901,12 @@ module Lithic attr_accessor type: Lithic::Models::Transaction::Event::type_ + attr_reader account_type: Lithic::Models::Transaction::Event::account_type? + + def account_type=: ( + Lithic::Models::Transaction::Event::account_type + ) -> Lithic::Models::Transaction::Event::account_type + attr_reader network_specific_data: Lithic::Transaction::Event::NetworkSpecificData? def network_specific_data=: ( @@ -917,6 +924,7 @@ module Lithic result: Lithic::Models::Transaction::Event::result, rule_results: ::Array[Lithic::Transaction::Event::RuleResult], type: Lithic::Models::Transaction::Event::type_, + ?account_type: Lithic::Models::Transaction::Event::account_type, ?network_specific_data: Lithic::Transaction::Event::NetworkSpecificData ) -> void @@ -931,6 +939,7 @@ module Lithic result: Lithic::Models::Transaction::Event::result, rule_results: ::Array[Lithic::Transaction::Event::RuleResult], type: Lithic::Models::Transaction::Event::type_, + account_type: Lithic::Models::Transaction::Event::account_type, network_specific_data: Lithic::Transaction::Event::NetworkSpecificData } @@ -1504,6 +1513,17 @@ module Lithic def self?.values: -> ::Array[Lithic::Models::Transaction::Event::type_] end + type account_type = :CHECKING | :SAVINGS + + module AccountType + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::Transaction::Event::account_type] + end + type network_specific_data = { mastercard: Lithic::Transaction::Event::NetworkSpecificData::Mastercard, diff --git a/test/lithic/resources/account_holders_test.rb b/test/lithic/resources/account_holders_test.rb index d4f5109b..d1c892c4 100644 --- a/test/lithic/resources/account_holders_test.rb +++ b/test/lithic/resources/account_holders_test.rb @@ -165,7 +165,7 @@ def test_retrieve_document_required_params def test_simulate_enrollment_document_review_required_params response = @lithic.account_holders.simulate_enrollment_document_review( - document_upload_token: "b11cd67b-0a52-4180-8365-314f3def5426", + document_upload_token: "document_upload_token", status: :UPLOADED )