@delopay/sdk 0.301.0 → 0.302.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.
@@ -60,6 +60,72 @@ interface RiskModel {
60
60
  }
61
61
  /** `stored` once an operator saved a model; `configuration` uses the deployment's default. */
62
62
  type RiskModelSource = 'stored' | 'configuration';
63
+ /**
64
+ * A range of UTC days to recalculate the shop risk history for, `YYYY-MM-DD`,
65
+ * `until` exclusive: at most tomorrow and at most 366 days after `from`.
66
+ */
67
+ interface RiskBackfillRequest {
68
+ from: string;
69
+ until: string;
70
+ }
71
+ /** What a recalculation request was accepted as. */
72
+ interface RiskBackfillResponse {
73
+ /** `false` when this range is still queued or running: nothing new was started. */
74
+ enqueued: boolean;
75
+ /** The same for every request of this range. */
76
+ job_id: string;
77
+ days: number;
78
+ }
79
+ /**
80
+ * Where a recalculation stands. `partial` visited every requested day but
81
+ * could not score some of them for every merchant; it is not a success.
82
+ */
83
+ type RiskBackfillState = 'accepted' | 'running' | 'completed' | 'partial' | 'failed';
84
+ /** Why a recalculation stopped. A code to word, not a sentence. */
85
+ type RiskBackfillFailure = 'started_too_often' | 'retries_exhausted' | 'no_risk_model' | 'no_merchant_scored' | 'nothing_left' | 'not_recorded' | 'held';
86
+ /** The requested days that could not be scored for every merchant. */
87
+ interface RiskBackfillIncompleteDays {
88
+ count: number;
89
+ first?: string | null;
90
+ last?: string | null;
91
+ }
92
+ /** One recalculation, as its scheduler row records it. */
93
+ interface RiskBackfillStatus {
94
+ job_id: string;
95
+ from: string;
96
+ until: string;
97
+ days: number;
98
+ state: RiskBackfillState;
99
+ /** Requested days scoring has visited, completely or not. */
100
+ days_scored: number;
101
+ /** Days whose counters are still to be rebuilt; absent once scoring began. */
102
+ rollup_days_remaining?: number | null;
103
+ incomplete_days?: RiskBackfillIncompleteDays | null;
104
+ failure?: RiskBackfillFailure | null;
105
+ /** For `failed`: the first requested day not finished. */
106
+ stopped_at?: string | null;
107
+ /** Every model version the run scored with; more than one means the model changed during it. */
108
+ model_versions: number[];
109
+ /** The operator who requested it, as the audit log names them. */
110
+ requested_by?: string | null;
111
+ requested_at?: string | null;
112
+ finished_at?: string | null;
113
+ updated_at: string;
114
+ }
115
+ /** What submitting a range would do, without queuing it. */
116
+ interface RiskBackfillPreview {
117
+ job_id: string;
118
+ from: string;
119
+ until: string;
120
+ days: number;
121
+ /** The first day whose counters are rebuilt, before `from`. */
122
+ rewrites_from: string;
123
+ /** The model a run would score with now; absent when none is usable. */
124
+ model_version?: number | null;
125
+ model_source?: RiskModelSource | null;
126
+ /** The run of this range already recorded. While accepted or running, submitting queues nothing. */
127
+ existing?: RiskBackfillStatus | null;
128
+ }
63
129
  /** `GET` / `PUT /admin-portal/risk-model`. */
64
130
  interface RiskModelResponse {
65
131
  source: RiskModelSource;
@@ -3068,6 +3134,29 @@ declare class AdminPortal {
3068
3134
  * `PUT /admin-portal/risk-model`
3069
3135
  */
3070
3136
  updateRiskModel(patch: RiskModelPatch, options?: RiskModelUpdateOptions): Promise<RiskModelResponse>;
3137
+ /**
3138
+ * What recalculating the shop risk history over `range` would do, without
3139
+ * queuing it: its days, the first day whose counters are rebuilt, the model
3140
+ * it would score with now, and the run of the same range already recorded.
3141
+ * Refused exactly where `startRiskBackfill()` would be.
3142
+ *
3143
+ * `POST /admin-portal/risk-engine/backfill/preview`
3144
+ */
3145
+ previewRiskBackfill(range: RiskBackfillRequest): Promise<RiskBackfillPreview>;
3146
+ /**
3147
+ * Queue a recalculation of `range`. Days that already have a risk score keep
3148
+ * it, and recalculated days never alert. While the same range is queued or
3149
+ * running, nothing new is started and `enqueued` is `false`.
3150
+ *
3151
+ * `POST /admin-portal/risk-engine/backfill`
3152
+ */
3153
+ startRiskBackfill(range: RiskBackfillRequest): Promise<RiskBackfillResponse>;
3154
+ /**
3155
+ * One recalculation by the `job_id` a preview or start returned.
3156
+ *
3157
+ * `GET /admin-portal/risk-engine/backfill/{job_id}`
3158
+ */
3159
+ getRiskBackfill(jobId: string): Promise<RiskBackfillStatus>;
3071
3160
  }
3072
3161
 
3073
3162
  declare class AuditLogs {
@@ -3697,4 +3786,4 @@ declare class DelopayInternal extends Delopay {
3697
3786
  constructor(...args: ConstructorParameters<typeof Delopay>);
3698
3787
  }
3699
3788
 
3700
- export { Admin, type AdminAdjustmentRequest, type AdminAdjustmentResponse, AdminAnalyticsExclusionRequest, AdminAnalyticsExclusionResponse, AdminAnalyticsExclusionsResponse, type AdminAnalyticsRequest, type AdminAttachVaultRequest, type AdminAttachVaultResponse, type AdminAttemptProcessorCost, type AdminAttemptProcessorCostBase, type AdminAttemptProcessorCostKnown, type AdminAttemptProcessorCostUnrecorded, type AdminAttemptProcessorCostWithoutFigure, type AdminAuditLogExportRecord, AdminBranding, type AdminCreateLedgerRequest, type AdminCreateLedgerResponse, type AdminCreateUserForMerchantRequest, type AdminCustomerDetail, type AdminCustomerListParams, type AdminCustomerListReconciliation, type AdminCustomerListResponse, type AdminLedgerAnalyticsRequest, type AdminLedgerAnalyticsResponse, AdminLive, type AdminOrphanedBillingProfilesResponse, AdminPortal, type AdminProcessorCostEventsParams, type AdminResetLedgerRequest, type AdminResetLedgerResponse, type AdminSetFreeRequest, type AdminSetHardFloorRequest, type AdminSetTrustedRequest, type AdminShopVaultState, type AdminSignInRequest, type AdminSuspendRequest, type AdminTransactionExportParams, type AdminTransactionExportRecord, type AdminTransactionLineExportRecord, type AdminTransactionListParams, type AdminTransactionListResponse, type AdminUnresolvedRefund, type AdminUnresolvedRefundListParams, type AdminUnresolvedRefundListResponse, type AdminUnsuspendRequest, type AdminUpdateUserRequest, type AdminUserResponse, type AdminVaultEntitlementState, type AdminVaultEnvironmentState, type AdminVaultStateResponse, AnalyticsScopeRequest, AnalyticsScopeResponse, ApplePayVerificationCatalogue, ApplePayVerificationSelection, type AuditActorInfo, type AuditActorKind, type AuditImpersonationKind, type AuditLogListParams, type AuditLogListResponse, type AuditLogResponse, AuditLogs, type AuditSessionInfo, AuthResponse, type AuthorizeResponse, type BillingProfileAdoptionCandidate, BillingProfileResponse, BinaryExportOptions, type BrandingAdminResponse, type BrandingUpdateRequest, BulkCreateProcessorCostSchedulesRequest, type BuyerEvidenceAssign, type BuyerEvidenceDeadlineChange, BuyerEvidenceInformationRequest, BuyerEvidenceNote, BuyerEvidenceQueue, BuyerEvidenceQueueQuery, BuyerEvidenceReply, BuyerEvidenceReviewCreate, BuyerEvidenceReviewDetail, BuyerRefundRequestList, BuyerRefundRequestPageQuery, Cache, type CardFundingBackfillCursor, type CardFundingBackfillRequest, type CardFundingBackfillResponse, type CardIssuerCreateRequest, type CardIssuerListResponse, type CardIssuerResponse, type CardIssuerUpdateRequest, CardIssuers, ClientAnalyticsRequest, Configs, type ConnectorHealthConfig, type ConnectorRestrictionResponse, type ConnectorRestrictionRuleAction, type ConnectorRestrictionRuleResponse, ConnectorRestrictionRules, type ConnectorRestrictionScope, ConnectorRestrictions, type ConnectorVisibility, type ConsolidateRolesRequest, type ConsolidateRolesResponse, type ConsolidationCandidate, type ConsolidationCandidatesResponse, type ConsolidationSource, type ConsolidationVerdict, type CreateConnectorRestrictionRuleRequest, type CreateInternalUserRequest, CreateProcessorCostScheduleRequest, type CreateSharedRoleRequest, type CreateTenantUserRequest, CsvExportOptions, type CustomerSummary, type CustomerUser, Delopay, DelopayInternal, type DeploymentBranding, DeviceDrillRequest, DevicesAnalyticsResponse, Diagnostic, type DiagnosticAttentionBoard, type DiagnosticAttentionItem, type DiagnosticAttentionParams, type DiagnosticAttentionSeverity, type DiagnosticCaptureState, type DiagnosticChange, type DiagnosticChangeListParams, type DiagnosticConnectorCall, type DiagnosticConnectorCallListParams, type DiagnosticDependencyCard, type DiagnosticEmptyReason, type DiagnosticEnvironment, type DiagnosticErrorCodeCount, type DiagnosticFiringAlert, type DiagnosticHealthState, type DiagnosticHealthTile, type DiagnosticIncomingWebhook, type DiagnosticIncomingWebhookDetail, type DiagnosticIncomingWebhookListParams, type DiagnosticInfrastructure, type DiagnosticList, type DiagnosticNearMatch, type DiagnosticOutgoingAttempt, type DiagnosticOutgoingWebhook, type DiagnosticOutgoingWebhookListParams, type DiagnosticOutgoingWebhookSummary, type DiagnosticPage, type DiagnosticPanel, type DiagnosticPayment, type DiagnosticPaymentListParams, type DiagnosticQueueItem, type DiagnosticQueueListParams, type DiagnosticQueueSummary, type DiagnosticReplicaHealth, type DiagnosticResolvedId, type DiagnosticRevealRequest, type DiagnosticRevealResponse, type DiagnosticRouterLog, type DiagnosticRouterLogParams, type DiagnosticSourceUnavailable, type DiagnosticTrace, type DiagnosticTraceSpan, type DiagnosticWindow, DrillResponse, DynamicLineExportOptions, EntityType, ExportEnvelope, ExportOptions, FailureSubstatus, FeeRulePreviewRequest, FeeRulePreviewResponse, FeeScheduleCreateRequest, FeeScheduleResponse, FeeScheduleUpdateRequest, FeeStatementDetail, type FeeTotalBound, GeoAnalyticsResponse, GeoDrillRequest, Gsm, type GsmDecision, type GsmRuleCreateRequest, type GsmRuleResponse, type GsmRuleUpdateRequest, InvoiceList, InvoicePageQuery, JsonExportOptions, type LastAdministratorRefusal, type LastAdministratorRoute, type LedgerDayBucket, type LedgerMerchant, type ListConnectorRestrictionRulesQuery, LiveEventStream, LiveStreamOptions, LiveVersionsParams, LiveVersionsResponse, MemberMethodAccessResponse, MemberPermissionOverridesResponse, MerchantAccountResponse, MerchantAccountUpdateRequest, MerchantRisk, type MerchantRoleSummary, MerchantSettingsQuery, MessageLanguage, MessageTemplateDetail, MessageTemplateLanguage, MessageTemplateList, MessageTemplatePreview, type NativeRenewalCloseResponse, type NativeRenewalCloseTarget, NativeRenewals, type OnboardMerchantRequest, type OnboardMerchantResponse, type OrphanedBillingProfile, type OverviewStat, type OverviewStatsResponse, ParentGroup, type PaymentAnalyticsRequest, type PaymentAnalyticsResponse, PaymentAttemptsListResponse, PaymentClientContextListResponse, PaymentIntegrationTestRequest, PaymentIntegrationTestResponse, PaymentLogConnectorCallDetail, PaymentLogIncomingWebhookDetail, PaymentLogOutgoingWebhookDetail, PaymentLogsResponse, type PaymentPeriodStats, PaymentProductLines, PaymentResponse, PaymentStatusHistoryResponse, PaymentsDeleteResponse, PermissionOverride, PermissionScope, type PlatformAnalyticsResponse, PlatformBilling, type PlatformFeeReturnListResponse, type PlatformFeeReturnQuery, type PlatformFeeReturnRecord, type PlatformFeeReturnResponse, type PlatformFeeReturnScope, type PlatformFeeReturnSetting, type PlatformFeeReturnSource, type PlatformFeeReturnStatus, PlatformFeeRuleInput, PlatformFeeRuleRecord, PlatformFees, PlatformMessageTemplates, PlatformSettings, PreviewMessageTemplateRequest, ProcessorCostEstimateBasis, ProcessorCostEventsResponse, ProcessorCostScheduleResponse, ProfileResponse, ProjectResponse, RefundListResponse, RefundStatus, type RefundVolumeQuery, type RefundVolumeResponse, type RefundVolumeScope, type RefundVolumeSetting, type RefundVolumeSource, ReplaceProcessorCostScheduleRequest, type ReplayMaskMode, type ReplayMaskingRule, RequestExtras, RequestFn, ResetMessageTemplateLanguageQuery, type RetireSharedRolePreviewRequest, type RetireSharedRolePreviewResponse, type RetireSharedRoleRequest, RiskAdjustments, RiskBands, type RiskClassWeights, type RiskCombine, RiskComponentRule, RiskDecidingWindow, type RiskModel, type RiskModelPatch, type RiskModelResponse, type RiskModelSource, type RiskModelUpdateOptions, type RiskSettingsOverrides, RiskTuningPreviewResponse, RiskTuningResponse, RiskTuningTarget, RiskTuningUpdateRequest, RiskWindowBandOverrides, type RoleAccessChange, type RoleColor, type RoleParentGroup, ScopeDrillRequest, SellToRestrictionsResponse, SendTestMessageRequest, SendTestMessageResponse, SettingsResponse, SettlementCostPeriod, SettlementCurrentParams, SettlementCurrentResponse, SettlementOverviewParams, SettlementOverviewResponse, SettlementStatementListParams, SettlementStatementListResponse, type SharedRoleApplied, type SharedRoleAudience, type SharedRoleChange, type SharedRoleDetailResponse, type SharedRoleListResponse, type SharedRoleMerchantHolders, type SharedRoleMerchantRef, type SharedRolePreviewResponse, type SharedRoleRefusal, type SharedRoleReplacementKind, type SharedRoleReplacementOption, type SharedRoleSummary, ShopResponse, SignUpWithMerchantIdRequest, type SignupToggleRequest, type SignupToggleResponse, StatementPdfParams, SubscriptionAnalyticsRequest, SubscriptionAnalyticsResponse, SubscriptionDrillRequest, type SystemRoleSummary, TransactionLineExportRecord, type UpdateConnectorRestrictionRuleRequest, type UpdateLedgerEntryRequest, UpdateMemberMethodAccessRequest, UpdateMemberPermissionOverridesRequest, UpdateMessageTemplateLanguageRequest, type UpdatePlatformFeeReturnRequest, UpdateProcessorCostScheduleRequest, type UpdateRefundVolumeRequest, UpdateSettingsRequest, type UpdateSharedRoleRequest, type UpsertConnectorRestrictionRequest, VaultEnvironment };
3789
+ export { Admin, type AdminAdjustmentRequest, type AdminAdjustmentResponse, AdminAnalyticsExclusionRequest, AdminAnalyticsExclusionResponse, AdminAnalyticsExclusionsResponse, type AdminAnalyticsRequest, type AdminAttachVaultRequest, type AdminAttachVaultResponse, type AdminAttemptProcessorCost, type AdminAttemptProcessorCostBase, type AdminAttemptProcessorCostKnown, type AdminAttemptProcessorCostUnrecorded, type AdminAttemptProcessorCostWithoutFigure, type AdminAuditLogExportRecord, AdminBranding, type AdminCreateLedgerRequest, type AdminCreateLedgerResponse, type AdminCreateUserForMerchantRequest, type AdminCustomerDetail, type AdminCustomerListParams, type AdminCustomerListReconciliation, type AdminCustomerListResponse, type AdminLedgerAnalyticsRequest, type AdminLedgerAnalyticsResponse, AdminLive, type AdminOrphanedBillingProfilesResponse, AdminPortal, type AdminProcessorCostEventsParams, type AdminResetLedgerRequest, type AdminResetLedgerResponse, type AdminSetFreeRequest, type AdminSetHardFloorRequest, type AdminSetTrustedRequest, type AdminShopVaultState, type AdminSignInRequest, type AdminSuspendRequest, type AdminTransactionExportParams, type AdminTransactionExportRecord, type AdminTransactionLineExportRecord, type AdminTransactionListParams, type AdminTransactionListResponse, type AdminUnresolvedRefund, type AdminUnresolvedRefundListParams, type AdminUnresolvedRefundListResponse, type AdminUnsuspendRequest, type AdminUpdateUserRequest, type AdminUserResponse, type AdminVaultEntitlementState, type AdminVaultEnvironmentState, type AdminVaultStateResponse, AnalyticsScopeRequest, AnalyticsScopeResponse, ApplePayVerificationCatalogue, ApplePayVerificationSelection, type AuditActorInfo, type AuditActorKind, type AuditImpersonationKind, type AuditLogListParams, type AuditLogListResponse, type AuditLogResponse, AuditLogs, type AuditSessionInfo, AuthResponse, type AuthorizeResponse, type BillingProfileAdoptionCandidate, BillingProfileResponse, BinaryExportOptions, type BrandingAdminResponse, type BrandingUpdateRequest, BulkCreateProcessorCostSchedulesRequest, type BuyerEvidenceAssign, type BuyerEvidenceDeadlineChange, BuyerEvidenceInformationRequest, BuyerEvidenceNote, BuyerEvidenceQueue, BuyerEvidenceQueueQuery, BuyerEvidenceReply, BuyerEvidenceReviewCreate, BuyerEvidenceReviewDetail, BuyerRefundRequestList, BuyerRefundRequestPageQuery, Cache, type CardFundingBackfillCursor, type CardFundingBackfillRequest, type CardFundingBackfillResponse, type CardIssuerCreateRequest, type CardIssuerListResponse, type CardIssuerResponse, type CardIssuerUpdateRequest, CardIssuers, ClientAnalyticsRequest, Configs, type ConnectorHealthConfig, type ConnectorRestrictionResponse, type ConnectorRestrictionRuleAction, type ConnectorRestrictionRuleResponse, ConnectorRestrictionRules, type ConnectorRestrictionScope, ConnectorRestrictions, type ConnectorVisibility, type ConsolidateRolesRequest, type ConsolidateRolesResponse, type ConsolidationCandidate, type ConsolidationCandidatesResponse, type ConsolidationSource, type ConsolidationVerdict, type CreateConnectorRestrictionRuleRequest, type CreateInternalUserRequest, CreateProcessorCostScheduleRequest, type CreateSharedRoleRequest, type CreateTenantUserRequest, CsvExportOptions, type CustomerSummary, type CustomerUser, Delopay, DelopayInternal, type DeploymentBranding, DeviceDrillRequest, DevicesAnalyticsResponse, Diagnostic, type DiagnosticAttentionBoard, type DiagnosticAttentionItem, type DiagnosticAttentionParams, type DiagnosticAttentionSeverity, type DiagnosticCaptureState, type DiagnosticChange, type DiagnosticChangeListParams, type DiagnosticConnectorCall, type DiagnosticConnectorCallListParams, type DiagnosticDependencyCard, type DiagnosticEmptyReason, type DiagnosticEnvironment, type DiagnosticErrorCodeCount, type DiagnosticFiringAlert, type DiagnosticHealthState, type DiagnosticHealthTile, type DiagnosticIncomingWebhook, type DiagnosticIncomingWebhookDetail, type DiagnosticIncomingWebhookListParams, type DiagnosticInfrastructure, type DiagnosticList, type DiagnosticNearMatch, type DiagnosticOutgoingAttempt, type DiagnosticOutgoingWebhook, type DiagnosticOutgoingWebhookListParams, type DiagnosticOutgoingWebhookSummary, type DiagnosticPage, type DiagnosticPanel, type DiagnosticPayment, type DiagnosticPaymentListParams, type DiagnosticQueueItem, type DiagnosticQueueListParams, type DiagnosticQueueSummary, type DiagnosticReplicaHealth, type DiagnosticResolvedId, type DiagnosticRevealRequest, type DiagnosticRevealResponse, type DiagnosticRouterLog, type DiagnosticRouterLogParams, type DiagnosticSourceUnavailable, type DiagnosticTrace, type DiagnosticTraceSpan, type DiagnosticWindow, DrillResponse, DynamicLineExportOptions, EntityType, ExportEnvelope, ExportOptions, FailureSubstatus, FeeRulePreviewRequest, FeeRulePreviewResponse, FeeScheduleCreateRequest, FeeScheduleResponse, FeeScheduleUpdateRequest, FeeStatementDetail, type FeeTotalBound, GeoAnalyticsResponse, GeoDrillRequest, Gsm, type GsmDecision, type GsmRuleCreateRequest, type GsmRuleResponse, type GsmRuleUpdateRequest, InvoiceList, InvoicePageQuery, JsonExportOptions, type LastAdministratorRefusal, type LastAdministratorRoute, type LedgerDayBucket, type LedgerMerchant, type ListConnectorRestrictionRulesQuery, LiveEventStream, LiveStreamOptions, LiveVersionsParams, LiveVersionsResponse, MemberMethodAccessResponse, MemberPermissionOverridesResponse, MerchantAccountResponse, MerchantAccountUpdateRequest, MerchantRisk, type MerchantRoleSummary, MerchantSettingsQuery, MessageLanguage, MessageTemplateDetail, MessageTemplateLanguage, MessageTemplateList, MessageTemplatePreview, type NativeRenewalCloseResponse, type NativeRenewalCloseTarget, NativeRenewals, type OnboardMerchantRequest, type OnboardMerchantResponse, type OrphanedBillingProfile, type OverviewStat, type OverviewStatsResponse, ParentGroup, type PaymentAnalyticsRequest, type PaymentAnalyticsResponse, PaymentAttemptsListResponse, PaymentClientContextListResponse, PaymentIntegrationTestRequest, PaymentIntegrationTestResponse, PaymentLogConnectorCallDetail, PaymentLogIncomingWebhookDetail, PaymentLogOutgoingWebhookDetail, PaymentLogsResponse, type PaymentPeriodStats, PaymentProductLines, PaymentResponse, PaymentStatusHistoryResponse, PaymentsDeleteResponse, PermissionOverride, PermissionScope, type PlatformAnalyticsResponse, PlatformBilling, type PlatformFeeReturnListResponse, type PlatformFeeReturnQuery, type PlatformFeeReturnRecord, type PlatformFeeReturnResponse, type PlatformFeeReturnScope, type PlatformFeeReturnSetting, type PlatformFeeReturnSource, type PlatformFeeReturnStatus, PlatformFeeRuleInput, PlatformFeeRuleRecord, PlatformFees, PlatformMessageTemplates, PlatformSettings, PreviewMessageTemplateRequest, ProcessorCostEstimateBasis, ProcessorCostEventsResponse, ProcessorCostScheduleResponse, ProfileResponse, ProjectResponse, RefundListResponse, RefundStatus, type RefundVolumeQuery, type RefundVolumeResponse, type RefundVolumeScope, type RefundVolumeSetting, type RefundVolumeSource, ReplaceProcessorCostScheduleRequest, type ReplayMaskMode, type ReplayMaskingRule, RequestExtras, RequestFn, ResetMessageTemplateLanguageQuery, type RetireSharedRolePreviewRequest, type RetireSharedRolePreviewResponse, type RetireSharedRoleRequest, RiskAdjustments, type RiskBackfillFailure, type RiskBackfillIncompleteDays, type RiskBackfillPreview, type RiskBackfillRequest, type RiskBackfillResponse, type RiskBackfillState, type RiskBackfillStatus, RiskBands, type RiskClassWeights, type RiskCombine, RiskComponentRule, RiskDecidingWindow, type RiskModel, type RiskModelPatch, type RiskModelResponse, type RiskModelSource, type RiskModelUpdateOptions, type RiskSettingsOverrides, RiskTuningPreviewResponse, RiskTuningResponse, RiskTuningTarget, RiskTuningUpdateRequest, RiskWindowBandOverrides, type RoleAccessChange, type RoleColor, type RoleParentGroup, ScopeDrillRequest, SellToRestrictionsResponse, SendTestMessageRequest, SendTestMessageResponse, SettingsResponse, SettlementCostPeriod, SettlementCurrentParams, SettlementCurrentResponse, SettlementOverviewParams, SettlementOverviewResponse, SettlementStatementListParams, SettlementStatementListResponse, type SharedRoleApplied, type SharedRoleAudience, type SharedRoleChange, type SharedRoleDetailResponse, type SharedRoleListResponse, type SharedRoleMerchantHolders, type SharedRoleMerchantRef, type SharedRolePreviewResponse, type SharedRoleRefusal, type SharedRoleReplacementKind, type SharedRoleReplacementOption, type SharedRoleSummary, ShopResponse, SignUpWithMerchantIdRequest, type SignupToggleRequest, type SignupToggleResponse, StatementPdfParams, SubscriptionAnalyticsRequest, SubscriptionAnalyticsResponse, SubscriptionDrillRequest, type SystemRoleSummary, TransactionLineExportRecord, type UpdateConnectorRestrictionRuleRequest, type UpdateLedgerEntryRequest, UpdateMemberMethodAccessRequest, UpdateMemberPermissionOverridesRequest, UpdateMessageTemplateLanguageRequest, type UpdatePlatformFeeReturnRequest, UpdateProcessorCostScheduleRequest, type UpdateRefundVolumeRequest, UpdateSettingsRequest, type UpdateSharedRoleRequest, type UpsertConnectorRestrictionRequest, VaultEnvironment };
@@ -60,6 +60,72 @@ interface RiskModel {
60
60
  }
61
61
  /** `stored` once an operator saved a model; `configuration` uses the deployment's default. */
62
62
  type RiskModelSource = 'stored' | 'configuration';
63
+ /**
64
+ * A range of UTC days to recalculate the shop risk history for, `YYYY-MM-DD`,
65
+ * `until` exclusive: at most tomorrow and at most 366 days after `from`.
66
+ */
67
+ interface RiskBackfillRequest {
68
+ from: string;
69
+ until: string;
70
+ }
71
+ /** What a recalculation request was accepted as. */
72
+ interface RiskBackfillResponse {
73
+ /** `false` when this range is still queued or running: nothing new was started. */
74
+ enqueued: boolean;
75
+ /** The same for every request of this range. */
76
+ job_id: string;
77
+ days: number;
78
+ }
79
+ /**
80
+ * Where a recalculation stands. `partial` visited every requested day but
81
+ * could not score some of them for every merchant; it is not a success.
82
+ */
83
+ type RiskBackfillState = 'accepted' | 'running' | 'completed' | 'partial' | 'failed';
84
+ /** Why a recalculation stopped. A code to word, not a sentence. */
85
+ type RiskBackfillFailure = 'started_too_often' | 'retries_exhausted' | 'no_risk_model' | 'no_merchant_scored' | 'nothing_left' | 'not_recorded' | 'held';
86
+ /** The requested days that could not be scored for every merchant. */
87
+ interface RiskBackfillIncompleteDays {
88
+ count: number;
89
+ first?: string | null;
90
+ last?: string | null;
91
+ }
92
+ /** One recalculation, as its scheduler row records it. */
93
+ interface RiskBackfillStatus {
94
+ job_id: string;
95
+ from: string;
96
+ until: string;
97
+ days: number;
98
+ state: RiskBackfillState;
99
+ /** Requested days scoring has visited, completely or not. */
100
+ days_scored: number;
101
+ /** Days whose counters are still to be rebuilt; absent once scoring began. */
102
+ rollup_days_remaining?: number | null;
103
+ incomplete_days?: RiskBackfillIncompleteDays | null;
104
+ failure?: RiskBackfillFailure | null;
105
+ /** For `failed`: the first requested day not finished. */
106
+ stopped_at?: string | null;
107
+ /** Every model version the run scored with; more than one means the model changed during it. */
108
+ model_versions: number[];
109
+ /** The operator who requested it, as the audit log names them. */
110
+ requested_by?: string | null;
111
+ requested_at?: string | null;
112
+ finished_at?: string | null;
113
+ updated_at: string;
114
+ }
115
+ /** What submitting a range would do, without queuing it. */
116
+ interface RiskBackfillPreview {
117
+ job_id: string;
118
+ from: string;
119
+ until: string;
120
+ days: number;
121
+ /** The first day whose counters are rebuilt, before `from`. */
122
+ rewrites_from: string;
123
+ /** The model a run would score with now; absent when none is usable. */
124
+ model_version?: number | null;
125
+ model_source?: RiskModelSource | null;
126
+ /** The run of this range already recorded. While accepted or running, submitting queues nothing. */
127
+ existing?: RiskBackfillStatus | null;
128
+ }
63
129
  /** `GET` / `PUT /admin-portal/risk-model`. */
64
130
  interface RiskModelResponse {
65
131
  source: RiskModelSource;
@@ -3068,6 +3134,29 @@ declare class AdminPortal {
3068
3134
  * `PUT /admin-portal/risk-model`
3069
3135
  */
3070
3136
  updateRiskModel(patch: RiskModelPatch, options?: RiskModelUpdateOptions): Promise<RiskModelResponse>;
3137
+ /**
3138
+ * What recalculating the shop risk history over `range` would do, without
3139
+ * queuing it: its days, the first day whose counters are rebuilt, the model
3140
+ * it would score with now, and the run of the same range already recorded.
3141
+ * Refused exactly where `startRiskBackfill()` would be.
3142
+ *
3143
+ * `POST /admin-portal/risk-engine/backfill/preview`
3144
+ */
3145
+ previewRiskBackfill(range: RiskBackfillRequest): Promise<RiskBackfillPreview>;
3146
+ /**
3147
+ * Queue a recalculation of `range`. Days that already have a risk score keep
3148
+ * it, and recalculated days never alert. While the same range is queued or
3149
+ * running, nothing new is started and `enqueued` is `false`.
3150
+ *
3151
+ * `POST /admin-portal/risk-engine/backfill`
3152
+ */
3153
+ startRiskBackfill(range: RiskBackfillRequest): Promise<RiskBackfillResponse>;
3154
+ /**
3155
+ * One recalculation by the `job_id` a preview or start returned.
3156
+ *
3157
+ * `GET /admin-portal/risk-engine/backfill/{job_id}`
3158
+ */
3159
+ getRiskBackfill(jobId: string): Promise<RiskBackfillStatus>;
3071
3160
  }
3072
3161
 
3073
3162
  declare class AuditLogs {
@@ -3697,4 +3786,4 @@ declare class DelopayInternal extends Delopay {
3697
3786
  constructor(...args: ConstructorParameters<typeof Delopay>);
3698
3787
  }
3699
3788
 
3700
- export { Admin, type AdminAdjustmentRequest, type AdminAdjustmentResponse, AdminAnalyticsExclusionRequest, AdminAnalyticsExclusionResponse, AdminAnalyticsExclusionsResponse, type AdminAnalyticsRequest, type AdminAttachVaultRequest, type AdminAttachVaultResponse, type AdminAttemptProcessorCost, type AdminAttemptProcessorCostBase, type AdminAttemptProcessorCostKnown, type AdminAttemptProcessorCostUnrecorded, type AdminAttemptProcessorCostWithoutFigure, type AdminAuditLogExportRecord, AdminBranding, type AdminCreateLedgerRequest, type AdminCreateLedgerResponse, type AdminCreateUserForMerchantRequest, type AdminCustomerDetail, type AdminCustomerListParams, type AdminCustomerListReconciliation, type AdminCustomerListResponse, type AdminLedgerAnalyticsRequest, type AdminLedgerAnalyticsResponse, AdminLive, type AdminOrphanedBillingProfilesResponse, AdminPortal, type AdminProcessorCostEventsParams, type AdminResetLedgerRequest, type AdminResetLedgerResponse, type AdminSetFreeRequest, type AdminSetHardFloorRequest, type AdminSetTrustedRequest, type AdminShopVaultState, type AdminSignInRequest, type AdminSuspendRequest, type AdminTransactionExportParams, type AdminTransactionExportRecord, type AdminTransactionLineExportRecord, type AdminTransactionListParams, type AdminTransactionListResponse, type AdminUnresolvedRefund, type AdminUnresolvedRefundListParams, type AdminUnresolvedRefundListResponse, type AdminUnsuspendRequest, type AdminUpdateUserRequest, type AdminUserResponse, type AdminVaultEntitlementState, type AdminVaultEnvironmentState, type AdminVaultStateResponse, AnalyticsScopeRequest, AnalyticsScopeResponse, ApplePayVerificationCatalogue, ApplePayVerificationSelection, type AuditActorInfo, type AuditActorKind, type AuditImpersonationKind, type AuditLogListParams, type AuditLogListResponse, type AuditLogResponse, AuditLogs, type AuditSessionInfo, AuthResponse, type AuthorizeResponse, type BillingProfileAdoptionCandidate, BillingProfileResponse, BinaryExportOptions, type BrandingAdminResponse, type BrandingUpdateRequest, BulkCreateProcessorCostSchedulesRequest, type BuyerEvidenceAssign, type BuyerEvidenceDeadlineChange, BuyerEvidenceInformationRequest, BuyerEvidenceNote, BuyerEvidenceQueue, BuyerEvidenceQueueQuery, BuyerEvidenceReply, BuyerEvidenceReviewCreate, BuyerEvidenceReviewDetail, BuyerRefundRequestList, BuyerRefundRequestPageQuery, Cache, type CardFundingBackfillCursor, type CardFundingBackfillRequest, type CardFundingBackfillResponse, type CardIssuerCreateRequest, type CardIssuerListResponse, type CardIssuerResponse, type CardIssuerUpdateRequest, CardIssuers, ClientAnalyticsRequest, Configs, type ConnectorHealthConfig, type ConnectorRestrictionResponse, type ConnectorRestrictionRuleAction, type ConnectorRestrictionRuleResponse, ConnectorRestrictionRules, type ConnectorRestrictionScope, ConnectorRestrictions, type ConnectorVisibility, type ConsolidateRolesRequest, type ConsolidateRolesResponse, type ConsolidationCandidate, type ConsolidationCandidatesResponse, type ConsolidationSource, type ConsolidationVerdict, type CreateConnectorRestrictionRuleRequest, type CreateInternalUserRequest, CreateProcessorCostScheduleRequest, type CreateSharedRoleRequest, type CreateTenantUserRequest, CsvExportOptions, type CustomerSummary, type CustomerUser, Delopay, DelopayInternal, type DeploymentBranding, DeviceDrillRequest, DevicesAnalyticsResponse, Diagnostic, type DiagnosticAttentionBoard, type DiagnosticAttentionItem, type DiagnosticAttentionParams, type DiagnosticAttentionSeverity, type DiagnosticCaptureState, type DiagnosticChange, type DiagnosticChangeListParams, type DiagnosticConnectorCall, type DiagnosticConnectorCallListParams, type DiagnosticDependencyCard, type DiagnosticEmptyReason, type DiagnosticEnvironment, type DiagnosticErrorCodeCount, type DiagnosticFiringAlert, type DiagnosticHealthState, type DiagnosticHealthTile, type DiagnosticIncomingWebhook, type DiagnosticIncomingWebhookDetail, type DiagnosticIncomingWebhookListParams, type DiagnosticInfrastructure, type DiagnosticList, type DiagnosticNearMatch, type DiagnosticOutgoingAttempt, type DiagnosticOutgoingWebhook, type DiagnosticOutgoingWebhookListParams, type DiagnosticOutgoingWebhookSummary, type DiagnosticPage, type DiagnosticPanel, type DiagnosticPayment, type DiagnosticPaymentListParams, type DiagnosticQueueItem, type DiagnosticQueueListParams, type DiagnosticQueueSummary, type DiagnosticReplicaHealth, type DiagnosticResolvedId, type DiagnosticRevealRequest, type DiagnosticRevealResponse, type DiagnosticRouterLog, type DiagnosticRouterLogParams, type DiagnosticSourceUnavailable, type DiagnosticTrace, type DiagnosticTraceSpan, type DiagnosticWindow, DrillResponse, DynamicLineExportOptions, EntityType, ExportEnvelope, ExportOptions, FailureSubstatus, FeeRulePreviewRequest, FeeRulePreviewResponse, FeeScheduleCreateRequest, FeeScheduleResponse, FeeScheduleUpdateRequest, FeeStatementDetail, type FeeTotalBound, GeoAnalyticsResponse, GeoDrillRequest, Gsm, type GsmDecision, type GsmRuleCreateRequest, type GsmRuleResponse, type GsmRuleUpdateRequest, InvoiceList, InvoicePageQuery, JsonExportOptions, type LastAdministratorRefusal, type LastAdministratorRoute, type LedgerDayBucket, type LedgerMerchant, type ListConnectorRestrictionRulesQuery, LiveEventStream, LiveStreamOptions, LiveVersionsParams, LiveVersionsResponse, MemberMethodAccessResponse, MemberPermissionOverridesResponse, MerchantAccountResponse, MerchantAccountUpdateRequest, MerchantRisk, type MerchantRoleSummary, MerchantSettingsQuery, MessageLanguage, MessageTemplateDetail, MessageTemplateLanguage, MessageTemplateList, MessageTemplatePreview, type NativeRenewalCloseResponse, type NativeRenewalCloseTarget, NativeRenewals, type OnboardMerchantRequest, type OnboardMerchantResponse, type OrphanedBillingProfile, type OverviewStat, type OverviewStatsResponse, ParentGroup, type PaymentAnalyticsRequest, type PaymentAnalyticsResponse, PaymentAttemptsListResponse, PaymentClientContextListResponse, PaymentIntegrationTestRequest, PaymentIntegrationTestResponse, PaymentLogConnectorCallDetail, PaymentLogIncomingWebhookDetail, PaymentLogOutgoingWebhookDetail, PaymentLogsResponse, type PaymentPeriodStats, PaymentProductLines, PaymentResponse, PaymentStatusHistoryResponse, PaymentsDeleteResponse, PermissionOverride, PermissionScope, type PlatformAnalyticsResponse, PlatformBilling, type PlatformFeeReturnListResponse, type PlatformFeeReturnQuery, type PlatformFeeReturnRecord, type PlatformFeeReturnResponse, type PlatformFeeReturnScope, type PlatformFeeReturnSetting, type PlatformFeeReturnSource, type PlatformFeeReturnStatus, PlatformFeeRuleInput, PlatformFeeRuleRecord, PlatformFees, PlatformMessageTemplates, PlatformSettings, PreviewMessageTemplateRequest, ProcessorCostEstimateBasis, ProcessorCostEventsResponse, ProcessorCostScheduleResponse, ProfileResponse, ProjectResponse, RefundListResponse, RefundStatus, type RefundVolumeQuery, type RefundVolumeResponse, type RefundVolumeScope, type RefundVolumeSetting, type RefundVolumeSource, ReplaceProcessorCostScheduleRequest, type ReplayMaskMode, type ReplayMaskingRule, RequestExtras, RequestFn, ResetMessageTemplateLanguageQuery, type RetireSharedRolePreviewRequest, type RetireSharedRolePreviewResponse, type RetireSharedRoleRequest, RiskAdjustments, RiskBands, type RiskClassWeights, type RiskCombine, RiskComponentRule, RiskDecidingWindow, type RiskModel, type RiskModelPatch, type RiskModelResponse, type RiskModelSource, type RiskModelUpdateOptions, type RiskSettingsOverrides, RiskTuningPreviewResponse, RiskTuningResponse, RiskTuningTarget, RiskTuningUpdateRequest, RiskWindowBandOverrides, type RoleAccessChange, type RoleColor, type RoleParentGroup, ScopeDrillRequest, SellToRestrictionsResponse, SendTestMessageRequest, SendTestMessageResponse, SettingsResponse, SettlementCostPeriod, SettlementCurrentParams, SettlementCurrentResponse, SettlementOverviewParams, SettlementOverviewResponse, SettlementStatementListParams, SettlementStatementListResponse, type SharedRoleApplied, type SharedRoleAudience, type SharedRoleChange, type SharedRoleDetailResponse, type SharedRoleListResponse, type SharedRoleMerchantHolders, type SharedRoleMerchantRef, type SharedRolePreviewResponse, type SharedRoleRefusal, type SharedRoleReplacementKind, type SharedRoleReplacementOption, type SharedRoleSummary, ShopResponse, SignUpWithMerchantIdRequest, type SignupToggleRequest, type SignupToggleResponse, StatementPdfParams, SubscriptionAnalyticsRequest, SubscriptionAnalyticsResponse, SubscriptionDrillRequest, type SystemRoleSummary, TransactionLineExportRecord, type UpdateConnectorRestrictionRuleRequest, type UpdateLedgerEntryRequest, UpdateMemberMethodAccessRequest, UpdateMemberPermissionOverridesRequest, UpdateMessageTemplateLanguageRequest, type UpdatePlatformFeeReturnRequest, UpdateProcessorCostScheduleRequest, type UpdateRefundVolumeRequest, UpdateSettingsRequest, type UpdateSharedRoleRequest, type UpsertConnectorRestrictionRequest, VaultEnvironment };
3789
+ export { Admin, type AdminAdjustmentRequest, type AdminAdjustmentResponse, AdminAnalyticsExclusionRequest, AdminAnalyticsExclusionResponse, AdminAnalyticsExclusionsResponse, type AdminAnalyticsRequest, type AdminAttachVaultRequest, type AdminAttachVaultResponse, type AdminAttemptProcessorCost, type AdminAttemptProcessorCostBase, type AdminAttemptProcessorCostKnown, type AdminAttemptProcessorCostUnrecorded, type AdminAttemptProcessorCostWithoutFigure, type AdminAuditLogExportRecord, AdminBranding, type AdminCreateLedgerRequest, type AdminCreateLedgerResponse, type AdminCreateUserForMerchantRequest, type AdminCustomerDetail, type AdminCustomerListParams, type AdminCustomerListReconciliation, type AdminCustomerListResponse, type AdminLedgerAnalyticsRequest, type AdminLedgerAnalyticsResponse, AdminLive, type AdminOrphanedBillingProfilesResponse, AdminPortal, type AdminProcessorCostEventsParams, type AdminResetLedgerRequest, type AdminResetLedgerResponse, type AdminSetFreeRequest, type AdminSetHardFloorRequest, type AdminSetTrustedRequest, type AdminShopVaultState, type AdminSignInRequest, type AdminSuspendRequest, type AdminTransactionExportParams, type AdminTransactionExportRecord, type AdminTransactionLineExportRecord, type AdminTransactionListParams, type AdminTransactionListResponse, type AdminUnresolvedRefund, type AdminUnresolvedRefundListParams, type AdminUnresolvedRefundListResponse, type AdminUnsuspendRequest, type AdminUpdateUserRequest, type AdminUserResponse, type AdminVaultEntitlementState, type AdminVaultEnvironmentState, type AdminVaultStateResponse, AnalyticsScopeRequest, AnalyticsScopeResponse, ApplePayVerificationCatalogue, ApplePayVerificationSelection, type AuditActorInfo, type AuditActorKind, type AuditImpersonationKind, type AuditLogListParams, type AuditLogListResponse, type AuditLogResponse, AuditLogs, type AuditSessionInfo, AuthResponse, type AuthorizeResponse, type BillingProfileAdoptionCandidate, BillingProfileResponse, BinaryExportOptions, type BrandingAdminResponse, type BrandingUpdateRequest, BulkCreateProcessorCostSchedulesRequest, type BuyerEvidenceAssign, type BuyerEvidenceDeadlineChange, BuyerEvidenceInformationRequest, BuyerEvidenceNote, BuyerEvidenceQueue, BuyerEvidenceQueueQuery, BuyerEvidenceReply, BuyerEvidenceReviewCreate, BuyerEvidenceReviewDetail, BuyerRefundRequestList, BuyerRefundRequestPageQuery, Cache, type CardFundingBackfillCursor, type CardFundingBackfillRequest, type CardFundingBackfillResponse, type CardIssuerCreateRequest, type CardIssuerListResponse, type CardIssuerResponse, type CardIssuerUpdateRequest, CardIssuers, ClientAnalyticsRequest, Configs, type ConnectorHealthConfig, type ConnectorRestrictionResponse, type ConnectorRestrictionRuleAction, type ConnectorRestrictionRuleResponse, ConnectorRestrictionRules, type ConnectorRestrictionScope, ConnectorRestrictions, type ConnectorVisibility, type ConsolidateRolesRequest, type ConsolidateRolesResponse, type ConsolidationCandidate, type ConsolidationCandidatesResponse, type ConsolidationSource, type ConsolidationVerdict, type CreateConnectorRestrictionRuleRequest, type CreateInternalUserRequest, CreateProcessorCostScheduleRequest, type CreateSharedRoleRequest, type CreateTenantUserRequest, CsvExportOptions, type CustomerSummary, type CustomerUser, Delopay, DelopayInternal, type DeploymentBranding, DeviceDrillRequest, DevicesAnalyticsResponse, Diagnostic, type DiagnosticAttentionBoard, type DiagnosticAttentionItem, type DiagnosticAttentionParams, type DiagnosticAttentionSeverity, type DiagnosticCaptureState, type DiagnosticChange, type DiagnosticChangeListParams, type DiagnosticConnectorCall, type DiagnosticConnectorCallListParams, type DiagnosticDependencyCard, type DiagnosticEmptyReason, type DiagnosticEnvironment, type DiagnosticErrorCodeCount, type DiagnosticFiringAlert, type DiagnosticHealthState, type DiagnosticHealthTile, type DiagnosticIncomingWebhook, type DiagnosticIncomingWebhookDetail, type DiagnosticIncomingWebhookListParams, type DiagnosticInfrastructure, type DiagnosticList, type DiagnosticNearMatch, type DiagnosticOutgoingAttempt, type DiagnosticOutgoingWebhook, type DiagnosticOutgoingWebhookListParams, type DiagnosticOutgoingWebhookSummary, type DiagnosticPage, type DiagnosticPanel, type DiagnosticPayment, type DiagnosticPaymentListParams, type DiagnosticQueueItem, type DiagnosticQueueListParams, type DiagnosticQueueSummary, type DiagnosticReplicaHealth, type DiagnosticResolvedId, type DiagnosticRevealRequest, type DiagnosticRevealResponse, type DiagnosticRouterLog, type DiagnosticRouterLogParams, type DiagnosticSourceUnavailable, type DiagnosticTrace, type DiagnosticTraceSpan, type DiagnosticWindow, DrillResponse, DynamicLineExportOptions, EntityType, ExportEnvelope, ExportOptions, FailureSubstatus, FeeRulePreviewRequest, FeeRulePreviewResponse, FeeScheduleCreateRequest, FeeScheduleResponse, FeeScheduleUpdateRequest, FeeStatementDetail, type FeeTotalBound, GeoAnalyticsResponse, GeoDrillRequest, Gsm, type GsmDecision, type GsmRuleCreateRequest, type GsmRuleResponse, type GsmRuleUpdateRequest, InvoiceList, InvoicePageQuery, JsonExportOptions, type LastAdministratorRefusal, type LastAdministratorRoute, type LedgerDayBucket, type LedgerMerchant, type ListConnectorRestrictionRulesQuery, LiveEventStream, LiveStreamOptions, LiveVersionsParams, LiveVersionsResponse, MemberMethodAccessResponse, MemberPermissionOverridesResponse, MerchantAccountResponse, MerchantAccountUpdateRequest, MerchantRisk, type MerchantRoleSummary, MerchantSettingsQuery, MessageLanguage, MessageTemplateDetail, MessageTemplateLanguage, MessageTemplateList, MessageTemplatePreview, type NativeRenewalCloseResponse, type NativeRenewalCloseTarget, NativeRenewals, type OnboardMerchantRequest, type OnboardMerchantResponse, type OrphanedBillingProfile, type OverviewStat, type OverviewStatsResponse, ParentGroup, type PaymentAnalyticsRequest, type PaymentAnalyticsResponse, PaymentAttemptsListResponse, PaymentClientContextListResponse, PaymentIntegrationTestRequest, PaymentIntegrationTestResponse, PaymentLogConnectorCallDetail, PaymentLogIncomingWebhookDetail, PaymentLogOutgoingWebhookDetail, PaymentLogsResponse, type PaymentPeriodStats, PaymentProductLines, PaymentResponse, PaymentStatusHistoryResponse, PaymentsDeleteResponse, PermissionOverride, PermissionScope, type PlatformAnalyticsResponse, PlatformBilling, type PlatformFeeReturnListResponse, type PlatformFeeReturnQuery, type PlatformFeeReturnRecord, type PlatformFeeReturnResponse, type PlatformFeeReturnScope, type PlatformFeeReturnSetting, type PlatformFeeReturnSource, type PlatformFeeReturnStatus, PlatformFeeRuleInput, PlatformFeeRuleRecord, PlatformFees, PlatformMessageTemplates, PlatformSettings, PreviewMessageTemplateRequest, ProcessorCostEstimateBasis, ProcessorCostEventsResponse, ProcessorCostScheduleResponse, ProfileResponse, ProjectResponse, RefundListResponse, RefundStatus, type RefundVolumeQuery, type RefundVolumeResponse, type RefundVolumeScope, type RefundVolumeSetting, type RefundVolumeSource, ReplaceProcessorCostScheduleRequest, type ReplayMaskMode, type ReplayMaskingRule, RequestExtras, RequestFn, ResetMessageTemplateLanguageQuery, type RetireSharedRolePreviewRequest, type RetireSharedRolePreviewResponse, type RetireSharedRoleRequest, RiskAdjustments, type RiskBackfillFailure, type RiskBackfillIncompleteDays, type RiskBackfillPreview, type RiskBackfillRequest, type RiskBackfillResponse, type RiskBackfillState, type RiskBackfillStatus, RiskBands, type RiskClassWeights, type RiskCombine, RiskComponentRule, RiskDecidingWindow, type RiskModel, type RiskModelPatch, type RiskModelResponse, type RiskModelSource, type RiskModelUpdateOptions, type RiskSettingsOverrides, RiskTuningPreviewResponse, RiskTuningResponse, RiskTuningTarget, RiskTuningUpdateRequest, RiskWindowBandOverrides, type RoleAccessChange, type RoleColor, type RoleParentGroup, ScopeDrillRequest, SellToRestrictionsResponse, SendTestMessageRequest, SendTestMessageResponse, SettingsResponse, SettlementCostPeriod, SettlementCurrentParams, SettlementCurrentResponse, SettlementOverviewParams, SettlementOverviewResponse, SettlementStatementListParams, SettlementStatementListResponse, type SharedRoleApplied, type SharedRoleAudience, type SharedRoleChange, type SharedRoleDetailResponse, type SharedRoleListResponse, type SharedRoleMerchantHolders, type SharedRoleMerchantRef, type SharedRolePreviewResponse, type SharedRoleRefusal, type SharedRoleReplacementKind, type SharedRoleReplacementOption, type SharedRoleSummary, ShopResponse, SignUpWithMerchantIdRequest, type SignupToggleRequest, type SignupToggleResponse, StatementPdfParams, SubscriptionAnalyticsRequest, SubscriptionAnalyticsResponse, SubscriptionDrillRequest, type SystemRoleSummary, TransactionLineExportRecord, type UpdateConnectorRestrictionRuleRequest, type UpdateLedgerEntryRequest, UpdateMemberMethodAccessRequest, UpdateMemberPermissionOverridesRequest, UpdateMessageTemplateLanguageRequest, type UpdatePlatformFeeReturnRequest, UpdateProcessorCostScheduleRequest, type UpdateRefundVolumeRequest, UpdateSettingsRequest, type UpdateSharedRoleRequest, type UpsertConnectorRestrictionRequest, VaultEnvironment };
package/dist/internal.js CHANGED
@@ -1399,6 +1399,35 @@ var AdminPortal = class {
1399
1399
  query: { revision: options.revision }
1400
1400
  });
1401
1401
  }
1402
+ /**
1403
+ * What recalculating the shop risk history over `range` would do, without
1404
+ * queuing it: its days, the first day whose counters are rebuilt, the model
1405
+ * it would score with now, and the run of the same range already recorded.
1406
+ * Refused exactly where `startRiskBackfill()` would be.
1407
+ *
1408
+ * `POST /admin-portal/risk-engine/backfill/preview`
1409
+ */
1410
+ async previewRiskBackfill(range) {
1411
+ return this.request("POST", "/admin-portal/risk-engine/backfill/preview", { body: range });
1412
+ }
1413
+ /**
1414
+ * Queue a recalculation of `range`. Days that already have a risk score keep
1415
+ * it, and recalculated days never alert. While the same range is queued or
1416
+ * running, nothing new is started and `enqueued` is `false`.
1417
+ *
1418
+ * `POST /admin-portal/risk-engine/backfill`
1419
+ */
1420
+ async startRiskBackfill(range) {
1421
+ return this.request("POST", "/admin-portal/risk-engine/backfill", { body: range });
1422
+ }
1423
+ /**
1424
+ * One recalculation by the `job_id` a preview or start returned.
1425
+ *
1426
+ * `GET /admin-portal/risk-engine/backfill/{job_id}`
1427
+ */
1428
+ async getRiskBackfill(jobId) {
1429
+ return this.request("GET", `/admin-portal/risk-engine/backfill/${encodeURIComponent(jobId)}`);
1430
+ }
1402
1431
  };
1403
1432
  function transactionListQuery(params) {
1404
1433
  if (!params) return void 0;