From a1bdc99fe97c31fcff475e4e46d9cba65893c4f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 10:56:51 +0000 Subject: [PATCH 1/4] chore(client): send user-agent header --- lib/finch_api/internal/transport/base_client.rb | 8 +++++++- rbi/finch_api/internal/transport/base_client.rbi | 5 +++++ sig/finch_api/internal/transport/base_client.rbs | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/finch_api/internal/transport/base_client.rb b/lib/finch_api/internal/transport/base_client.rb index d6d5a3e9..af133bbc 100644 --- a/lib/finch_api/internal/transport/base_client.rb +++ b/lib/finch_api/internal/transport/base_client.rb @@ -201,7 +201,8 @@ def initialize( self.class::PLATFORM_HEADERS, { "accept" => "application/json", - "content-type" => "application/json" + "content-type" => "application/json", + "user-agent" => user_agent }, headers ) @@ -219,6 +220,11 @@ def initialize( # @return [Hash{String=>String}] private def auth_headers = {} + # @api private + # + # @return [String] + private def user_agent = "#{self.class.name}/Ruby #{FinchAPI::VERSION}" + # @api private # # @return [String] diff --git a/rbi/finch_api/internal/transport/base_client.rbi b/rbi/finch_api/internal/transport/base_client.rbi index 061306c6..3f33b2f5 100644 --- a/rbi/finch_api/internal/transport/base_client.rbi +++ b/rbi/finch_api/internal/transport/base_client.rbi @@ -176,6 +176,11 @@ module FinchAPI private def auth_headers end + # @api private + sig { returns(String) } + private def user_agent + end + # @api private sig { returns(String) } private def generate_idempotency_key diff --git a/sig/finch_api/internal/transport/base_client.rbs b/sig/finch_api/internal/transport/base_client.rbs index f901f932..70cd492e 100644 --- a/sig/finch_api/internal/transport/base_client.rbs +++ b/sig/finch_api/internal/transport/base_client.rbs @@ -87,6 +87,8 @@ module FinchAPI private def auth_headers: -> ::Hash[String, String] + private def user_agent: -> String + private def generate_idempotency_key: -> String private def build_request: ( From e2215daac58922a19f110eb71249f5b0480bcfd4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 17:37:38 +0000 Subject: [PATCH 2/4] feat(api): api update --- .stats.yml | 4 +- .../models/connect/session_new_params.rb | 104 ++++---- .../connect/session_reauthenticate_params.rb | 10 +- lib/finch_api/resources/connect/sessions.rb | 12 +- .../models/connect/session_new_params.rbi | 224 +++++++++--------- .../connect/session_reauthenticate_params.rbi | 13 +- rbi/finch_api/resources/connect/sessions.rbi | 30 +-- .../models/connect/session_new_params.rbs | 98 ++++---- .../connect/session_reauthenticate_params.rbs | 10 +- sig/finch_api/resources/connect/sessions.rbs | 18 +- .../resources/connect/sessions_test.rb | 21 +- 11 files changed, 266 insertions(+), 278 deletions(-) diff --git a/.stats.yml b/.stats.yml index 906bc775..6dc87a14 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 46 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-0105d239fcaf84750c886dfa6c2cfbf2b2087f89a48f8827c4cbe28479ebfb13.yml -openapi_spec_hash: 34895c3d3c137fb9f5a019ac5370afbb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-b817e7a30a6366c063a8c9a334d5be281eb8d93e21acc8c8219d3bdc95043deb.yml +openapi_spec_hash: d4cc4a5cba9f13986e38d148d330aa00 config_hash: 5c64f384746e7570c10f19fe241062a7 diff --git a/lib/finch_api/models/connect/session_new_params.rb b/lib/finch_api/models/connect/session_new_params.rb index 88dad917..d42fea1b 100644 --- a/lib/finch_api/models/connect/session_new_params.rb +++ b/lib/finch_api/models/connect/session_new_params.rb @@ -8,12 +8,6 @@ class SessionNewParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters - # @!attribute customer_email - # Email address of the customer - # - # @return [String, nil] - required :customer_email, String, nil?: true - # @!attribute customer_id # Unique identifier for the customer # @@ -26,89 +20,114 @@ class SessionNewParams < FinchAPI::Internal::Type::BaseModel # @return [String] required :customer_name, String + # @!attribute products + # The Finch products to request access to + # + # @return [Array] + required :products, + -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Connect::SessionNewParams::Product] } + + # @!attribute customer_email + # Email address of the customer + # + # @return [String, nil] + optional :customer_email, String, nil?: true + # @!attribute integration # Integration configuration for the connect session # # @return [FinchAPI::Models::Connect::SessionNewParams::Integration, nil] - required :integration, -> { FinchAPI::Connect::SessionNewParams::Integration }, nil?: true + optional :integration, -> { FinchAPI::Connect::SessionNewParams::Integration }, nil?: true # @!attribute manual # Enable manual authentication mode # # @return [Boolean, nil] - required :manual, FinchAPI::Internal::Type::Boolean, nil?: true + optional :manual, FinchAPI::Internal::Type::Boolean, nil?: true # @!attribute minutes_to_expire # The number of minutes until the session expires (defaults to 129,600, which is # 90 days) # # @return [Float, nil] - required :minutes_to_expire, Float, nil?: true - - # @!attribute products - # The Finch products to request access to - # - # @return [Array] - required :products, - -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Connect::SessionNewParams::Product] } + optional :minutes_to_expire, Float, nil?: true # @!attribute redirect_uri # The URI to redirect to after the Connect flow is completed # # @return [String, nil] - required :redirect_uri, String, nil?: true + optional :redirect_uri, String, nil?: true # @!attribute sandbox # Sandbox mode for testing # # @return [Symbol, FinchAPI::Models::Connect::SessionNewParams::Sandbox, nil] - required :sandbox, enum: -> { FinchAPI::Connect::SessionNewParams::Sandbox }, nil?: true + optional :sandbox, enum: -> { FinchAPI::Connect::SessionNewParams::Sandbox }, nil?: true - # @!method initialize(customer_email:, customer_id:, customer_name:, integration:, manual:, minutes_to_expire:, products:, redirect_uri:, sandbox:, request_options: {}) + # @!method initialize(customer_id:, customer_name:, products:, customer_email: nil, integration: nil, manual: nil, minutes_to_expire: nil, redirect_uri: nil, sandbox: nil, request_options: {}) # Some parameter documentations has been truncated, see # {FinchAPI::Models::Connect::SessionNewParams} for more details. # - # @param customer_email [String, nil] Email address of the customer - # # @param customer_id [String] Unique identifier for the customer # # @param customer_name [String] Name of the customer # + # @param products [Array] The Finch products to request access to + # + # @param customer_email [String, nil] Email address of the customer + # # @param integration [FinchAPI::Models::Connect::SessionNewParams::Integration, nil] Integration configuration for the connect session # # @param manual [Boolean, nil] Enable manual authentication mode # # @param minutes_to_expire [Float, nil] The number of minutes until the session expires (defaults to 129,600, which is 9 # - # @param products [Array] The Finch products to request access to - # # @param redirect_uri [String, nil] The URI to redirect to after the Connect flow is completed # # @param sandbox [Symbol, FinchAPI::Models::Connect::SessionNewParams::Sandbox, nil] Sandbox mode for testing # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # The Finch products that can be requested during the Connect flow. + module Product + extend FinchAPI::Internal::Type::Enum + + BENEFITS = :benefits + COMPANY = :company + DEDUCTION = :deduction + DIRECTORY = :directory + DOCUMENTS = :documents + EMPLOYMENT = :employment + INDIVIDUAL = :individual + PAYMENT = :payment + PAY_STATEMENT = :pay_statement + SSN = :ssn + + # @!method self.values + # @return [Array] + end + class Integration < FinchAPI::Internal::Type::BaseModel + # @!attribute provider + # The provider to integrate with + # + # @return [String] + required :provider, String + # @!attribute auth_method # The authentication method to use # # @return [Symbol, FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod, nil] - required :auth_method, + optional :auth_method, enum: -> { FinchAPI::Connect::SessionNewParams::Integration::AuthMethod }, nil?: true - # @!attribute provider - # The provider to integrate with - # - # @return [String, nil] - required :provider, String, nil?: true - - # @!method initialize(auth_method:, provider:) + # @!method initialize(provider:, auth_method: nil) # Integration configuration for the connect session # - # @param auth_method [Symbol, FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod, nil] The authentication method to use + # @param provider [String] The provider to integrate with # - # @param provider [String, nil] The provider to integrate with + # @param auth_method [Symbol, FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod, nil] The authentication method to use # The authentication method to use # @@ -126,25 +145,6 @@ module AuthMethod end end - # The Finch products that can be requested during the Connect flow. - module Product - extend FinchAPI::Internal::Type::Enum - - BENEFITS = :benefits - COMPANY = :company - DEDUCTION = :deduction - DIRECTORY = :directory - DOCUMENTS = :documents - EMPLOYMENT = :employment - INDIVIDUAL = :individual - PAYMENT = :payment - PAY_STATEMENT = :pay_statement - SSN = :ssn - - # @!method self.values - # @return [Array] - end - # Sandbox mode for testing module Sandbox extend FinchAPI::Internal::Type::Enum diff --git a/lib/finch_api/models/connect/session_reauthenticate_params.rb b/lib/finch_api/models/connect/session_reauthenticate_params.rb index 2fe9d045..638d108b 100644 --- a/lib/finch_api/models/connect/session_reauthenticate_params.rb +++ b/lib/finch_api/models/connect/session_reauthenticate_params.rb @@ -18,14 +18,14 @@ class SessionReauthenticateParams < FinchAPI::Internal::Type::BaseModel # The number of minutes until the session expires (defaults to 43,200, which is 30 # days) # - # @return [Integer] - required :minutes_to_expire, Integer + # @return [Integer, nil] + optional :minutes_to_expire, Integer # @!attribute products # The products to request access to (optional for reauthentication) # # @return [Array, nil] - required :products, + optional :products, -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Connect::SessionReauthenticateParams::Product] }, @@ -35,9 +35,9 @@ class SessionReauthenticateParams < FinchAPI::Internal::Type::BaseModel # The URI to redirect to after the Connect flow is completed # # @return [String, nil] - required :redirect_uri, String, nil?: true + optional :redirect_uri, String, nil?: true - # @!method initialize(connection_id:, minutes_to_expire:, products:, redirect_uri:, request_options: {}) + # @!method initialize(connection_id:, minutes_to_expire: nil, products: nil, redirect_uri: nil, request_options: {}) # Some parameter documentations has been truncated, see # {FinchAPI::Models::Connect::SessionReauthenticateParams} for more details. # diff --git a/lib/finch_api/resources/connect/sessions.rb b/lib/finch_api/resources/connect/sessions.rb index df010dd6..3d850a1f 100644 --- a/lib/finch_api/resources/connect/sessions.rb +++ b/lib/finch_api/resources/connect/sessions.rb @@ -9,22 +9,22 @@ class Sessions # # Create a new connect session for an employer # - # @overload new(customer_email:, customer_id:, customer_name:, integration:, manual:, minutes_to_expire:, products:, redirect_uri:, sandbox:, request_options: {}) - # - # @param customer_email [String, nil] Email address of the customer + # @overload new(customer_id:, customer_name:, products:, customer_email: nil, integration: nil, manual: nil, minutes_to_expire: nil, redirect_uri: nil, sandbox: nil, request_options: {}) # # @param customer_id [String] Unique identifier for the customer # # @param customer_name [String] Name of the customer # + # @param products [Array] The Finch products to request access to + # + # @param customer_email [String, nil] Email address of the customer + # # @param integration [FinchAPI::Models::Connect::SessionNewParams::Integration, nil] Integration configuration for the connect session # # @param manual [Boolean, nil] Enable manual authentication mode # # @param minutes_to_expire [Float, nil] The number of minutes until the session expires (defaults to 129,600, which is 9 # - # @param products [Array] The Finch products to request access to - # # @param redirect_uri [String, nil] The URI to redirect to after the Connect flow is completed # # @param sandbox [Symbol, FinchAPI::Models::Connect::SessionNewParams::Sandbox, nil] Sandbox mode for testing @@ -50,7 +50,7 @@ def new(params) # # Create a new Connect session for reauthenticating an existing connection # - # @overload reauthenticate(connection_id:, minutes_to_expire:, products:, redirect_uri:, request_options: {}) + # @overload reauthenticate(connection_id:, minutes_to_expire: nil, products: nil, redirect_uri: nil, request_options: {}) # # @param connection_id [String] The ID of the existing connection to reauthenticate # diff --git a/rbi/finch_api/models/connect/session_new_params.rbi b/rbi/finch_api/models/connect/session_new_params.rbi index e209450d..de4f214d 100644 --- a/rbi/finch_api/models/connect/session_new_params.rbi +++ b/rbi/finch_api/models/connect/session_new_params.rbi @@ -15,10 +15,6 @@ module FinchAPI ) end - # Email address of the customer - sig { returns(T.nilable(String)) } - attr_accessor :customer_email - # Unique identifier for the customer sig { returns(String) } attr_accessor :customer_id @@ -27,6 +23,18 @@ module FinchAPI sig { returns(String) } attr_accessor :customer_name + # The Finch products to request access to + sig do + returns( + T::Array[FinchAPI::Connect::SessionNewParams::Product::OrSymbol] + ) + end + attr_accessor :products + + # Email address of the customer + sig { returns(T.nilable(String)) } + attr_accessor :customer_email + # Integration configuration for the connect session sig do returns(T.nilable(FinchAPI::Connect::SessionNewParams::Integration)) @@ -52,14 +60,6 @@ module FinchAPI sig { returns(T.nilable(Float)) } attr_accessor :minutes_to_expire - # The Finch products to request access to - sig do - returns( - T::Array[FinchAPI::Connect::SessionNewParams::Product::OrSymbol] - ) - end - attr_accessor :products - # The URI to redirect to after the Connect flow is completed sig { returns(T.nilable(String)) } attr_accessor :redirect_uri @@ -74,17 +74,17 @@ module FinchAPI sig do params( - customer_email: T.nilable(String), customer_id: String, customer_name: String, + products: + T::Array[FinchAPI::Connect::SessionNewParams::Product::OrSymbol], + customer_email: T.nilable(String), integration: T.nilable( FinchAPI::Connect::SessionNewParams::Integration::OrHash ), manual: T.nilable(T::Boolean), minutes_to_expire: T.nilable(Float), - products: - T::Array[FinchAPI::Connect::SessionNewParams::Product::OrSymbol], redirect_uri: T.nilable(String), sandbox: T.nilable(FinchAPI::Connect::SessionNewParams::Sandbox::OrSymbol), @@ -92,25 +92,25 @@ module FinchAPI ).returns(T.attached_class) end def self.new( - # Email address of the customer - customer_email:, # Unique identifier for the customer customer_id:, # Name of the customer customer_name:, + # The Finch products to request access to + products:, + # Email address of the customer + customer_email: nil, # Integration configuration for the connect session - integration:, + integration: nil, # Enable manual authentication mode - manual:, + manual: nil, # The number of minutes until the session expires (defaults to 129,600, which is # 90 days) - minutes_to_expire:, - # The Finch products to request access to - products:, + minutes_to_expire: nil, # The URI to redirect to after the Connect flow is completed - redirect_uri:, + redirect_uri: nil, # Sandbox mode for testing - sandbox:, + sandbox: nil, request_options: {} ) end @@ -118,17 +118,17 @@ module FinchAPI sig do override.returns( { - customer_email: T.nilable(String), customer_id: String, customer_name: String, - integration: - T.nilable(FinchAPI::Connect::SessionNewParams::Integration), - manual: T.nilable(T::Boolean), - minutes_to_expire: T.nilable(Float), products: T::Array[ FinchAPI::Connect::SessionNewParams::Product::OrSymbol ], + customer_email: T.nilable(String), + integration: + T.nilable(FinchAPI::Connect::SessionNewParams::Integration), + manual: T.nilable(T::Boolean), + minutes_to_expire: T.nilable(Float), redirect_uri: T.nilable(String), sandbox: T.nilable( @@ -141,6 +141,78 @@ module FinchAPI def to_hash end + # The Finch products that can be requested during the Connect flow. + module Product + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, FinchAPI::Connect::SessionNewParams::Product) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BENEFITS = + T.let( + :benefits, + FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol + ) + COMPANY = + T.let( + :company, + FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol + ) + DEDUCTION = + T.let( + :deduction, + FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol + ) + DIRECTORY = + T.let( + :directory, + FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol + ) + DOCUMENTS = + T.let( + :documents, + FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol + ) + EMPLOYMENT = + T.let( + :employment, + FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol + ) + INDIVIDUAL = + T.let( + :individual, + FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol + ) + PAYMENT = + T.let( + :payment, + FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol + ) + PAY_STATEMENT = + T.let( + :pay_statement, + FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol + ) + SSN = + T.let( + :ssn, + FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol + ] + ) + end + def self.values + end + end + class Integration < FinchAPI::Internal::Type::BaseModel OrHash = T.type_alias do @@ -150,6 +222,10 @@ module FinchAPI ) end + # The provider to integrate with + sig { returns(String) } + attr_accessor :provider + # The authentication method to use sig do returns( @@ -160,36 +236,32 @@ module FinchAPI end attr_accessor :auth_method - # The provider to integrate with - sig { returns(T.nilable(String)) } - attr_accessor :provider - # Integration configuration for the connect session sig do params( + provider: String, auth_method: T.nilable( FinchAPI::Connect::SessionNewParams::Integration::AuthMethod::OrSymbol - ), - provider: T.nilable(String) + ) ).returns(T.attached_class) end def self.new( - # The authentication method to use - auth_method:, # The provider to integrate with - provider: + provider:, + # The authentication method to use + auth_method: nil ) end sig do override.returns( { + provider: String, auth_method: T.nilable( FinchAPI::Connect::SessionNewParams::Integration::AuthMethod::OrSymbol - ), - provider: T.nilable(String) + ) } ) end @@ -242,78 +314,6 @@ module FinchAPI end end - # The Finch products that can be requested during the Connect flow. - module Product - extend FinchAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, FinchAPI::Connect::SessionNewParams::Product) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - BENEFITS = - T.let( - :benefits, - FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol - ) - COMPANY = - T.let( - :company, - FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol - ) - DEDUCTION = - T.let( - :deduction, - FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol - ) - DIRECTORY = - T.let( - :directory, - FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol - ) - DOCUMENTS = - T.let( - :documents, - FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol - ) - EMPLOYMENT = - T.let( - :employment, - FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol - ) - INDIVIDUAL = - T.let( - :individual, - FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol - ) - PAYMENT = - T.let( - :payment, - FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol - ) - PAY_STATEMENT = - T.let( - :pay_statement, - FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol - ) - SSN = - T.let( - :ssn, - FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - FinchAPI::Connect::SessionNewParams::Product::TaggedSymbol - ] - ) - end - def self.values - end - end - # Sandbox mode for testing module Sandbox extend FinchAPI::Internal::Type::Enum diff --git a/rbi/finch_api/models/connect/session_reauthenticate_params.rbi b/rbi/finch_api/models/connect/session_reauthenticate_params.rbi index 6facaac7..e47555a4 100644 --- a/rbi/finch_api/models/connect/session_reauthenticate_params.rbi +++ b/rbi/finch_api/models/connect/session_reauthenticate_params.rbi @@ -21,8 +21,11 @@ module FinchAPI # The number of minutes until the session expires (defaults to 43,200, which is 30 # days) - sig { returns(Integer) } - attr_accessor :minutes_to_expire + sig { returns(T.nilable(Integer)) } + attr_reader :minutes_to_expire + + sig { params(minutes_to_expire: Integer).void } + attr_writer :minutes_to_expire # The products to request access to (optional for reauthentication) sig do @@ -59,11 +62,11 @@ module FinchAPI connection_id:, # The number of minutes until the session expires (defaults to 43,200, which is 30 # days) - minutes_to_expire:, + minutes_to_expire: nil, # The products to request access to (optional for reauthentication) - products:, + products: nil, # The URI to redirect to after the Connect flow is completed - redirect_uri:, + redirect_uri: nil, request_options: {} ) end diff --git a/rbi/finch_api/resources/connect/sessions.rbi b/rbi/finch_api/resources/connect/sessions.rbi index bd60287f..4975322f 100644 --- a/rbi/finch_api/resources/connect/sessions.rbi +++ b/rbi/finch_api/resources/connect/sessions.rbi @@ -7,17 +7,17 @@ module FinchAPI # Create a new connect session for an employer sig do params( - customer_email: T.nilable(String), customer_id: String, customer_name: String, + products: + T::Array[FinchAPI::Connect::SessionNewParams::Product::OrSymbol], + customer_email: T.nilable(String), integration: T.nilable( FinchAPI::Connect::SessionNewParams::Integration::OrHash ), manual: T.nilable(T::Boolean), minutes_to_expire: T.nilable(Float), - products: - T::Array[FinchAPI::Connect::SessionNewParams::Product::OrSymbol], redirect_uri: T.nilable(String), sandbox: T.nilable(FinchAPI::Connect::SessionNewParams::Sandbox::OrSymbol), @@ -25,25 +25,25 @@ module FinchAPI ).returns(FinchAPI::Models::Connect::SessionNewResponse) end def new( - # Email address of the customer - customer_email:, # Unique identifier for the customer customer_id:, # Name of the customer customer_name:, + # The Finch products to request access to + products:, + # Email address of the customer + customer_email: nil, # Integration configuration for the connect session - integration:, + integration: nil, # Enable manual authentication mode - manual:, + manual: nil, # The number of minutes until the session expires (defaults to 129,600, which is # 90 days) - minutes_to_expire:, - # The Finch products to request access to - products:, + minutes_to_expire: nil, # The URI to redirect to after the Connect flow is completed - redirect_uri:, + redirect_uri: nil, # Sandbox mode for testing - sandbox:, + sandbox: nil, request_options: {} ) end @@ -68,11 +68,11 @@ module FinchAPI connection_id:, # The number of minutes until the session expires (defaults to 43,200, which is 30 # days) - minutes_to_expire:, + minutes_to_expire: nil, # The products to request access to (optional for reauthentication) - products:, + products: nil, # The URI to redirect to after the Connect flow is completed - redirect_uri:, + redirect_uri: nil, request_options: {} ) end diff --git a/sig/finch_api/models/connect/session_new_params.rbs b/sig/finch_api/models/connect/session_new_params.rbs index 9f2b894b..6773915e 100644 --- a/sig/finch_api/models/connect/session_new_params.rbs +++ b/sig/finch_api/models/connect/session_new_params.rbs @@ -3,13 +3,13 @@ module FinchAPI module Connect type session_new_params = { - customer_email: String?, customer_id: String, customer_name: String, + products: ::Array[FinchAPI::Models::Connect::SessionNewParams::product], + customer_email: String?, integration: FinchAPI::Connect::SessionNewParams::Integration?, manual: bool?, minutes_to_expire: Float?, - products: ::Array[FinchAPI::Models::Connect::SessionNewParams::product], redirect_uri: String?, sandbox: FinchAPI::Models::Connect::SessionNewParams::sandbox? } @@ -19,85 +19,50 @@ module FinchAPI extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters - attr_accessor customer_email: String? - attr_accessor customer_id: String attr_accessor customer_name: String + attr_accessor products: ::Array[FinchAPI::Models::Connect::SessionNewParams::product] + + attr_accessor customer_email: String? + attr_accessor integration: FinchAPI::Connect::SessionNewParams::Integration? attr_accessor manual: bool? attr_accessor minutes_to_expire: Float? - attr_accessor products: ::Array[FinchAPI::Models::Connect::SessionNewParams::product] - attr_accessor redirect_uri: String? attr_accessor sandbox: FinchAPI::Models::Connect::SessionNewParams::sandbox? def initialize: ( - customer_email: String?, customer_id: String, customer_name: String, - integration: FinchAPI::Connect::SessionNewParams::Integration?, - manual: bool?, - minutes_to_expire: Float?, products: ::Array[FinchAPI::Models::Connect::SessionNewParams::product], - redirect_uri: String?, - sandbox: FinchAPI::Models::Connect::SessionNewParams::sandbox?, + ?customer_email: String?, + ?integration: FinchAPI::Connect::SessionNewParams::Integration?, + ?manual: bool?, + ?minutes_to_expire: Float?, + ?redirect_uri: String?, + ?sandbox: FinchAPI::Models::Connect::SessionNewParams::sandbox?, ?request_options: FinchAPI::request_opts ) -> void def to_hash: -> { - customer_email: String?, customer_id: String, customer_name: String, + products: ::Array[FinchAPI::Models::Connect::SessionNewParams::product], + customer_email: String?, integration: FinchAPI::Connect::SessionNewParams::Integration?, manual: bool?, minutes_to_expire: Float?, - products: ::Array[FinchAPI::Models::Connect::SessionNewParams::product], redirect_uri: String?, sandbox: FinchAPI::Models::Connect::SessionNewParams::sandbox?, request_options: FinchAPI::RequestOptions } - type integration = - { - auth_method: FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method?, - provider: String? - } - - class Integration < FinchAPI::Internal::Type::BaseModel - attr_accessor auth_method: FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method? - - attr_accessor provider: String? - - def initialize: ( - auth_method: FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method?, - provider: String? - ) -> void - - def to_hash: -> { - auth_method: FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method?, - provider: String? - } - - type auth_method = :assisted | :credential | :oauth | :api_token - - module AuthMethod - extend FinchAPI::Internal::Type::Enum - - ASSISTED: :assisted - CREDENTIAL: :credential - OAUTH: :oauth - API_TOKEN: :api_token - - def self?.values: -> ::Array[FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method] - end - end - type product = :benefits | :company @@ -127,6 +92,41 @@ module FinchAPI def self?.values: -> ::Array[FinchAPI::Models::Connect::SessionNewParams::product] end + type integration = + { + provider: String, + auth_method: FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method? + } + + class Integration < FinchAPI::Internal::Type::BaseModel + attr_accessor provider: String + + attr_accessor auth_method: FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method? + + def initialize: ( + provider: String, + ?auth_method: FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method? + ) -> void + + def to_hash: -> { + provider: String, + auth_method: FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method? + } + + type auth_method = :assisted | :credential | :oauth | :api_token + + module AuthMethod + extend FinchAPI::Internal::Type::Enum + + ASSISTED: :assisted + CREDENTIAL: :credential + OAUTH: :oauth + API_TOKEN: :api_token + + def self?.values: -> ::Array[FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method] + end + end + type sandbox = :finch | :provider module Sandbox diff --git a/sig/finch_api/models/connect/session_reauthenticate_params.rbs b/sig/finch_api/models/connect/session_reauthenticate_params.rbs index 8c8d277a..a61c187d 100644 --- a/sig/finch_api/models/connect/session_reauthenticate_params.rbs +++ b/sig/finch_api/models/connect/session_reauthenticate_params.rbs @@ -16,7 +16,9 @@ module FinchAPI attr_accessor connection_id: String - attr_accessor minutes_to_expire: Integer + attr_reader minutes_to_expire: Integer? + + def minutes_to_expire=: (Integer) -> Integer attr_accessor products: ::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::product]? @@ -24,9 +26,9 @@ module FinchAPI def initialize: ( connection_id: String, - minutes_to_expire: Integer, - products: ::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::product]?, - redirect_uri: String?, + ?minutes_to_expire: Integer, + ?products: ::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::product]?, + ?redirect_uri: String?, ?request_options: FinchAPI::request_opts ) -> void diff --git a/sig/finch_api/resources/connect/sessions.rbs b/sig/finch_api/resources/connect/sessions.rbs index 884fdd08..b4204b8d 100644 --- a/sig/finch_api/resources/connect/sessions.rbs +++ b/sig/finch_api/resources/connect/sessions.rbs @@ -3,23 +3,23 @@ module FinchAPI class Connect class Sessions def new: ( - customer_email: String?, customer_id: String, customer_name: String, - integration: FinchAPI::Connect::SessionNewParams::Integration?, - manual: bool?, - minutes_to_expire: Float?, products: ::Array[FinchAPI::Models::Connect::SessionNewParams::product], - redirect_uri: String?, - sandbox: FinchAPI::Models::Connect::SessionNewParams::sandbox?, + ?customer_email: String?, + ?integration: FinchAPI::Connect::SessionNewParams::Integration?, + ?manual: bool?, + ?minutes_to_expire: Float?, + ?redirect_uri: String?, + ?sandbox: FinchAPI::Models::Connect::SessionNewParams::sandbox?, ?request_options: FinchAPI::request_opts ) -> FinchAPI::Models::Connect::SessionNewResponse def reauthenticate: ( connection_id: String, - minutes_to_expire: Integer, - products: ::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::product]?, - redirect_uri: String?, + ?minutes_to_expire: Integer, + ?products: ::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::product]?, + ?redirect_uri: String?, ?request_options: FinchAPI::request_opts ) -> FinchAPI::Models::Connect::SessionReauthenticateResponse diff --git a/test/finch_api/resources/connect/sessions_test.rb b/test/finch_api/resources/connect/sessions_test.rb index e51c7d7f..874476f9 100644 --- a/test/finch_api/resources/connect/sessions_test.rb +++ b/test/finch_api/resources/connect/sessions_test.rb @@ -6,18 +6,7 @@ class FinchAPI::Test::Resources::Connect::SessionsTest < FinchAPI::Test::Resourc def test_new_required_params skip("prism tests are broken") - response = - @finch.connect.sessions.new( - customer_email: "dev@stainless.com", - customer_id: "x", - customer_name: "x", - integration: {auth_method: :assisted, provider: "provider"}, - manual: true, - minutes_to_expire: 1, - products: [:benefits], - redirect_uri: "redirect_uri", - sandbox: :finch - ) + response = @finch.connect.sessions.new(customer_id: "x", customer_name: "x", products: [:benefits]) assert_pattern do response => FinchAPI::Models::Connect::SessionNewResponse @@ -34,13 +23,7 @@ def test_new_required_params def test_reauthenticate_required_params skip("prism tests are broken") - response = - @finch.connect.sessions.reauthenticate( - connection_id: "connection_id", - minutes_to_expire: 0, - products: [:benefits], - redirect_uri: "https://example.com" - ) + response = @finch.connect.sessions.reauthenticate(connection_id: "connection_id") assert_pattern do response => FinchAPI::Models::Connect::SessionReauthenticateResponse From 82af1496618cbd69a049591e5fcaca45907f3fa4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 21:49:20 +0000 Subject: [PATCH 3/4] chore: bump dependency version and update sorbet types --- Gemfile | 3 +- Gemfile.lock | 82 +++++++++++----------- rbi/finch_api/internal/type/base_model.rbi | 12 ++-- 3 files changed, 50 insertions(+), 47 deletions(-) diff --git a/Gemfile b/Gemfile index 0d76364b..1be178cb 100644 --- a/Gemfile +++ b/Gemfile @@ -11,8 +11,7 @@ group :development do gem "sorbet" gem "steep" gem "syntax_tree" - # TODO: using a fork for now, the prettier below has a bug - gem "syntax_tree-rbs", github: "stainless-api/syntax_tree-rbs", branch: "main" + gem "syntax_tree-rbs", github: "ruby-syntax-tree/syntax_tree-rbs", branch: "main" gem "tapioca" end diff --git a/Gemfile.lock b/Gemfile.lock index 4ced77ca..f2ba3a8a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT - remote: https://github.com/stainless-api/syntax_tree-rbs.git - revision: c30b50219918be7cfe3ef803a00b59d1e77fcada + remote: https://github.com/ruby-syntax-tree/syntax_tree-rbs.git + revision: f94bc3060682ffbd126e4d5086ffedc89073d626 branch: main specs: syntax_tree-rbs (1.0.0) @@ -17,14 +17,14 @@ PATH GEM remote: https://rubygems.org/ specs: - activesupport (8.0.2.1) + activesupport (8.1.1) base64 - benchmark (>= 0.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + json logger (>= 1.4.2) minitest (>= 5.1) securerandom (>= 0.3) @@ -33,22 +33,22 @@ GEM addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.3) - async (2.27.3) + async (2.34.0) console (~> 1.29) fiber-annotation io-event (~> 1.11) metrics (~> 0.12) - traces (~> 0.15) + traces (~> 0.18) base64 (0.3.0) - benchmark (0.4.1) - bigdecimal (3.2.2) + benchmark (0.5.0) + bigdecimal (3.3.1) concurrent-ruby (1.3.5) - connection_pool (2.5.3) - console (1.33.0) + connection_pool (2.5.4) + console (1.34.2) fiber-annotation fiber-local (~> 1.1) json - crack (1.0.0) + crack (1.0.1) bigdecimal rexml csv (3.3.5) @@ -64,20 +64,20 @@ GEM fiber-local (1.1.0) fiber-storage fiber-storage (1.0.1) - fileutils (1.7.3) - hashdiff (1.2.0) + fileutils (1.8.0) + hashdiff (1.2.1) i18n (1.14.7) concurrent-ruby (~> 1.0) io-event (1.11.2) - json (2.13.2) + json (2.15.2) language_server-protocol (3.17.0.5) lint_roller (1.1.0) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) - metrics (0.13.0) - minitest (5.25.5) + metrics (0.15.0) + minitest (5.26.0) minitest-focus (1.4.0) minitest (>= 4, < 6) minitest-hooks (1.5.2) @@ -89,27 +89,27 @@ GEM mutex_m (0.3.0) netrc (0.11.0) parallel (1.27.0) - parser (3.3.9.0) + parser (3.3.10.0) ast (~> 2.4.1) racc prettier_print (1.2.1) - prism (1.4.0) + prism (1.6.0) public_suffix (6.0.2) racc (1.8.1) rainbow (3.1.1) - rake (13.3.0) + rake (13.3.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rbi (0.3.6) + rbi (0.3.7) prism (~> 1.0) rbs (>= 3.4.4) - rbs (3.9.4) + rbs (3.9.5) logger redcarpet (3.6.1) - regexp_parser (2.11.2) - rexml (3.4.1) - rubocop (1.79.2) + regexp_parser (2.11.3) + rexml (3.4.4) + rubocop (1.81.7) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -117,23 +117,23 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.46.0, < 2.0) + rubocop-ast (>= 1.47.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.46.0) + rubocop-ast (1.47.1) parser (>= 3.3.7.2) prism (~> 1.4) ruby-progressbar (1.13.0) securerandom (0.4.1) - sorbet (0.5.12424) - sorbet-static (= 0.5.12424) - sorbet-runtime (0.5.12424) - sorbet-static (0.5.12424-aarch64-linux) - sorbet-static (0.5.12424-universal-darwin) - sorbet-static (0.5.12424-x86_64-linux) - sorbet-static-and-runtime (0.5.12424) - sorbet (= 0.5.12424) - sorbet-runtime (= 0.5.12424) + sorbet (0.6.12690) + sorbet-static (= 0.6.12690) + sorbet-runtime (0.6.12690) + sorbet-static (0.6.12690-aarch64-linux) + sorbet-static (0.6.12690-universal-darwin) + sorbet-static (0.6.12690-x86_64-linux) + sorbet-static-and-runtime (0.6.12690) + sorbet (= 0.6.12690) + sorbet-runtime (= 0.6.12690) spoom (1.6.3) erubi (>= 1.10.0) prism (>= 0.28.0) @@ -174,14 +174,14 @@ GEM terminal-table (4.0.0) unicode-display_width (>= 1.1.1, < 4) thor (1.4.0) - traces (0.17.0) + traces (0.18.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.5) - unicode-emoji (~> 4.0, >= 4.0.4) - unicode-emoji (4.0.4) - uri (1.0.3) - webmock (3.25.1) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.1.0) + uri (1.1.0) + webmock (3.26.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) diff --git a/rbi/finch_api/internal/type/base_model.rbi b/rbi/finch_api/internal/type/base_model.rbi index 7c1e691a..add31594 100644 --- a/rbi/finch_api/internal/type/base_model.rbi +++ b/rbi/finch_api/internal/type/base_model.rbi @@ -31,7 +31,7 @@ module FinchAPI # # Assumes superclass fields are totally defined before fields are accessed / # defined on subclasses. - sig { params(child: T.self_type).void } + sig { params(child: FinchAPI::Internal::Type::BaseModel).void } def inherited(child) end @@ -274,9 +274,13 @@ module FinchAPI # Create a new instance of a model. sig do - params(data: T.any(T::Hash[Symbol, T.anything], T.self_type)).returns( - T.attached_class - ) + params( + data: + T.any( + T::Hash[Symbol, T.anything], + FinchAPI::Internal::Type::BaseModel + ) + ).returns(T.attached_class) end def self.new(data = {}) end From e6335a7fb93a0aed3f231e6e5246c305cd767a45 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 21:49:38 +0000 Subject: [PATCH 4/4] release: 0.1.0-alpha.33 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/finch_api/version.rb | 2 +- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2ce25fec..ff4f9a50 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.32" + ".": "0.1.0-alpha.33" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 428c5d2e..a2754324 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.1.0-alpha.33 (2025-11-03) + +Full Changelog: [v0.1.0-alpha.32...v0.1.0-alpha.33](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.32...v0.1.0-alpha.33) + +### Features + +* **api:** api update ([e2215da](https://github.com/Finch-API/finch-api-ruby/commit/e2215daac58922a19f110eb71249f5b0480bcfd4)) + + +### Chores + +* bump dependency version and update sorbet types ([82af149](https://github.com/Finch-API/finch-api-ruby/commit/82af1496618cbd69a049591e5fcaca45907f3fa4)) +* **client:** send user-agent header ([a1bdc99](https://github.com/Finch-API/finch-api-ruby/commit/a1bdc99fe97c31fcff475e4e46d9cba65893c4f3)) + ## 0.1.0-alpha.32 (2025-10-31) Full Changelog: [v0.1.0-alpha.31...v0.1.0-alpha.32](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.31...v0.1.0-alpha.32) diff --git a/Gemfile.lock b/Gemfile.lock index f2ba3a8a..4c291f6f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - finch-api (0.1.0.pre.alpha.32) + finch-api (0.1.0.pre.alpha.33) connection_pool GEM diff --git a/README.md b/README.md index c0b5f066..b5c0dd50 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "finch-api", "~> 0.1.0.pre.alpha.32" +gem "finch-api", "~> 0.1.0.pre.alpha.33" ``` diff --git a/lib/finch_api/version.rb b/lib/finch_api/version.rb index a859166e..21a97020 100644 --- a/lib/finch_api/version.rb +++ b/lib/finch_api/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module FinchAPI - VERSION = "0.1.0.pre.alpha.32" + VERSION = "0.1.0.pre.alpha.33" end