@optima-chat/tiktok-cli 0.15.0 → 0.15.1

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 CHANGED
@@ -21,7 +21,7 @@ tiktok <domain> <verb> --shop <shopId> [--flags]
21
21
  | `auth link` | 生成店铺绑定授权链接(无需 --shop) |
22
22
  | `shops` | 查当前登录用户已授权店铺 |
23
23
  | `orders list` | 订单列表(`--status --page-size --since`) |
24
- | `orders get --id <id>` | 订单详情 |
24
+ | `orders get --id <id>[,<id>]` | 订单详情(多个用英文逗号连) |
25
25
  | `analytics shop` | 店铺经营数据(`--from --to`,默认近30天) |
26
26
  | `analytics products` | 商品维度数据(GMV 降序)。`--version` 默认 `202509`;`202605` 返回 `total_performance` + 分渠道 `*_performance` 组(**组是可选的、字段名三套变体、`overall_performance` 在新版不存在**,见 spec §3.0);未知版本本地拒,平台出新版可 `--force-version` 直接试;`--page-token` 翻页,**末页 `next_page_token` 为空串**(不是缺席) |
27
27
  | `products list` | 商品列表 |
package/dist/index.js CHANGED
@@ -134,8 +134,9 @@ function classify(status, body, shop) {
134
134
  if (status === 0 || body?.code === 0) {
135
135
  return { ok: true, data: body.data, meta };
136
136
  }
137
- if (status === 404) return { ok: false, error: { code: "SHOP_NOT_AUTHORIZED", message: body?.error ?? "\u5E97\u94FA\u672A\u6388\u6743", retryable: false }, meta };
138
- if (status === 403) return { ok: false, error: { code: "VALIDATION", message: body?.error ?? "\u8DEF\u5F84\u4E0D\u5141\u8BB8", retryable: false }, meta };
137
+ const isBackendEnvelope = typeof body?.code !== "number" && typeof body?.error === "string";
138
+ if (status === 404 && isBackendEnvelope) return { ok: false, error: { code: "SHOP_NOT_AUTHORIZED", message: body.error, retryable: false }, meta };
139
+ if (status === 403 && isBackendEnvelope) return { ok: false, error: { code: "VALIDATION", message: body.error, retryable: false }, meta };
139
140
  const tc = body?.code;
140
141
  const msg = body?.message ?? body?.error ?? `HTTP ${status}`;
141
142
  if (tc === 36009002 || status === 429) return { ok: false, error: { code: "RATE_LIMITED", message: msg, retryable: true, retry_after_s: 30 }, meta };
@@ -346,9 +347,11 @@ var COMMANDS = [
346
347
  },
347
348
  {
348
349
  name: "orders get",
349
- summary: "\u8BA2\u5355\u8BE6\u60C5\uFF08--id \u5FC5\u586B\uFF09",
350
+ summary: "\u8BA2\u5355\u8BE6\u60C5\uFF08--id \u5FC5\u586B\uFF0C\u591A\u4E2A\u7528\u82F1\u6587\u9017\u53F7\u8FDE\uFF09",
350
351
  flags: ["id"],
351
- run: ({ shop, args: args2 }) => proxy("GET", shop, "/order/202309/orders/detail", { query: { ids: args2.id } })
352
+ // 🔴 Get Order Detail 是 GET /order/202309/orders?ids=a,b(#42:原来写成 …/orders/detail,
353
+ // 平台回 36009009 Invalid path;cn-stage 测试店 2026-09-20 实打本路径 200)
354
+ run: ({ shop, args: args2 }) => proxy("GET", shop, "/order/202309/orders", { query: { ids: args2.id } })
352
355
  },
353
356
  // ── 售后(退货/取消)只读 ──
354
357
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optima-chat/tiktok-cli",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "TikTok Shop CLI for Optima agents — 经 tiktok-backend 操作店铺",
5
5
  "type": "module",
6
6
  "bin": {