feat(workflow & platform): optimize complex workflow orchestration, code node debug summary, MVEL simulation and entity/feetype helpers

- feat(feetype): add --subtree and --ids-only flags to listFeeTypes for direct array export
- feat(platform): add platform gen-props command to generate MVEL/JS entity field constants and templates
- feat(workflow): show code node return value summaries in workflow test and job first screen
- feat(workflow): add workflow node map sub-command and --mapping-file for deep declarative field mutations
- feat(workflow): add executeMvelSandbox for local offline simulation of MVEL code nodes
- test: add comprehensive test cases across feetype, platform gen-props, node map, and MVEL sandbox

Closes #140
This commit is contained in:
gitea committed 2026-10-23 13:06:32 +08:00
1 parent 1739daacf2
commit ad771e92e0
18 files changed
+591 -29

No files matched your search

+36
View File
@@ -1656,6 +1656,42 @@ describe("CLI - workflow job 执行详情与异常精准透视", () => {
expect(editRes.exitCode).toBe(0);
expect(editRes.stdout).toContain("修改已保存至工作流");
// 5.1 node map
const mapRes = await handleWorkflowCommand(
{
area: "workflow",
action: "node",
args: ["map", "pipe_node_test", "action_js_1"],
options: { yes: true },
raw: ["workflow", "node", "map", "pipe_node_test", "action_js_1", "--yes"],
},
mockRuntime
);
expect(mapRes.exitCode).toBe(1);
expect(mapRes.stderr).toContain("请通过 --mapping-file=<路径> 指定");
const tmpMappingFile = (await import("os")).tmpdir() + "/test-fields-" + Date.now() + ".json";
await (await import("fs/promises")).writeFile(
tmpMappingFile,
JSON.stringify([{ name: "test_field", label: "测试字段", value: "test_val" }]),
"utf-8"
);
const mapSuccessRes = await handleWorkflowCommand(
{
area: "workflow",
action: "node",
args: ["map", "pipe_node_test", "action_js_1"],
options: { "mapping-file": tmpMappingFile, yes: true },
raw: ["workflow", "node", "map", "pipe_node_test", "action_js_1", `--mapping-file=${tmpMappingFile}`, "--yes"],
},
mockRuntime
);
expect(mapSuccessRes.exitCode).toBe(0);
expect(mapSuccessRes.stdout).toContain("已批量应用映射");
await (await import("fs/promises")).unlink(tmpMappingFile).catch(() => {});
// 6. node rm
const rmRes = await handleWorkflowCommand(
{