feat(task-018): add observability retry cancel and audit trail
This commit is contained in:
@@ -20,6 +20,7 @@ new Function("exports", compiled.outputText)(moduleExports);
|
||||
|
||||
const {
|
||||
buildAdminScriptVersionRows,
|
||||
buildAdminScriptAuditRows,
|
||||
defaultScriptVersionDraft,
|
||||
buildCreateScriptVersionPayload,
|
||||
parseJsonObject,
|
||||
@@ -53,3 +54,21 @@ assert.equal(payload.rollback_target_version_id, null);
|
||||
assert.deepEqual(parseJsonObject('{"a":1}'), { a: 1 });
|
||||
assert.equal(parseJsonObject("[]"), null);
|
||||
assert.deepEqual(parseJsonObject(""), {});
|
||||
|
||||
const auditRows = buildAdminScriptAuditRows([
|
||||
{
|
||||
id: "evt-1",
|
||||
target_site_id: "site-1",
|
||||
version_id: "ver-1",
|
||||
event_type: "SCRIPT_CONFIG_VERSION_ROLLBACK",
|
||||
actor_user_id: "user-1",
|
||||
payload: { action: "rollback" },
|
||||
created_at: "2026-05-21T12:00:00Z",
|
||||
version: 2,
|
||||
diff: { summary: "rollback event" },
|
||||
rollback_target_version_id: "ver-0",
|
||||
},
|
||||
]);
|
||||
assert.equal(auditRows.length, 1);
|
||||
assert.equal(auditRows[0].eventType, "SCRIPT_CONFIG_VERSION_ROLLBACK");
|
||||
assert.equal(auditRows[0].rollbackTargetVersionId, "ver-0");
|
||||
|
||||
Reference in New Issue
Block a user