e10-data 0.1.26 → 0.1.28
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/CHANGELOG.md +55 -0
- package/README.md +7 -4
- package/bin/e10-data.mjs +98 -12
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# 变更记录
|
|
2
2
|
|
|
3
|
+
## 0.1.28(2026-10-17)—— `module call` 支持自定义 `confType` 与 `--show-params` 精简
|
|
4
|
+
|
|
5
|
+
### 1. `module call` 新增 `--type <confType>`
|
|
6
|
+
|
|
7
|
+
- 此前 `cmdModuleCall` 把 confType **硬编码为 `api`**,无法调用 `confType` 非 `api` 的配置条目
|
|
8
|
+
(域级配置分组:`ebu` / `pmo` / `contract` / `partner` 等),报 `配置不存在或为空: confType=api …`。
|
|
9
|
+
- 新增 `--type <confType>`:**不传时默认 `api`,行为与旧版逐字节一致**(纯增量,无破坏性变更)。
|
|
10
|
+
- `--show-params` 输出新增 `conf_type`(实际使用的 confType),便于核对定位到的是哪一类条目。
|
|
11
|
+
|
|
12
|
+
### 2. `--show-params` 支持精简模式
|
|
13
|
+
|
|
14
|
+
- 四域接口的 `confAttrs.request_example` 常有上万字符(18 个 queryFields + 11 个条件节点),全量回显会把
|
|
15
|
+
「字段清单 / 占位符 / 必填项」淹没。
|
|
16
|
+
- 现默认**不回显 `request_example`**,改为返回 `request_example_omitted: true` + `request_example_hint`;
|
|
17
|
+
完整模板用 `--full`(别名 `--with-example`)取回,`--no-example` 可显式表达「要精简」。
|
|
18
|
+
- **旧行为可完整恢复**(`--full`),组参脚本 `build_query.py` 显式带 `--full`,两种环境都能跑。
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
e10-data module call --conf-key <confKey> --group ebu --type ebu --show-params # 精简(默认)
|
|
22
|
+
e10-data module call --conf-key <confKey> --group ebu --show-params --full # 回显完整 request_example
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 3. 同步改动
|
|
26
|
+
|
|
27
|
+
- `usage()` 的 `module` 帮助段:签名补 `[--type <confType>]` / `[--show-params [--full]]`,并补 `--type` 说明行;
|
|
28
|
+
- `README.md` 的 module call 段落(签名、参数表)同步;`package.json`(版本 + description)同步。
|
|
29
|
+
|
|
30
|
+
## 0.1.27(2026-10-15)—— 新增 `noun scope`:词库按生效范围批量检索
|
|
31
|
+
|
|
32
|
+
### 1. `noun` 族新增子命令 `scope`
|
|
33
|
+
|
|
34
|
+
- 端点:`POST /api/dw/newetl/chatBi/doc/getChatBiDocByScopeId`,**请求体 = 数据集 id 的 JSON 数组**(`List<Long>`,必填非空)。
|
|
35
|
+
- 入参(`--ids <id1,id2|@ids.json>`)= **数据集 id 列表**,即 `e10-data scene items --group <分组id>` 输出里每个条目的 `id`
|
|
36
|
+
(`ChatBiDataset.id`;接口条目与数据源条目同等适用)。支持逗号分隔或 `@文件`(JSON 数组或逗号串,沿用 `readListArg`)。
|
|
37
|
+
- **id 一律按字符串下发**:19 位雪花号超出 JS 安全整数(2^53),`Number()` 会丢精度
|
|
38
|
+
(实测 `Number("1060565684758507544")` 末位归零)→ 下发即检不到、且**不报错**,故 JSON 数组元素用字符串形态。
|
|
39
|
+
- 命中范围(服务端):`deleteType=0` 且同租户 且(`allScope=1` 全局词库 **或** `scopeEffectId LIKE '%<任一传入 id>%'`)
|
|
40
|
+
⇒ **全局词库恒返回**,与传入哪些 id 无关。
|
|
41
|
+
- 输出:`--json` = `{ scopeIds, count, globalCount, scopedCount, docs[] }`(`docs` 只留 `keyword` / `synonyms` / `wordExplain` / `allScope` / `scopeEffectId` / `docType`);
|
|
42
|
+
人读 = 逐条打印名词并标注生效范围(全局 / 数据集),「只命中全局词库」时额外给提示。
|
|
43
|
+
- 边界(实测):GET 不可用(业务失败);空数组 → `{"code":500,"msg":"getChatBiDocByScopeId.arg0: can not be empty"}`;
|
|
44
|
+
超出 `Long` 上限的位数 → 500;合法但未命中的 id **不报错**,只返回全局词库。
|
|
45
|
+
- ⚠️ **本命令为新增通道,不影响原有 `noun list`**(`getChatDocsBySkillKey`,仍按 skillKey + 数据源三参数检索,行为与输出完全不变);两条通道并存,`noun list` 的既有调用方无需改动。
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
e10-data noun scope --ids 1060565684758507544,1060565684758507545 # 人读:批量取回该数据集的词库
|
|
49
|
+
e10-data noun scope --ids @ids.json --json # ids.json = ["1060565684758507544","1060565684758507545"]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 2. 同步改动
|
|
53
|
+
|
|
54
|
+
- `CMD_SUBS` 白名单 `noun: ["list"]` → `noun: ["list", "scope"]`;`main()` 的 `noun` 分支新增 `scope`;
|
|
55
|
+
`usage()` 的 `noun` 帮助段新增 `noun scope` 条目;头部注释 `noun` 一行改为 `list|scope`;
|
|
56
|
+
`README.md` / `CHANGELOG.md` / `package.json`(版本 + description)同步。
|
|
57
|
+
|
|
3
58
|
## 0.1.26(2026-10-15)—— 新增 `refusal rules`:拒答话术规则
|
|
4
59
|
|
|
5
60
|
### 1. `refusal` 族新增子命令 `rules`
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ e10-data login xiaoe-env [--domain <url>] 登录:环境变量 Xi
|
|
|
20
20
|
e10-data query <--conn <connId> --model <ebuilder|flow|eteams|attend|hr|document|dw|blog> --schema <数据库> [--table-id <流程ID>] [--debug true|false] --dsl @file.json>
|
|
21
21
|
e10-data ds tables|fields|list|chart|stat|count 数据源(业务模块)取数与元数据
|
|
22
22
|
e10-data doc count|list 文档查询(documentListCount + documentList)
|
|
23
|
-
e10-data noun list
|
|
23
|
+
e10-data noun list|scope 词库查询(list = 按 skill/数据源;scope = 按生效范围批量,2026-10-15 新增)
|
|
24
24
|
e10-data field id2name|name2id 关联字段翻译(testRemoteBrowser / complete)
|
|
25
25
|
e10-data conf get|batch|batch-file|group|group-file|resolve|resolve-file|add|add-file|update|delete 环境参数配置中心(chatBi config map,替代 config-resolve 脚本 URL 直连;confType 默认按 CONN_/DS_/WF_/API_ 前缀推导,可 --type 显式;confType=api 时支持 confGroup 分组,见下)
|
|
26
26
|
e10-data exp status|manifest|commits|file|pull|init|commit|lock|release|rollback 专家包版本管理
|
|
@@ -76,6 +76,7 @@ e10-data ds count --group weaver-project-servicetask --table 715738355537494016
|
|
|
76
76
|
e10-data ds fields --group weaver-formreport-service --table 1307487628041044060
|
|
77
77
|
e10-data doc count --name 智能问数
|
|
78
78
|
e10-data noun list --skill rd-department
|
|
79
|
+
e10-data noun scope --ids 1060565684758507544,1060565684758507545 # 词库:按生效范围(数据集 id)批量取回
|
|
79
80
|
e10-data field id2name --module ebuilder/form --type ebuilder --ids 3194494277170470571 \
|
|
80
81
|
--form-param '{"fieldId":"966849910772850766","module":"ebuilderform"}'
|
|
81
82
|
e10-data conf get CONN_EC_EDCAPP # 读配置中心单条
|
|
@@ -282,20 +283,22 @@ e10-data attend statis [--user <人员ID>] [--begin 2026-09-01] [--end 2026-09-3
|
|
|
282
283
|
→ 按外层结构(`datajson` / `data` / `records` / 裸数组)提取精简结果。
|
|
283
284
|
|
|
284
285
|
```bash
|
|
285
|
-
e10-data module call --conf-key <confKey> --group <模块> \
|
|
286
|
+
e10-data module call --conf-key <confKey> --group <模块> [--type <confType>] \
|
|
286
287
|
[--args '<JSON>'|--args @params.json] [--query "k=v&k2=v2"] \
|
|
287
288
|
[--method GET|POST|FORM] [--header 'K: V'|--headers '<JSON>'|@file] \
|
|
288
|
-
[--limit 50] [--fields a,b|@f] [--raw] [--show-params] [--dry-run] [--timeout 60] [--json]
|
|
289
|
+
[--limit 50] [--fields a,b|@f] [--raw] [--show-params [--full]] [--dry-run] [--timeout 60] [--json]
|
|
289
290
|
```
|
|
290
291
|
|
|
291
292
|
| 参数 | 说明 |
|
|
292
293
|
|---|---|
|
|
293
294
|
| `--conf-key` / `--group` | **必填**;`confKey` 取自模块接口清单,`--group` = 模块唯一标识(confGroup,如 `WORKFLOW` / `EHR` / `DOCUMENT`) |
|
|
295
|
+
| `--type` | confType,**默认 `api`**(不传 = 与旧版行为一致);域级配置分组传该域名,如 `ebu` / `pmo` / `contract` / `partner` |
|
|
294
296
|
| `--args` | 业务参数 JSON 对象;**含中文一律用 `--args @文件`**(规避 shell 编码损坏) |
|
|
295
297
|
| `--query` | 追加 query(`k=v&k2=v2`,多对用 `&` 连接;与 `--args` 合并) |
|
|
296
298
|
| `--method` | 覆盖 `confAttrs.http_method`(`FORM` = `x-www-form-urlencoded`) |
|
|
297
299
|
| `--header` / `--headers` | 追加请求头:单条 `'K: V'`,或 JSON 对象(可 `@文件`) |
|
|
298
|
-
| `--show-params` |
|
|
300
|
+
| `--show-params` | **只打印该接口的入/出参说明、不调接口** —— 替代手工 `conf get` dump,用于正确组参;**默认省略 `request_example`**(返 `request_example_omitted` + hint),完整模板加 `--full` |
|
|
301
|
+
| `--full` / `--with-example` | 仅配合 `--show-params`:回显完整 `request_example`(等同 v0.1.27 的旧行为) |
|
|
299
302
|
| `--dry-run` | 只组装请求不发送(**凭据一律脱敏**) |
|
|
300
303
|
| `--limit` / `--fields` | 列表行数上限(默认 50,`0` = 不截断)/ 每行字段投影 |
|
|
301
304
|
| `--raw` | 不提取,原样输出响应体 |
|
package/bin/e10-data.mjs
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* 该值取自 ebdf_obj.app_id(2026-10-09 起不再做 EB 权限前置校验);
|
|
18
18
|
* 不带 appId 时按原样发送,由后端报错(CLI 不做拦截)
|
|
19
19
|
* e10-data doc count|list 文档查询 documentListCount / documentList
|
|
20
|
-
* e10-data noun list
|
|
20
|
+
* e10-data noun list|scope 词库:list = getChatDocsBySkillKey(按 skill/数据源);scope = getChatBiDocByScopeId(按生效范围批量)
|
|
21
21
|
* e10-data field id2name|name2id 关联字段翻译 testRemoteBrowser / complete
|
|
22
22
|
* e10-data conf get|batch|batch-file|group|group-file|resolve|resolve-file|add|add-file|update|delete
|
|
23
23
|
* 环境参数配置中心(chatBi config map,替代 config-resolve 脚本 URL 直连;
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
* node e10-data.mjs ds count --group weaver-project-servicetask --table 715738355537494016
|
|
50
50
|
* node e10-data.mjs doc count --name 测试
|
|
51
51
|
* node e10-data.mjs noun list --skill rd-department
|
|
52
|
+
* node e10-data.mjs noun scope --ids 1060565684758507544,1060565684758507545
|
|
52
53
|
* node e10-data.mjs field id2name --module ebuilder/form --type ebuilder \
|
|
53
54
|
* --ids 3194494277170470571 --form-param '{"fieldId":"966849910772850766","module":"ebuilderform"}'
|
|
54
55
|
*/
|
|
@@ -710,7 +711,7 @@ async function cmdLoginXiaoeEnv(args, json) {
|
|
|
710
711
|
const CMD_SUBS = {
|
|
711
712
|
ds: ["groups", "find", "describe", "tables", "fields", "fields-dsl", "list", "chart", "stat", "count"],
|
|
712
713
|
doc: ["count", "list"],
|
|
713
|
-
noun: ["list"],
|
|
714
|
+
noun: ["list", "scope"],
|
|
714
715
|
field: ["id2name", "name2id"],
|
|
715
716
|
conf: ["get", "batch", "batch-file", "group", "group-file", "resolve", "resolve-file", "add", "add-file", "update", "delete"],
|
|
716
717
|
exp: ["status", "manifest", "commits", "file", "pull", "init", "commit", "lock", "release", "rollback"],
|
|
@@ -1640,6 +1641,74 @@ async function cmdNoun(args, json) {
|
|
|
1640
1641
|
}
|
|
1641
1642
|
}
|
|
1642
1643
|
|
|
1644
|
+
// noun scope(2026-10-15 新增)—— 按生效范围批量检索词库 getChatBiDocByScopeId
|
|
1645
|
+
// 入参 = 数据集 id 列表(Long 数组)= 场景定位(scene items --group <gid>)里每个条目的 id
|
|
1646
|
+
// ⚠️ id 一律按**字符串**下发:19 位雪花号超出 JS 安全整数(2^53),Number() 会丢精度
|
|
1647
|
+
// (实测 Number("1060565684758507544") 末位归零)→ 下发即检不到,且不报错。
|
|
1648
|
+
const DOC_SCOPE_PATH = "/api/dw/newetl/chatBi/doc/getChatBiDocByScopeId";
|
|
1649
|
+
|
|
1650
|
+
/** 词库条目 → 模型真正要用的精简字段(+ 生效范围标识,便于判「有无专属词库」) */
|
|
1651
|
+
function normalizeDoc(d) {
|
|
1652
|
+
return {
|
|
1653
|
+
keyword: d.keyword ?? null,
|
|
1654
|
+
synonyms: d.synonyms ?? null,
|
|
1655
|
+
wordExplain: d.wordExplain ?? null,
|
|
1656
|
+
allScope: d.allScope ?? null, // 0=表级别 1=所有数据集 2=WorkBuddy Skill
|
|
1657
|
+
scopeEffectId: d.scopeEffectId ?? null,
|
|
1658
|
+
docType: d.docType ?? null,
|
|
1659
|
+
};
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
/** --ids:逗号/空白分隔的 id 串,或 @文件(JSON 数组或逗号串)→ 字符串 id 数组(去重保序) */
|
|
1663
|
+
function parseScopeIds(val) {
|
|
1664
|
+
const raw = String(readListArg(val) ?? "").trim();
|
|
1665
|
+
const ids = raw.split(/[,\s]+/).map((s) => s.trim().replace(/^["']|["']$/g, "")).filter(Boolean);
|
|
1666
|
+
if (!ids.length) throw new Error("--ids 为空:请传数据集 id 列表(如 --ids 1060565684758507544,1060565684758507545 或 --ids @ids.json)");
|
|
1667
|
+
for (const id of ids) {
|
|
1668
|
+
if (!/^\d+$/.test(id)) throw new Error("--ids 含非法项「" + id + "」(须为数字型数据集 id,取自 scene items 的条目 id)");
|
|
1669
|
+
if (BigInt(id) > 9223372036854775807n) throw new Error("--ids 含超出 Long 上限的 id:" + id);
|
|
1670
|
+
}
|
|
1671
|
+
return [...new Set(ids)];
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
/** 按生效范围批量取词库 → { scopeIds, count, globalCount, scopedCount, docs } */
|
|
1675
|
+
async function fetchDocsByScope(ids) {
|
|
1676
|
+
const r = await postJson(DOC_SCOPE_PATH, ids.map(String));
|
|
1677
|
+
const bad = r && typeof r === "object" && !Array.isArray(r)
|
|
1678
|
+
&& ((r.code !== undefined && Number(r.code) !== 0) || r.fail === true);
|
|
1679
|
+
if (bad) throw new Error("getChatBiDocByScopeId 业务失败:code=" + r.code + " msg=" + (r.msg || "(无 msg)"));
|
|
1680
|
+
const docs = ((r && r.data) || []).map(normalizeDoc);
|
|
1681
|
+
return {
|
|
1682
|
+
scopeIds: ids,
|
|
1683
|
+
count: docs.length,
|
|
1684
|
+
globalCount: docs.filter((d) => d.allScope === 1).length,
|
|
1685
|
+
scopedCount: docs.filter((d) => d.allScope !== 1).length,
|
|
1686
|
+
docs,
|
|
1687
|
+
};
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
async function cmdNounScope(args, json) {
|
|
1691
|
+
const ids = parseScopeIds(need("ids", args));
|
|
1692
|
+
const out = await fetchDocsByScope(ids);
|
|
1693
|
+
if (json) return out;
|
|
1694
|
+
console.log("== 词库 " + out.count + " 条(生效范围 id " + ids.length + " 个;全局 " + out.globalCount
|
|
1695
|
+
+ " + 数据集级 " + out.scopedCount + ")==");
|
|
1696
|
+
if (!out.count) {
|
|
1697
|
+
console.log("(空词库:该环境未返回任何词库条目)");
|
|
1698
|
+
return;
|
|
1699
|
+
}
|
|
1700
|
+
for (const d of out.docs) {
|
|
1701
|
+
const tag = d.allScope === 1 ? "全局" : (d.allScope === 2 ? "Skill" : "数据集");
|
|
1702
|
+
const scope = d.allScope === 1 ? "全部数据" : (d.scopeEffectId || "");
|
|
1703
|
+
console.log("【" + (d.keyword || "") + "】" + (d.synonyms ? " 同义:" + d.synonyms : "")
|
|
1704
|
+
+ " [" + tag + " " + scope + "]");
|
|
1705
|
+
if (d.wordExplain) console.log(" " + String(d.wordExplain).replace(/\n/g, " "));
|
|
1706
|
+
}
|
|
1707
|
+
if (out.scopedCount === 0) {
|
|
1708
|
+
console.log("(提示:本次只命中全局词库,所选数据集均无专属词库 —— 为确定结论)");
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1643
1712
|
// ---------------- field:关联字段翻译 ----------------
|
|
1644
1713
|
function customParamFromArgs(args) {
|
|
1645
1714
|
if (args["form-param"]) return { formParam: args["form-param"] };
|
|
@@ -1989,7 +2058,7 @@ async function cmdConf(sub, args, json, pos) {
|
|
|
1989
2058
|
|
|
1990
2059
|
// ---------------- module:模块配置接口调用(配置中心驱动,2026-09-28 新增)----------------
|
|
1991
2060
|
// 用途:**已确定「哪个模块的哪条具体接口」之后**,用本命令一条命令完成取数:
|
|
1992
|
-
// 复用本 CLI 已加载的凭据 → 精取该条 confAttrs(confType
|
|
2061
|
+
// 复用本 CLI 已加载的凭据 → 精取该条 confAttrs(confType 默认 api,可用 --type 指定;按 confGroup 二级定位)
|
|
1993
2062
|
// → 按 http_method / input_params 组参 → 发请求(自动禁代理 + Cookie/eteamsid/UA 三件套)
|
|
1994
2063
|
// → 按外层结构提取精简结果(datajson / data / records / 裸数组皆可)。
|
|
1995
2064
|
// 与技能自带 python 调用器 call_module.py **等价**(参数名、退出码、提取口径全对齐),区别:
|
|
@@ -2118,24 +2187,27 @@ async function moduleInvoiceToken(json, timeoutMs) {
|
|
|
2118
2187
|
async function cmdModuleCall(args, json) {
|
|
2119
2188
|
// ---- 必填与选项(缺参一律退出码 8,对齐 call_module.py)----
|
|
2120
2189
|
if (!args["conf-key"] || args["conf-key"] === true) {
|
|
2121
|
-
moduleDie(json, MODULE_EXIT.USAGE, "缺必填参数 --conf-key(用法: module call --conf-key <confKey> --group
|
|
2190
|
+
moduleDie(json, MODULE_EXIT.USAGE, "缺必填参数 --conf-key(用法: module call --conf-key <confKey> --group <模块> [--type <confType>])");
|
|
2122
2191
|
}
|
|
2123
2192
|
if (!args.group || args.group === true) {
|
|
2124
2193
|
moduleDie(json, MODULE_EXIT.USAGE, "缺必填参数 --group(模块唯一标识,如 WORKFLOW / EHR / DOCUMENT)");
|
|
2125
2194
|
}
|
|
2126
2195
|
const confKey = String(args["conf-key"]);
|
|
2127
2196
|
const group = String(args.group);
|
|
2197
|
+
// 2026-10-16:支持自定义 confType(域级配置分组,如 ebu / pmo / contract / partner)。
|
|
2198
|
+
// 不传 --type 时行为与旧版完全一致(confType 固定 api)。
|
|
2199
|
+
const confType = (typeof args.type === "string" && args.type) ? args.type : "api";
|
|
2128
2200
|
const timeoutMs = Math.max(1, parseInt(args.timeout || "60", 10) || 60) * 1000;
|
|
2129
2201
|
const limit = (args.limit === undefined || args.limit === true) ? 50 : (parseInt(String(args.limit), 10) || 0);
|
|
2130
2202
|
const fields = (typeof args.fields === "string" && args.fields) ? readListArg(args.fields).split(",").map((s) => s.trim()).filter(Boolean) : null;
|
|
2131
2203
|
|
|
2132
|
-
// ---- ① 精取该条接口配置(confType
|
|
2204
|
+
// ---- ① 精取该条接口配置(confType 默认 api,可用 --type 指定;confGroup 二级定位必带)----
|
|
2133
2205
|
let rec;
|
|
2134
|
-
try { rec = await confGetData(
|
|
2206
|
+
try { rec = await confGetData(confType, confKey, false, group); }
|
|
2135
2207
|
catch (e) {
|
|
2136
2208
|
const m = String((e && e.message) || e);
|
|
2137
2209
|
moduleDie(json, /登录态失效|未取得登录凭据/.test(m) ? MODULE_EXIT.AUTH : MODULE_EXIT.JSON,
|
|
2138
|
-
"conf get 失败:" + m + "(先核对
|
|
2210
|
+
"conf get 失败:" + m + "(先核对 confType / confGroup / confKey;自定义 confType 须显式 --type;登录态问题请重新登录)");
|
|
2139
2211
|
}
|
|
2140
2212
|
let attrs = rec.confAttrs;
|
|
2141
2213
|
if (typeof attrs === "string") {
|
|
@@ -2158,15 +2230,22 @@ async function cmdModuleCall(args, json) {
|
|
|
2158
2230
|
|
|
2159
2231
|
// ---- ③ --show-params:只给入/出参说明与请求示例,不调接口(用于正确组参)----
|
|
2160
2232
|
if (args["show-params"]) {
|
|
2233
|
+
// 2026-10-17:精简模式(默认)—— 不回显 request_example;--full / --with-example 回显。
|
|
2234
|
+
const fullExample = (args.full === true || args["with-example"] === true) && args["no-example"] !== true;
|
|
2161
2235
|
const out = {
|
|
2162
|
-
confKey, module: group, api_name: apiName,
|
|
2236
|
+
confKey, conf_type: confType, module: group, api_name: apiName,
|
|
2163
2237
|
http_method: attrs.http_method ?? null, api_path: apiPath,
|
|
2164
2238
|
business_desc: attrs.business_desc ?? null,
|
|
2165
2239
|
api_params: attrs.api_params ?? null,
|
|
2166
2240
|
input_params: attrs.input_params ?? null,
|
|
2167
2241
|
output_params: attrs.output_params ?? null,
|
|
2168
|
-
request_example: attrs.request_example ?? null,
|
|
2169
2242
|
};
|
|
2243
|
+
if (fullExample) {
|
|
2244
|
+
out.request_example = attrs.request_example ?? null;
|
|
2245
|
+
} else {
|
|
2246
|
+
out.request_example_omitted = true;
|
|
2247
|
+
out.request_example_hint = "已省略 request_example(需完整模板加 --full);组参建议用 build_query.py --set/--set-file 生成";
|
|
2248
|
+
}
|
|
2170
2249
|
console.log(JSON.stringify(out, null, 1));
|
|
2171
2250
|
return;
|
|
2172
2251
|
}
|
|
@@ -2989,6 +3068,11 @@ doc 文档查询
|
|
|
2989
3068
|
doc list [同上条件] [--all 翻页到底] [--page N] [--size 100]
|
|
2990
3069
|
noun 词库查询
|
|
2991
3070
|
noun list --skill <skillKey> [--source-type LOGIC] [--source-group gid] [--source-table tid](数据源场景带三参数)
|
|
3071
|
+
noun scope --ids <id1,id2|@ids.json> [--json] # 2026-10-15 新增:按生效范围批量检索
|
|
3072
|
+
# 端点 /api/dw/newetl/chatBi/doc/getChatBiDocByScopeId(POST,body = 数据集 id 的 JSON 数组)
|
|
3073
|
+
# 入参 = **数据集 id 列表** = scene items --group <分组id> 里每个条目的 id 字段(接口/数据源条目同等适用)
|
|
3074
|
+
# 命中范围:allScope=1(所有数据集,恒返回)∪ scopeEffectId 含任一传入 id(数据集级)
|
|
3075
|
+
# ⚠️ id 按字符串下发(19 位雪花号超 2^53);空列表会被后端拒绝(arg0: can not be empty)
|
|
2992
3076
|
field 关联字段翻译
|
|
2993
3077
|
field id2name --module <m> --type <t> --ids id1,id2 [--form-param '{"fieldId":"..","module":"ebuilderform"}'|--eb-browser-param '{..}'|--property-type x]
|
|
2994
3078
|
field name2id --module <m> --type <t> --name 名称 [同上附加参数]
|
|
@@ -3021,14 +3105,15 @@ exp 专家包版本管理(expert-repository/v1,响应以 data.actionMsg.
|
|
|
3021
3105
|
attend 考勤 REST 接口(2026-09-07 新增,hr-attendance 病假/事假等假期余额)
|
|
3022
3106
|
attend statis [--user <人员ID>] [--begin 2026-09-01] [--end 2026-09-30] # getAttendInfoStatis 假期余额统计;--user 默认当前登录用户,--begin/--end 默认当月
|
|
3023
3107
|
module 模块配置接口调用(配置中心驱动;**已确定「哪个模块的哪条具体接口」之后**用它取数,2026-09-28 新增)
|
|
3024
|
-
module call --conf-key <confKey> --group <模块> [--args '<JSON>'|--args @params.json]
|
|
3108
|
+
module call --conf-key <confKey> --group <模块> [--type <confType>] [--args '<JSON>'|--args @params.json]
|
|
3025
3109
|
[--query "k=v&k2=v2"] [--method GET|POST|FORM] [--header 'K: V'|--headers '<JSON>'|@file]
|
|
3026
|
-
[--limit 50] [--fields a,b|@f] [--raw] [--show-params] [--dry-run] [--timeout 60] [--json]
|
|
3110
|
+
[--limit 50] [--fields a,b|@f] [--raw] [--show-params [--full]] [--dry-run] [--timeout 60] [--json]
|
|
3111
|
+
# --type:confType,默认 api(模块通道);域级自定义分组传该域名(如 ebu / pmo / contract / partner)
|
|
3027
3112
|
# 一条命令完成:精取该条 confAttrs → 按 http_method/input_params 组参 → 发请求
|
|
3028
3113
|
# (自动禁代理 + Cookie/eteamsid/UA 三件套)→ 按外层结构(datajson/data/records/裸数组)提取精简结果
|
|
3029
3114
|
# 与技能自带 python 调用器 call_module.py 等价(参数名/退出码/提取口径全对齐),但复用本 CLI 凭据缓存与
|
|
3030
3115
|
# conf 通道、零临时文件 —— 调用器首选本命令,call_module.py 仅作兜底
|
|
3031
|
-
# --show-params
|
|
3116
|
+
# --show-params:只打印入/出参说明(默认省略 request_example);--full 回显完整模板(不调接口)
|
|
3032
3117
|
# --dry-run:只组装请求不发送(凭据脱敏);--limit 0 = 不截断
|
|
3033
3118
|
# --query 多对用 & 连接;INVOICE 自动换取发票云 token(内存透传,不打印不落盘)
|
|
3034
3119
|
# 退出码:0 正常(**空结果也算正常**)|2 未登录·凭据失效|3 非 JSON·confAttrs 异常
|
|
@@ -3095,6 +3180,7 @@ async function main() {
|
|
|
3095
3180
|
else { usage(); process.exit(1); }
|
|
3096
3181
|
} else if (family === "noun") {
|
|
3097
3182
|
if (sub === "list") result = await cmdNoun(args, json);
|
|
3183
|
+
else if (sub === "scope") result = await cmdNounScope(args, json);
|
|
3098
3184
|
else { usage(); process.exit(1); }
|
|
3099
3185
|
} else if (family === "field") {
|
|
3100
3186
|
if (sub === "id2name") result = await cmdFieldId2name(args, json);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "e10-data",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "泛微 E10 数据接口统一 CLI(data-assistant 专家配套):登录(login xiaoe-env,环境变量 XiaoE 全局 token 换 ETEAMSID,免浏览器/免 python)/DSL 查询/数据源/文档/词库/关联字段翻译/环境参数配置中心(conf,支持 confGroup 分组)/专家包版本管理;ds 取数(list/chart/stat/count)的 appId 由调用方显式传入 --app-id(v0.1.14 起 CLI 不再自动反查;EB 建模表单 weaver-ebuilder-form-service 必须带,appId 取自 ebdf_obj.app_id;2026-10-09 起不再做 EB 权限前置校验);认证凭据**唯一来源 = weaver-work-cli**(通过 `auth export-weaver-env` 命令出口取明文凭据,**不设 e10-login 回退**;加解密由该 CLI 自行负责,本 CLI 不实现任何加解密;仅 login xiaoe-env 在无凭据时自行换 token,写 profile 仍交 e10-login set)。v0.1.17 性能改造:免凭据命令(--version/--help/未知命令)提前返回、直连 e10-login JS 入口(去掉 shell:true 的 cmd.exe 开销)、新增凭据进程间 TTL 缓存(不落明文);v0.1.19(2026-09-24)新增 ds 发现层聚合 groups/find/describe(进程内并发,全 58 分组扫表实测 ~5.5s),并修复 ds tables --name 因 listByPage 端点切换导致的关键词过滤静默失效;v0.1.18(2026-09-24)新增 ds fields-dsl(接口 /api/dw/newetl/chatBi/ds/fieldsForDSL),并移除凭据明文镜像同步(不再写 ~/.workbuddy/e10-login-cache.md);v0.1.20(2026-09-24)凭据来源切换为 weaver-work-cli 唯一来源、移除 e10-login 回退,并补齐 userId/tenantKey 传递(修复 attend statis 等命令报「缺少查询人员」的问题)。v0.1.21(2026-09-28)新增 module call —— 模块配置接口调用(配置中心驱动):已确定「哪个模块的哪条具体接口」之后的一条命令取数入口(精取该条 confAttrs → 按 http_method/input_params 组参 → 发请求(自动禁代理 + Cookie/eteamsid/UA 三件套)→ 提取精简结果),与技能自带 script/call_module.py 等价(参数名/退出码/提取口径全对齐),复用本 CLI 凭据缓存与 conf 通道、零临时文件;同时 auth 归一化与凭据缓存补齐 userAgent(供 AgentType UA 使用,缺失时从 cookie 的 agentType= 推导)。v0.1.22(2026-10-10):移除 `eb perm-page` 命令(EB 建模表单取数不再做权限前置校验,appId 直接取 ebdf_obj.app_id);`--fields`/`--group-by`/`--order` 等逗号列表支持 `@文件`(逗号字符串或 JSON 数组,与 --where/--stat/--dsl 一致,规避 shell 拆分导致的静默丢列/0 行)。v0.1.23(2026-10-13)新增 `refusal get` —— 拒答话术 getRefusalSpeechTechnique(入参仅 type,返回对象的 data = 话术字符串;默认 auto 通道 = POST multipart 表单优先、返回不含 data 时自动回退 GET ?type=,可用 --http post|get 锁定单通道)。v0.1.25(2026-10-14)新增 `scene groups|items` —— 场景定位元数据 getSceneGroups(① groups 分组骨架 / ② items --group <groupId> 组内条目),由技能 references/scene-locate/scripts/locate.mjs 整体迁入(属元数据定位接口、不取业务数据):默认输出精简 JSON(groups: groupId/groupName/itemCount/groupDesc;items: id/datasetName/datasetType/sourceId[/moduleName/sourceType/sourceGroupId/appId]/datasetDesc),--json 原样输出接口返回,计数走 stderr;--client agent|all|connector 默认 agent。v0.1.26(2026-10-15)新增 `refusal rules` —— 拒答话术规则 getRefusalSpeechRules(**无入参**,返回对象的 data = 对象数组;调用方式与 refusal get 同口径:默认 auto 通道 = POST 空 multipart 表单优先、返回不含 data 时回退 GET,可用 --http post|get 锁定单通道;人读直接打印 data 数组,--json 原样输出整个响应对象)。",
|
|
3
|
+
"version": "0.1.28",
|
|
4
|
+
"description": "泛微 E10 数据接口统一 CLI(data-assistant 专家配套):登录(login xiaoe-env,环境变量 XiaoE 全局 token 换 ETEAMSID,免浏览器/免 python)/DSL 查询/数据源/文档/词库/关联字段翻译/环境参数配置中心(conf,支持 confGroup 分组)/专家包版本管理;ds 取数(list/chart/stat/count)的 appId 由调用方显式传入 --app-id(v0.1.14 起 CLI 不再自动反查;EB 建模表单 weaver-ebuilder-form-service 必须带,appId 取自 ebdf_obj.app_id;2026-10-09 起不再做 EB 权限前置校验);认证凭据**唯一来源 = weaver-work-cli**(通过 `auth export-weaver-env` 命令出口取明文凭据,**不设 e10-login 回退**;加解密由该 CLI 自行负责,本 CLI 不实现任何加解密;仅 login xiaoe-env 在无凭据时自行换 token,写 profile 仍交 e10-login set)。v0.1.17 性能改造:免凭据命令(--version/--help/未知命令)提前返回、直连 e10-login JS 入口(去掉 shell:true 的 cmd.exe 开销)、新增凭据进程间 TTL 缓存(不落明文);v0.1.19(2026-09-24)新增 ds 发现层聚合 groups/find/describe(进程内并发,全 58 分组扫表实测 ~5.5s),并修复 ds tables --name 因 listByPage 端点切换导致的关键词过滤静默失效;v0.1.18(2026-09-24)新增 ds fields-dsl(接口 /api/dw/newetl/chatBi/ds/fieldsForDSL),并移除凭据明文镜像同步(不再写 ~/.workbuddy/e10-login-cache.md);v0.1.20(2026-09-24)凭据来源切换为 weaver-work-cli 唯一来源、移除 e10-login 回退,并补齐 userId/tenantKey 传递(修复 attend statis 等命令报「缺少查询人员」的问题)。v0.1.21(2026-09-28)新增 module call —— 模块配置接口调用(配置中心驱动):已确定「哪个模块的哪条具体接口」之后的一条命令取数入口(精取该条 confAttrs → 按 http_method/input_params 组参 → 发请求(自动禁代理 + Cookie/eteamsid/UA 三件套)→ 提取精简结果),与技能自带 script/call_module.py 等价(参数名/退出码/提取口径全对齐),复用本 CLI 凭据缓存与 conf 通道、零临时文件;同时 auth 归一化与凭据缓存补齐 userAgent(供 AgentType UA 使用,缺失时从 cookie 的 agentType= 推导)。v0.1.22(2026-10-10):移除 `eb perm-page` 命令(EB 建模表单取数不再做权限前置校验,appId 直接取 ebdf_obj.app_id);`--fields`/`--group-by`/`--order` 等逗号列表支持 `@文件`(逗号字符串或 JSON 数组,与 --where/--stat/--dsl 一致,规避 shell 拆分导致的静默丢列/0 行)。v0.1.23(2026-10-13)新增 `refusal get` —— 拒答话术 getRefusalSpeechTechnique(入参仅 type,返回对象的 data = 话术字符串;默认 auto 通道 = POST multipart 表单优先、返回不含 data 时自动回退 GET ?type=,可用 --http post|get 锁定单通道)。v0.1.25(2026-10-14)新增 `scene groups|items` —— 场景定位元数据 getSceneGroups(① groups 分组骨架 / ② items --group <groupId> 组内条目),由技能 references/scene-locate/scripts/locate.mjs 整体迁入(属元数据定位接口、不取业务数据):默认输出精简 JSON(groups: groupId/groupName/itemCount/groupDesc;items: id/datasetName/datasetType/sourceId[/moduleName/sourceType/sourceGroupId/appId]/datasetDesc),--json 原样输出接口返回,计数走 stderr;--client agent|all|connector 默认 agent。v0.1.26(2026-10-15)新增 `refusal rules` —— 拒答话术规则 getRefusalSpeechRules(**无入参**,返回对象的 data = 对象数组;调用方式与 refusal get 同口径:默认 auto 通道 = POST 空 multipart 表单优先、返回不含 data 时回退 GET,可用 --http post|get 锁定单通道;人读直接打印 data 数组,--json 原样输出整个响应对象)。v0.1.27(2026-10-15)新增 `noun scope --ids <id1,id2|@ids.json>` —— 词库**按生效范围批量检索**(端点 /api/dw/newetl/chatBi/doc/getChatBiDocByScopeId,POST body = 数据集 id 的 JSON 数组;入参 = 数据集 id 列表 = `scene items --group <分组id>` 里每个条目的 `id`;命中 = allScope=1 全局词库 ∪ scopeEffectId 含任一传入 id;id 按字符串下发,避免 19 位雪花号超 2^53 丢精度)。属**新增通道**,原 `noun list --skill <skillKey>`(getChatDocsBySkillKey)行为**完全不变**。 v0.1.28(2026-10-17):`module call` 支持 `--type <confType>`(自定义 confType / 域级配置分组,默认 `api`,不传时行为与旧版一致)与 `--show-params` 精简模式(默认省略 `request_example`,`--full` / `--with-example` 回显,`--no-example` 显式精简),`--show-params` 输出新增 `conf_type` 字段。",
|
|
5
5
|
"author": "e10-dw",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|