Files
MikrotikManager/backend/src/services/alert-engine/state-machine.ts
T
DenozordecandCursor 5f31bb47fb chore: synchronize pending app/backend updates and repository hygiene
Includes current frontend and backend work in progress and removes generated artifacts from tracking to keep the repository clean for дальнейшая разработка.

Co-authored-by: Cursor <[email protected]>
2026-05-07 12:29:04 +07:00

17 lines
436 B
TypeScript

import type { RuleEvalHit } from "./types.js"
export type RecoveryMode = "always" | "never" | "conditional"
export function isRecoveryTransition(hit: RuleEvalHit | null): boolean {
return hit?.transition === "recovery"
}
export function shouldAllowRecoveryByPolicy(
hit: RuleEvalHit | null,
policy: RecoveryMode,
): boolean {
if (!isRecoveryTransition(hit)) return true
if (policy === "never") return false
return true
}