e10-data 0.1.10 → 0.1.13
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/README.md +207 -179
- package/bin/e10-data.mjs +1519 -1464
- package/package.json +29 -29
package/README.md
CHANGED
|
@@ -1,179 +1,207 @@
|
|
|
1
|
-
# e10-data
|
|
2
|
-
|
|
3
|
-
泛微 E10 数据接口统一命令行工具(「数据助手」data-assistant 专家配套)。将专家内散落的 HTTP 接口调用收敛为统一的 CLI 命令面。
|
|
4
|
-
|
|
5
|
-
## 安装
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm i -g e10-data # 全局安装
|
|
9
|
-
e10-data --version # 验证
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
> 依赖:认证复用 `weaver-e10-login` 的登录态。**加解密全部由 `e10-login` 负责,本 CLI 不实现任何加解密**(auth 文件由 e10-login 自己的密钥体系加密:1.5.0 起为「每机随机密钥 + OS keychain」,早期版本为固定 seed,只有 e10-login 解得开)。CLI 通过 e10-login 的命令出口取明文凭据,优先级:**① `e10-login auth --json`**(推荐的正式契约)→ **② `e10-login whoami --json`**(其 JSON 带 `cookies` 时)→ **③ `e10-login whoami`**(文本解析,当前实际路径)→ **④ 明文镜像 `~/.workbuddy/e10-login-cache.md`**(兜底,命中时打印告警)。请先安装并登录 weaver-e10-login(`e10-login oidc`)。
|
|
13
|
-
|
|
14
|
-
## 命令总览
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
e10-data query <--conn <connId> --model <ebuilder|flow|eteams|attend|hr|document|dw|blog> --schema <数据库> [--table-id <流程ID>] [--debug true|false] --dsl @file.json>
|
|
18
|
-
e10-data ds tables|fields|list|chart|stat|count 数据源(业务模块)取数与元数据
|
|
19
|
-
e10-data doc count|list 文档查询(documentListCount + documentList)
|
|
20
|
-
e10-data noun list --skill <skillKey> 词库查询(可带 --source-type/--source-group/--source-table 三参数)
|
|
21
|
-
e10-data field id2name|name2id 关联字段翻译(testRemoteBrowser / complete)
|
|
22
|
-
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 分组,见下)
|
|
23
|
-
e10-data exp status|manifest|commits|file|pull|init|commit|lock|release|rollback 专家包版本管理
|
|
24
|
-
e10-data attend statis 考勤假期余额统计 getAttendInfoStatis(hr-attendance 病假/事假等,v0.1.5 新增)
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## 通用约定
|
|
28
|
-
|
|
29
|
-
- `--json`:原样输出接口 JSON(供脚本/Agent 消费);默认人读输出。
|
|
30
|
-
- 复杂 JSON/中文参数:推荐 `@文件` 承载(如 `--dsl @q.json`、`--where @cond.json`)。
|
|
31
|
-
- ⚠️ 大整数精度(自动处理):E10 的 ID 多为 19 位,超过 JS 安全整数(2^53-1≈9e15)。CLI 解析 JSON 时**自动把超范围裸整数转成字符串**再发请求/输出(实测后端接受字符串做 =/IN/BETWEEN 数值比较),无需手动加引号,也不误伤字符串正文。
|
|
32
|
-
- 认证:**加解密由 `e10-login` 负责(本 CLI 不参与)**。凭据出口优先级:`e10-login auth --json` → `e10-login whoami --json` → `e10-login whoami`(文本)→ 明文镜像 `~/.workbuddy/e10-login-cache.md`(兜底,命中时告警)。命中的出口会记入 `~/.e10-cli/.e10-data-auth-mode`(只存模式名、不存凭据),下次优先复用。环境变量:`E10_DATA_AUTH_PROBE=1` 强制重新探测、`E10_DATA_AUTH_MODE=<模式名>` 手动指定、`E10_DATA_QUIET=1` 抑制告警(告警只走 stderr)。
|
|
33
|
-
- 版本更新:`npm i -g e10-data@latest`;查看源上最新 `npm view e10-data version`。
|
|
34
|
-
|
|
35
|
-
## 用法示例
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
e10-data query --conn 1144919996804022272 --model dw --schema dw --dsl @q.json
|
|
39
|
-
e10-data query --conn 1144919996804022272 --model dw --schema dw --debug true --dsl @q.json # debug 模式:额外打印实际执行 SQL
|
|
40
|
-
e10-data ds count --group weaver-project-servicetask --table 715738355537494016
|
|
41
|
-
e10-data ds fields --group weaver-formreport-service --table 1307487628041044060
|
|
42
|
-
e10-data doc count --name 智能问数
|
|
43
|
-
e10-data noun list --skill rd-department
|
|
44
|
-
e10-data field id2name --module ebuilder/form --type ebuilder --ids 3194494277170470571 \
|
|
45
|
-
--form-param '{"fieldId":"966849910772850766","module":"ebuilderform"}'
|
|
46
|
-
e10-data conf get CONN_EC_EDCAPP # 读配置中心单条
|
|
47
|
-
e10-data conf resolve '{"connId":"#{CONN_EC_EDCAPP}"}' # 占位符替换为真实值
|
|
48
|
-
e10-data conf add CONN_EC_EDCAPP --value 10 --name "说明" --attrs '{"schema":"ec_edcapp"}'
|
|
49
|
-
e10-data conf delete CONN_EC_EDCAPP
|
|
50
|
-
# confType=api + confGroup 分组(v0.1.9 新增)
|
|
51
|
-
e10-data conf group api workflow # 按 类型+分组 批量查全部配置
|
|
52
|
-
e10-data conf get GET_WORKFLOW_LIST --type api --group workflow # 单查(组内定位)
|
|
53
|
-
e10-data conf add GET_WORKFLOW_LIST --type api --group workflow --value /api/workflow/getList --name 查询流程列表 --attrs '{"request":{"pageNo":"页码"},"response":{"list":"流程列表"}}'
|
|
54
|
-
e10-data conf add-file @api-items.json # 批量新增(元素含 confGroup,见下)
|
|
55
|
-
e10-data conf update GET_WORKFLOW_LIST --type api --group workflow --value /api/workflow/queryList
|
|
56
|
-
e10-data conf delete GET_WORKFLOW_LIST --type api --group workflow
|
|
57
|
-
e10-data exp status --expert data-assistant
|
|
58
|
-
e10-data exp pull --expert data-assistant --dir <本地专家包目录> [--dry-run] [--force]
|
|
59
|
-
e10-data attend statis # 查当前登录用户当月假期余额(病假/事假/年假)
|
|
60
|
-
e10-data attend statis --user 6264843388578732287 --begin 2026-09-01 --end 2026-09-30
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## conf 配置中心与 confGroup 分组(v0.1.9 新增)
|
|
64
|
-
|
|
65
|
-
`conf` 系列对接 chatBi config map 接口,`confGroup` 是**可选**的二级分组维度:后端在 `confType=api` 时按 `confType + confGroup + confKey` 定位配置(如 `api/workflow/GET_WORKFLOW_LIST`),用于把同类 API 定义归档到同一分组。
|
|
66
|
-
|
|
67
|
-
**下发规则(重要)**:只有 `confType` 为 `api`(或显式传了 `--group`)时,CLI 才会在请求体/查询串里带上 `confGroup`;其他 confType 一律不带该字段,避免污染既有配置类型。
|
|
68
|
-
|
|
69
|
-
| 操作 | 命令 | 对应接口 |
|
|
70
|
-
|---|---|---|
|
|
71
|
-
| 新增(批量,可含分组) | `conf add <key> --value v [--type api] [--group g]` / `conf add-file @items.json` | `POST /api/dw/newetl/chatBi/batchAddChatBiConfigMap` |
|
|
72
|
-
| 单查 | `conf get <key> [--type api] [--group g]` | `GET /api/dw/newetl/chatBi/getChatBiConfigMap?confType=&confGroup=&confKey=` |
|
|
73
|
-
| 批量查(按 key) | `conf batch <k1> <k2> ...` / `conf batch-file @items.json` | `POST /api/dw/newetl/chatBi/batchGetChatBiConfigMap` |
|
|
74
|
-
| 批量查(按类型+分组) | `conf group <confType> <confGroup> [--key k]` / `conf group-file @items.json` | `POST /api/dw/newetl/chatBi/batchGetChatBiConfigMapByTypeAndGroup` |
|
|
75
|
-
| 更新 | `conf update <key> [--value v] [--name n] [--attrs a] [--group g]` | `POST /api/dw/newetl/chatBi/updateChatBiConfigMap` |
|
|
76
|
-
| 删除 | `conf delete <key> [--type api] [--group g]` | `DELETE /api/dw/newetl/chatBi/deleteChatBiConfigMap?confType=&confGroup=&confKey=` |
|
|
77
|
-
|
|
78
|
-
批量新增文件 `api-items.json`(`confType=api` 时元素带 `confGroup`):
|
|
79
|
-
|
|
80
|
-
```json
|
|
81
|
-
[
|
|
82
|
-
{
|
|
83
|
-
"confType": "api",
|
|
84
|
-
"confGroup": "workflow",
|
|
85
|
-
"confKey": "GET_WORKFLOW_LIST",
|
|
86
|
-
"confValue": "/api/workflow/getList",
|
|
87
|
-
"confName": "查询流程列表",
|
|
88
|
-
"confAttrs": "{\"request\":{\"pageNo\":\"页码\",\"pageSize\":\"每页数量\"},\"response\":{\"list\":\"流程列表\"}}"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"confType": "api",
|
|
92
|
-
"confGroup": "workflow",
|
|
93
|
-
"confKey": "GET_WORKFLOW_DETAIL",
|
|
94
|
-
"confValue": "/api/workflow/getDetail",
|
|
95
|
-
"confName": "查询流程详情",
|
|
96
|
-
"confAttrs": "{\"request\":{\"id\":\"流程ID\"},\"response\":{\"id\":\"流程ID\",\"name\":\"流程名称\"}}"
|
|
97
|
-
}
|
|
98
|
-
]
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
e10-data conf add-file @api-items.json # 批量新增(逐条判重:同 组+键 已存在则跳过)
|
|
103
|
-
e10-data conf group api workflow # 取回 workflow 分组下全部 API 配置
|
|
104
|
-
e10-data conf group-file @groups.json # 多分组一次取回,@groups.json = [{"confType":"api","confGroup":"workflow"}]
|
|
105
|
-
e10-data conf update GET_WORKFLOW_LIST --type api --group workflow --value /api/workflow/queryList
|
|
106
|
-
e10-data conf delete GET_WORKFLOW_LIST --type api --group workflow
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
补充说明:
|
|
110
|
-
|
|
111
|
-
- `confKey` 前缀推导 confType:`CONN_→conn`、`DS_→ds`、`WF_→wf`、`API_→api`;其余类型用 `--type` 显式指定(`--type` 与 `--group` 可同时使用)。
|
|
112
|
-
- 同一 `confKey` 可存在于多个 `confGroup`;`conf batch` / `batch-file` 的返回映射在带分组时以 `组|键` 为键,不会互相覆盖。
|
|
113
|
-
- `--json` 输出:`conf group` 返回配置数组(带 `--key` 时返回单条),`conf batch` 返回映射对象。
|
|
114
|
-
|
|
115
|
-
## ds
|
|
116
|
-
|
|
117
|
-
`
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
|
|
1
|
+
# e10-data
|
|
2
|
+
|
|
3
|
+
泛微 E10 数据接口统一命令行工具(「数据助手」data-assistant 专家配套)。将专家内散落的 HTTP 接口调用收敛为统一的 CLI 命令面。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i -g e10-data # 全局安装
|
|
9
|
+
e10-data --version # 验证
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
> 依赖:认证复用 `weaver-e10-login` 的登录态。**加解密全部由 `e10-login` 负责,本 CLI 不实现任何加解密**(auth 文件由 e10-login 自己的密钥体系加密:1.5.0 起为「每机随机密钥 + OS keychain」,早期版本为固定 seed,只有 e10-login 解得开)。CLI 通过 e10-login 的命令出口取明文凭据,优先级:**① `e10-login auth --json`**(推荐的正式契约)→ **② `e10-login whoami --json`**(其 JSON 带 `cookies` 时)→ **③ `e10-login whoami`**(文本解析,当前实际路径)→ **④ 明文镜像 `~/.workbuddy/e10-login-cache.md`**(兜底,命中时打印告警)。请先安装并登录 weaver-e10-login(`e10-login oidc`)。
|
|
13
|
+
|
|
14
|
+
## 命令总览
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
e10-data query <--conn <connId> --model <ebuilder|flow|eteams|attend|hr|document|dw|blog> --schema <数据库> [--table-id <流程ID>] [--debug true|false] --dsl @file.json>
|
|
18
|
+
e10-data ds tables|fields|list|chart|stat|count 数据源(业务模块)取数与元数据
|
|
19
|
+
e10-data doc count|list 文档查询(documentListCount + documentList)
|
|
20
|
+
e10-data noun list --skill <skillKey> 词库查询(可带 --source-type/--source-group/--source-table 三参数)
|
|
21
|
+
e10-data field id2name|name2id 关联字段翻译(testRemoteBrowser / complete)
|
|
22
|
+
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 分组,见下)
|
|
23
|
+
e10-data exp status|manifest|commits|file|pull|init|commit|lock|release|rollback 专家包版本管理
|
|
24
|
+
e10-data attend statis 考勤假期余额统计 getAttendInfoStatis(hr-attendance 病假/事假等,v0.1.5 新增)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 通用约定
|
|
28
|
+
|
|
29
|
+
- `--json`:原样输出接口 JSON(供脚本/Agent 消费);默认人读输出。
|
|
30
|
+
- 复杂 JSON/中文参数:推荐 `@文件` 承载(如 `--dsl @q.json`、`--where @cond.json`)。
|
|
31
|
+
- ⚠️ 大整数精度(自动处理):E10 的 ID 多为 19 位,超过 JS 安全整数(2^53-1≈9e15)。CLI 解析 JSON 时**自动把超范围裸整数转成字符串**再发请求/输出(实测后端接受字符串做 =/IN/BETWEEN 数值比较),无需手动加引号,也不误伤字符串正文。
|
|
32
|
+
- 认证:**加解密由 `e10-login` 负责(本 CLI 不参与)**。凭据出口优先级:`e10-login auth --json` → `e10-login whoami --json` → `e10-login whoami`(文本)→ 明文镜像 `~/.workbuddy/e10-login-cache.md`(兜底,命中时告警)。命中的出口会记入 `~/.e10-cli/.e10-data-auth-mode`(只存模式名、不存凭据),下次优先复用。环境变量:`E10_DATA_AUTH_PROBE=1` 强制重新探测、`E10_DATA_AUTH_MODE=<模式名>` 手动指定、`E10_DATA_QUIET=1` 抑制告警(告警只走 stderr)。
|
|
33
|
+
- 版本更新:`npm i -g e10-data@latest`;查看源上最新 `npm view e10-data version`。
|
|
34
|
+
|
|
35
|
+
## 用法示例
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
e10-data query --conn 1144919996804022272 --model dw --schema dw --dsl @q.json
|
|
39
|
+
e10-data query --conn 1144919996804022272 --model dw --schema dw --debug true --dsl @q.json # debug 模式:额外打印实际执行 SQL
|
|
40
|
+
e10-data ds count --group weaver-project-servicetask --table 715738355537494016
|
|
41
|
+
e10-data ds fields --group weaver-formreport-service --table 1307487628041044060
|
|
42
|
+
e10-data doc count --name 智能问数
|
|
43
|
+
e10-data noun list --skill rd-department
|
|
44
|
+
e10-data field id2name --module ebuilder/form --type ebuilder --ids 3194494277170470571 \
|
|
45
|
+
--form-param '{"fieldId":"966849910772850766","module":"ebuilderform"}'
|
|
46
|
+
e10-data conf get CONN_EC_EDCAPP # 读配置中心单条
|
|
47
|
+
e10-data conf resolve '{"connId":"#{CONN_EC_EDCAPP}"}' # 占位符替换为真实值
|
|
48
|
+
e10-data conf add CONN_EC_EDCAPP --value 10 --name "说明" --attrs '{"schema":"ec_edcapp"}'
|
|
49
|
+
e10-data conf delete CONN_EC_EDCAPP
|
|
50
|
+
# confType=api + confGroup 分组(v0.1.9 新增)
|
|
51
|
+
e10-data conf group api workflow # 按 类型+分组 批量查全部配置
|
|
52
|
+
e10-data conf get GET_WORKFLOW_LIST --type api --group workflow # 单查(组内定位)
|
|
53
|
+
e10-data conf add GET_WORKFLOW_LIST --type api --group workflow --value /api/workflow/getList --name 查询流程列表 --attrs '{"request":{"pageNo":"页码"},"response":{"list":"流程列表"}}'
|
|
54
|
+
e10-data conf add-file @api-items.json # 批量新增(元素含 confGroup,见下)
|
|
55
|
+
e10-data conf update GET_WORKFLOW_LIST --type api --group workflow --value /api/workflow/queryList
|
|
56
|
+
e10-data conf delete GET_WORKFLOW_LIST --type api --group workflow
|
|
57
|
+
e10-data exp status --expert data-assistant
|
|
58
|
+
e10-data exp pull --expert data-assistant --dir <本地专家包目录> [--dry-run] [--force]
|
|
59
|
+
e10-data attend statis # 查当前登录用户当月假期余额(病假/事假/年假)
|
|
60
|
+
e10-data attend statis --user 6264843388578732287 --begin 2026-09-01 --end 2026-09-30
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## conf 配置中心与 confGroup 分组(v0.1.9 新增)
|
|
64
|
+
|
|
65
|
+
`conf` 系列对接 chatBi config map 接口,`confGroup` 是**可选**的二级分组维度:后端在 `confType=api` 时按 `confType + confGroup + confKey` 定位配置(如 `api/workflow/GET_WORKFLOW_LIST`),用于把同类 API 定义归档到同一分组。
|
|
66
|
+
|
|
67
|
+
**下发规则(重要)**:只有 `confType` 为 `api`(或显式传了 `--group`)时,CLI 才会在请求体/查询串里带上 `confGroup`;其他 confType 一律不带该字段,避免污染既有配置类型。
|
|
68
|
+
|
|
69
|
+
| 操作 | 命令 | 对应接口 |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| 新增(批量,可含分组) | `conf add <key> --value v [--type api] [--group g]` / `conf add-file @items.json` | `POST /api/dw/newetl/chatBi/batchAddChatBiConfigMap` |
|
|
72
|
+
| 单查 | `conf get <key> [--type api] [--group g]` | `GET /api/dw/newetl/chatBi/getChatBiConfigMap?confType=&confGroup=&confKey=` |
|
|
73
|
+
| 批量查(按 key) | `conf batch <k1> <k2> ...` / `conf batch-file @items.json` | `POST /api/dw/newetl/chatBi/batchGetChatBiConfigMap` |
|
|
74
|
+
| 批量查(按类型+分组) | `conf group <confType> <confGroup> [--key k]` / `conf group-file @items.json` | `POST /api/dw/newetl/chatBi/batchGetChatBiConfigMapByTypeAndGroup` |
|
|
75
|
+
| 更新 | `conf update <key> [--value v] [--name n] [--attrs a] [--group g]` | `POST /api/dw/newetl/chatBi/updateChatBiConfigMap` |
|
|
76
|
+
| 删除 | `conf delete <key> [--type api] [--group g]` | `DELETE /api/dw/newetl/chatBi/deleteChatBiConfigMap?confType=&confGroup=&confKey=` |
|
|
77
|
+
|
|
78
|
+
批量新增文件 `api-items.json`(`confType=api` 时元素带 `confGroup`):
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
[
|
|
82
|
+
{
|
|
83
|
+
"confType": "api",
|
|
84
|
+
"confGroup": "workflow",
|
|
85
|
+
"confKey": "GET_WORKFLOW_LIST",
|
|
86
|
+
"confValue": "/api/workflow/getList",
|
|
87
|
+
"confName": "查询流程列表",
|
|
88
|
+
"confAttrs": "{\"request\":{\"pageNo\":\"页码\",\"pageSize\":\"每页数量\"},\"response\":{\"list\":\"流程列表\"}}"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"confType": "api",
|
|
92
|
+
"confGroup": "workflow",
|
|
93
|
+
"confKey": "GET_WORKFLOW_DETAIL",
|
|
94
|
+
"confValue": "/api/workflow/getDetail",
|
|
95
|
+
"confName": "查询流程详情",
|
|
96
|
+
"confAttrs": "{\"request\":{\"id\":\"流程ID\"},\"response\":{\"id\":\"流程ID\",\"name\":\"流程名称\"}}"
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
e10-data conf add-file @api-items.json # 批量新增(逐条判重:同 组+键 已存在则跳过)
|
|
103
|
+
e10-data conf group api workflow # 取回 workflow 分组下全部 API 配置
|
|
104
|
+
e10-data conf group-file @groups.json # 多分组一次取回,@groups.json = [{"confType":"api","confGroup":"workflow"}]
|
|
105
|
+
e10-data conf update GET_WORKFLOW_LIST --type api --group workflow --value /api/workflow/queryList
|
|
106
|
+
e10-data conf delete GET_WORKFLOW_LIST --type api --group workflow
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
补充说明:
|
|
110
|
+
|
|
111
|
+
- `confKey` 前缀推导 confType:`CONN_→conn`、`DS_→ds`、`WF_→wf`、`API_→api`;其余类型用 `--type` 显式指定(`--type` 与 `--group` 可同时使用)。
|
|
112
|
+
- 同一 `confKey` 可存在于多个 `confGroup`;`conf batch` / `batch-file` 的返回映射在带分组时以 `组|键` 为键,不会互相覆盖。
|
|
113
|
+
- `--json` 输出:`conf group` 返回配置数组(带 `--key` 时返回单条),`conf batch` 返回映射对象。
|
|
114
|
+
|
|
115
|
+
## ds appId 自动解析(v0.1.13 新增)
|
|
116
|
+
|
|
117
|
+
ChatBI 数据源取数接口(`getListDatas` / `getChartDatas` / `getStatDatas` / `getCountData`)对**部分 EB 应用(独立部署)**的数据集,必须在 `queryDto` 中携带 `appId`,否则后端一律返回 `code=500 请求失败`(实测:小餐厅应用 `840360791696547845` 名下 4 张表不传全 500、传即 200;低代码大赛等应用不传也正常)。
|
|
118
|
+
|
|
119
|
+
`e10-data ds list|chart|stat|count` **默认自动解析并带上 appId**,解析顺序(**每次实时查,不做本地缓存**):
|
|
120
|
+
|
|
121
|
+
1. `--app-id <id>` 显式指定(最高优先,0 额外请求);
|
|
122
|
+
2. **`chat_bi_eb_config_map`**(`dw` 库权限配置表,按 `obj_id = tableId` 取 `app_id`)—— **主来源**;
|
|
123
|
+
3. **`ebdf_obj`**(`ec_edcapp` 库 EB 元数据表,按 `id = tableId` 取 `app_id`)—— 兜底;
|
|
124
|
+
4. 都取不到 → 不带 appId 发送(兼容旧行为)。
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# 默认:自动解析(推荐)
|
|
128
|
+
e10-data ds count --group weaver-ebuilder-form-service --table 840360795890851856
|
|
129
|
+
|
|
130
|
+
# 显式指定(跳过解析,最快)
|
|
131
|
+
e10-data ds count --group weaver-ebuilder-form-service --table 840360795890851856 --app-id 840360791696547845
|
|
132
|
+
|
|
133
|
+
# 完全跳过自动解析(明确不需要 appId 的数据集,省两次解析往返)
|
|
134
|
+
e10-data ds count --group weaver-ebuilder-form-service --table 1081139888007225347 --no-app-id
|
|
135
|
+
|
|
136
|
+
# 查看某张表的 appId:ds tables 输出含 appId 列(服务端返回字段,仅展示用)
|
|
137
|
+
e10-data ds tables --group weaver-ebuilder-form-service --name 低代码大赛
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
> 解析走两条 DSL:`chat_bi_eb_config_map` 用 `#{CONN_DW}`、`ebdf_obj` 用 `#{CONN_EC_EDCAPP}`(占位符由 CLI 内部向配置中心解析;解析不到则跳过该来源)。
|
|
141
|
+
> 实测:小餐厅 4 张表的 appId 均由主来源 `chat_bi_eb_config_map` 直接拿到;解析失败的场景(非 EB 数据集)两次往返的耗时影响可忽略(冷启动 3.7s ≈ `--no-app-id` 基线 3.7s)。
|
|
142
|
+
|
|
143
|
+
## ds --where 过滤条件(v0.1.8 起支持树形 OR)
|
|
144
|
+
|
|
145
|
+
`e10-data ds list|chart|stat|count --where` 接收**条件数组**或**完整条件树**,均可递归嵌套表达 AND/OR:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# ① 数组 = AND 根(旧写法,行为不变):满足全部条件的记录
|
|
149
|
+
e10-data ds count --group <gid> --table <tid> \
|
|
150
|
+
--where '[{"fieldId":"fieldA","compareType":"range","conditionValue":"2026-09~2026-10"},{"fieldId":"fieldB","compareType":"eq","conditionValue":"1"}]'
|
|
151
|
+
|
|
152
|
+
# ② 对象 = 完整条件树:relationship "0"=OR、"1"=AND(缺省 AND),conditionList 内可再嵌套条件组
|
|
153
|
+
e10-data ds count --group <gid> --table <tid> \
|
|
154
|
+
--where '{"relationship":"0","conditionList":[{"fieldId":"fieldA","compareType":"range","conditionValue":"2026-09~2026-10"},{"fieldId":"fieldB","compareType":"range","conditionValue":"2026-09~2026-10"}]}'
|
|
155
|
+
|
|
156
|
+
# ③ 数组元素内嵌条件组 → 复杂组合,如 (A AND B) OR (C AND D)
|
|
157
|
+
e10-data ds list --group <gid> --table <tid> --fields a,b \
|
|
158
|
+
--where @cond.json # 内容见下
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
```json
|
|
162
|
+
// cond.json —— 组合条件示例
|
|
163
|
+
[
|
|
164
|
+
{ "relationship": "1", "conditionList": [
|
|
165
|
+
{ "fieldId": "A", "compareType": "eq", "conditionValue": "x" },
|
|
166
|
+
{ "fieldId": "B", "compareType": "eq", "conditionValue": "y" } ] },
|
|
167
|
+
{ "relationship": "0", "conditionList": [
|
|
168
|
+
{ "fieldId": "C", "compareType": "eq", "conditionValue": "m" },
|
|
169
|
+
{ "fieldId": "D", "compareType": "eq", "conditionValue": "n" } ] }
|
|
170
|
+
]
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
要点:
|
|
174
|
+
|
|
175
|
+
- **叶子字段键**:`fieldId` 与 `conditionId` 均可(fieldId 优先),旧树形 `conditionId` 写法兼容;
|
|
176
|
+
- **relationship**:`"0"`/`0`/`false` = OR,其余 = AND;子节点关系作用于其自身 `conditionList`;
|
|
177
|
+
- 数组顶层恒为 AND 根,需要整体 OR 请用对象形态 `{"relationship":"0","conditionList":[...]}`;
|
|
178
|
+
- 叶子缺少字段会**直接报错**(v0.1.8 起,不再静默产生空条件导致误返回全表);
|
|
179
|
+
- 其余条件属性(conditionType/compareType/conditionValue/objId/mainField/ignoreCaseMark 等)照旧透传。
|
|
180
|
+
|
|
181
|
+
## exp pull 智能拉取(v0.1.4 新增,防本地修改被覆盖)`exp pull` 不再盲目覆盖。CLI 在专家包本地目录维护基线文件 `.sync-state.json`(记录上次同步的 commitId/headRevision 与每文件 sha256),拉取时逐文件三方对比:
|
|
182
|
+
|
|
183
|
+
| 场景 | 判定 | 处理 |
|
|
184
|
+
|---|---|---|
|
|
185
|
+
| 仅远端改(本地未动) | 本地 sha == 基线 sha ≠ 远端 sha | 直接下载覆盖(安全) |
|
|
186
|
+
| 仅本地改(远端未动) | 本地 sha ≠ 基线 sha == 远端 sha | **保留本地,不覆盖** |
|
|
187
|
+
| 双方都改 / 无基线可判 | 本地、基线、远端互不相同 | **先备份本地副本到 `<专家包目录>.pull-backup-<时间戳>/`,再下载覆盖** |
|
|
188
|
+
| 本地缺失 | manifest 有、本地无 | 直接下载(新增/恢复) |
|
|
189
|
+
|
|
190
|
+
- 拉取成功后将 `.sync-state.json` 刷新到新 head,后续判定持续准确;
|
|
191
|
+
- `--force`:一律以远端覆盖(放弃本地修改,不备份);
|
|
192
|
+
- `--dry-run`:只预览决策,不写盘不下载;
|
|
193
|
+
- `.sync-state.json` 为本地同步元文件,**永不随包提交**(`walkDir`/`collectPackage` 已排除);`exp commit` 成功后也会自动刷新该基线。
|
|
194
|
+
|
|
195
|
+
## attend statis 考勤假期余额(v0.1.5 新增)
|
|
196
|
+
|
|
197
|
+
封装 E10 考勤 REST 接口 `POST /api/attend/web/attendInfoV2/getAttendInfoStatis`(hr-attendance 场景六:病假/事假/年假余额统计,替代原手工 curl)。认证/绕代理由 CLI 进程内自动完成(权威源 `~/.e10-cli/profiles/<active>/auth`)。
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
e10-data attend statis [--user <人员ID>] [--begin 2026-09-01] [--end 2026-09-30]
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
- `--user`:目标人员 ID;**缺省 = 当前登录用户**(查他人前需先 HRM 下属校验,见 hr-attendance Skill);
|
|
204
|
+
- `--begin` / `--end`:统计月份范围,**缺省 = 当前月 1 日 ~ 月末**(接口按整月统计,时间范围不影响假期余额口径);
|
|
205
|
+
- `--json`:原样输出接口 JSON(含 `data.attendStatis` 出勤统计 / `data.attendSummary` 汇总 / `data.leaveInfo` 请假 / `data.outAttend` 外出 / `data.vacationBalanceList` 假期余额);
|
|
206
|
+
- 默认人读输出:仅列出 `data.vacationBalanceList`(按 title 区分假期类型)——带薪病假 `100584850000000003`、带薪事假 `100584850000000010` 含 `lastRemaining`(历年可请)/`remaining`(今年可请)/`total`(总计可请) 三项。
|
|
207
|
+
|