lithic 0.10.0 → 0.12.0

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 (104) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +49 -0
  3. data/README.md +1 -1
  4. data/lib/lithic/internal/util.rb +22 -7
  5. data/lib/lithic/models/auth_rules/backtest_stats.rb +9 -1
  6. data/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb +158 -1
  7. data/lib/lithic/models/auth_rules/report_stats.rb +46 -81
  8. data/lib/lithic/models/auth_rules/rule_feature.rb +47 -1
  9. data/lib/lithic/models/auth_rules/typescript_code_parameters.rb +2 -2
  10. data/lib/lithic/models/auth_rules/v2_list_results_response.rb +36 -4
  11. data/lib/lithic/models/auth_rules/v2_retrieve_report_response.rb +4 -531
  12. data/lib/lithic/models/card_authorization_approval_request_webhook_event.rb +17 -26
  13. data/lib/lithic/models/card_authorization_challenge_response_webhook_event.rb +103 -0
  14. data/lib/lithic/models/card_bulk_order.rb +8 -3
  15. data/lib/lithic/models/card_bulk_order_create_params.rb +8 -3
  16. data/lib/lithic/models/card_convert_physical_params.rb +5 -3
  17. data/lib/lithic/models/card_create_params.rb +5 -3
  18. data/lib/lithic/models/card_reissue_params.rb +5 -3
  19. data/lib/lithic/models/card_renew_params.rb +5 -3
  20. data/lib/lithic/models/event.rb +5 -0
  21. data/lib/lithic/models/event_list_params.rb +3 -0
  22. data/lib/lithic/models/event_subscription.rb +3 -0
  23. data/lib/lithic/models/events/subscription_create_params.rb +3 -0
  24. data/lib/lithic/models/events/subscription_send_simulated_example_params.rb +1 -0
  25. data/lib/lithic/models/events/subscription_update_params.rb +3 -0
  26. data/lib/lithic/models/external_bank_account_set_verification_method_params.rb +55 -0
  27. data/lib/lithic/models/financial_account.rb +1 -0
  28. data/lib/lithic/models/financial_account_update_status_params.rb +1 -0
  29. data/lib/lithic/models/financial_accounts/statement.rb +11 -4
  30. data/lib/lithic/models/instance_financial_account_type.rb +1 -0
  31. data/lib/lithic/models/parsed_webhook_event.rb +3 -1
  32. data/lib/lithic/models/payment_create_params.rb +13 -1
  33. data/lib/lithic/models.rb +6 -0
  34. data/lib/lithic/resources/card_bulk_orders.rb +10 -11
  35. data/lib/lithic/resources/external_bank_accounts.rb +31 -0
  36. data/lib/lithic/resources/webhooks.rb +1 -1
  37. data/lib/lithic/version.rb +1 -1
  38. data/lib/lithic.rb +2 -0
  39. data/rbi/lithic/internal/util.rbi +8 -0
  40. data/rbi/lithic/models/auth_rules/backtest_stats.rbi +11 -3
  41. data/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi +370 -3
  42. data/rbi/lithic/models/auth_rules/report_stats.rbi +73 -177
  43. data/rbi/lithic/models/auth_rules/rule_feature.rbi +104 -1
  44. data/rbi/lithic/models/auth_rules/typescript_code_parameters.rbi +6 -3
  45. data/rbi/lithic/models/auth_rules/v2_list_results_response.rbi +38 -6
  46. data/rbi/lithic/models/auth_rules/v2_retrieve_report_response.rbi +3 -1721
  47. data/rbi/lithic/models/card_authorization_approval_request_webhook_event.rbi +23 -78
  48. data/rbi/lithic/models/card_authorization_challenge_response_webhook_event.rbi +175 -0
  49. data/rbi/lithic/models/card_bulk_order.rbi +21 -3
  50. data/rbi/lithic/models/card_bulk_order_create_params.rbi +21 -3
  51. data/rbi/lithic/models/card_convert_physical_params.rbi +8 -5
  52. data/rbi/lithic/models/card_create_params.rbi +8 -8
  53. data/rbi/lithic/models/card_reissue_params.rbi +8 -8
  54. data/rbi/lithic/models/card_renew_params.rbi +8 -8
  55. data/rbi/lithic/models/event.rbi +11 -0
  56. data/rbi/lithic/models/event_list_params.rbi +7 -0
  57. data/rbi/lithic/models/event_subscription.rbi +7 -0
  58. data/rbi/lithic/models/events/subscription_create_params.rbi +7 -0
  59. data/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi +5 -0
  60. data/rbi/lithic/models/events/subscription_update_params.rbi +7 -0
  61. data/rbi/lithic/models/external_bank_account_set_verification_method_params.rbi +111 -0
  62. data/rbi/lithic/models/financial_account.rbi +5 -0
  63. data/rbi/lithic/models/financial_account_update_status_params.rbi +5 -0
  64. data/rbi/lithic/models/financial_accounts/statement.rbi +15 -6
  65. data/rbi/lithic/models/instance_financial_account_type.rbi +5 -0
  66. data/rbi/lithic/models/parsed_webhook_event.rbi +1 -0
  67. data/rbi/lithic/models/payment_create_params.rbi +13 -3
  68. data/rbi/lithic/models.rbi +6 -0
  69. data/rbi/lithic/resources/card_bulk_orders.rbi +11 -11
  70. data/rbi/lithic/resources/cards.rbi +8 -4
  71. data/rbi/lithic/resources/external_bank_accounts.rbi +22 -0
  72. data/rbi/lithic/resources/webhooks.rbi +1 -0
  73. data/sig/lithic/internal/util.rbs +4 -0
  74. data/sig/lithic/models/auth_rules/backtest_stats.rbs +8 -3
  75. data/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs +93 -3
  76. data/sig/lithic/models/auth_rules/report_stats.rbs +34 -70
  77. data/sig/lithic/models/auth_rules/rule_feature.rbs +42 -0
  78. data/sig/lithic/models/auth_rules/v2_list_results_response.rbs +29 -9
  79. data/sig/lithic/models/auth_rules/v2_retrieve_report_response.rbs +4 -667
  80. data/sig/lithic/models/card_authorization_approval_request_webhook_event.rbs +14 -41
  81. data/sig/lithic/models/card_authorization_challenge_response_webhook_event.rbs +76 -0
  82. data/sig/lithic/models/card_bulk_order.rbs +5 -1
  83. data/sig/lithic/models/card_bulk_order_create_params.rbs +5 -1
  84. data/sig/lithic/models/card_convert_physical_params.rbs +2 -2
  85. data/sig/lithic/models/card_create_params.rbs +2 -2
  86. data/sig/lithic/models/card_reissue_params.rbs +2 -2
  87. data/sig/lithic/models/card_renew_params.rbs +2 -2
  88. data/sig/lithic/models/event.rbs +2 -0
  89. data/sig/lithic/models/event_list_params.rbs +2 -0
  90. data/sig/lithic/models/event_subscription.rbs +2 -0
  91. data/sig/lithic/models/events/subscription_create_params.rbs +2 -0
  92. data/sig/lithic/models/events/subscription_send_simulated_example_params.rbs +2 -0
  93. data/sig/lithic/models/events/subscription_update_params.rbs +2 -0
  94. data/sig/lithic/models/external_bank_account_set_verification_method_params.rbs +51 -0
  95. data/sig/lithic/models/financial_account.rbs +2 -0
  96. data/sig/lithic/models/financial_account_update_status_params.rbs +2 -0
  97. data/sig/lithic/models/financial_accounts/statement.rbs +16 -7
  98. data/sig/lithic/models/instance_financial_account_type.rbs +2 -0
  99. data/sig/lithic/models/parsed_webhook_event.rbs +1 -0
  100. data/sig/lithic/models/payment_create_params.rbs +8 -3
  101. data/sig/lithic/models.rbs +4 -0
  102. data/sig/lithic/resources/external_bank_accounts.rbs +7 -0
  103. data/sig/lithic/resources/webhooks.rbs +1 -0
  104. metadata +8 -2
@@ -24,6 +24,10 @@ module Lithic
24
24
  # - `SPEND_VELOCITY`: Spend velocity data for the card or account. Requires
25
25
  # `scope`, `period`, and optionally `filters` to configure the velocity
26
26
  # calculation. Available for AUTHORIZATION event stream rules.
27
+ # - `TRANSACTION_HISTORY_SIGNALS`: Behavioral feature state derived from the
28
+ # entity's transaction history. Requires `scope` to specify whether to load
29
+ # card, account, or business account history. Available for AUTHORIZATION event
30
+ # stream rules.
27
31
  module RuleFeature
28
32
  extend Lithic::Internal::Type::Union
29
33
 
@@ -43,6 +47,8 @@ module Lithic
43
47
 
44
48
  variant -> { Lithic::AuthRules::RuleFeature::SpendVelocityFeature }
45
49
 
50
+ variant -> { Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature }
51
+
46
52
  class AuthorizationFeature < Lithic::Internal::Type::BaseModel
47
53
  # @!attribute type
48
54
  #
@@ -223,8 +229,48 @@ module Lithic
223
229
  end
224
230
  end
225
231
 
232
+ class TransactionHistorySignalsFeature < Lithic::Internal::Type::BaseModel
233
+ # @!attribute scope
234
+ # The entity scope to load transaction history signals for.
235
+ #
236
+ # @return [Symbol, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope]
237
+ required :scope, enum: -> { Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope }
238
+
239
+ # @!attribute type
240
+ #
241
+ # @return [Symbol, :TRANSACTION_HISTORY_SIGNALS]
242
+ required :type, const: :TRANSACTION_HISTORY_SIGNALS
243
+
244
+ # @!attribute name
245
+ # The variable name for this feature in the rule function signature
246
+ #
247
+ # @return [String, nil]
248
+ optional :name, String
249
+
250
+ # @!method initialize(scope:, name: nil, type: :TRANSACTION_HISTORY_SIGNALS)
251
+ # @param scope [Symbol, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope] The entity scope to load transaction history signals for.
252
+ #
253
+ # @param name [String] The variable name for this feature in the rule function signature
254
+ #
255
+ # @param type [Symbol, :TRANSACTION_HISTORY_SIGNALS]
256
+
257
+ # The entity scope to load transaction history signals for.
258
+ #
259
+ # @see Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature#scope
260
+ module Scope
261
+ extend Lithic::Internal::Type::Enum
262
+
263
+ CARD = :CARD
264
+ ACCOUNT = :ACCOUNT
265
+ BUSINESS_ACCOUNT = :BUSINESS_ACCOUNT
266
+
267
+ # @!method self.values
268
+ # @return [Array<Symbol>]
269
+ end
270
+ end
271
+
226
272
  # @!method self.variants
227
- # @return [Array(Lithic::Models::AuthRules::RuleFeature::AuthorizationFeature, Lithic::Models::AuthRules::RuleFeature::AuthenticationFeature, Lithic::Models::AuthRules::RuleFeature::TokenizationFeature, Lithic::Models::AuthRules::RuleFeature::ACHReceiptFeature, Lithic::Models::AuthRules::RuleFeature::CardFeature, Lithic::Models::AuthRules::RuleFeature::AccountHolderFeature, Lithic::Models::AuthRules::RuleFeature::IPMetadataFeature, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature)]
273
+ # @return [Array(Lithic::Models::AuthRules::RuleFeature::AuthorizationFeature, Lithic::Models::AuthRules::RuleFeature::AuthenticationFeature, Lithic::Models::AuthRules::RuleFeature::TokenizationFeature, Lithic::Models::AuthRules::RuleFeature::ACHReceiptFeature, Lithic::Models::AuthRules::RuleFeature::CardFeature, Lithic::Models::AuthRules::RuleFeature::AccountHolderFeature, Lithic::Models::AuthRules::RuleFeature::IPMetadataFeature, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature)]
228
274
  end
229
275
  end
230
276
  end
@@ -15,7 +15,7 @@ module Lithic
15
15
  # @!attribute features
16
16
  # Features available to the TypeScript code at evaluation time
17
17
  #
18
- # @return [Array<Lithic::Models::AuthRules::RuleFeature::AuthorizationFeature, Lithic::Models::AuthRules::RuleFeature::AuthenticationFeature, Lithic::Models::AuthRules::RuleFeature::TokenizationFeature, Lithic::Models::AuthRules::RuleFeature::ACHReceiptFeature, Lithic::Models::AuthRules::RuleFeature::CardFeature, Lithic::Models::AuthRules::RuleFeature::AccountHolderFeature, Lithic::Models::AuthRules::RuleFeature::IPMetadataFeature, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature>]
18
+ # @return [Array<Lithic::Models::AuthRules::RuleFeature::AuthorizationFeature, Lithic::Models::AuthRules::RuleFeature::AuthenticationFeature, Lithic::Models::AuthRules::RuleFeature::TokenizationFeature, Lithic::Models::AuthRules::RuleFeature::ACHReceiptFeature, Lithic::Models::AuthRules::RuleFeature::CardFeature, Lithic::Models::AuthRules::RuleFeature::AccountHolderFeature, Lithic::Models::AuthRules::RuleFeature::IPMetadataFeature, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature>]
19
19
  required :features, -> { Lithic::Internal::Type::ArrayOf[union: Lithic::AuthRules::RuleFeature] }
20
20
 
21
21
  # @!method initialize(code:, features:)
@@ -26,7 +26,7 @@ module Lithic
26
26
  #
27
27
  # @param code [String] The TypeScript source code of the rule. Must define a `rule()` function that acc
28
28
  #
29
- # @param features [Array<Lithic::Models::AuthRules::RuleFeature::AuthorizationFeature, Lithic::Models::AuthRules::RuleFeature::AuthenticationFeature, Lithic::Models::AuthRules::RuleFeature::TokenizationFeature, Lithic::Models::AuthRules::RuleFeature::ACHReceiptFeature, Lithic::Models::AuthRules::RuleFeature::CardFeature, Lithic::Models::AuthRules::RuleFeature::AccountHolderFeature, Lithic::Models::AuthRules::RuleFeature::IPMetadataFeature, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature>] Features available to the TypeScript code at evaluation time
29
+ # @param features [Array<Lithic::Models::AuthRules::RuleFeature::AuthorizationFeature, Lithic::Models::AuthRules::RuleFeature::AuthenticationFeature, Lithic::Models::AuthRules::RuleFeature::TokenizationFeature, Lithic::Models::AuthRules::RuleFeature::ACHReceiptFeature, Lithic::Models::AuthRules::RuleFeature::CardFeature, Lithic::Models::AuthRules::RuleFeature::AccountHolderFeature, Lithic::Models::AuthRules::RuleFeature::IPMetadataFeature, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature>] Features available to the TypeScript code at evaluation time
30
30
  end
31
31
  end
32
32
  end
@@ -67,7 +67,13 @@ module Lithic
67
67
  # @return [Integer]
68
68
  required :rule_version, Integer
69
69
 
70
- # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, event_stream: :AUTHORIZATION)
70
+ # @!attribute transaction_token
71
+ # The token of the transaction that triggered the rule evaluation
72
+ #
73
+ # @return [String, nil]
74
+ required :transaction_token, String, nil?: true
75
+
76
+ # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, transaction_token:, event_stream: :AUTHORIZATION)
71
77
  # @param token [String] Globally unique identifier for the evaluation
72
78
  #
73
79
  # @param actions [Array<Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization, Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization>] Actions returned by the rule evaluation
@@ -82,6 +88,8 @@ module Lithic
82
88
  #
83
89
  # @param rule_version [Integer] Version of the rule that was evaluated
84
90
  #
91
+ # @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation
92
+ #
85
93
  # @param event_stream [Symbol, :AUTHORIZATION] The event stream during which the rule was evaluated
86
94
 
87
95
  module Action
@@ -295,7 +303,13 @@ module Lithic
295
303
  # @return [Integer]
296
304
  required :rule_version, Integer
297
305
 
298
- # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, event_stream: :THREE_DS_AUTHENTICATION)
306
+ # @!attribute transaction_token
307
+ # The token of the transaction that triggered the rule evaluation
308
+ #
309
+ # @return [String, nil]
310
+ required :transaction_token, String, nil?: true
311
+
312
+ # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, transaction_token:, event_stream: :THREE_DS_AUTHENTICATION)
299
313
  # @param token [String] Globally unique identifier for the evaluation
300
314
  #
301
315
  # @param actions [Array<Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action>] Actions returned by the rule evaluation
@@ -310,6 +324,8 @@ module Lithic
310
324
  #
311
325
  # @param rule_version [Integer] Version of the rule that was evaluated
312
326
  #
327
+ # @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation
328
+ #
313
329
  # @param event_stream [Symbol, :THREE_DS_AUTHENTICATION] The event stream during which the rule was evaluated
314
330
 
315
331
  class Action < Lithic::Internal::Type::BaseModel
@@ -406,7 +422,13 @@ module Lithic
406
422
  # @return [Integer]
407
423
  required :rule_version, Integer
408
424
 
409
- # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, event_stream: :TOKENIZATION)
425
+ # @!attribute transaction_token
426
+ # The token of the transaction that triggered the rule evaluation
427
+ #
428
+ # @return [String, nil]
429
+ required :transaction_token, String, nil?: true
430
+
431
+ # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, transaction_token:, event_stream: :TOKENIZATION)
410
432
  # @param token [String] Globally unique identifier for the evaluation
411
433
  #
412
434
  # @param actions [Array<Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction>] Actions returned by the rule evaluation
@@ -421,6 +443,8 @@ module Lithic
421
443
  #
422
444
  # @param rule_version [Integer] Version of the rule that was evaluated
423
445
  #
446
+ # @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation
447
+ #
424
448
  # @param event_stream [Symbol, :TOKENIZATION] The event stream during which the rule was evaluated
425
449
 
426
450
  module Action
@@ -631,7 +655,13 @@ module Lithic
631
655
  # @return [Integer]
632
656
  required :rule_version, Integer
633
657
 
634
- # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_stream:, event_token:, mode:, rule_version:)
658
+ # @!attribute transaction_token
659
+ # The token of the transaction that triggered the rule evaluation
660
+ #
661
+ # @return [String, nil]
662
+ required :transaction_token, String, nil?: true
663
+
664
+ # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_stream:, event_token:, mode:, rule_version:, transaction_token:)
635
665
  # @param token [String] Globally unique identifier for the evaluation
636
666
  #
637
667
  # @param actions [Array<Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction>] Actions returned by the rule evaluation
@@ -647,6 +677,8 @@ module Lithic
647
677
  # @param mode [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Mode] The state of the Auth Rule
648
678
  #
649
679
  # @param rule_version [Integer] Version of the rule that was evaluated
680
+ #
681
+ # @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation
650
682
 
651
683
  module Action
652
684
  extend Lithic::Internal::Type::Union