@bty/customer-service-cli 0.6.9 → 0.6.10
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 +5 -0
- package/dist/bin.js +14 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.10 (2026-08-26)
|
|
4
|
+
|
|
5
|
+
- `context-search`:`query_content` 增加最少 2 个字符的本地校验,避免过短关键词触发服务端全量扫描。
|
|
6
|
+
- `channel-metric backfill`:对齐服务端权限收紧——`--workspace-id` 逐个鉴权,缺省不再采集所有 workspace,改为只采集当前登录 workspace;同时修复不传 `--workspace-id` 时 commander 解析崩溃的问题。
|
|
7
|
+
|
|
3
8
|
## 0.6.9 (2026-08-24)
|
|
4
9
|
|
|
5
10
|
- 新增 `channel-metric` 命令组,查询千牛等渠道店铺客服的每日排行指标(`channel_metric_snapshot`):
|
package/dist/bin.js
CHANGED
|
@@ -1185,8 +1185,14 @@ function registerChannelMetricCommand(program2) {
|
|
|
1185
1185
|
}
|
|
1186
1186
|
});
|
|
1187
1187
|
channelMetric.command("backfill").description(
|
|
1188
|
-
"\u624B\u52A8\u8865\u6570\u636E\uFF1A\u91C7\u96C6\u6307\u5B9A\u65E5\u671F\u533A\u95F4\u7684\u6E20\u9053\u6307\u6807\u3002\u53EF\u6307\u5B9A workspace\uFF08\u53EF\u91CD\u590D\u4F20\uFF09\uFF1B\u4E0D\u4F20 --workspace-id = \u91C7\u96C6\
|
|
1189
|
-
).requiredOption("--channel <channel>", "\u6E20\u9053\uFF08platform\uFF09\uFF0C\u5982 qianniu").requiredOption("--start <date>", "\u8D77\u59CB\u65E5\u671F\uFF08YYYY-MM-DD\uFF09").requiredOption("--end <date>", "\u7ED3\u675F\u65E5\u671F\uFF08YYYY-MM-DD\uFF09").option(
|
|
1188
|
+
"\u624B\u52A8\u8865\u6570\u636E\uFF1A\u91C7\u96C6\u6307\u5B9A\u65E5\u671F\u533A\u95F4\u7684\u6E20\u9053\u6307\u6807\u3002\u53EF\u6307\u5B9A workspace\uFF08\u53EF\u91CD\u590D\u4F20\uFF0C\u9010\u4E2A\u9274\u6743\uFF09\uFF1B\u4E0D\u4F20 --workspace-id = \u53EA\u91C7\u96C6\u5F53\u524D workspace\uFF08\u767B\u5F55\u6001\u4E0B\uFF0C\u670D\u52A1\u7AEF\u9650\u5236\uFF09"
|
|
1189
|
+
).requiredOption("--channel <channel>", "\u6E20\u9053\uFF08platform\uFF09\uFF0C\u5982 qianniu").requiredOption("--start <date>", "\u8D77\u59CB\u65E5\u671F\uFF08YYYY-MM-DD\uFF09").requiredOption("--end <date>", "\u7ED3\u675F\u65E5\u671F\uFF08YYYY-MM-DD\uFF09").option(
|
|
1190
|
+
"--workspace-id <workspace_id>",
|
|
1191
|
+
"\u5DE5\u4F5C\u7A7A\u95F4 ID\uFF08\u53EF\u91CD\u590D\u4F20\uFF1B\u7F3A\u7701 = \u53EA\u91C7\u96C6\u5F53\u524D workspace\uFF09",
|
|
1192
|
+
collect,
|
|
1193
|
+
[]
|
|
1194
|
+
// 默认空数组:commander 首次解析时 previous 为 undefined,无默认值会崩
|
|
1195
|
+
).action(async (opts) => {
|
|
1190
1196
|
try {
|
|
1191
1197
|
const workspaceIds = opts.workspaceId?.length ? opts.workspaceId : void 0;
|
|
1192
1198
|
setRuntimeWorkspaceId(workspaceIds?.[0]);
|
|
@@ -1359,6 +1365,11 @@ function parseSearchTime(value, fieldName) {
|
|
|
1359
1365
|
}
|
|
1360
1366
|
return parsed;
|
|
1361
1367
|
}
|
|
1368
|
+
function validateContextSearchQuery(queryContent) {
|
|
1369
|
+
if (queryContent.trim().length < 2) {
|
|
1370
|
+
throw new Error("query_content \u81F3\u5C11\u9700\u8981 2 \u4E2A\u5B57\u7B26");
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1362
1373
|
function validateContextSearchRange(startTime, endTime) {
|
|
1363
1374
|
if (!startTime || !endTime) return;
|
|
1364
1375
|
const start = parseSearchTime(startTime, "\u5F00\u59CB\u65F6\u95F4");
|
|
@@ -1397,6 +1408,7 @@ function shouldKeepTransferHumanConversation(item, onlyAbnormal) {
|
|
|
1397
1408
|
});
|
|
1398
1409
|
}
|
|
1399
1410
|
async function contextSearchRecords(opts) {
|
|
1411
|
+
validateContextSearchQuery(opts.queryContent);
|
|
1400
1412
|
validateContextSearchRange(opts.startTime, opts.endTime);
|
|
1401
1413
|
const wsId = getWorkspaceId(opts.workspaceId);
|
|
1402
1414
|
const request = createRequest();
|