lithic 0.1.0.pre.alpha.52 → 0.1.0.pre.alpha.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/README.md +1 -1
- data/lib/lithic/internal/transport/base_client.rb +7 -1
- data/lib/lithic/internal/transport/pooled_net_requester.rb +36 -26
- data/lib/lithic/internal/type/union.rb +15 -3
- data/lib/lithic/models/account_activity_list_response.rb +48 -1141
- data/lib/lithic/models/account_activity_retrieve_transaction_response.rb +48 -1151
- data/lib/lithic/models/auth_rules/auth_rule_condition.rb +3 -0
- data/lib/lithic/models/auth_rules/conditional_3ds_action_parameters.rb +7 -0
- data/lib/lithic/models/auth_rules/conditional_attribute.rb +4 -0
- data/lib/lithic/models/auth_rules/v2_apply_response.rb +14 -0
- data/lib/lithic/models/auth_rules/v2_create_params.rb +7 -0
- data/lib/lithic/models/auth_rules/v2_create_response.rb +14 -0
- data/lib/lithic/models/auth_rules/v2_draft_params.rb +7 -0
- data/lib/lithic/models/auth_rules/v2_draft_response.rb +14 -0
- data/lib/lithic/models/auth_rules/v2_list_response.rb +14 -0
- data/lib/lithic/models/auth_rules/v2_promote_response.rb +14 -0
- data/lib/lithic/models/auth_rules/v2_retrieve_response.rb +14 -0
- data/lib/lithic/models/auth_rules/v2_update_response.rb +14 -0
- data/lib/lithic/models/book_transfer_response.rb +51 -48
- data/lib/lithic/models/card_provision_response.rb +25 -3
- data/lib/lithic/models/event.rb +0 -1
- data/lib/lithic/models/event_list_params.rb +0 -1
- data/lib/lithic/models/event_subscription.rb +0 -1
- data/lib/lithic/models/events/subscription_create_params.rb +0 -1
- data/lib/lithic/models/events/subscription_send_simulated_example_params.rb +0 -1
- data/lib/lithic/models/events/subscription_update_params.rb +0 -1
- data/lib/lithic/models/external_bank_account_create_params.rb +1 -8
- data/lib/lithic/models/external_payment.rb +21 -23
- data/lib/lithic/models/financial_account.rb +48 -39
- data/lib/lithic/models/financial_accounts/financial_account_credit_config.rb +32 -23
- data/lib/lithic/models/financial_accounts/statements/statement_line_items.rb +1 -0
- data/lib/lithic/models/financial_transaction.rb +1 -0
- data/lib/lithic/models/management_operation_transaction.rb +21 -23
- data/lib/lithic/models/payment.rb +269 -140
- data/lib/lithic/models/payment_create_response.rb +2 -0
- data/lib/lithic/models/payment_retry_response.rb +2 -0
- data/lib/lithic/models/provision_response.rb +30 -0
- data/lib/lithic/models/three_ds/authentication_retrieve_response.rb +32 -1
- data/lib/lithic/models/tokenization.rb +1 -0
- data/lib/lithic/models/transaction.rb +4 -0
- data/lib/lithic/models/transfer.rb +1 -0
- data/lib/lithic/models/verification_method.rb +0 -1
- data/lib/lithic/models.rb +2 -0
- data/lib/lithic/resources/account_activity.rb +2 -2
- data/lib/lithic/resources/auth_rules/v2.rb +0 -72
- data/lib/lithic/resources/external_bank_accounts.rb +1 -3
- data/lib/lithic/version.rb +1 -1
- data/lib/lithic.rb +2 -2
- data/manifest.yaml +1 -0
- data/rbi/lithic/internal/transport/base_client.rbi +5 -0
- data/rbi/lithic/internal/transport/pooled_net_requester.rbi +6 -2
- data/rbi/lithic/internal/type/base_model.rbi +8 -4
- data/rbi/lithic/models/account_activity_list_response.rbi +158 -2629
- data/rbi/lithic/models/account_activity_retrieve_transaction_response.rbi +158 -2629
- data/rbi/lithic/models/auth_rules/auth_rule_condition.rbi +6 -0
- data/rbi/lithic/models/auth_rules/conditional_3ds_action_parameters.rbi +14 -0
- data/rbi/lithic/models/auth_rules/conditional_attribute.rbi +8 -0
- data/rbi/lithic/models/auth_rules/v2_apply_response.rbi +28 -0
- data/rbi/lithic/models/auth_rules/v2_create_params.rbi +14 -0
- data/rbi/lithic/models/auth_rules/v2_create_response.rbi +28 -0
- data/rbi/lithic/models/auth_rules/v2_draft_params.rbi +14 -0
- data/rbi/lithic/models/auth_rules/v2_draft_response.rbi +28 -0
- data/rbi/lithic/models/auth_rules/v2_list_response.rbi +28 -0
- data/rbi/lithic/models/auth_rules/v2_promote_response.rbi +28 -0
- data/rbi/lithic/models/auth_rules/v2_retrieve_response.rbi +28 -0
- data/rbi/lithic/models/auth_rules/v2_update_response.rbi +28 -0
- data/rbi/lithic/models/book_transfer_response.rbi +67 -68
- data/rbi/lithic/models/card_provision_response.rbi +50 -5
- data/rbi/lithic/models/event.rbi +0 -5
- data/rbi/lithic/models/event_list_params.rbi +0 -5
- data/rbi/lithic/models/event_subscription.rbi +0 -5
- data/rbi/lithic/models/events/subscription_create_params.rbi +0 -5
- data/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi +0 -5
- data/rbi/lithic/models/events/subscription_update_params.rbi +0 -5
- data/rbi/lithic/models/external_bank_account_create_params.rbi +0 -6
- data/rbi/lithic/models/external_payment.rbi +34 -39
- data/rbi/lithic/models/financial_account.rbi +74 -73
- data/rbi/lithic/models/financial_accounts/financial_account_credit_config.rbi +46 -33
- data/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi +5 -0
- data/rbi/lithic/models/financial_transaction.rbi +5 -0
- data/rbi/lithic/models/management_operation_transaction.rbi +49 -60
- data/rbi/lithic/models/payment.rbi +425 -182
- data/rbi/lithic/models/payment_create_response.rbi +1 -0
- data/rbi/lithic/models/payment_retry_response.rbi +1 -0
- data/rbi/lithic/models/provision_response.rbi +58 -0
- data/rbi/lithic/models/three_ds/authentication_retrieve_response.rbi +83 -0
- data/rbi/lithic/models/tokenization.rbi +5 -0
- data/rbi/lithic/models/transaction.rbi +20 -0
- data/rbi/lithic/models/transfer.rbi +5 -0
- data/rbi/lithic/models/verification_method.rbi +0 -1
- data/rbi/lithic/models.rbi +2 -0
- data/rbi/lithic/resources/auth_rules/v2.rbi +0 -64
- data/rbi/lithic/resources/external_bank_accounts.rbi +0 -2
- data/sig/lithic/internal/transport/base_client.rbs +2 -0
- data/sig/lithic/internal/transport/pooled_net_requester.rbs +4 -1
- data/sig/lithic/models/account_activity_list_response.rbs +50 -1036
- data/sig/lithic/models/account_activity_retrieve_transaction_response.rbs +50 -1036
- data/sig/lithic/models/auth_rules/conditional_3ds_action_parameters.rbs +2 -0
- data/sig/lithic/models/auth_rules/conditional_attribute.rbs +2 -0
- data/sig/lithic/models/auth_rules/v2_apply_response.rbs +4 -0
- data/sig/lithic/models/auth_rules/v2_create_params.rbs +2 -0
- data/sig/lithic/models/auth_rules/v2_create_response.rbs +4 -0
- data/sig/lithic/models/auth_rules/v2_draft_params.rbs +2 -0
- data/sig/lithic/models/auth_rules/v2_draft_response.rbs +4 -0
- data/sig/lithic/models/auth_rules/v2_list_response.rbs +4 -0
- data/sig/lithic/models/auth_rules/v2_promote_response.rbs +4 -0
- data/sig/lithic/models/auth_rules/v2_retrieve_response.rbs +4 -0
- data/sig/lithic/models/auth_rules/v2_update_response.rbs +4 -0
- data/sig/lithic/models/book_transfer_response.rbs +26 -19
- data/sig/lithic/models/card_provision_response.rbs +22 -5
- data/sig/lithic/models/event.rbs +0 -2
- data/sig/lithic/models/event_list_params.rbs +0 -2
- data/sig/lithic/models/event_subscription.rbs +0 -2
- data/sig/lithic/models/events/subscription_create_params.rbs +0 -2
- data/sig/lithic/models/events/subscription_send_simulated_example_params.rbs +0 -2
- data/sig/lithic/models/events/subscription_update_params.rbs +0 -2
- data/sig/lithic/models/external_bank_account_create_params.rbs +1 -6
- data/sig/lithic/models/external_payment.rbs +19 -26
- data/sig/lithic/models/financial_account.rbs +28 -30
- data/sig/lithic/models/financial_accounts/financial_account_credit_config.rbs +21 -15
- data/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs +2 -0
- data/sig/lithic/models/financial_transaction.rbs +2 -0
- data/sig/lithic/models/management_operation_transaction.rbs +19 -26
- data/sig/lithic/models/payment.rbs +199 -76
- data/sig/lithic/models/provision_response.rbs +36 -0
- data/sig/lithic/models/three_ds/authentication_retrieve_response.rbs +28 -0
- data/sig/lithic/models/tokenization.rbs +2 -0
- data/sig/lithic/models/transaction.rbs +8 -0
- data/sig/lithic/models/transfer.rbs +2 -0
- data/sig/lithic/models/verification_method.rbs +1 -7
- data/sig/lithic/models.rbs +2 -0
- data/sig/lithic/resources/auth_rules/v2.rbs +0 -5
- data/sig/lithic/resources/external_bank_accounts.rbs +0 -1
- metadata +5 -8
- data/lib/lithic/models/auth_rules/v2_report_params.rb +0 -16
- data/lib/lithic/models/auth_rules/v2_report_response.rb +0 -18
- data/rbi/lithic/models/auth_rules/v2_report_params.rbi +0 -29
- data/rbi/lithic/models/auth_rules/v2_report_response.rbi +0 -31
- data/sig/lithic/models/auth_rules/v2_report_params.rbs +0 -16
- data/sig/lithic/models/auth_rules/v2_report_response.rbs +0 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0cafb9995bee6a1f6538ae3f917907ec64d021442bdadc54d796f527e4b8a398
|
|
4
|
+
data.tar.gz: 7d0de20d92faba1f2f0951f3fc446653743b9fff0510677e927311cf4cef1ddb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 92d1c6cb2842552f0630d9d9c748ea67f84739d99b7470c46d252a6c8a0c6903ad653b221f118e34872a76e38f0293965ebc1d045b56359b131386225f890010
|
|
7
|
+
data.tar.gz: 3adb703444bf3e91ff3105312e561b615ea5df93ac6a6be10b626f2c6b5dd32ddc9222d355dff361f7065b0470a1ec5729566a05e80e5413e9dcfbf187fafa71
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.54 (2025-11-04)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.53...v0.1.0-alpha.54](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.53...v0.1.0-alpha.54)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* better thread safety via early initializing SSL store during HTTP client creation ([67db6d5](https://github.com/lithic-com/lithic-ruby/commit/67db6d53b0af488113c3506c6cacfbfafcf28164))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Chores
|
|
13
|
+
|
|
14
|
+
* **api:** adds support for new ACH_RECEIPT_RELEASED event ([1834708](https://github.com/lithic-com/lithic-ruby/commit/183470896e9f3fb3e6f1b5d1e242e14ac6992d89))
|
|
15
|
+
* **client:** send user-agent header ([60cfe27](https://github.com/lithic-com/lithic-ruby/commit/60cfe272af1a4018aabca79debcbb6426ba9de0f))
|
|
16
|
+
* **internal:** codegen related update ([b4dbac6](https://github.com/lithic-com/lithic-ruby/commit/b4dbac6efd1ca89c7e60fe9a85f19fdc68654492))
|
|
17
|
+
|
|
18
|
+
## 0.1.0-alpha.53 (2025-10-23)
|
|
19
|
+
|
|
20
|
+
Full Changelog: [v0.1.0-alpha.52...v0.1.0-alpha.53](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.52...v0.1.0-alpha.53)
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **api:** updates to Auth Rules and Card provisioning ([fe22047](https://github.com/lithic-com/lithic-ruby/commit/fe22047b0689b63872eb7454cb4fc733aabe81cc))
|
|
25
|
+
* handle thread interrupts in the core HTTP client ([1f9867e](https://github.com/lithic-com/lithic-ruby/commit/1f9867e2708d86c52e212e11a55d04ef03410b5d))
|
|
26
|
+
|
|
3
27
|
## 0.1.0-alpha.52 (2025-10-15)
|
|
4
28
|
|
|
5
29
|
Full Changelog: [v0.1.0-alpha.51...v0.1.0-alpha.52](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.51...v0.1.0-alpha.52)
|
data/README.md
CHANGED
|
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
15
15
|
<!-- x-release-please-start-version -->
|
|
16
16
|
|
|
17
17
|
```ruby
|
|
18
|
-
gem "lithic", "~> 0.1.0.pre.alpha.
|
|
18
|
+
gem "lithic", "~> 0.1.0.pre.alpha.54"
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
<!-- x-release-please-end -->
|
|
@@ -201,7 +201,8 @@ module Lithic
|
|
|
201
201
|
self.class::PLATFORM_HEADERS,
|
|
202
202
|
{
|
|
203
203
|
"accept" => "application/json",
|
|
204
|
-
"content-type" => "application/json"
|
|
204
|
+
"content-type" => "application/json",
|
|
205
|
+
"user-agent" => user_agent
|
|
205
206
|
},
|
|
206
207
|
headers
|
|
207
208
|
)
|
|
@@ -219,6 +220,11 @@ module Lithic
|
|
|
219
220
|
# @return [Hash{String=>String}]
|
|
220
221
|
private def auth_headers = {}
|
|
221
222
|
|
|
223
|
+
# @api private
|
|
224
|
+
#
|
|
225
|
+
# @return [String]
|
|
226
|
+
private def user_agent = "#{self.class.name}/Ruby #{Lithic::VERSION}"
|
|
227
|
+
|
|
222
228
|
# @api private
|
|
223
229
|
#
|
|
224
230
|
# @return [String]
|
|
@@ -16,10 +16,11 @@ module Lithic
|
|
|
16
16
|
class << self
|
|
17
17
|
# @api private
|
|
18
18
|
#
|
|
19
|
+
# @param cert_store [OpenSSL::X509::Store]
|
|
19
20
|
# @param url [URI::Generic]
|
|
20
21
|
#
|
|
21
22
|
# @return [Net::HTTP]
|
|
22
|
-
def connect(url)
|
|
23
|
+
def connect(cert_store:, url:)
|
|
23
24
|
port =
|
|
24
25
|
case [url.port, url.scheme]
|
|
25
26
|
in [Integer, _]
|
|
@@ -33,6 +34,8 @@ module Lithic
|
|
|
33
34
|
Net::HTTP.new(url.host, port).tap do
|
|
34
35
|
_1.use_ssl = %w[https wss].include?(url.scheme)
|
|
35
36
|
_1.max_retries = 0
|
|
37
|
+
|
|
38
|
+
(_1.cert_store = cert_store) if _1.use_ssl?
|
|
36
39
|
end
|
|
37
40
|
end
|
|
38
41
|
|
|
@@ -102,7 +105,7 @@ module Lithic
|
|
|
102
105
|
pool =
|
|
103
106
|
@mutex.synchronize do
|
|
104
107
|
@pools[origin] ||= ConnectionPool.new(size: @size) do
|
|
105
|
-
self.class.connect(url)
|
|
108
|
+
self.class.connect(cert_store: @cert_store, url: url)
|
|
106
109
|
end
|
|
107
110
|
end
|
|
108
111
|
|
|
@@ -128,40 +131,48 @@ module Lithic
|
|
|
128
131
|
url, deadline = request.fetch_values(:url, :deadline)
|
|
129
132
|
|
|
130
133
|
req = nil
|
|
131
|
-
eof = false
|
|
132
134
|
finished = false
|
|
133
|
-
closing = nil
|
|
134
135
|
|
|
135
136
|
# rubocop:disable Metrics/BlockLength
|
|
136
137
|
enum = Enumerator.new do |y|
|
|
137
138
|
next if finished
|
|
138
139
|
|
|
139
140
|
with_pool(url, deadline: deadline) do |conn|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
conn.start
|
|
148
|
-
end
|
|
141
|
+
eof = false
|
|
142
|
+
closing = nil
|
|
143
|
+
::Thread.handle_interrupt(Object => :never) do
|
|
144
|
+
::Thread.handle_interrupt(Object => :immediate) do
|
|
145
|
+
req, closing = self.class.build_request(request) do
|
|
146
|
+
self.class.calibrate_socket_timeout(conn, deadline)
|
|
147
|
+
end
|
|
149
148
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
rsp.read_body do |bytes|
|
|
156
|
-
y << bytes.force_encoding(Encoding::BINARY)
|
|
157
|
-
break if finished
|
|
149
|
+
self.class.calibrate_socket_timeout(conn, deadline)
|
|
150
|
+
unless conn.started?
|
|
151
|
+
conn.keep_alive_timeout = self.class::KEEP_ALIVE_TIMEOUT
|
|
152
|
+
conn.start
|
|
153
|
+
end
|
|
158
154
|
|
|
159
155
|
self.class.calibrate_socket_timeout(conn, deadline)
|
|
156
|
+
conn.request(req) do |rsp|
|
|
157
|
+
y << [req, rsp]
|
|
158
|
+
break if finished
|
|
159
|
+
|
|
160
|
+
rsp.read_body do |bytes|
|
|
161
|
+
y << bytes.force_encoding(Encoding::BINARY)
|
|
162
|
+
break if finished
|
|
163
|
+
|
|
164
|
+
self.class.calibrate_socket_timeout(conn, deadline)
|
|
165
|
+
end
|
|
166
|
+
eof = true
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
ensure
|
|
170
|
+
begin
|
|
171
|
+
conn.finish if !eof && conn&.started?
|
|
172
|
+
ensure
|
|
173
|
+
closing&.call
|
|
160
174
|
end
|
|
161
|
-
eof = true
|
|
162
175
|
end
|
|
163
|
-
ensure
|
|
164
|
-
conn.finish if !eof && conn&.started?
|
|
165
176
|
end
|
|
166
177
|
rescue Timeout::Error
|
|
167
178
|
raise Lithic::Errors::APITimeoutError.new(url: url, request: req)
|
|
@@ -174,8 +185,6 @@ module Lithic
|
|
|
174
185
|
body = Lithic::Internal::Util.fused_enum(enum, external: true) do
|
|
175
186
|
finished = true
|
|
176
187
|
loop { enum.next }
|
|
177
|
-
ensure
|
|
178
|
-
closing&.call
|
|
179
188
|
end
|
|
180
189
|
[Integer(response.code), response, body]
|
|
181
190
|
end
|
|
@@ -186,6 +195,7 @@ module Lithic
|
|
|
186
195
|
def initialize(size: self.class::DEFAULT_MAX_CONNECTIONS)
|
|
187
196
|
@mutex = Mutex.new
|
|
188
197
|
@size = size
|
|
198
|
+
@cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths)
|
|
189
199
|
@pools = {}
|
|
190
200
|
end
|
|
191
201
|
|
|
@@ -8,15 +8,27 @@ module Lithic
|
|
|
8
8
|
# @example
|
|
9
9
|
# # `account_activity_list_response` is a `Lithic::Models::AccountActivityListResponse`
|
|
10
10
|
# case account_activity_list_response
|
|
11
|
-
# when Lithic::Models::AccountActivityListResponse::
|
|
11
|
+
# when Lithic::Models::AccountActivityListResponse::Internal
|
|
12
12
|
# puts(account_activity_list_response.token)
|
|
13
|
-
# when Lithic::
|
|
13
|
+
# when Lithic::BookTransferResponse
|
|
14
14
|
# puts(account_activity_list_response.category)
|
|
15
|
-
# when Lithic::Models::AccountActivityListResponse::
|
|
15
|
+
# when Lithic::Models::AccountActivityListResponse::Card
|
|
16
16
|
# # ...
|
|
17
17
|
# else
|
|
18
18
|
# puts(account_activity_list_response)
|
|
19
19
|
# end
|
|
20
|
+
#
|
|
21
|
+
# @example
|
|
22
|
+
# case account_activity_list_response
|
|
23
|
+
# in {family: :INTERNAL, token: token, category: category, created: created}
|
|
24
|
+
# puts(token)
|
|
25
|
+
# in {family: :TRANSFER, token: token, category: category, created: created}
|
|
26
|
+
# puts(category)
|
|
27
|
+
# in {family: :PAYMENT, token: token, category: category, created: created}
|
|
28
|
+
# puts(created)
|
|
29
|
+
# else
|
|
30
|
+
# puts(account_activity_list_response)
|
|
31
|
+
# end
|
|
20
32
|
module Union
|
|
21
33
|
include Lithic::Internal::Type::Converter
|
|
22
34
|
include Lithic::Internal::Util::SorbetRuntimeSupport
|