@bty/customer-service-cli 0.4.3 → 0.4.4
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 +2 -2
- package/dist/bin.js +6 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -223,14 +223,14 @@ cs-cli workspace points-consumes-daily --start 2026-04-01 --end 2026-04-23
|
|
|
223
223
|
| `product update --agent <id> --product-id <商品ID> --update <json\|@file>` | 更新商品信息 |
|
|
224
224
|
| `product update-sku --agent <id> (--sku <SKU名称> \| --sku-id <id>) --update <json\|@file>` | 更新 SKU 信息(`--sku-id` 优先于 `--sku`) |
|
|
225
225
|
| `product learn --agent <id> --url <URL...> [--source <type>] [--no-identify]` | 通过商品 URL 异步学习(manual / identify 默认开启) |
|
|
226
|
-
| `product sync-taobao --agent <id> [--skip-hash-check]` |
|
|
226
|
+
| `product sync-taobao --agent <id> [--skip-hash-check] [--sync-type <full\|incremental>]` | 触发淘宝店铺商品同步 |
|
|
227
227
|
| `product sync-taobao-item --agent <id> --product-id <商品ID>` | 触发单个淘宝商品同步 |
|
|
228
228
|
|
|
229
229
|
`product update` 支持更新的字段包括:`卖点`、`补充知识`、`tag`、`参数`、`轮播图识别结果`、`商品详情页识别结果` 等。`--update` 接受 JSON 字符串或 `@文件路径`。
|
|
230
230
|
|
|
231
231
|
`product learn` 提交商品详情页 URL 进入异步学习队列(`/v1/knowledge/products/upload`),返回 `flow_id` 和 `knowledge_ids`。`--url` 可多值,用空格分隔;`--source` 默认 `manual`;传 `--no-identify` 可关闭自动识别。
|
|
232
232
|
|
|
233
|
-
`product sync-taobao` / `product sync-taobao-item` 调用 customer-servhub-api 的授权店铺同步接口,要求 `--agent`
|
|
233
|
+
`product sync-taobao` / `product sync-taobao-item` 调用 customer-servhub-api 的授权店铺同步接口,要求 `--agent` 已唯一绑定一个淘宝授权店铺。前者支持 `--sync-type full|incremental`,默认 `full`;后者按 `product_id` 补同步单个淘宝商品。
|
|
234
234
|
|
|
235
235
|
注意:这两个命令仅对已开通“高级工具”的店铺 Agent 生效。未开通高级工具时,即使 `--agent` 已绑定淘宝授权店铺,请求也可能在服务端失败。
|
|
236
236
|
|
package/dist/bin.js
CHANGED
|
@@ -2853,7 +2853,8 @@ async function syncTaobaoProducts(opts) {
|
|
|
2853
2853
|
method: "POST",
|
|
2854
2854
|
body: {
|
|
2855
2855
|
customer_agent_config_id: opts.agentConfigId,
|
|
2856
|
-
skip_hash_check: opts.skipHashCheck ?? false
|
|
2856
|
+
skip_hash_check: opts.skipHashCheck ?? false,
|
|
2857
|
+
sync_type: opts.syncType ?? "full"
|
|
2857
2858
|
}
|
|
2858
2859
|
});
|
|
2859
2860
|
}
|
|
@@ -2977,12 +2978,13 @@ function registerProductCommand(program2) {
|
|
|
2977
2978
|
}
|
|
2978
2979
|
});
|
|
2979
2980
|
product.command("sync-taobao").description(
|
|
2980
|
-
"\u89E6\u53D1\u6DD8\u5B9D\u5E97\u94FA\u5546\u54C1\
|
|
2981
|
-
).requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u5FC5\u987B\u5DF2\u552F\u4E00\u7ED1\u5B9A\u4E00\u4E2A\u6DD8\u5B9D\u6388\u6743\u5E97\u94FA\uFF09").option("--skip-hash-check", "\u8DF3\u8FC7\u54C8\u5E0C\u6821\u9A8C\uFF0C\u5F3A\u5236\u91CD\u65B0\u540C\u6B65\u5546\u54C1").action(async (opts) => {
|
|
2981
|
+
"\u89E6\u53D1\u6DD8\u5B9D\u5E97\u94FA\u5546\u54C1\u540C\u6B65\u3002\u8C03\u7528 customer-servhub-api \u7684\u6388\u6743\u5E97\u94FA\u540C\u6B65\u63A5\u53E3\uFF0C\u6309 Agent \u914D\u7F6E\u627E\u5230\u552F\u4E00\u7ED1\u5B9A\u5E97\u94FA\u540E\u5F02\u6B65\u542F\u52A8\u540C\u6B65\u4EFB\u52A1"
|
|
2982
|
+
).requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u5FC5\u987B\u5DF2\u552F\u4E00\u7ED1\u5B9A\u4E00\u4E2A\u6DD8\u5B9D\u6388\u6743\u5E97\u94FA\uFF09").option("--skip-hash-check", "\u8DF3\u8FC7\u54C8\u5E0C\u6821\u9A8C\uFF0C\u5F3A\u5236\u91CD\u65B0\u540C\u6B65\u5546\u54C1").option("--sync-type <type>", "\u540C\u6B65\u7C7B\u578B\uFF1Afull / incremental\uFF0C\u9ED8\u8BA4 full", "full").action(async (opts) => {
|
|
2982
2983
|
try {
|
|
2983
2984
|
const data = await syncTaobaoProducts({
|
|
2984
2985
|
agentConfigId: opts.agent,
|
|
2985
|
-
skipHashCheck: Boolean(opts.skipHashCheck)
|
|
2986
|
+
skipHashCheck: Boolean(opts.skipHashCheck),
|
|
2987
|
+
syncType: opts.syncType
|
|
2986
2988
|
});
|
|
2987
2989
|
formatOutput({ success: true, data }, program2.opts().table);
|
|
2988
2990
|
} catch (err) {
|