bpmax-cli 0.2.1-beta.90 → 0.2.1-beta.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmax-cli",
3
- "version": "0.2.1-beta.90",
3
+ "version": "0.2.1-beta.91",
4
4
  "description": "CLI for BPMAX environments with multi-profile config and local login callback flow",
5
5
  "type": "module",
6
6
  "bin": {
@@ -104,6 +104,14 @@ description: "用于通过 bpmax-cli typed config 能力创建和编辑 BPMAX
104
104
  - 标准整页创建页必须配置 `data.meta.form_template`;创建页不会从首个 `nodes[].form_template` 推断发起表单。
105
105
  - 脚本类查询不得把 `data_set_id` 当 ES 查询入口;项目 ES 数据优先用 `raw-es-search` + `data_set_key`、`ctx.$esQuery(...)` 或已验证 helper。
106
106
 
107
+ ## 环节模板盘点
108
+ - 选型前先用 typed CLI 盘点当前环境不绑定流程的 type=6 环节模板,不要凭模板名猜测模块构成:
109
+ - `bpmax-cli config step-detail-template list --profile <profile> --format json`:分页列出裁剪后的摘要(`id`、`name`、`desc`、`flow_type`、`flow_key`、`status`、`create_time`、`update_time`、`content_hash`、`module_signature`),不返回完整 `content`。
110
+ - `bpmax-cli config step-detail-template inventory --profile <profile> --format json`:按模块组合降序盘点,给出每个 `module_signature` 的 `count`、代表性 `template_ids` 和 `sample_names`。
111
+ - `module_signature` 是模块名集合去重、稳定排序后用 `+` 连接的结果(例如 `关联项目表单+环节表单`);content 无法解析的模板归入 `unparsed`,不阻断整体盘点。
112
+ - 两个命令默认读取 `profiles/<profile>/template-cache/step-detail.json`(TTL 6 小时,可用 `BPMAX_CLI_STEP_DETAIL_TEMPLATE_CACHE_TTL_SECONDS` 覆盖);需要与远端强制对齐时加 `--refresh`。`list` 另支持 `--name` 子串过滤和 `--page/--page-size` 本地分页。
113
+ - 盘点结果是选型依据,不是提交证据;最终仍须对目标 `step_detail_id` 做 export/readback,并用真实环节页面闭环。
114
+
107
115
  ## 创建后跳转与消息模板
108
116
  - 创建成功后的自定义跳转必须配置 `meta.project_after_create_path`,前端创建页执行脚本后调用 `this.$router.push(path)`;这个脚本必须以 `return` 开头,不要把创建后跳转写到 `project_after_create_callback`。
109
117
  - 消息模板分两种配置模式:
@@ -60,6 +60,13 @@
60
60
 
61
61
  其中核心是前者。后者是流程编辑器的 type=5 配套数据,不是 `node.step_detail_id` 使用的环节详情模板;环节详情模板固定为 type=6,并走 `config step-detail-template`。
62
62
 
63
+ ## 环节模板(type=6)列表与盘点
64
+ - 列表接口:`GET /api/flow_page_template?type=6&no_flow=true`,支持 `page`、`page_size`、`sort=-create_time`、`name`(LIKE 模糊)、`skip_i18n=true`。
65
+ - 信封:`{code,msg,data:{data:[...],count,currentPage,pageSize,totalPages}}`;每行携带完整 `content`,CLI 只输出裁剪后的摘要和 `content_hash`,不得把完整内容写进输出或缓存。
66
+ - typed CLI:`bpmax-cli config step-detail-template list` 和 `inventory`;底层复用 `config.step_detail_template.export` capability,不需要独立 list capability。
67
+ - 缓存:`profiles/<profile>/template-cache/step-detail.json`,以 `expires_at` 和 `source_signature`(模板 `count` + 最大 `update_time` 的摘要)判定失效;默认 TTL 6 小时,`--refresh` 强制重拉。
68
+ - `no_flow=true` 是环节模板语义:盘点的对象是不绑定具体流程的 type=6 模板;不要复用 `flow-detail-template`(type=5)的 `flow_type/flow_key` 查询。
69
+
63
70
  ## bpmax-core 源码映射
64
71
 
65
72
  ### 创建主流程模板
@@ -565,10 +565,10 @@ bpmax-cli config readback form-template --id <form_template_id> --format json
565
565
  - 模板名称需要再通过 `GET /api/form_template/<id>` 解析,不要只凭右侧表单区域文案猜测
566
566
  - 如果本地配置目录里只拿到了 `uuid` 或目录引用,而 typed CLI export/readback 使用的是数字 `id`,必须继续通过当前环境接口解析真实远端模板 `id`,不要直接把本地目录引用塞进 `meta.form_template`。
567
567
  - 如果本地配置目录里只拿到了 `uuid` 或目录引用,而 typed CLI export/readback 里 `node.form_template` 使用的是数字 `id`,也必须继续通过当前环境接口解析真实远端模板 `id`,不要把目录引用直接塞进节点 payload。
568
- - 如果需求涉及 `node.step_detail_id` / `meta.step_detail_id`,或本次 diff 会影响环节动作语义,必须额外做“环节模板远端核验”:
568
+ - 如果需求涉及 `node.step_detail_id` / `meta.step_detail_id`,或本次 diff 会影响环节动作语义,必须额外做“环节模板远端核验”;选型阶段先运行 `bpmax-cli config step-detail-template inventory` / `list` 盘点当前环境已有 type=6 模板及模块组合,再进入逐节点核验:
569
569
  1. 先从线上最新流程详情或页面运行时读取每个受影响节点当前 `step_detail_id`。
570
570
  2. 使用独立 typed domain 回读模板详情:`bpmax-cli config step-detail-template export --id <id> --profile <profile> --out <dir> --format json`;底层固定使用 `GET /api/flow_page_template/<id>?type=6&skip_i18n=true`,不得使用 type=5 或 project-detail-template domain。
571
- 3. 若列表接口无法覆盖目标 `id`,继续用详情接口按 `id` 单条读取;读取失败、返回空、被删除、类型不符都视为模板不存在。
571
+ 3. 若 `config step-detail-template list` 无法覆盖目标 `id`,继续用详情接口按 `id` 单条读取;读取失败、返回空、被删除、类型不符都视为模板不存在。
572
572
  4. 记录 `节点名 -> step_detail_id -> 模板名/类型/关键模块 -> 适配结论`,作为变更计划和回读验证的一部分。
573
573
  5. 如果只能在本地 `think_flow_page_template` 找到模板 `uuid`,必须再完成 `uuid -> 当前环境远端数字 id` 映射;没有映射成功不得写入 `work`。
574
574
  6. 如果模板存在但语义不适合当前环节,不能把它当作“可用模板”提交;必须换用匹配模板,或把例外列为 `required-collateral` 并取得用户逐项确认。