lithic 0.1.0.pre.alpha.30 → 0.1.0.pre.alpha.31

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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +1 -1
  4. data/lib/lithic/internal/util.rb +8 -9
  5. data/lib/lithic/models/account_update_params.rb +4 -4
  6. data/lib/lithic/models/auth_rules/v2/backtest_results.rb +100 -28
  7. data/lib/lithic/models/auth_rules/v2_apply_response.rb +401 -10
  8. data/lib/lithic/models/auth_rules/v2_create_params.rb +205 -6
  9. data/lib/lithic/models/auth_rules/v2_create_response.rb +401 -10
  10. data/lib/lithic/models/auth_rules/v2_draft_params.rb +186 -3
  11. data/lib/lithic/models/auth_rules/v2_draft_response.rb +401 -10
  12. data/lib/lithic/models/auth_rules/v2_list_params.rb +27 -8
  13. data/lib/lithic/models/auth_rules/v2_list_response.rb +401 -10
  14. data/lib/lithic/models/auth_rules/v2_promote_response.rb +401 -10
  15. data/lib/lithic/models/auth_rules/v2_retrieve_response.rb +401 -10
  16. data/lib/lithic/models/auth_rules/v2_update_response.rb +401 -10
  17. data/lib/lithic/models/funding_event_list_response.rb +26 -22
  18. data/lib/lithic/models/funding_event_retrieve_response.rb +26 -22
  19. data/lib/lithic/models/payment.rb +2 -2
  20. data/lib/lithic/models/required_document.rb +2 -2
  21. data/lib/lithic/models/transaction.rb +2 -1
  22. data/lib/lithic/resources/auth_rules/v2/backtests.rb +12 -13
  23. data/lib/lithic/resources/auth_rules/v2.rb +43 -39
  24. data/lib/lithic/version.rb +1 -1
  25. data/rbi/lithic/internal/util.rbi +2 -0
  26. data/rbi/lithic/models/account_update_params.rbi +6 -6
  27. data/rbi/lithic/models/auth_rules/v2/backtest_results.rbi +186 -24
  28. data/rbi/lithic/models/auth_rules/v2_apply_response.rbi +895 -7
  29. data/rbi/lithic/models/auth_rules/v2_create_params.rbi +442 -8
  30. data/rbi/lithic/models/auth_rules/v2_create_response.rbi +895 -7
  31. data/rbi/lithic/models/auth_rules/v2_draft_params.rbi +414 -4
  32. data/rbi/lithic/models/auth_rules/v2_draft_response.rbi +895 -7
  33. data/rbi/lithic/models/auth_rules/v2_list_params.rbi +60 -7
  34. data/rbi/lithic/models/auth_rules/v2_list_response.rbi +895 -7
  35. data/rbi/lithic/models/auth_rules/v2_promote_response.rbi +895 -7
  36. data/rbi/lithic/models/auth_rules/v2_retrieve_response.rbi +895 -7
  37. data/rbi/lithic/models/auth_rules/v2_update_response.rbi +895 -7
  38. data/rbi/lithic/models/funding_event_list_response.rbi +35 -28
  39. data/rbi/lithic/models/funding_event_retrieve_response.rbi +35 -28
  40. data/rbi/lithic/models/payment.rbi +3 -3
  41. data/rbi/lithic/models/required_document.rbi +2 -2
  42. data/rbi/lithic/models/transaction.rbi +4 -2
  43. data/rbi/lithic/resources/accounts.rbi +2 -2
  44. data/rbi/lithic/resources/auth_rules/v2/backtests.rbi +12 -13
  45. data/rbi/lithic/resources/auth_rules/v2.rbi +49 -38
  46. data/sig/lithic/models/auth_rules/v2/backtest_results.rbs +66 -2
  47. data/sig/lithic/models/auth_rules/v2_apply_response.rbs +280 -1
  48. data/sig/lithic/models/auth_rules/v2_create_params.rbs +135 -1
  49. data/sig/lithic/models/auth_rules/v2_create_response.rbs +280 -1
  50. data/sig/lithic/models/auth_rules/v2_draft_params.rbs +129 -0
  51. data/sig/lithic/models/auth_rules/v2_draft_response.rbs +280 -1
  52. data/sig/lithic/models/auth_rules/v2_list_params.rbs +20 -0
  53. data/sig/lithic/models/auth_rules/v2_list_response.rbs +280 -1
  54. data/sig/lithic/models/auth_rules/v2_promote_response.rbs +280 -1
  55. data/sig/lithic/models/auth_rules/v2_retrieve_response.rbs +280 -1
  56. data/sig/lithic/models/auth_rules/v2_update_response.rbs +280 -1
  57. data/sig/lithic/models/funding_event_list_response.rbs +18 -11
  58. data/sig/lithic/models/funding_event_retrieve_response.rbs +18 -11
  59. data/sig/lithic/resources/auth_rules/v2.rbs +1 -0
  60. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69dc9d2ddc7acfeb469907a8acc0a5be4d6974e3efcb4f3b496c3e139e46ab53
4
- data.tar.gz: 67a86092130e3632d58bb8bdb1e7613d05f4f7934ce9273f5a7ff829ffdbbcf3
3
+ metadata.gz: 630bfafdf71cef9d5fa1a2b9210b6b177d4a09e240357d40f36891678cfa10ed
4
+ data.tar.gz: 50d09940c53afb135c4cf3660917a1b3a0b7e2c1b8d7934f243ef4f0ac6cdfdf
5
5
  SHA512:
6
- metadata.gz: 883fb853690e2dd6348725f0e09abe5c29ac69f1cb1fdea8973158c025a748e3b330d48409b376248df5725a2e9229beebc05d9d3d6d28b4ef40e19fbb3d3c19
7
- data.tar.gz: 9d0e0d14111af87c763d4b9c1309e23d62899faaf20c03417fc40fa5cb3c056eae10e8bf1cd46503656164433f4e04e9654e16003b66b926e8d433a72e26d354
6
+ metadata.gz: 1483c82d67704cc560bd6d0589181a9167c75a148eab9ce19d7962d2f8d2d11d19727a6714e1bd4b671796502b2316842c39bc3672ce567eed0c5ea0905130e6
7
+ data.tar.gz: 5e85f2b9a7692e781f3eef0c56cea7ccbc168cf5e44e2b54f782501ef1d45789feb6d801c9daa66f598bffc28ecd9a47e5f7bb200f9c2dbf02167a555a82eda2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.31 (2025-06-04)
4
+
5
+ Full Changelog: [v0.1.0-alpha.30...v0.1.0-alpha.31](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.30...v0.1.0-alpha.31)
6
+
7
+ ### Features
8
+
9
+ * **client:** adds support for 3DS to Auth Rules ([e6fe981](https://github.com/lithic-com/lithic-ruby/commit/e6fe9812f9757af993396cb544240698b96e769a))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * default content-type for text in multi-part formdata uploads should be text/plain ([e992bea](https://github.com/lithic-com/lithic-ruby/commit/e992beadf27a198a2a1d6259b3df2a094a3986b7))
15
+
3
16
  ## 0.1.0-alpha.30 (2025-06-02)
4
17
 
5
18
  Full Changelog: [v0.1.0-alpha.29...v0.1.0-alpha.30](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.29...v0.1.0-alpha.30)
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.30"
18
+ gem "lithic", "~> 0.1.0.pre.alpha.31"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -497,7 +497,7 @@ module Lithic
497
497
  # @param closing [Array<Proc>]
498
498
  # @param content_type [String, nil]
499
499
  private def write_multipart_content(y, val:, closing:, content_type: nil)
500
- content_type ||= "application/octet-stream"
500
+ content_line = "Content-Type: %s\r\n\r\n"
501
501
 
502
502
  case val
503
503
  in Lithic::FilePart
@@ -508,24 +508,21 @@ module Lithic
508
508
  content_type: val.content_type
509
509
  )
510
510
  in Pathname
511
- y << "Content-Type: #{content_type}\r\n\r\n"
511
+ y << format(content_line, content_type || "application/octet-stream")
512
512
  io = val.open(binmode: true)
513
513
  closing << io.method(:close)
514
514
  IO.copy_stream(io, y)
515
515
  in IO
516
- y << "Content-Type: #{content_type}\r\n\r\n"
516
+ y << format(content_line, content_type || "application/octet-stream")
517
517
  IO.copy_stream(val, y)
518
518
  in StringIO
519
- y << "Content-Type: #{content_type}\r\n\r\n"
519
+ y << format(content_line, content_type || "application/octet-stream")
520
520
  y << val.string
521
- in String
522
- y << "Content-Type: #{content_type}\r\n\r\n"
523
- y << val.to_s
524
521
  in -> { primitive?(_1) }
525
- y << "Content-Type: text/plain\r\n\r\n"
522
+ y << format(content_line, content_type || "text/plain")
526
523
  y << val.to_s
527
524
  else
528
- y << "Content-Type: application/json\r\n\r\n"
525
+ y << format(content_line, content_type || "application/json")
529
526
  y << JSON.generate(val)
530
527
  end
531
528
  y << "\r\n"
@@ -563,6 +560,8 @@ module Lithic
563
560
 
564
561
  # @api private
565
562
  #
563
+ # https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#special-considerations-for-multipart-content
564
+ #
566
565
  # @param body [Object]
567
566
  #
568
567
  # @return [Array(String, Enumerable<String>)]
@@ -44,8 +44,8 @@ module Lithic
44
44
  #
45
45
  # Address used during Address Verification Service (AVS) checks during
46
46
  # transactions if enabled via Auth Rules. This field is deprecated as AVS checks
47
- # are no longer supported by Authorization Rules. The field will be removed from
48
- # the schema in a future release.
47
+ # are no longer supported by Auth Rules. The field will be removed from the schema
48
+ # in a future release.
49
49
  #
50
50
  # @return [Lithic::Models::AccountUpdateParams::VerificationAddress, nil]
51
51
  optional :verification_address, -> { Lithic::AccountUpdateParams::VerificationAddress }
@@ -112,8 +112,8 @@ module Lithic
112
112
  # @!method initialize(address1: nil, address2: nil, city: nil, country: nil, postal_code: nil, state: nil)
113
113
  # Address used during Address Verification Service (AVS) checks during
114
114
  # transactions if enabled via Auth Rules. This field is deprecated as AVS checks
115
- # are no longer supported by Authorization Rules. The field will be removed from
116
- # the schema in a future release.
115
+ # are no longer supported by Auth Rules. The field will be removed from the schema
116
+ # in a future release.
117
117
  #
118
118
  # @param address1 [String]
119
119
  # @param address2 [String]
@@ -55,22 +55,31 @@ module Lithic
55
55
  class CurrentVersion < Lithic::Internal::Type::BaseModel
56
56
  # @!attribute approved
57
57
  # The total number of historical transactions approved by this rule during the
58
- # backtest period, or the number of transactions that would have been approved if
58
+ # relevant period, or the number of transactions that would have been approved if
59
59
  # the rule was evaluated in shadow mode.
60
60
  #
61
61
  # @return [Integer, nil]
62
62
  optional :approved, Integer
63
63
 
64
+ # @!attribute challenged
65
+ # The total number of historical transactions challenged by this rule during the
66
+ # relevant period, or the number of transactions that would have been challenged
67
+ # if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth
68
+ # Rules.
69
+ #
70
+ # @return [Integer, nil]
71
+ optional :challenged, Integer
72
+
64
73
  # @!attribute declined
65
74
  # The total number of historical transactions declined by this rule during the
66
- # backtest period, or the number of transactions that would have been declined if
75
+ # relevant period, or the number of transactions that would have been declined if
67
76
  # the rule was evaluated in shadow mode.
68
77
  #
69
78
  # @return [Integer, nil]
70
79
  optional :declined, Integer
71
80
 
72
81
  # @!attribute examples
73
- # Example authorization request events that would have been approved or declined.
82
+ # Example events and their outcomes.
74
83
  #
75
84
  # @return [Array<Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example>, nil]
76
85
  optional :examples,
@@ -87,44 +96,71 @@ module Lithic
87
96
  optional :version, Integer
88
97
  end
89
98
 
90
- # @!method initialize(approved: nil, declined: nil, examples: nil, version: nil)
99
+ # @!method initialize(approved: nil, challenged: nil, declined: nil, examples: nil, version: nil)
91
100
  # Some parameter documentations has been truncated, see
92
101
  # {Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion} for
93
102
  # more details.
94
103
  #
95
- # @param approved [Integer] The total number of historical transactions approved by this rule during the bac
104
+ # @param approved [Integer] The total number of historical transactions approved by this rule during the rel
96
105
  #
97
- # @param declined [Integer] The total number of historical transactions declined by this rule during the bac
106
+ # @param challenged [Integer] The total number of historical transactions challenged by this rule during the r
98
107
  #
99
- # @param examples [Array<Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example>] Example authorization request events that would have been approved or declined.
108
+ # @param declined [Integer] The total number of historical transactions declined by this rule during the rel
109
+ #
110
+ # @param examples [Array<Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example>] Example events and their outcomes.
100
111
  #
101
112
  # @param version [Integer] The version of the rule, this is incremented whenever the rule's parameters chan
102
113
 
103
114
  class Example < Lithic::Internal::Type::BaseModel
104
115
  # @!attribute approved
105
- # Whether the rule would have approved the authorization request.
116
+ # Whether the rule would have approved the request.
106
117
  #
107
118
  # @return [Boolean, nil]
108
119
  optional :approved, Lithic::Internal::Type::Boolean
109
120
 
121
+ # @!attribute decision
122
+ # The decision made by the rule for this event.
123
+ #
124
+ # @return [Symbol, Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example::Decision, nil]
125
+ optional :decision,
126
+ enum: -> {
127
+ Lithic::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example::Decision
128
+ }
129
+
110
130
  # @!attribute event_token
111
- # The authorization request event token.
131
+ # The event token.
112
132
  #
113
133
  # @return [String, nil]
114
134
  optional :event_token, String
115
135
 
116
136
  # @!attribute timestamp
117
- # The timestamp of the authorization request event.
137
+ # The timestamp of the event.
118
138
  #
119
139
  # @return [Time, nil]
120
140
  optional :timestamp, Time
121
141
 
122
- # @!method initialize(approved: nil, event_token: nil, timestamp: nil)
123
- # @param approved [Boolean] Whether the rule would have approved the authorization request.
142
+ # @!method initialize(approved: nil, decision: nil, event_token: nil, timestamp: nil)
143
+ # @param approved [Boolean] Whether the rule would have approved the request.
124
144
  #
125
- # @param event_token [String] The authorization request event token.
145
+ # @param decision [Symbol, Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example::Decision] The decision made by the rule for this event.
126
146
  #
127
- # @param timestamp [Time] The timestamp of the authorization request event.
147
+ # @param event_token [String] The event token.
148
+ #
149
+ # @param timestamp [Time] The timestamp of the event.
150
+
151
+ # The decision made by the rule for this event.
152
+ #
153
+ # @see Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example#decision
154
+ module Decision
155
+ extend Lithic::Internal::Type::Enum
156
+
157
+ APPROVED = :APPROVED
158
+ DECLINED = :DECLINED
159
+ CHALLENGED = :CHALLENGED
160
+
161
+ # @!method self.values
162
+ # @return [Array<Symbol>]
163
+ end
128
164
  end
129
165
  end
130
166
 
@@ -132,22 +168,31 @@ module Lithic
132
168
  class DraftVersion < Lithic::Internal::Type::BaseModel
133
169
  # @!attribute approved
134
170
  # The total number of historical transactions approved by this rule during the
135
- # backtest period, or the number of transactions that would have been approved if
171
+ # relevant period, or the number of transactions that would have been approved if
136
172
  # the rule was evaluated in shadow mode.
137
173
  #
138
174
  # @return [Integer, nil]
139
175
  optional :approved, Integer
140
176
 
177
+ # @!attribute challenged
178
+ # The total number of historical transactions challenged by this rule during the
179
+ # relevant period, or the number of transactions that would have been challenged
180
+ # if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth
181
+ # Rules.
182
+ #
183
+ # @return [Integer, nil]
184
+ optional :challenged, Integer
185
+
141
186
  # @!attribute declined
142
187
  # The total number of historical transactions declined by this rule during the
143
- # backtest period, or the number of transactions that would have been declined if
188
+ # relevant period, or the number of transactions that would have been declined if
144
189
  # the rule was evaluated in shadow mode.
145
190
  #
146
191
  # @return [Integer, nil]
147
192
  optional :declined, Integer
148
193
 
149
194
  # @!attribute examples
150
- # Example authorization request events that would have been approved or declined.
195
+ # Example events and their outcomes.
151
196
  #
152
197
  # @return [Array<Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example>, nil]
153
198
  optional :examples,
@@ -164,44 +209,71 @@ module Lithic
164
209
  optional :version, Integer
165
210
  end
166
211
 
167
- # @!method initialize(approved: nil, declined: nil, examples: nil, version: nil)
212
+ # @!method initialize(approved: nil, challenged: nil, declined: nil, examples: nil, version: nil)
168
213
  # Some parameter documentations has been truncated, see
169
214
  # {Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion} for more
170
215
  # details.
171
216
  #
172
- # @param approved [Integer] The total number of historical transactions approved by this rule during the bac
217
+ # @param approved [Integer] The total number of historical transactions approved by this rule during the rel
173
218
  #
174
- # @param declined [Integer] The total number of historical transactions declined by this rule during the bac
219
+ # @param challenged [Integer] The total number of historical transactions challenged by this rule during the r
175
220
  #
176
- # @param examples [Array<Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example>] Example authorization request events that would have been approved or declined.
221
+ # @param declined [Integer] The total number of historical transactions declined by this rule during the rel
222
+ #
223
+ # @param examples [Array<Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example>] Example events and their outcomes.
177
224
  #
178
225
  # @param version [Integer] The version of the rule, this is incremented whenever the rule's parameters chan
179
226
 
180
227
  class Example < Lithic::Internal::Type::BaseModel
181
228
  # @!attribute approved
182
- # Whether the rule would have approved the authorization request.
229
+ # Whether the rule would have approved the request.
183
230
  #
184
231
  # @return [Boolean, nil]
185
232
  optional :approved, Lithic::Internal::Type::Boolean
186
233
 
234
+ # @!attribute decision
235
+ # The decision made by the rule for this event.
236
+ #
237
+ # @return [Symbol, Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example::Decision, nil]
238
+ optional :decision,
239
+ enum: -> {
240
+ Lithic::AuthRules::V2::BacktestResults::Results::DraftVersion::Example::Decision
241
+ }
242
+
187
243
  # @!attribute event_token
188
- # The authorization request event token.
244
+ # The event token.
189
245
  #
190
246
  # @return [String, nil]
191
247
  optional :event_token, String
192
248
 
193
249
  # @!attribute timestamp
194
- # The timestamp of the authorization request event.
250
+ # The timestamp of the event.
195
251
  #
196
252
  # @return [Time, nil]
197
253
  optional :timestamp, Time
198
254
 
199
- # @!method initialize(approved: nil, event_token: nil, timestamp: nil)
200
- # @param approved [Boolean] Whether the rule would have approved the authorization request.
255
+ # @!method initialize(approved: nil, decision: nil, event_token: nil, timestamp: nil)
256
+ # @param approved [Boolean] Whether the rule would have approved the request.
201
257
  #
202
- # @param event_token [String] The authorization request event token.
258
+ # @param decision [Symbol, Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example::Decision] The decision made by the rule for this event.
203
259
  #
204
- # @param timestamp [Time] The timestamp of the authorization request event.
260
+ # @param event_token [String] The event token.
261
+ #
262
+ # @param timestamp [Time] The timestamp of the event.
263
+
264
+ # The decision made by the rule for this event.
265
+ #
266
+ # @see Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example#decision
267
+ module Decision
268
+ extend Lithic::Internal::Type::Enum
269
+
270
+ APPROVED = :APPROVED
271
+ DECLINED = :DECLINED
272
+ CHALLENGED = :CHALLENGED
273
+
274
+ # @!method self.values
275
+ # @return [Array<Symbol>]
276
+ end
205
277
  end
206
278
  end
207
279
  end