22
33import { APIResource } from '../../../resource' ;
44import * as Core from '../../../core' ;
5+ import * as V2API from './v2' ;
56
67export class Backtests extends APIResource {
78 /**
@@ -22,13 +23,14 @@ export class Backtests extends APIResource {
2223 * `/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}`
2324 * endpoint.
2425 *
25- * Lithic currently supports backtesting for `CONDITIONAL_BLOCK` rules. Backtesting
26- * for `VELOCITY_LIMIT` rules is generally not supported. In specific cases (i.e.
27- * where Lithic has pre-calculated the requested velocity metrics for historical
28- * transactions), a backtest may be feasible. However, such cases are uncommon and
29- * customers should not anticipate support for velocity backtests under most
30- * configurations. If a historical transaction does not feature the required inputs
31- * to evaluate the rule, then it will not be included in the final backtest report.
26+ * Lithic currently supports backtesting for `CONDITIONAL_BLOCK` /
27+ * `CONDITIONAL_3DS_ACTION` rules. Backtesting for `VELOCITY_LIMIT` rules is
28+ * generally not supported. In specific cases (i.e. where Lithic has pre-calculated
29+ * the requested velocity metrics for historical transactions), a backtest may be
30+ * feasible. However, such cases are uncommon and customers should not anticipate
31+ * support for velocity backtests under most configurations. If a historical
32+ * transaction does not feature the required inputs to evaluate the rule, then it
33+ * will not be included in the final backtest report.
3234 *
3335 * @example
3436 * ```ts
@@ -96,129 +98,9 @@ export interface BacktestResults {
9698
9799export namespace BacktestResults {
98100 export interface Results {
99- current_version ?: Results . CurrentVersion | null ;
101+ current_version ?: V2API . RuleStats | null ;
100102
101- draft_version ?: Results . DraftVersion | null ;
102- }
103-
104- export namespace Results {
105- export interface CurrentVersion {
106- /**
107- * The total number of historical transactions approved by this rule during the
108- * relevant period, or the number of transactions that would have been approved if
109- * the rule was evaluated in shadow mode.
110- */
111- approved ?: number ;
112-
113- /**
114- * The total number of historical transactions challenged by this rule during the
115- * relevant period, or the number of transactions that would have been challenged
116- * if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth
117- * Rules.
118- */
119- challenged ?: number ;
120-
121- /**
122- * The total number of historical transactions declined by this rule during the
123- * relevant period, or the number of transactions that would have been declined if
124- * the rule was evaluated in shadow mode.
125- */
126- declined ?: number ;
127-
128- /**
129- * Example events and their outcomes.
130- */
131- examples ?: Array < CurrentVersion . Example > ;
132-
133- /**
134- * The version of the rule, this is incremented whenever the rule's parameters
135- * change.
136- */
137- version ?: number ;
138- }
139-
140- export namespace CurrentVersion {
141- export interface Example {
142- /**
143- * Whether the rule would have approved the request.
144- */
145- approved ?: boolean ;
146-
147- /**
148- * The decision made by the rule for this event.
149- */
150- decision ?: 'APPROVED' | 'DECLINED' | 'CHALLENGED' ;
151-
152- /**
153- * The event token.
154- */
155- event_token ?: string ;
156-
157- /**
158- * The timestamp of the event.
159- */
160- timestamp ?: string ;
161- }
162- }
163-
164- export interface DraftVersion {
165- /**
166- * The total number of historical transactions approved by this rule during the
167- * relevant period, or the number of transactions that would have been approved if
168- * the rule was evaluated in shadow mode.
169- */
170- approved ?: number ;
171-
172- /**
173- * The total number of historical transactions challenged by this rule during the
174- * relevant period, or the number of transactions that would have been challenged
175- * if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth
176- * Rules.
177- */
178- challenged ?: number ;
179-
180- /**
181- * The total number of historical transactions declined by this rule during the
182- * relevant period, or the number of transactions that would have been declined if
183- * the rule was evaluated in shadow mode.
184- */
185- declined ?: number ;
186-
187- /**
188- * Example events and their outcomes.
189- */
190- examples ?: Array < DraftVersion . Example > ;
191-
192- /**
193- * The version of the rule, this is incremented whenever the rule's parameters
194- * change.
195- */
196- version ?: number ;
197- }
198-
199- export namespace DraftVersion {
200- export interface Example {
201- /**
202- * Whether the rule would have approved the request.
203- */
204- approved ?: boolean ;
205-
206- /**
207- * The decision made by the rule for this event.
208- */
209- decision ?: 'APPROVED' | 'DECLINED' | 'CHALLENGED' ;
210-
211- /**
212- * The event token.
213- */
214- event_token ?: string ;
215-
216- /**
217- * The timestamp of the event.
218- */
219- timestamp ?: string ;
220- }
221- }
103+ draft_version ?: V2API . RuleStats | null ;
222104 }
223105
224106 export interface SimulationParameters {
0 commit comments