feat(workflows): add revision history, trash, UUID naming, and backup
- Store up to 50 revisions per workflow in SQLite with normalized SHA dedup - Soft-delete workflows to trash (7-day retention) with restore and permanent purge - Assign UUID filenames for new and duplicated workflows; show name + file in UI - Warn on invalid YAML, unknown scripts, and plaintext secrets with save-anyway option - Add workflow backup zip (workflows + plugins) and merge/replace restore - Trash page, history panel on editor, and smoke test Co-authored-by: Nasyarobby Putra <nasyarobby@gmail.com>
This commit is contained in:
@@ -28,11 +28,7 @@ import {
|
||||
createWorkflowWorker,
|
||||
getRedisUrlForLog,
|
||||
} from "./workflow-queue.js";
|
||||
import {
|
||||
getConfigGeneration,
|
||||
startHeartbeatLoop,
|
||||
subscribeReload,
|
||||
} from "./control-bus.js";
|
||||
import { purgeExpiredTrash } from "./workflow-trash.js";
|
||||
|
||||
/**
|
||||
* @param {{
|
||||
@@ -48,6 +44,14 @@ export async function startApp(opts = {}) {
|
||||
|
||||
if (shouldMigrate) {
|
||||
await migrate();
|
||||
try {
|
||||
const purged = await purgeExpiredTrash();
|
||||
if (purged > 0) {
|
||||
log.info({ purged }, "purged expired workflow trash");
|
||||
}
|
||||
} catch (err) {
|
||||
log.warn({ err }, "workflow trash purge failed");
|
||||
}
|
||||
}
|
||||
enableLogPersistence();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user