@@ -82,6 +82,8 @@ class AuthRule < Lithic::Internal::Type::BaseModel
8282 # - `MERCHANT_LOCK`: AUTHORIZATION event stream.
8383 # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
8484 # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
85+ # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
86+ # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
8587 #
8688 # @return [Symbol, Lithic::Models::AuthRules::AuthRule::Type]
8789 required :type , enum : -> { Lithic ::AuthRules ::AuthRule ::Type }
@@ -127,7 +129,7 @@ class CurrentVersion < Lithic::Internal::Type::BaseModel
127129 # @!attribute parameters
128130 # Parameters for the Auth Rule
129131 #
130- # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters]
132+ # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters ]
131133 required :parameters , union : -> { Lithic ::AuthRules ::AuthRule ::CurrentVersion ::Parameters }
132134
133135 response_only do
@@ -143,7 +145,7 @@ class CurrentVersion < Lithic::Internal::Type::BaseModel
143145 # Some parameter documentations has been truncated, see
144146 # {Lithic::Models::AuthRules::AuthRule::CurrentVersion} for more details.
145147 #
146- # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters] Parameters for the Auth Rule
148+ # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters ] Parameters for the Auth Rule
147149 #
148150 # @param version [Integer] The version of the rule, this is incremented whenever the rule's parameters chan
149151
@@ -168,19 +170,44 @@ module Parameters
168170
169171 variant -> { Lithic ::AuthRules ::ConditionalTokenizationActionParameters }
170172
173+ # Parameters for defining a TypeScript code rule
174+ variant -> { Lithic ::AuthRules ::TypescriptCodeParameters }
175+
171176 # @!method self.variants
172- # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters)]
177+ # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters )]
173178 end
174179 end
175180
176181 # @see Lithic::Models::AuthRules::AuthRule#draft_version
177182 class DraftVersion < Lithic ::Internal ::Type ::BaseModel
183+ # @!attribute error
184+ # An error message if the draft version failed compilation. Populated when `state`
185+ # is `ERROR`, `null` otherwise.
186+ #
187+ # @return [String, nil]
188+ required :error , String , nil? : true
189+
178190 # @!attribute parameters
179191 # Parameters for the Auth Rule
180192 #
181- # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters]
193+ # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters ]
182194 required :parameters , union : -> { Lithic ::AuthRules ::AuthRule ::DraftVersion ::Parameters }
183195
196+ # @!attribute state
197+ # The state of the draft version. Most rules are created synchronously and the
198+ # state is immediately `SHADOWING`. Rules backed by TypeScript code are compiled
199+ # asynchronously — the state starts as `PENDING` and transitions to `SHADOWING` on
200+ # success or `ERROR` on failure.
201+ #
202+ # - `PENDING`: Compilation of the rule is in progress (TypeScript rules only).
203+ # - `SHADOWING`: The draft version is ready and evaluating in shadow mode
204+ # alongside the current active version. It can be promoted to the active
205+ # version.
206+ # - `ERROR`: Compilation of the rule failed. Check the `error` field for details.
207+ #
208+ # @return [Symbol, Lithic::Models::AuthRules::AuthRule::DraftVersion::State]
209+ required :state , enum : -> { Lithic ::AuthRules ::AuthRule ::DraftVersion ::State }
210+
184211 response_only do
185212 # @!attribute version
186213 # The version of the rule, this is incremented whenever the rule's parameters
@@ -190,11 +217,15 @@ class DraftVersion < Lithic::Internal::Type::BaseModel
190217 required :version , Integer
191218 end
192219
193- # @!method initialize(parameters:, version:)
220+ # @!method initialize(error:, parameters:, state :, version:)
194221 # Some parameter documentations has been truncated, see
195222 # {Lithic::Models::AuthRules::AuthRule::DraftVersion} for more details.
196223 #
197- # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters] Parameters for the Auth Rule
224+ # @param error [String, nil] An error message if the draft version failed compilation. Populated when `state`
225+ #
226+ # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters] Parameters for the Auth Rule
227+ #
228+ # @param state [Symbol, Lithic::Models::AuthRules::AuthRule::DraftVersion::State] The state of the draft version. Most rules are created synchronously and the sta
198229 #
199230 # @param version [Integer] The version of the rule, this is incremented whenever the rule's parameters chan
200231
@@ -219,8 +250,34 @@ module Parameters
219250
220251 variant -> { Lithic ::AuthRules ::ConditionalTokenizationActionParameters }
221252
253+ # Parameters for defining a TypeScript code rule
254+ variant -> { Lithic ::AuthRules ::TypescriptCodeParameters }
255+
222256 # @!method self.variants
223- # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters)]
257+ # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters)]
258+ end
259+
260+ # The state of the draft version. Most rules are created synchronously and the
261+ # state is immediately `SHADOWING`. Rules backed by TypeScript code are compiled
262+ # asynchronously — the state starts as `PENDING` and transitions to `SHADOWING` on
263+ # success or `ERROR` on failure.
264+ #
265+ # - `PENDING`: Compilation of the rule is in progress (TypeScript rules only).
266+ # - `SHADOWING`: The draft version is ready and evaluating in shadow mode
267+ # alongside the current active version. It can be promoted to the active
268+ # version.
269+ # - `ERROR`: Compilation of the rule failed. Check the `error` field for details.
270+ #
271+ # @see Lithic::Models::AuthRules::AuthRule::DraftVersion#state
272+ module State
273+ extend Lithic ::Internal ::Type ::Enum
274+
275+ PENDING = :PENDING
276+ SHADOWING = :SHADOWING
277+ ERROR = :ERROR
278+
279+ # @!method self.values
280+ # @return [Array<Symbol>]
224281 end
225282 end
226283
@@ -248,6 +305,8 @@ module State
248305 # - `MERCHANT_LOCK`: AUTHORIZATION event stream.
249306 # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
250307 # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
308+ # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
309+ # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
251310 #
252311 # @see Lithic::Models::AuthRules::AuthRule#type
253312 module Type
@@ -257,6 +316,7 @@ module Type
257316 VELOCITY_LIMIT = :VELOCITY_LIMIT
258317 MERCHANT_LOCK = :MERCHANT_LOCK
259318 CONDITIONAL_ACTION = :CONDITIONAL_ACTION
319+ TYPESCRIPT_CODE = :TYPESCRIPT_CODE
260320
261321 # @!method self.values
262322 # @return [Array<Symbol>]
0 commit comments