feat(scanner): validate elevated live automation

This commit is contained in:
AzuTear
2026-07-07 07:49:22 +02:00
parent 7930e369a7
commit ef65c3e6a0
37 changed files with 826 additions and 217 deletions
@@ -26,6 +26,7 @@ import type {
ClickResult,
ReviewSampleListResult,
SaveScannerLearningRulesResult,
GoodImportFileResult,
} from "../../types/global";
const EMPTY_SNAPSHOT: AppSnapshot | null = null;
@@ -67,6 +68,12 @@ const EMPTY_SAVE_RULES_RESULT: SaveScannerLearningRulesResult = {
rules: {},
total: 0,
};
const EMPTY_GOOD_IMPORT_FILE_RESULT: GoodImportFileResult = {
ok: false,
canceled: false,
path: "",
error: "Electron bridge unavailable.",
};
async function createBridgeSafeCall<TResult>(
callback: () => Promise<TResult> | TResult | null | undefined,
@@ -205,6 +212,7 @@ export function createRendererRepositories(): RendererRepositories | null {
const exportRepo: ScanExportPort = {
exportGood: (payload) => createBridgeSafeCall(() => bridge.exportGood(payload), EMPTY_SAVE_RESULT),
importGoodFile: () => createBridgeSafeCall(() => bridge.importGoodFile(), EMPTY_GOOD_IMPORT_FILE_RESULT),
};
return {