@henryxiaoyang/wechat-access-unqclawed 1.0.14 → 1.0.15

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/auth/qclaw-api.ts CHANGED
@@ -70,9 +70,14 @@ export class QClawAPI {
70
70
  }
71
71
 
72
72
  if (ret === 0 || commonCode === 0) {
73
+ // 匹配 Python 的 or 语义:空对象 {} 视为 falsy 跳过
74
+ const nonEmpty = (v: unknown): unknown =>
75
+ v != null && typeof v === "object" && !Array.isArray(v) && Object.keys(v as Record<string, unknown>).length === 0
76
+ ? undefined
77
+ : v;
73
78
  const respData =
74
- nested(data, "data", "resp", "data") ??
75
- nested(data, "data", "data") ??
79
+ nonEmpty(nested(data, "data", "resp", "data")) ??
80
+ nonEmpty(nested(data, "data", "data")) ??
76
81
  data.data ??
77
82
  data;
78
83
  return { success: true, data: respData as Record<string, unknown> };
package/index.ts CHANGED
@@ -282,6 +282,7 @@ const tencentAccessPlugin = {
282
282
  channels["wechat-access-unqclawed"] = {
283
283
  ...(channels["wechat-access-unqclawed"] ?? {}),
284
284
  token: channelToken,
285
+ wsUrl: env.wechatWsUrl,
285
286
  };
286
287
  const nextCfg: Record<string, unknown> = { ...fullCfg, channels };
287
288
  if (apiKey) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryxiaoyang/wechat-access-unqclawed",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "type": "module",
5
5
  "description": "OpenClaw 微信通路插件 — 扫码登录 + AGP WebSocket 双向通信",
6
6
  "author": "HenryXiaoYang",