publishport-opencli 1.0.20 → 1.0.21

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.
Files changed (1041) hide show
  1. package/clis/12306/me.js +2 -2
  2. package/clis/12306/orders.js +3 -3
  3. package/clis/12306/passengers.js +3 -3
  4. package/clis/12306/price.js +1 -1
  5. package/clis/12306/stations.js +1 -1
  6. package/clis/12306/train.js +1 -1
  7. package/clis/12306/trains.js +1 -1
  8. package/clis/12306/utils.js +1 -1
  9. package/clis/1688/download.js +1 -1
  10. package/clis/1688/item.js +4 -4
  11. package/clis/1688/search.js +4 -4
  12. package/clis/1688/store.js +4 -4
  13. package/clis/1point3acres/forum.js +1 -1
  14. package/clis/1point3acres/forums.js +1 -1
  15. package/clis/1point3acres/notifications.js +1 -1
  16. package/clis/1point3acres/search.js +1 -1
  17. package/clis/1point3acres/thread.js +2 -2
  18. package/clis/1point3acres/user.js +1 -1
  19. package/clis/1point3acres/utils.js +2 -2
  20. package/clis/36kr/article.js +2 -2
  21. package/clis/36kr/hot.js +2 -2
  22. package/clis/36kr/news.js +1 -1
  23. package/clis/36kr/search.js +2 -2
  24. package/clis/51job/company.js +2 -2
  25. package/clis/51job/detail.js +2 -2
  26. package/clis/51job/hot.js +1 -1
  27. package/clis/51job/search.js +1 -1
  28. package/clis/51job/utils.js +7 -7
  29. package/clis/_atlassian/shared.js +9 -9
  30. package/clis/_shared/article/auth.js +4 -4
  31. package/clis/_shared/article/douban-md2draft.js +4 -4
  32. package/clis/_shared/article/format.js +1 -1
  33. package/clis/_shared/article/images.js +7 -7
  34. package/clis/_shared/article/login.js +1 -1
  35. package/clis/_shared/article/publish.js +11 -11
  36. package/clis/_shared/common.js +1 -1
  37. package/clis/_shared/content-guard.js +1 -1
  38. package/clis/_shared/desktop-commands.js +1 -1
  39. package/clis/_shared/file-inject.js +12 -12
  40. package/clis/_shared/self-hosted-sites.js +2 -2
  41. package/clis/_shared/site-auth.js +1 -1
  42. package/clis/_shared/token-auth.js +2 -2
  43. package/clis/_shared/video-publish.js +9 -9
  44. package/clis/amazon/offer.js +3 -3
  45. package/clis/amazon/product.js +5 -5
  46. package/clis/amazon/shared.js +6 -6
  47. package/clis/antigravity/_actions.js +13 -13
  48. package/clis/antigravity/audit-extras.js +10 -10
  49. package/clis/antigravity/delete.js +1 -1
  50. package/clis/antigravity/model.js +6 -6
  51. package/clis/antigravity/new.js +2 -2
  52. package/clis/antigravity/read.js +2 -2
  53. package/clis/antigravity/rename.js +1 -1
  54. package/clis/antigravity/send.js +3 -3
  55. package/clis/antigravity/serve.js +17 -17
  56. package/clis/antigravity/storage.js +6 -6
  57. package/clis/antigravity/watch.js +2 -2
  58. package/clis/apple-podcasts/episodes.js +1 -1
  59. package/clis/apple-podcasts/top.js +1 -1
  60. package/clis/apple-podcasts/utils.js +1 -1
  61. package/clis/archive/item.js +1 -1
  62. package/clis/archive/search.js +1 -1
  63. package/clis/archive/snapshots.js +1 -1
  64. package/clis/archive/wayback.js +1 -1
  65. package/clis/arxiv/author.js +1 -1
  66. package/clis/arxiv/utils.js +1 -1
  67. package/clis/autohome/brand.js +1 -1
  68. package/clis/autohome/score.js +1 -1
  69. package/clis/autohome/utils.js +1 -1
  70. package/clis/baijiahao/article.js +1 -1
  71. package/clis/baijiahao/lists.js +1 -1
  72. package/clis/baijiahao/login.js +1 -1
  73. package/clis/baijiahao/publish.js +9 -9
  74. package/clis/baijiahao/stats.js +1 -1
  75. package/clis/baijiahao/whoami.js +1 -1
  76. package/clis/band/bands.js +2 -2
  77. package/clis/band/mentions.js +2 -2
  78. package/clis/band/post.js +4 -4
  79. package/clis/band/posts.js +3 -3
  80. package/clis/barchart/flow.js +3 -3
  81. package/clis/barchart/greeks.js +2 -2
  82. package/clis/barchart/quote.js +3 -3
  83. package/clis/bbc/news.js +1 -1
  84. package/clis/bbc/topic.js +1 -1
  85. package/clis/bbc/utils.js +1 -1
  86. package/clis/bilibili/article.js +1 -1
  87. package/clis/bilibili/categories.js +1 -1
  88. package/clis/bilibili/coin.js +1 -1
  89. package/clis/bilibili/comment-del.js +1 -1
  90. package/clis/bilibili/comment-like.js +1 -1
  91. package/clis/bilibili/comment.js +1 -1
  92. package/clis/bilibili/comments.js +1 -1
  93. package/clis/bilibili/dm-list.js +1 -1
  94. package/clis/bilibili/dm-read.js +1 -1
  95. package/clis/bilibili/dm-send.js +1 -1
  96. package/clis/bilibili/download.js +2 -2
  97. package/clis/bilibili/drafts.js +1 -1
  98. package/clis/bilibili/dynamic-post.js +3 -3
  99. package/clis/bilibili/favorite-add.js +1 -1
  100. package/clis/bilibili/favorite.js +1 -1
  101. package/clis/bilibili/feed.js +2 -2
  102. package/clis/bilibili/follow.js +1 -1
  103. package/clis/bilibili/following.js +1 -1
  104. package/clis/bilibili/like.js +1 -1
  105. package/clis/bilibili/partitions.js +1 -1
  106. package/clis/bilibili/stats.js +1 -1
  107. package/clis/bilibili/subtitle.js +3 -3
  108. package/clis/bilibili/summary.js +1 -1
  109. package/clis/bilibili/topics.js +1 -1
  110. package/clis/bilibili/unfollow.js +1 -1
  111. package/clis/bilibili/upload.js +1 -1
  112. package/clis/bilibili/utils.js +10 -10
  113. package/clis/bilibili/video-drafts.js +1 -1
  114. package/clis/bilibili/video.js +1 -1
  115. package/clis/bloomberg/businessweek.js +4 -4
  116. package/clis/bloomberg/news.js +2 -2
  117. package/clis/bloomberg/utils.js +13 -13
  118. package/clis/bluesky/post.js +1 -1
  119. package/clis/bluesky/shared.js +11 -11
  120. package/clis/bluesky/whoami.js +1 -1
  121. package/clis/booking/search.js +2 -2
  122. package/clis/boss/accept.js +1 -1
  123. package/clis/boss/applied.js +1 -1
  124. package/clis/boss/auth.js +1 -1
  125. package/clis/boss/batchgreet.js +1 -1
  126. package/clis/boss/bossinfo.js +1 -1
  127. package/clis/boss/chatlist.js +1 -1
  128. package/clis/boss/chatmsg.js +1 -1
  129. package/clis/boss/cities.js +1 -1
  130. package/clis/boss/detail.js +1 -1
  131. package/clis/boss/exchange.js +1 -1
  132. package/clis/boss/greet.js +1 -1
  133. package/clis/boss/interviews.js +1 -1
  134. package/clis/boss/invite.js +1 -1
  135. package/clis/boss/joblist.js +1 -1
  136. package/clis/boss/mark.js +1 -1
  137. package/clis/boss/me.js +2 -2
  138. package/clis/boss/recommend.js +1 -1
  139. package/clis/boss/resumedelete.js +1 -1
  140. package/clis/boss/resumelist.js +1 -1
  141. package/clis/boss/resumeupload.js +11 -11
  142. package/clis/boss/search.js +1 -1
  143. package/clis/boss/send.js +1 -1
  144. package/clis/boss/sendresume.js +1 -1
  145. package/clis/boss/stats.js +1 -1
  146. package/clis/boss/unread.js +1 -1
  147. package/clis/boss/utils.js +13 -13
  148. package/clis/chaoxing/assignments.js +1 -1
  149. package/clis/chaoxing/exams.js +1 -1
  150. package/clis/chaoxing/utils.js +9 -9
  151. package/clis/chatgpt/ask.js +1 -1
  152. package/clis/chatgpt/auth.js +2 -2
  153. package/clis/chatgpt/detail.js +1 -1
  154. package/clis/chatgpt/image.js +1 -1
  155. package/clis/chatgpt/read.js +1 -1
  156. package/clis/chatgpt/send.js +1 -1
  157. package/clis/chatgpt/utils.js +59 -59
  158. package/clis/chatgpt-app/ask.js +1 -1
  159. package/clis/chatgpt-app/send.js +1 -1
  160. package/clis/chatwise/model.js +6 -6
  161. package/clis/chess/analyze.js +1 -1
  162. package/clis/chess/game.js +1 -1
  163. package/clis/chess/games.js +1 -1
  164. package/clis/chess/stats.js +1 -1
  165. package/clis/chess/utils.js +1 -1
  166. package/clis/claude/ask.js +2 -2
  167. package/clis/claude/detail.js +1 -1
  168. package/clis/claude/new.js +1 -1
  169. package/clis/claude/read.js +1 -1
  170. package/clis/claude/send.js +1 -1
  171. package/clis/claude/utils.js +23 -23
  172. package/clis/cnblogs/article.js +1 -1
  173. package/clis/cnblogs/login.js +1 -1
  174. package/clis/cnblogs/stats.js +7 -7
  175. package/clis/cnblogs/whoami.js +1 -1
  176. package/clis/codex/_actions.js +3 -3
  177. package/clis/codex/archive.js +1 -1
  178. package/clis/codex/ask.js +6 -6
  179. package/clis/codex/model.js +8 -8
  180. package/clis/codex/pin.js +1 -1
  181. package/clis/codex/rename.js +4 -4
  182. package/clis/codex/send.js +3 -3
  183. package/clis/codex/sidebar.js +1 -1
  184. package/clis/coingecko/categories.js +1 -1
  185. package/clis/coingecko/coin.js +1 -1
  186. package/clis/coingecko/derivatives.js +1 -1
  187. package/clis/coingecko/exchanges.js +1 -1
  188. package/clis/coingecko/global.js +1 -1
  189. package/clis/coingecko/trending.js +1 -1
  190. package/clis/confluence/search.js +1 -1
  191. package/clis/coupang/product.js +3 -3
  192. package/clis/coupang/utils.js +1 -1
  193. package/clis/crates/crate.js +1 -1
  194. package/clis/crates/search.js +1 -1
  195. package/clis/crates/utils.js +1 -1
  196. package/clis/csdn/article.js +13 -13
  197. package/clis/csdn/columns.js +1 -1
  198. package/clis/csdn/login.js +1 -1
  199. package/clis/csdn/stats.js +4 -4
  200. package/clis/csdn/whoami.js +1 -1
  201. package/clis/cto51/article.js +1 -1
  202. package/clis/cto51/whoami.js +1 -1
  203. package/clis/ctrip/flight.js +2 -2
  204. package/clis/ctrip/hotel-search.js +3 -3
  205. package/clis/ctrip/hotel-suggest.js +1 -1
  206. package/clis/ctrip/search.js +1 -1
  207. package/clis/ctrip/utils.js +6 -6
  208. package/clis/cursor/ask.js +5 -5
  209. package/clis/cursor/composer.js +2 -2
  210. package/clis/cursor/model.js +4 -4
  211. package/clis/cursor/send.js +2 -2
  212. package/clis/dblp/author.js +1 -1
  213. package/clis/dblp/paper.js +1 -1
  214. package/clis/dblp/search.js +1 -1
  215. package/clis/dblp/utils.js +1 -1
  216. package/clis/dblp/venue.js +1 -1
  217. package/clis/deepseek/ask.js +1 -1
  218. package/clis/deepseek/auth.js +2 -2
  219. package/clis/deepseek/detail.js +1 -1
  220. package/clis/deepseek/new.js +1 -1
  221. package/clis/deepseek/read.js +1 -1
  222. package/clis/deepseek/send.js +7 -7
  223. package/clis/deepseek/utils.js +25 -25
  224. package/clis/defillama/protocol.js +1 -1
  225. package/clis/defillama/protocols.js +1 -1
  226. package/clis/defillama/utils.js +1 -1
  227. package/clis/devto/auth.js +2 -2
  228. package/clis/devto/latest.js +1 -1
  229. package/clis/devto/publish.js +5 -5
  230. package/clis/devto/read.js +2 -2
  231. package/clis/devto/stats.js +3 -3
  232. package/clis/dianping/auth.js +2 -2
  233. package/clis/dianping/cityResolver.js +2 -2
  234. package/clis/dianping/search.js +1 -1
  235. package/clis/dianping/shop.js +1 -1
  236. package/clis/dianping/utils.js +1 -1
  237. package/clis/discord-app/delete.js +3 -3
  238. package/clis/discord-app/read.js +1 -1
  239. package/clis/discord-app/thread-read.js +1 -1
  240. package/clis/discord-web/auth.js +2 -2
  241. package/clis/discord-web/send.js +5 -5
  242. package/clis/dockerhub/image.js +1 -1
  243. package/clis/dockerhub/search.js +1 -1
  244. package/clis/dockerhub/utils.js +1 -1
  245. package/clis/dongchedi/koubei.js +1 -1
  246. package/clis/dongchedi/models.js +1 -1
  247. package/clis/dongchedi/score.js +1 -1
  248. package/clis/dongchedi/search.js +1 -1
  249. package/clis/dongchedi/series.js +1 -1
  250. package/clis/dongchedi/specs.js +1 -1
  251. package/clis/dongchedi/utils.js +1 -1
  252. package/clis/douban/article.js +3 -3
  253. package/clis/douban/auth.js +2 -2
  254. package/clis/douban/download.js +1 -1
  255. package/clis/douban/utils.js +23 -23
  256. package/clis/doubao/auth.js +3 -3
  257. package/clis/doubao/utils.js +39 -39
  258. package/clis/doubao-app/ask.js +1 -1
  259. package/clis/doubao-app/utils.js +4 -4
  260. package/clis/douyin/_shared/browser-fetch.js +7 -7
  261. package/clis/douyin/_shared/draft-cache.js +1 -1
  262. package/clis/douyin/_shared/imagex-upload.js +1 -1
  263. package/clis/douyin/_shared/sts2.js +1 -1
  264. package/clis/douyin/_shared/text-extra.js +1 -1
  265. package/clis/douyin/_shared/tos-upload.js +4 -4
  266. package/clis/douyin/_shared/transcode.js +1 -1
  267. package/clis/douyin/_shared/vod-upload.js +4 -4
  268. package/clis/douyin/draft.js +18 -18
  269. package/clis/douyin/drafts.js +1 -1
  270. package/clis/douyin/publish-image.js +12 -12
  271. package/clis/douyin/publish.js +9 -9
  272. package/clis/douyin/search.js +3 -3
  273. package/clis/douyin/videos.js +1 -1
  274. package/clis/eastmoney/_secid.js +1 -1
  275. package/clis/eastmoney/announcement.js +1 -1
  276. package/clis/eastmoney/article.js +1 -1
  277. package/clis/eastmoney/convertible.js +1 -1
  278. package/clis/eastmoney/etf.js +1 -1
  279. package/clis/eastmoney/holders.js +1 -1
  280. package/clis/eastmoney/index-board.js +1 -1
  281. package/clis/eastmoney/kline.js +1 -1
  282. package/clis/eastmoney/kuaixun.js +1 -1
  283. package/clis/eastmoney/longhu.js +1 -1
  284. package/clis/eastmoney/money-flow.js +1 -1
  285. package/clis/eastmoney/northbound.js +1 -1
  286. package/clis/eastmoney/quote.js +1 -1
  287. package/clis/eastmoney/rank.js +1 -1
  288. package/clis/eastmoney/sectors.js +1 -1
  289. package/clis/endoflife/product.js +1 -1
  290. package/clis/endoflife/utils.js +1 -1
  291. package/clis/facebook/comment.js +8 -8
  292. package/clis/facebook/feed.js +4 -4
  293. package/clis/facebook/like.js +5 -5
  294. package/clis/facebook/notifications.js +3 -3
  295. package/clis/facebook/post.js +11 -11
  296. package/clis/facebook/search.js +3 -3
  297. package/clis/flathub/app.js +1 -1
  298. package/clis/flathub/search.js +1 -1
  299. package/clis/flathub/utils.js +1 -1
  300. package/clis/flomo/memos.js +1 -1
  301. package/clis/gemini/deep-research-result.js +4 -4
  302. package/clis/gemini/deep-research.js +1 -1
  303. package/clis/gemini/detail.js +1 -1
  304. package/clis/gemini/history.js +1 -1
  305. package/clis/gemini/image.js +2 -2
  306. package/clis/gemini/status.js +1 -1
  307. package/clis/gemini/utils.js +43 -43
  308. package/clis/geogebra/hexagon.js +1 -1
  309. package/clis/geogebra/info.js +3 -3
  310. package/clis/geogebra/triangle.js +1 -1
  311. package/clis/geogebra/utils.js +11 -11
  312. package/clis/ghost/login.js +1 -1
  313. package/clis/ghost/shared.js +2 -2
  314. package/clis/gitee/auth.js +2 -2
  315. package/clis/github-trending/repos.js +1 -1
  316. package/clis/google/news.js +1 -1
  317. package/clis/google/search.js +2 -2
  318. package/clis/google/suggest.js +1 -1
  319. package/clis/google/trends.js +1 -1
  320. package/clis/google/utils.js +1 -1
  321. package/clis/goproxy/module.js +1 -1
  322. package/clis/goproxy/utils.js +1 -1
  323. package/clis/goproxy/versions.js +1 -1
  324. package/clis/gov-policy/recent.js +2 -2
  325. package/clis/gov-policy/search.js +2 -2
  326. package/clis/grok/ask.js +1 -1
  327. package/clis/grok/detail.js +1 -1
  328. package/clis/grok/image.js +8 -8
  329. package/clis/grok/pin.js +1 -1
  330. package/clis/grok/send.js +1 -1
  331. package/clis/grok/status.js +1 -1
  332. package/clis/grok/utils.js +21 -21
  333. package/clis/guazi/browse.js +1 -1
  334. package/clis/guazi/car.js +1 -1
  335. package/clis/guazi/utils.js +1 -1
  336. package/clis/hackernews/auth.js +2 -2
  337. package/clis/hackernews/comment.js +8 -8
  338. package/clis/hackernews/read.js +7 -7
  339. package/clis/hackernews/submit.js +7 -7
  340. package/clis/hashnode/auth.js +3 -3
  341. package/clis/hashnode/publish.js +14 -14
  342. package/clis/hf/auth.js +2 -2
  343. package/clis/hf/models.js +1 -1
  344. package/clis/hf/paper.js +1 -1
  345. package/clis/hf/spaces.js +1 -1
  346. package/clis/hf/top.js +1 -1
  347. package/clis/homebrew/cask.js +1 -1
  348. package/clis/homebrew/formula.js +1 -1
  349. package/clis/homebrew/popular.js +1 -1
  350. package/clis/homebrew/utils.js +1 -1
  351. package/clis/huodongxing/events.js +1 -1
  352. package/clis/hupu/detail.js +4 -4
  353. package/clis/hupu/hot.js +3 -3
  354. package/clis/hupu/reply.js +1 -1
  355. package/clis/hupu/search.js +1 -1
  356. package/clis/hupu/unlike.js +1 -1
  357. package/clis/hupu/utils.js +10 -10
  358. package/clis/imdb/person.js +2 -2
  359. package/clis/imdb/reviews.js +3 -3
  360. package/clis/imdb/search.js +2 -2
  361. package/clis/imdb/title.js +1 -1
  362. package/clis/imdb/top.js +1 -1
  363. package/clis/imdb/trending.js +1 -1
  364. package/clis/imdb/utils.js +13 -13
  365. package/clis/imooc/article.js +6 -6
  366. package/clis/imooc/login.js +1 -1
  367. package/clis/imooc/whoami.js +1 -1
  368. package/clis/indeed/job.js +2 -2
  369. package/clis/indeed/search.js +2 -2
  370. package/clis/indeed/utils.js +1 -1
  371. package/clis/infoq/article.js +2 -2
  372. package/clis/infoq/login.js +1 -1
  373. package/clis/infoq/whoami.js +1 -1
  374. package/clis/instagram/_shared/private-publish.js +4 -4
  375. package/clis/instagram/_shared/protocol-capture.js +9 -9
  376. package/clis/instagram/detail.js +3 -3
  377. package/clis/instagram/post.js +25 -25
  378. package/clis/instagram/reel.js +18 -18
  379. package/clis/instagram/story.js +4 -4
  380. package/clis/instagram/user.js +2 -2
  381. package/clis/jd/item.js +65 -65
  382. package/clis/jianshu/article.js +1 -1
  383. package/clis/jianshu/login.js +1 -1
  384. package/clis/jianshu/notebooks.js +1 -1
  385. package/clis/jianshu/whoami.js +1 -1
  386. package/clis/jianyu/search.js +6 -6
  387. package/clis/jianyu/shared/procurement-contract.js +1 -1
  388. package/clis/jike/api.js +6 -6
  389. package/clis/jike/auth.js +3 -3
  390. package/clis/jike/comment.js +1 -1
  391. package/clis/jike/create.js +6 -6
  392. package/clis/jike/feed.js +3 -3
  393. package/clis/jike/like.js +1 -1
  394. package/clis/jike/notifications.js +3 -3
  395. package/clis/jike/repost.js +13 -13
  396. package/clis/jike/search.js +3 -3
  397. package/clis/jimeng/auth.js +2 -2
  398. package/clis/jimeng/generate.js +10 -10
  399. package/clis/jira/shared.js +1 -1
  400. package/clis/juejin/article.js +4 -4
  401. package/clis/juejin/categories.js +1 -1
  402. package/clis/juejin/hot.js +1 -1
  403. package/clis/juejin/login.js +1 -1
  404. package/clis/juejin/recommend.js +1 -1
  405. package/clis/juejin/stats.js +3 -3
  406. package/clis/juejin/tags.js +1 -1
  407. package/clis/juejin/utils.js +1 -1
  408. package/clis/juejin/whoami.js +1 -1
  409. package/clis/ke/utils.js +4 -4
  410. package/clis/kimi/_utils.js +7 -7
  411. package/clis/kimi/audit-extras.js +14 -14
  412. package/clis/kimi/auth.js +3 -3
  413. package/clis/kimi/chat.js +15 -15
  414. package/clis/kimi/storage.js +5 -5
  415. package/clis/kimi/ui.js +13 -13
  416. package/clis/kimi/usage.js +3 -3
  417. package/clis/kuaishou/auth.js +1 -1
  418. package/clis/kuaishou/publish.js +6 -6
  419. package/clis/lesswrong/_helpers.js +5 -5
  420. package/clis/lesswrong/comments.js +5 -5
  421. package/clis/lichess/top.js +1 -1
  422. package/clis/lichess/user.js +1 -1
  423. package/clis/lichess/utils.js +1 -1
  424. package/clis/linkedin/comment.js +1 -1
  425. package/clis/linkedin/connect.js +11 -11
  426. package/clis/linkedin/create.js +5 -5
  427. package/clis/linkedin/follow.js +1 -1
  428. package/clis/linkedin/inbox.js +1 -1
  429. package/clis/linkedin/job-detail.js +3 -3
  430. package/clis/linkedin/like.js +1 -1
  431. package/clis/linkedin/notifications.js +1 -1
  432. package/clis/linkedin/people-search.js +1 -1
  433. package/clis/linkedin/post-comments.js +1 -1
  434. package/clis/linkedin/post-detail.js +1 -1
  435. package/clis/linkedin/profile-analytics.js +1 -1
  436. package/clis/linkedin/profile-api.js +13 -13
  437. package/clis/linkedin/profile-experience.js +1 -1
  438. package/clis/linkedin/profile-projects.js +1 -1
  439. package/clis/linkedin/profile-read.js +3 -3
  440. package/clis/linkedin/reply.js +1 -1
  441. package/clis/linkedin/repost.js +1 -1
  442. package/clis/linkedin/safe-send.js +8 -8
  443. package/clis/linkedin/salesnav-inbox.js +5 -5
  444. package/clis/linkedin/salesnav-message.js +3 -3
  445. package/clis/linkedin/salesnav-search.js +4 -4
  446. package/clis/linkedin/salesnav-thread.js +1 -1
  447. package/clis/linkedin/search-api.js +3 -3
  448. package/clis/linkedin/search.js +8 -8
  449. package/clis/linkedin/social-api.js +31 -31
  450. package/clis/linkedin/timeline.js +3 -3
  451. package/clis/linkedin-learning/search.js +2 -2
  452. package/clis/linkedin-learning/trending.js +2 -2
  453. package/clis/linux-do/feed.js +4 -4
  454. package/clis/linux-do/topic-content.js +8 -8
  455. package/clis/lobsters/domain.js +1 -1
  456. package/clis/lobsters/read.js +7 -7
  457. package/clis/maimai/auth.js +2 -2
  458. package/clis/maimai/search-talents.js +4 -4
  459. package/clis/manus/_utils.js +1 -1
  460. package/clis/mastodon/login.js +1 -1
  461. package/clis/mastodon/post.js +1 -1
  462. package/clis/mastodon/shared.js +12 -12
  463. package/clis/mastodon/whoami.js +1 -1
  464. package/clis/maven/artifact.js +1 -1
  465. package/clis/maven/search.js +1 -1
  466. package/clis/maven/utils.js +1 -1
  467. package/clis/mdn/search.js +1 -1
  468. package/clis/medium/article.js +5 -5
  469. package/clis/medium/login.js +1 -1
  470. package/clis/medium/stats.js +3 -3
  471. package/clis/medium/tag.js +1 -1
  472. package/clis/medium/whoami.js +1 -1
  473. package/clis/mubu/notes.js +1 -1
  474. package/clis/mubu/utils.js +15 -15
  475. package/clis/note/auth.js +2 -2
  476. package/clis/note/note-utils.js +2 -2
  477. package/clis/note/publish.js +8 -8
  478. package/clis/notebooklm/add-source.js +8 -8
  479. package/clis/notebooklm/create.js +1 -1
  480. package/clis/notebooklm/generate-slides.js +1 -1
  481. package/clis/notebooklm/notes-get.js +1 -1
  482. package/clis/notebooklm/rpc.js +8 -8
  483. package/clis/notebooklm/source-fulltext.js +1 -1
  484. package/clis/notebooklm/utils.js +10 -10
  485. package/clis/nowcoder/auth.js +2 -2
  486. package/clis/nowcoder/comment.js +1 -1
  487. package/clis/nowcoder/comments.js +1 -1
  488. package/clis/nowcoder/dm-list.js +1 -1
  489. package/clis/nowcoder/dm-read.js +1 -1
  490. package/clis/nowcoder/dm-send.js +1 -1
  491. package/clis/nowcoder/drafts.js +1 -1
  492. package/clis/nowcoder/inbox.js +1 -1
  493. package/clis/nowcoder/like.js +1 -1
  494. package/clis/nowcoder/my.js +1 -1
  495. package/clis/nowcoder/post.js +1 -1
  496. package/clis/nowcoder/utils.js +13 -13
  497. package/clis/npm/downloads.js +1 -1
  498. package/clis/npm/package.js +1 -1
  499. package/clis/npm/search.js +1 -1
  500. package/clis/npm/utils.js +1 -1
  501. package/clis/nuget/package.js +1 -1
  502. package/clis/nuget/search.js +1 -1
  503. package/clis/nuget/utils.js +1 -1
  504. package/clis/nvd/cve.js +1 -1
  505. package/clis/oeis/search.js +1 -1
  506. package/clis/oeis/sequence.js +1 -1
  507. package/clis/oeis/utils.js +1 -1
  508. package/clis/ones/common.js +6 -6
  509. package/clis/ones/enrich-tasks.js +1 -1
  510. package/clis/ones/my-tasks.js +1 -1
  511. package/clis/ones/resolve-labels.js +1 -1
  512. package/clis/ones/task-helpers.js +1 -1
  513. package/clis/ones/task.js +1 -1
  514. package/clis/ones/worklog.js +7 -7
  515. package/clis/openalex/search.js +1 -1
  516. package/clis/openalex/utils.js +1 -1
  517. package/clis/openalex/work.js +1 -1
  518. package/clis/openfda/drug-label.js +1 -1
  519. package/clis/openfda/food-recall.js +1 -1
  520. package/clis/openfda/utils.js +1 -1
  521. package/clis/openreview/author.js +1 -1
  522. package/clis/openreview/paper.js +1 -1
  523. package/clis/openreview/reviews.js +3 -3
  524. package/clis/openreview/search.js +1 -1
  525. package/clis/openreview/utils.js +1 -1
  526. package/clis/openreview/venue.js +1 -1
  527. package/clis/oschina/article.js +1 -1
  528. package/clis/oschina/catalogs.js +1 -1
  529. package/clis/oschina/login.js +1 -1
  530. package/clis/oschina/stats.js +6 -6
  531. package/clis/oschina/whoami.js +1 -1
  532. package/clis/osv/query.js +1 -1
  533. package/clis/osv/utils.js +1 -1
  534. package/clis/osv/vulnerability.js +1 -1
  535. package/clis/packagist/package.js +1 -1
  536. package/clis/packagist/search.js +1 -1
  537. package/clis/packagist/utils.js +1 -1
  538. package/clis/pinterest/api.js +1 -1
  539. package/clis/pinterest/auth.js +1 -1
  540. package/clis/pinterest/boards.js +1 -1
  541. package/clis/pinterest/client.js +6 -6
  542. package/clis/pinterest/publish.js +5 -5
  543. package/clis/pixiv/auth.js +2 -2
  544. package/clis/pixiv/download.js +1 -1
  545. package/clis/pixiv/illusts.js +1 -1
  546. package/clis/pixiv/search.js +1 -1
  547. package/clis/pixiv/utils.js +3 -3
  548. package/clis/powerchina/auth.js +2 -2
  549. package/clis/powerchina/search.js +1 -1
  550. package/clis/producthunt/browse.js +2 -2
  551. package/clis/producthunt/hot.js +2 -2
  552. package/clis/producthunt/posts.js +1 -1
  553. package/clis/producthunt/today.js +1 -1
  554. package/clis/producthunt/utils.js +1 -1
  555. package/clis/pypi/downloads.js +1 -1
  556. package/clis/pypi/package.js +1 -1
  557. package/clis/pypi/utils.js +1 -1
  558. package/clis/qiita/auth.js +1 -1
  559. package/clis/qiita/gql.js +6 -6
  560. package/clis/qiita/publish.js +4 -4
  561. package/clis/qiita/stats.js +4 -4
  562. package/clis/qoder/_utils.js +16 -16
  563. package/clis/qoder/composer.js +1 -1
  564. package/clis/qoder/quest.js +1 -1
  565. package/clis/qoder/ui.js +14 -14
  566. package/clis/quark/auth.js +2 -2
  567. package/clis/quark/utils.js +2 -2
  568. package/clis/quora/answer-comments.js +3 -3
  569. package/clis/quora/create-answer.js +4 -4
  570. package/clis/quora/create-question.js +3 -3
  571. package/clis/quora/shared.js +17 -17
  572. package/clis/quora/whoami.js +1 -1
  573. package/clis/qwen/ask.js +1 -1
  574. package/clis/qwen/auth.js +3 -3
  575. package/clis/qwen/detail.js +1 -1
  576. package/clis/qwen/image.js +5 -5
  577. package/clis/qwen/status.js +1 -1
  578. package/clis/qwen/utils.js +16 -16
  579. package/clis/reddit/home.js +3 -3
  580. package/clis/reddit/read.js +10 -10
  581. package/clis/reddit/reply.js +4 -4
  582. package/clis/reddit/submit.js +11 -11
  583. package/clis/reddit/subreddit-info.js +3 -3
  584. package/clis/reddit/subscribed.js +4 -4
  585. package/clis/reddit/whoami.js +2 -2
  586. package/clis/rednote/comments.js +1 -1
  587. package/clis/rednote/download.js +1 -1
  588. package/clis/rednote/feed.js +1 -1
  589. package/clis/rednote/note.js +1 -1
  590. package/clis/rednote/notifications.js +2 -2
  591. package/clis/rednote/search.js +2 -2
  592. package/clis/rest-countries/country.js +1 -1
  593. package/clis/rest-countries/region.js +1 -1
  594. package/clis/rest-countries/utils.js +1 -1
  595. package/clis/reuters/article-detail.js +1 -1
  596. package/clis/reuters/auth.js +3 -3
  597. package/clis/reuters/search.js +1 -1
  598. package/clis/reuters/utils.js +4 -4
  599. package/clis/rfc/rfc.js +1 -1
  600. package/clis/rfc/utils.js +1 -1
  601. package/clis/rubygems/gem.js +1 -1
  602. package/clis/rubygems/search.js +1 -1
  603. package/clis/rubygems/utils.js +1 -1
  604. package/clis/segmentfault/article.js +3 -3
  605. package/clis/segmentfault/channels.js +1 -1
  606. package/clis/segmentfault/login.js +1 -1
  607. package/clis/segmentfault/stats.js +4 -4
  608. package/clis/segmentfault/tags.js +1 -1
  609. package/clis/segmentfault/whoami.js +1 -1
  610. package/clis/semanticscholar/citations.js +1 -1
  611. package/clis/semanticscholar/paper.js +1 -1
  612. package/clis/semanticscholar/recommendations.js +1 -1
  613. package/clis/semanticscholar/search.js +1 -1
  614. package/clis/semanticscholar/utils.js +1 -1
  615. package/clis/sinafinance/news.js +1 -1
  616. package/clis/sinafinance/stock-rank.js +1 -1
  617. package/clis/sinafinance/stock.js +1 -1
  618. package/clis/slock/attachment-download.js +1 -1
  619. package/clis/slock/attachment-upload.js +7 -7
  620. package/clis/slock/attachment-url.js +1 -1
  621. package/clis/slock/auth-verify.js +1 -1
  622. package/clis/slock/bookmark-add.js +1 -1
  623. package/clis/slock/bookmark-remove.js +1 -1
  624. package/clis/slock/channel-action.js +1 -1
  625. package/clis/slock/channel-create.js +1 -1
  626. package/clis/slock/channel-files.js +1 -1
  627. package/clis/slock/channel-list.js +1 -1
  628. package/clis/slock/channel-mark.js +1 -1
  629. package/clis/slock/channel-members.js +1 -1
  630. package/clis/slock/channel-unarchive.js +1 -1
  631. package/clis/slock/dm-list.js +1 -1
  632. package/clis/slock/errors.js +1 -1
  633. package/clis/slock/in-page.js +28 -28
  634. package/clis/slock/inbox-done.js +5 -5
  635. package/clis/slock/inbox.js +1 -1
  636. package/clis/slock/message-read.js +22 -22
  637. package/clis/slock/message-search.js +10 -10
  638. package/clis/slock/message-send.js +25 -25
  639. package/clis/slock/reaction-add.js +1 -1
  640. package/clis/slock/reaction-remove.js +1 -1
  641. package/clis/slock/resolve.js +1 -1
  642. package/clis/slock/server-list.js +2 -2
  643. package/clis/slock/task-claim.js +4 -4
  644. package/clis/slock/task-convert.js +13 -13
  645. package/clis/slock/task-create.js +1 -1
  646. package/clis/slock/task-delete.js +5 -5
  647. package/clis/slock/task-get.js +5 -5
  648. package/clis/slock/task-list-server.js +4 -4
  649. package/clis/slock/task-list.js +5 -5
  650. package/clis/slock/task-status.js +3 -3
  651. package/clis/slock/task-unclaim.js +3 -3
  652. package/clis/slock/thread-follow.js +1 -1
  653. package/clis/slock/thread-state.js +1 -1
  654. package/clis/slock/unread-summary.js +5 -5
  655. package/clis/slock/whoami.js +1 -1
  656. package/clis/smzdm/search.js +3 -3
  657. package/clis/sohu/article.js +1 -1
  658. package/clis/sohu/attributes.js +1 -1
  659. package/clis/sohu/categories.js +1 -1
  660. package/clis/sohu/channels.js +1 -1
  661. package/clis/sohu/columns.js +1 -1
  662. package/clis/sohu/login.js +1 -1
  663. package/clis/sohu/stats.js +3 -3
  664. package/clis/sohu/topics.js +1 -1
  665. package/clis/sohu/whoami.js +1 -1
  666. package/clis/spotify/spotify.js +1 -1
  667. package/clis/stackoverflow/read.js +6 -6
  668. package/clis/stackoverflow/related.js +1 -1
  669. package/clis/stackoverflow/tag.js +1 -1
  670. package/clis/stackoverflow/user.js +1 -1
  671. package/clis/stackoverflow/utils.js +1 -1
  672. package/clis/steam/app.js +1 -1
  673. package/clis/steam/search.js +1 -1
  674. package/clis/steam/utils.js +1 -1
  675. package/clis/substack/auth.js +2 -2
  676. package/clis/substack/post-utils.js +2 -2
  677. package/clis/substack/publish.js +5 -5
  678. package/clis/suno/auth.js +2 -2
  679. package/clis/suno/download.js +5 -5
  680. package/clis/suno/generate.js +3 -3
  681. package/clis/suno/list.js +1 -1
  682. package/clis/suno/status.js +1 -1
  683. package/clis/suno/utils.js +29 -29
  684. package/clis/telegram/send.js +7 -7
  685. package/clis/telegram/shared.js +2 -2
  686. package/clis/telegram/whoami.js +1 -1
  687. package/clis/test-utils.js +1 -1
  688. package/clis/threads/post.js +23 -23
  689. package/clis/threads/shared.js +3 -3
  690. package/clis/threads/whoami.js +1 -1
  691. package/clis/tieba/hot.js +3 -3
  692. package/clis/tieba/posts.js +1 -1
  693. package/clis/tieba/read.js +2 -2
  694. package/clis/tieba/search.js +3 -3
  695. package/clis/tieba/utils.js +1 -1
  696. package/clis/tiktok/comment.js +2 -2
  697. package/clis/tiktok/creator-videos.js +3 -3
  698. package/clis/tiktok/explore.js +3 -3
  699. package/clis/tiktok/follow.js +8 -8
  700. package/clis/tiktok/following.js +4 -4
  701. package/clis/tiktok/friends.js +7 -7
  702. package/clis/tiktok/live.js +3 -3
  703. package/clis/tiktok/notifications.js +6 -6
  704. package/clis/tiktok/publish.js +17 -17
  705. package/clis/tiktok/unfollow.js +4 -4
  706. package/clis/tiktok/user.js +2 -2
  707. package/clis/tiktok/utils.js +1 -1
  708. package/clis/toutiao/article.js +1 -1
  709. package/clis/toutiao/articles.js +2 -2
  710. package/clis/toutiao/auth.js +2 -2
  711. package/clis/toutiao/hot.js +1 -1
  712. package/clis/toutiao/recommend.js +1 -1
  713. package/clis/toutiao/utils.js +2 -2
  714. package/clis/trae-solo/_actions.js +4 -4
  715. package/clis/trae-solo/_fs.js +5 -5
  716. package/clis/trae-solo/_state.js +2 -2
  717. package/clis/trae-solo/automation.js +4 -4
  718. package/clis/trae-solo/mode.js +4 -4
  719. package/clis/trae-solo/model.js +4 -4
  720. package/clis/trae-solo/renderer-storage.js +4 -4
  721. package/clis/trae-solo/settings.js +1 -1
  722. package/clis/trae-solo/skill-fs.js +1 -1
  723. package/clis/trae-solo/skill.js +12 -12
  724. package/clis/trae-solo/state-fs.js +2 -2
  725. package/clis/trae-solo/task-fs.js +5 -5
  726. package/clis/trae-solo/workspaces-fs.js +1 -1
  727. package/clis/tumblr/auth.js +2 -2
  728. package/clis/tumblr/publish.js +3 -3
  729. package/clis/tvmaze/search.js +1 -1
  730. package/clis/tvmaze/show.js +1 -1
  731. package/clis/tvmaze/utils.js +1 -1
  732. package/clis/twitter/accept.js +7 -7
  733. package/clis/twitter/article.js +7 -7
  734. package/clis/twitter/bookmark-folder.js +3 -3
  735. package/clis/twitter/bookmark-folders.js +3 -3
  736. package/clis/twitter/bookmarks.js +4 -4
  737. package/clis/twitter/delete.js +5 -5
  738. package/clis/twitter/device-follow.js +3 -3
  739. package/clis/twitter/dm-list.js +1 -1
  740. package/clis/twitter/dm-read.js +1 -1
  741. package/clis/twitter/dm-send.js +5 -5
  742. package/clis/twitter/dm-shared.js +3 -3
  743. package/clis/twitter/download.js +6 -6
  744. package/clis/twitter/followers.js +5 -5
  745. package/clis/twitter/following.js +2 -2
  746. package/clis/twitter/like.js +3 -3
  747. package/clis/twitter/likes.js +8 -8
  748. package/clis/twitter/list-add-core.js +9 -9
  749. package/clis/twitter/list-create.js +5 -5
  750. package/clis/twitter/list-remove-core.js +9 -9
  751. package/clis/twitter/list-tweets.js +7 -7
  752. package/clis/twitter/lists.js +6 -6
  753. package/clis/twitter/notifications.js +2 -2
  754. package/clis/twitter/post.js +24 -24
  755. package/clis/twitter/profile.js +7 -7
  756. package/clis/twitter/quote.js +7 -7
  757. package/clis/twitter/reply-dm.js +7 -7
  758. package/clis/twitter/reply.js +12 -12
  759. package/clis/twitter/retweet.js +3 -3
  760. package/clis/twitter/scheduled-delete.js +3 -3
  761. package/clis/twitter/scheduled-list.js +2 -2
  762. package/clis/twitter/scheduled-utils.js +3 -3
  763. package/clis/twitter/search.js +5 -5
  764. package/clis/twitter/shared.js +6 -6
  765. package/clis/twitter/thread.js +4 -4
  766. package/clis/twitter/timeline.js +3 -3
  767. package/clis/twitter/trending.js +2 -2
  768. package/clis/twitter/tweets.js +11 -11
  769. package/clis/twitter/unlike.js +3 -3
  770. package/clis/twitter/unretweet.js +3 -3
  771. package/clis/twitter/utils.js +6 -6
  772. package/clis/upwork/detail.js +2 -2
  773. package/clis/upwork/feed.js +2 -2
  774. package/clis/upwork/search.js +2 -2
  775. package/clis/upwork/utils.js +1 -1
  776. package/clis/v2ex/auth.js +2 -2
  777. package/clis/v2ex/daily.js +3 -3
  778. package/clis/v2ex/me.js +2 -2
  779. package/clis/v2ex/notifications.js +2 -2
  780. package/clis/vk/post.js +1 -1
  781. package/clis/vk/shared.js +2 -2
  782. package/clis/vk/whoami.js +1 -1
  783. package/clis/web/read.js +8 -8
  784. package/clis/wechat-channels/auth.js +2 -2
  785. package/clis/wechat-channels/publish.js +30 -30
  786. package/clis/weibo/article.js +1 -1
  787. package/clis/weibo/auth.js +3 -3
  788. package/clis/weibo/comments.js +1 -1
  789. package/clis/weibo/delete.js +2 -2
  790. package/clis/weibo/feed.js +3 -3
  791. package/clis/weibo/hot.js +1 -1
  792. package/clis/weibo/publish.js +10 -10
  793. package/clis/weibo/search.js +2 -2
  794. package/clis/weibo/user-posts.js +3 -3
  795. package/clis/weibo/user.js +2 -2
  796. package/clis/weibo/utils.js +3 -3
  797. package/clis/weixin/article.js +1 -1
  798. package/clis/weixin/create-draft.js +26 -26
  799. package/clis/weixin/download.js +2 -2
  800. package/clis/weixin/login.js +1 -1
  801. package/clis/weixin/search.js +2 -2
  802. package/clis/weixin/stats.js +3 -3
  803. package/clis/weixin/whoami.js +1 -1
  804. package/clis/weread/ai-outline.js +2 -2
  805. package/clis/weread/book-search.js +2 -2
  806. package/clis/weread/book.js +2 -2
  807. package/clis/weread/notebooks.js +1 -1
  808. package/clis/weread/search.js +1 -1
  809. package/clis/weread/shelf.js +1 -1
  810. package/clis/weread/utils.js +6 -6
  811. package/clis/weread-official/book.js +1 -1
  812. package/clis/weread-official/discover.js +1 -1
  813. package/clis/weread-official/list-apis.js +1 -1
  814. package/clis/weread-official/notes.js +1 -1
  815. package/clis/weread-official/readdata.js +1 -1
  816. package/clis/weread-official/review.js +1 -1
  817. package/clis/weread-official/search.js +1 -1
  818. package/clis/weread-official/shelf.js +1 -1
  819. package/clis/weread-official/utils.js +1 -1
  820. package/clis/wikidata/entity.js +1 -1
  821. package/clis/wikidata/search.js +1 -1
  822. package/clis/wikidata/utils.js +1 -1
  823. package/clis/wikipedia/page.js +1 -1
  824. package/clis/wikipedia/trending.js +1 -1
  825. package/clis/wikipedia/utils.js +1 -1
  826. package/clis/wordpress/login.js +1 -1
  827. package/clis/wordpress/publish.js +1 -1
  828. package/clis/wordpress/shared.js +3 -3
  829. package/clis/wordpress/whoami.js +1 -1
  830. package/clis/woshipm/article.js +1 -1
  831. package/clis/woshipm/login.js +1 -1
  832. package/clis/woshipm/stats.js +4 -4
  833. package/clis/woshipm/whoami.js +1 -1
  834. package/clis/wttr/current.js +1 -1
  835. package/clis/wttr/forecast.js +1 -1
  836. package/clis/wttr/utils.js +1 -1
  837. package/clis/xianyu/collect.js +1 -1
  838. package/clis/xianyu/inbox.js +1 -1
  839. package/clis/xianyu/item-stats.js +2 -2
  840. package/clis/xianyu/location.js +1 -1
  841. package/clis/xianyu/manage.js +1 -1
  842. package/clis/xianyu/messages.js +1 -1
  843. package/clis/xianyu/mtop.js +5 -5
  844. package/clis/xianyu/order.js +1 -1
  845. package/clis/xianyu/promote-stats.js +2 -2
  846. package/clis/xianyu/publish.js +17 -17
  847. package/clis/xianyu/rate.js +1 -1
  848. package/clis/xianyu/reply.js +1 -1
  849. package/clis/xianyu/search.js +8 -8
  850. package/clis/xianyu/seller-data.js +1 -1
  851. package/clis/xianyu/seller-list.js +1 -1
  852. package/clis/xianyu/user.js +1 -1
  853. package/clis/xiaoe/catalog.js +2 -2
  854. package/clis/xiaoe/content.js +2 -2
  855. package/clis/xiaoe/courses.js +2 -2
  856. package/clis/xiaohongshu/ask.js +6 -6
  857. package/clis/xiaohongshu/comments.js +6 -6
  858. package/clis/xiaohongshu/creator-note-detail.js +7 -7
  859. package/clis/xiaohongshu/creator-notes-summary.js +1 -1
  860. package/clis/xiaohongshu/creator-notes.js +13 -13
  861. package/clis/xiaohongshu/creator-profile.js +2 -2
  862. package/clis/xiaohongshu/creator-stats.js +2 -2
  863. package/clis/xiaohongshu/delete-note.js +7 -7
  864. package/clis/xiaohongshu/download.js +4 -4
  865. package/clis/xiaohongshu/feed.js +2 -2
  866. package/clis/xiaohongshu/follow.js +3 -3
  867. package/clis/xiaohongshu/human.js +3 -3
  868. package/clis/xiaohongshu/note-helpers.js +1 -1
  869. package/clis/xiaohongshu/note.js +2 -2
  870. package/clis/xiaohongshu/notifications.js +1 -1
  871. package/clis/xiaohongshu/publish-video.js +8 -8
  872. package/clis/xiaohongshu/publish.js +59 -59
  873. package/clis/xiaohongshu/search.js +8 -8
  874. package/clis/xiaohongshu/unfollow.js +4 -4
  875. package/clis/xiaohongshu/user-helpers.js +1 -1
  876. package/clis/xiaohongshu/user.js +2 -2
  877. package/clis/xiaoyuzhou/auth.js +3 -3
  878. package/clis/xiaoyuzhou/download.js +1 -1
  879. package/clis/xiaoyuzhou/utils.js +1 -1
  880. package/clis/xueqiu/article.js +4 -4
  881. package/clis/xueqiu/comments.js +4 -4
  882. package/clis/xueqiu/danjuan-utils.js +4 -4
  883. package/clis/xueqiu/earnings-date.js +1 -1
  884. package/clis/xueqiu/events.js +3 -3
  885. package/clis/xueqiu/hashtags.js +3 -3
  886. package/clis/xueqiu/stocks.js +3 -3
  887. package/clis/xueqiu/users.js +3 -3
  888. package/clis/xueqiu/utils.js +3 -3
  889. package/clis/yahoo-finance/quote.js +1 -1
  890. package/clis/yollomi/background.js +1 -1
  891. package/clis/yollomi/edit.js +1 -1
  892. package/clis/yollomi/face-swap.js +1 -1
  893. package/clis/yollomi/generate.js +1 -1
  894. package/clis/yollomi/object-remover.js +1 -1
  895. package/clis/yollomi/remove-bg.js +1 -1
  896. package/clis/yollomi/restore.js +1 -1
  897. package/clis/yollomi/try-on.js +1 -1
  898. package/clis/yollomi/upload.js +4 -4
  899. package/clis/yollomi/upscale.js +1 -1
  900. package/clis/yollomi/utils.js +4 -4
  901. package/clis/yollomi/video.js +1 -1
  902. package/clis/youtube/channel.js +4 -4
  903. package/clis/youtube/feed.js +2 -2
  904. package/clis/youtube/like.js +5 -5
  905. package/clis/youtube/playlist.js +7 -7
  906. package/clis/youtube/publish.js +11 -11
  907. package/clis/youtube/search.js +3 -3
  908. package/clis/youtube/subscribe.js +7 -7
  909. package/clis/youtube/subscriptions.js +1 -1
  910. package/clis/youtube/transcript-group.js +2 -2
  911. package/clis/youtube/transcript.js +13 -13
  912. package/clis/youtube/unlike.js +5 -5
  913. package/clis/youtube/unsubscribe.js +7 -7
  914. package/clis/youtube/utils.js +3 -3
  915. package/clis/youtube/video.js +4 -4
  916. package/clis/youtube/watch-later.js +2 -2
  917. package/clis/yuanbao/ask.js +18 -18
  918. package/clis/yuanbao/detail.js +1 -1
  919. package/clis/yuanbao/read.js +1 -1
  920. package/clis/yuanbao/shared.js +9 -9
  921. package/clis/yuanbao/status.js +1 -1
  922. package/clis/yuque/article.js +1 -1
  923. package/clis/yuque/whoami.js +1 -1
  924. package/clis/zhihu/answer-comments.js +2 -2
  925. package/clis/zhihu/answer-detail.js +3 -3
  926. package/clis/zhihu/answer.js +1 -1
  927. package/clis/zhihu/article-transform.js +1 -1
  928. package/clis/zhihu/article.js +1 -1
  929. package/clis/zhihu/auth.js +2 -2
  930. package/clis/zhihu/collection.js +3 -3
  931. package/clis/zhihu/collections.js +3 -3
  932. package/clis/zhihu/download.js +2 -2
  933. package/clis/zhihu/image-profile.js +6 -6
  934. package/clis/zhihu/paginate.js +3 -3
  935. package/clis/zhihu/pin.js +4 -4
  936. package/clis/zhihu/question.js +3 -3
  937. package/clis/zhihu/recommend.js +3 -3
  938. package/clis/zhihu/search.js +3 -3
  939. package/clis/zhihu/stats.js +3 -3
  940. package/clis/zhihu/user-arg.js +1 -1
  941. package/clis/zhihu/write-shared.js +7 -7
  942. package/clis/zlibrary/utils.js +6 -6
  943. package/clis/zsxq/auth.js +3 -3
  944. package/clis/zsxq/search.js +1 -1
  945. package/clis/zsxq/topic.js +1 -1
  946. package/clis/zsxq/utils.js +5 -5
  947. package/dist/src/adapter-source.js +1 -1
  948. package/dist/src/browser/analyze.js +1 -1
  949. package/dist/src/browser/article-extract.js +2 -2
  950. package/dist/src/browser/ax-snapshot.js +2 -2
  951. package/dist/src/browser/base-page.js +25 -25
  952. package/dist/src/browser/bridge.js +1 -1
  953. package/dist/src/browser/cdp.js +1 -1
  954. package/dist/src/browser/daemon-client.js +1 -1
  955. package/dist/src/browser/daemon-lifecycle.js +7 -7
  956. package/dist/src/browser/dom-helpers.js +35 -35
  957. package/dist/src/browser/dom-snapshot.js +19 -19
  958. package/dist/src/browser/errors.js +3 -3
  959. package/dist/src/browser/extract.js +5 -5
  960. package/dist/src/browser/find.js +13 -13
  961. package/dist/src/browser/fingerprint.js +2 -2
  962. package/dist/src/browser/html-tree.js +6 -6
  963. package/dist/src/browser/managed-chrome.js +1 -1
  964. package/dist/src/browser/network-cache.js +1 -1
  965. package/dist/src/browser/network-key.js +1 -1
  966. package/dist/src/browser/page.js +7 -7
  967. package/dist/src/browser/profile.js +2 -2
  968. package/dist/src/browser/proxy-test.js +8 -8
  969. package/dist/src/browser/shape-filter.js +1 -1
  970. package/dist/src/browser/shape.js +1 -1
  971. package/dist/src/browser/stealth.js +3 -3
  972. package/dist/src/browser/tabs.js +2 -2
  973. package/dist/src/browser/target-errors.js +1 -1
  974. package/dist/src/browser/target-resolver.js +23 -23
  975. package/dist/src/browser/trace.js +2 -2
  976. package/dist/src/browser/utils.js +1 -1
  977. package/dist/src/browser/verify-fixture.js +2 -2
  978. package/dist/src/browser-session-lock.js +1 -1
  979. package/dist/src/build-manifest.js +11 -11
  980. package/dist/src/capabilityRouting.js +1 -1
  981. package/dist/src/cli-argv-preprocess.js +1 -1
  982. package/dist/src/cli.js +32 -32
  983. package/dist/src/commanderAdapter.js +3 -3
  984. package/dist/src/commands/auth.js +3 -3
  985. package/dist/src/commands/daemon.js +1 -1
  986. package/dist/src/completion-fast.js +1 -1
  987. package/dist/src/completion.js +1 -1
  988. package/dist/src/constants.js +1 -1
  989. package/dist/src/convention-audit.js +2 -2
  990. package/dist/src/daemon-utils.js +1 -1
  991. package/dist/src/daemon.js +1 -1
  992. package/dist/src/discovery.js +2 -2
  993. package/dist/src/doctor.js +9 -9
  994. package/dist/src/download/article-download.js +15 -15
  995. package/dist/src/download/index.js +4 -4
  996. package/dist/src/download/media-download.js +1 -1
  997. package/dist/src/download/progress.js +3 -3
  998. package/dist/src/electron-apps.js +1 -1
  999. package/dist/src/errors.js +2 -2
  1000. package/dist/src/execution.js +2 -2
  1001. package/dist/src/external.js +1 -1
  1002. package/dist/src/help.js +8 -8
  1003. package/dist/src/hooks.js +1 -1
  1004. package/dist/src/interceptor.js +21 -21
  1005. package/dist/src/launcher.js +7 -7
  1006. package/dist/src/logger.js +8 -8
  1007. package/dist/src/main.js +7 -7
  1008. package/dist/src/observation/artifact.js +5 -5
  1009. package/dist/src/observation/retention.js +1 -1
  1010. package/dist/src/output.js +2 -2
  1011. package/dist/src/package-paths.js +1 -1
  1012. package/dist/src/pipeline/executor.js +1 -1
  1013. package/dist/src/pipeline/registry.js +1 -1
  1014. package/dist/src/pipeline/steps/browser.js +1 -1
  1015. package/dist/src/pipeline/steps/download.js +1 -1
  1016. package/dist/src/pipeline/steps/fetch.js +6 -6
  1017. package/dist/src/pipeline/steps/intercept.js +1 -1
  1018. package/dist/src/pipeline/steps/tap.js +17 -17
  1019. package/dist/src/pipeline/steps/transform.js +1 -1
  1020. package/dist/src/pipeline/template.js +1 -1
  1021. package/dist/src/plugin-manifest.js +1 -1
  1022. package/dist/src/plugin-scaffold.js +19 -19
  1023. package/dist/src/plugin.js +12 -12
  1024. package/dist/src/rate-limit.js +1 -1
  1025. package/dist/src/registry.js +1 -1
  1026. package/dist/src/runtime-detect.js +1 -1
  1027. package/dist/src/runtime.js +1 -1
  1028. package/dist/src/scripts/framework.js +1 -1
  1029. package/dist/src/scripts/interact.js +1 -1
  1030. package/dist/src/scripts/store.js +1 -1
  1031. package/dist/src/serialization.js +2 -2
  1032. package/dist/src/session-lease.js +1 -1
  1033. package/dist/src/snapshotFormatter.js +2 -2
  1034. package/dist/src/tui.js +12 -12
  1035. package/dist/src/user-runtime.js +1 -1
  1036. package/dist/src/utils.d.ts +12 -0
  1037. package/dist/src/utils.js +4 -4
  1038. package/dist/src/validate.js +2 -2
  1039. package/dist/src/verify.js +2 -2
  1040. package/dist/src/version.js +1 -1
  1041. package/package.json +1 -1
@@ -1 +1 @@
1
- import{cli as F,Strategy as H}from"@jackwener/opencli/registry";import{CliError as G,AuthRequiredError as M,CommandExecutionError as O}from"@jackwener/opencli/errors";import{readFileSync as L}from"node:fs";import{normalizeContent as N}from"../_shared/article/format.js";import{assertLiteralContent as f}from"../_shared/content-guard.js";import{resolveBaseUrl as k,getAppPasswordCreds as q,basicAuthHeader as R,wpRequest as W,gotoWpAdmin as I,buildPublishJs as T,WP_ADMIN_POST_NEW as j}from"./shared.js";const U=["draft","publish","pending","private"];function V(K){return String(K).split(",").map((Q)=>Number(Q.trim())).filter((Q)=>Number.isFinite(Q))}function w(K,Q){const Z={title:String(K.title),content:Q,status:String(K.status)};if(K.excerpt)Z.excerpt=String(K.excerpt);if(K.slug)Z.slug=String(K.slug);if(K.categories)Z.categories=V(K.categories);if(K.tags)Z.tags=V(K.tags);return Z}F({site:"wordpress",name:"publish",access:"write",description:"发布一篇文章到自建 WordPress 站点。默认走登录态 cookie(零配置:只需在「连接」里填站点网址并在浏览器里登录),通过同源页面 fetch + REST nonce 调 POST /wp/v2/posts。Markdown 正文自动转 HTML。为安全默认存草稿,--status publish 才真发。分类/标签是 WordPress 的 term ID(数字),不是名字。",domain:"wordpress.org",strategy:H.COOKIE,browser:!0,navigateBefore:!1,siteSession:"persistent",args:[{name:"site",help:"连接名称或站点网址;省略时使用默认站点"},{name:"title",required:!0,help:"文章标题"},{name:"content",help:"正文(Markdown 或 HTML),或用 --file"},{name:"file",help:"从本地文件读正文,替代 --content"},{name:"markup",default:"auto",choices:["auto","markdown","html"],help:"正文格式:auto 自动识别(默认) / markdown / html"},{name:"status",default:"draft",choices:U,help:"文章状态(默认 draft)"},{name:"excerpt",help:"摘要(可选)"},{name:"slug",help:"URL 别名 slug(可选)"},{name:"categories",help:"分类 term ID,逗号分隔(数字,非名字)"},{name:"tags",help:"标签 term ID,逗号分隔(数字,非名字)"},{name:"base-url",help:"兼容旧版:覆盖站点根网址(推荐改用 --site)"}],columns:["id","status","title","url"],func:async(K,Q)=>{const Z=k(Q);let $=typeof Q.content==="string"?Q.content:"";if(Q.file)try{$=L(String(Q.file),"utf8")}catch(Y){throw new G("CONFIG",`Cannot read --file ${Q.file}: ${Y?.message??Y}`,"Pass a readable UTF-8 text file.")}else f($,{fileFlag:"--file",label:"正文"});if(!$.trim())throw new G("CONFIG","Post body is empty",'Pass --content "..." or --file <path>.');const x=N($,{format:Q.markup}).html,v=w(Q,x),J=q();if(J){const Y=await W(Z,"/wp/v2/posts",{method:"POST",body:v,authorization:R(J),label:"WordPress publish"});return[{id:Y?.id??"",status:Y?.status??"",title:Y?.title?.rendered??v.title,url:Y?.link??""}]}if(!K)throw new O("WordPress publish 需要浏览器会话(默认走登录态;或配置 WORDPRESS_APP_PASSWORD 走 Basic auth)。");if((await I(K,Z,j)).onLogin)throw new M("wordpress",`未登录 ${Z}(打开 wp-admin 被重定向到登录页)。请先在浏览器里登录该站点(可用 wordpress login)。`);const X=await K.evaluate(T(v));if(!X||X.ok===!1){const Y=X?.stage||"publish",z=X?.httpStatus!=null?` (HTTP ${X.httpStatus})`:"",D=X?.bodyText?`;接口原始响应:${String(X.bodyText).slice(0,500)}`:"",B=X?.message||"发布失败";if(Y==="auth")throw new M("wordpress",`WordPress publish 未授权${z}:${B}`);if(Y==="not_found")throw new G("NOT_FOUND",`WordPress publish:REST 接口不可达${z}:${B}`,"部分主机/安全插件会禁用 /wp-json(REST API)。请确认站点开启了 REST API。");throw new O(`[${Y}] WordPress publish 失败${z}:${B}${D}`)}return[{id:X.id!=null?String(X.id):"",status:X.status??"",title:X.title??v.title,url:X.link??""}]}});
1
+ import{cli as w,Strategy as S}from"@jackwener/opencli/registry";import{CliError as u,AuthRequiredError as d,CommandExecutionError as m}from"@jackwener/opencli/errors";import{readFileSync as b}from"node:fs";import{normalizeContent as P}from"../_shared/article/format.js";import{assertLiteralContent as g}from"../_shared/content-guard.js";import{resolveBaseUrl as T,getAppPasswordCreds as y,basicAuthHeader as W,wpRequest as A,gotoWpAdmin as E,buildPublishJs as I,WP_ADMIN_POST_NEW as O}from"./shared.js";const k=["draft","publish","pending","private"];function c(t){return String(t).split(",").map((e)=>Number(e.trim())).filter((e)=>Number.isFinite(e))}function R(t,e){const i={title:String(t.title),content:e,status:String(t.status)};if(t.excerpt)i.excerpt=String(t.excerpt);if(t.slug)i.slug=String(t.slug);if(t.categories)i.categories=c(t.categories);if(t.tags)i.tags=c(t.tags);return i}w({site:"wordpress",name:"publish",access:"write",description:"发布一篇文章到自建 WordPress 站点。默认走登录态 cookie(零配置:只需在「连接」里填站点网址并在浏览器里登录),通过同源页面 fetch + REST nonce 调 POST /wp/v2/posts。Markdown 正文自动转 HTML。为安全默认存草稿,--status publish 才真发。分类/标签是 WordPress 的 term ID(数字),不是名字。",domain:"wordpress.org",strategy:S.COOKIE,browser:!0,navigateBefore:!1,siteSession:"persistent",args:[{name:"site",help:"连接名称或站点网址;省略时使用默认站点"},{name:"title",required:!0,help:"文章标题"},{name:"content",help:"正文(Markdown 或 HTML),或用 --file"},{name:"file",help:"从本地文件读正文,替代 --content"},{name:"markup",default:"auto",choices:["auto","markdown","html"],help:"正文格式:auto 自动识别(默认) / markdown / html"},{name:"status",default:"draft",choices:k,help:"文章状态(默认 draft)"},{name:"excerpt",help:"摘要(可选)"},{name:"slug",help:"URL 别名 slug(可选)"},{name:"categories",help:"分类 term ID,逗号分隔(数字,非名字)"},{name:"tags",help:"标签 term ID,逗号分隔(数字,非名字)"},{name:"base-url",help:"兼容旧版:覆盖站点根网址(推荐改用 --site)"}],columns:["id","status","title","url"],func:async(t,e)=>{const i=T(e);let o=typeof e.content==="string"?e.content:"";if(e.file)try{o=b(String(e.file),"utf8")}catch(r){throw new u("CONFIG",`Cannot read --file ${e.file}: ${r?.message??r}`,"Pass a readable UTF-8 text file.")}else g(o,{fileFlag:"--file",label:"正文"});if(!o.trim())throw new u("CONFIG","Post body is empty",'Pass --content "..." or --file <path>.');const h=P(o,{format:e.markup}).html,n=R(e,h),p=y();if(p){const r=await A(i,"/wp/v2/posts",{method:"POST",body:n,authorization:W(p),label:"WordPress publish"});return[{id:r?.id??"",status:r?.status??"",title:r?.title?.rendered??n.title,url:r?.link??""}]}if(!t)throw new m("WordPress publish 需要浏览器会话(默认走登录态;或配置 WORDPRESS_APP_PASSWORD 走 Basic auth)。");if((await E(t,i,O)).onLogin)throw new d("wordpress",`未登录 ${i}(打开 wp-admin 被重定向到登录页)。请先在浏览器里登录该站点(可用 wordpress login)。`);const s=await t.evaluate(I(n));if(!s||s.ok===!1){const r=s?.stage||"publish",l=s?.httpStatus!=null?` (HTTP ${s.httpStatus})`:"",f=s?.bodyText?`;接口原始响应:${String(s.bodyText).slice(0,500)}`:"",a=s?.message||"发布失败";if(r==="auth")throw new d("wordpress",`WordPress publish 未授权${l}:${a}`);if(r==="not_found")throw new u("NOT_FOUND",`WordPress publish:REST 接口不可达${l}:${a}`,"部分主机/安全插件会禁用 /wp-json(REST API)。请确认站点开启了 REST API。");throw new m(`[${r}] WordPress publish 失败${l}:${a}${f}`)}return[{id:s.id!=null?String(s.id):"",status:s.status??"",title:s.title??n.title,url:s.link??""}]}});
@@ -1,9 +1,9 @@
1
- import{CliError as K}from"@jackwener/opencli/errors";import{loadSiteConnections as R,normalizeSiteUrl as T,resolveSiteConnection as j}from"../_shared/self-hosted-sites.js";export const WP_LOGIN_COOKIE_PREFIX="wordpress_logged_in_",WP_ADMIN_POST_NEW="/wp-admin/post-new.php",WP_ADMIN="/wp-admin/",WP_LOGIN="/wp-login.php";export function normalizeBaseUrl(q,D){return T(q,{label:D})}export function getWordpressBaseUrl(q=process.env){return normalizeBaseUrl(q.WORDPRESS_BASE_URL,"WORDPRESS_BASE_URL")}export function resolveBaseUrl(q={},D=process.env){return j("wordpress",q,{selector:"site",legacySelectors:["base-url","baseUrl","base_url"],envUrl:D.WORDPRESS_BASE_URL}).url}export function configuredWordpressSites(q=process.env){const D=R("wordpress").sites;if(D.length>0)return D;if(!q.WORDPRESS_BASE_URL)return[];return[{name:"",url:normalizeBaseUrl(q.WORDPRESS_BASE_URL,"WORDPRESS_BASE_URL")}]}export function getAppPasswordCreds(q=process.env){const D=q.WORDPRESS_USER?.trim(),M=q.WORDPRESS_APP_PASSWORD?.replace(/\s+/g,"");if(!D||!M)return null;return{user:D,appPassword:M}}export function basicAuthHeader(q){return`Basic ${Buffer.from(`${q.user}:${q.appPassword}`,"utf8").toString("base64")}`}export async function wpRequest(q,D,M={}){const V=D.startsWith("/")?D:`/${D}`,Y=`${q}/wp-json${V}`,Z=M.label||`WordPress ${M.method||"GET"} ${V}`;let Q;try{Q=await fetch(Y,{method:M.method||"GET",headers:{...M.authorization?{Authorization:M.authorization}:{},Accept:"application/json",...M.body!==void 0?{"Content-Type":"application/json"}:{},...M.headers||{}},body:M.body!==void 0?JSON.stringify(M.body):void 0})}catch(H){throw new K("FETCH_ERROR",`${Z} failed: ${H?.message??H}`,"Check the site URL is reachable and the REST API (/wp-json) is enabled.")}const $=await Q.text();let F=null;try{F=$?JSON.parse($):null}catch{F=null}if(Q.status===401||Q.status===403)throw new K("AUTH_REQUIRED",`${Z} returned HTTP ${Q.status} (unauthorized)`,"Check WORDPRESS_USER / WORDPRESS_APP_PASSWORD — the Application Password must belong to that user and not be revoked.");if(Q.status===404)throw new K("NOT_FOUND",`${Z} returned HTTP 404`,"Check the site URL and that the WordPress REST API is enabled (some hosts/security plugins disable /wp-json).");if(!Q.ok){const H=F?.message?`: ${F.message}`:Q.statusText?`: ${Q.statusText}`:"";throw new K("HTTP_ERROR",`${Z} returned HTTP ${Q.status}${H}`)}return F}export async function readCookieLogin(q,D){if(typeof q?.getCookies!=="function")return!1;const M=await q.getCookies({url:D});return Array.isArray(M)&&M.some((V)=>V&&V.value&&typeof V.name==="string"&&V.name.startsWith(WP_LOGIN_COOKIE_PREFIX))}export async function gotoWpAdmin(q,D,M){const V=D+M;let Y={};for(let Z=0;Z<6;Z++){await q.goto(V);await q.wait({time:1});Y=await q.evaluate(`(() => {
1
+ import{CliError as l}from"@jackwener/opencli/errors";import{loadSiteConnections as d,normalizeSiteUrl as p,resolveSiteConnection as h}from"../_shared/self-hosted-sites.js";export const WP_LOGIN_COOKIE_PREFIX="wordpress_logged_in_",WP_ADMIN_POST_NEW="/wp-admin/post-new.php",WP_ADMIN="/wp-admin/",WP_LOGIN="/wp-login.php";export function normalizeBaseUrl(e,t){return p(e,{label:t})}export function getWordpressBaseUrl(e=process.env){return normalizeBaseUrl(e.WORDPRESS_BASE_URL,"WORDPRESS_BASE_URL")}export function resolveBaseUrl(e={},t=process.env){return h("wordpress",e,{selector:"site",legacySelectors:["base-url","baseUrl","base_url"],envUrl:t.WORDPRESS_BASE_URL}).url}export function configuredWordpressSites(e=process.env){const t=d("wordpress").sites;if(t.length>0)return t;if(!e.WORDPRESS_BASE_URL)return[];return[{name:"",url:normalizeBaseUrl(e.WORDPRESS_BASE_URL,"WORDPRESS_BASE_URL")}]}export function getAppPasswordCreds(e=process.env){const t=e.WORDPRESS_USER?.trim(),n=e.WORDPRESS_APP_PASSWORD?.replace(/\s+/g,"");if(!t||!n)return null;return{user:t,appPassword:n}}export function basicAuthHeader(e){return`Basic ${Buffer.from(`${e.user}:${e.appPassword}`,"utf8").toString("base64")}`}export async function wpRequest(e,t,n={}){const r=t.startsWith("/")?t:`/${t}`,s=`${e}/wp-json${r}`,a=n.label||`WordPress ${n.method||"GET"} ${r}`;let o;try{o=await fetch(s,{method:n.method||"GET",headers:{...n.authorization?{Authorization:n.authorization}:{},Accept:"application/json",...n.body!==void 0?{"Content-Type":"application/json"}:{},...n.headers||{}},body:n.body!==void 0?JSON.stringify(n.body):void 0})}catch(u){throw new l("FETCH_ERROR",`${a} failed: ${u?.message??u}`,"Check the site URL is reachable and the REST API (/wp-json) is enabled.")}const i=await o.text();let c=null;try{c=i?JSON.parse(i):null}catch{c=null}if(o.status===401||o.status===403)throw new l("AUTH_REQUIRED",`${a} returned HTTP ${o.status} (unauthorized)`,"Check WORDPRESS_USER / WORDPRESS_APP_PASSWORD — the Application Password must belong to that user and not be revoked.");if(o.status===404)throw new l("NOT_FOUND",`${a} returned HTTP 404`,"Check the site URL and that the WordPress REST API is enabled (some hosts/security plugins disable /wp-json).");if(!o.ok){const u=c?.message?`: ${c.message}`:o.statusText?`: ${o.statusText}`:"";throw new l("HTTP_ERROR",`${a} returned HTTP ${o.status}${u}`)}return c}export async function readCookieLogin(e,t){if(typeof e?.getCookies!=="function")return!1;const n=await e.getCookies({url:t});return Array.isArray(n)&&n.some((r)=>r&&r.value&&typeof r.name==="string"&&r.name.startsWith(WP_LOGIN_COOKIE_PREFIX))}export async function gotoWpAdmin(e,t,n){const r=t+n;let s={};for(let a=0;a<6;a++){await e.goto(r);await e.wait({time:1});s=await e.evaluate(`(() => {
2
2
  var href = ''; try { href = location.href; } catch (e) {}
3
3
  var cookieOk = true; try { void document.cookie; } catch (e) { cookieOk = false; }
4
4
  var hasNonce = !!(window.wpApiSettings && window.wpApiSettings.nonce);
5
5
  return { href: href, cookieOk: cookieOk, hasNonce: hasNonce };
6
- })()`)||{};const $=Y.href||"";if(/wp-login\.php/i.test($))return{onLogin:!0,href:$};if(Y.cookieOk&&(Y.hasNonce||/\/wp-admin\//i.test($)))return{onLogin:!1,href:$};await q.wait({time:1})}return{onLogin:!1,href:Y.href||"",uncertain:!0}}export function buildPublishJs(q){return`(async () => {
6
+ })()`)||{};const i=s.href||"";if(/wp-login\.php/i.test(i))return{onLogin:!0,href:i};if(s.cookieOk&&(s.hasNonce||/\/wp-admin\//i.test(i)))return{onLogin:!1,href:i};await e.wait({time:1})}return{onLogin:!1,href:s.href||"",uncertain:!0}}export function buildPublishJs(e){return`(async () => {
7
7
  var s = (window.wpApiSettings || {});
8
8
  var nonce = s.nonce || "";
9
9
  var root = s.root || (location.origin + "/wp-json/");
@@ -19,7 +19,7 @@ import{CliError as K}from"@jackwener/opencli/errors";import{loadSiteConnections
19
19
  `+` if (!nonce) return { ok: false, stage: "nonce", message: "无法从 wp-admin 页面取到 REST nonce(window.wpApiSettings.nonce 缺失)。可能未登录、REST API 被禁用,或该页面未加载区块编辑器。" };
20
20
  `+` if (!/\\/$/.test(root)) root += "/";
21
21
  var url = root + "wp/v2/posts";
22
- var payload = `+JSON.stringify(q)+`;
22
+ var payload = `+JSON.stringify(e)+`;
23
23
  try {
24
24
  var r = await fetch(url, { method: "POST", headers: { "X-WP-Nonce": nonce, "Content-Type": "application/json" }, credentials: "include", body: JSON.stringify(payload) });
25
25
  var text = await r.text();
@@ -1 +1 @@
1
- import{cli as Z,Strategy as $}from"@jackwener/opencli/registry";import{resolveBaseUrl as f,configuredWordpressSites as v,getAppPasswordCreds as X,basicAuthHeader as x,wpRequest as B,readCookieLogin as Y,gotoWpAdmin as D,buildWhoamiJs as E,WP_ADMIN_POST_NEW as H}from"./shared.js";async function I(F){if(X())return{logged_in:!0};for(const Q of v())if(await Y(F,Q.url))return{logged_in:!0};return{logged_in:!1}}Z({site:"wordpress",name:"whoami",access:"read",description:"检测自建 WordPress 站点的登录状态(返回布尔)。默认走登录态 cookie / 页面上下文 GET /wp/v2/users/me?context=edit;配置了 WORDPRESS_APP_PASSWORD 时走 Basic auth。",domain:"wordpress.org",strategy:$.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"site",help:"连接名称或站点网址;省略时使用默认站点"},{name:"base-url",help:"兼容旧版:站点根网址(推荐改用 --site)"}],columns:["logged_in","user_id","username","site"],authStatus:{quickCheck:I},func:async(F,Q)=>{const z=f(Q),V=X();if(V)try{const G=await B(z,"/wp/v2/users/me?context=edit",{authorization:x(V),label:"WordPress whoami"});return[{logged_in:!!(G&&G.id!=null),user_id:G?.id!=null?String(G.id):"",username:G?.name??G?.slug??"",site:z}]}catch{return[{logged_in:!1,user_id:"",username:"",site:z}]}if(!F)return[{logged_in:!1,user_id:"",username:"",site:z}];if((await D(F,z,H)).onLogin)return[{logged_in:!1,user_id:"",username:"",site:z}];const K=await F.evaluate(E());if(K&&K.loggedIn)return[{logged_in:!0,user_id:K.id||"",username:K.name||K.slug||"",site:z}];return[{logged_in:await Y(F,z),user_id:"",username:"",site:z}]}});
1
+ import{cli as u,Strategy as d}from"@jackwener/opencli/registry";import{resolveBaseUrl as l,configuredWordpressSites as g,getAppPasswordCreds as o,basicAuthHeader as c,wpRequest as m,readCookieLogin as a,gotoWpAdmin as _,buildWhoamiJs as f,WP_ADMIN_POST_NEW as w}from"./shared.js";async function h(r){if(o())return{logged_in:!0};for(const t of g())if(await a(r,t.url))return{logged_in:!0};return{logged_in:!1}}u({site:"wordpress",name:"whoami",access:"read",description:"检测自建 WordPress 站点的登录状态(返回布尔)。默认走登录态 cookie / 页面上下文 GET /wp/v2/users/me?context=edit;配置了 WORDPRESS_APP_PASSWORD 时走 Basic auth。",domain:"wordpress.org",strategy:d.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"site",help:"连接名称或站点网址;省略时使用默认站点"},{name:"base-url",help:"兼容旧版:站点根网址(推荐改用 --site)"}],columns:["logged_in","user_id","username","site"],authStatus:{quickCheck:h},func:async(r,t)=>{const e=l(t),n=o();if(n)try{const s=await m(e,"/wp/v2/users/me?context=edit",{authorization:c(n),label:"WordPress whoami"});return[{logged_in:!!(s&&s.id!=null),user_id:s?.id!=null?String(s.id):"",username:s?.name??s?.slug??"",site:e}]}catch{return[{logged_in:!1,user_id:"",username:"",site:e}]}if(!r)return[{logged_in:!1,user_id:"",username:"",site:e}];if((await _(r,e,w)).onLogin)return[{logged_in:!1,user_id:"",username:"",site:e}];const i=await r.evaluate(f());if(i&&i.loggedIn)return[{logged_in:!0,user_id:i.id||"",username:i.name||i.slug||"",site:e}];return[{logged_in:await a(r,e),user_id:"",username:"",site:e}]}});
@@ -1 +1 @@
1
- import{CliError as F,CommandExecutionError as U}from"@jackwener/opencli/errors";import{cli as v,Strategy as H}from"@jackwener/opencli/registry";import{publishArticle as O}from"../_shared/article/publish.js";import{checkLogin as x}from"../_shared/article/auth.js";import{readFile as S,stat as _}from"node:fs/promises";function A(K){if(!K.execute)throw new F("INVALID_INPUT","此写操作需要 --execute 参数确认,未传则拒绝写入。注意:本报错仅表示缺少 --execute,并未校验其余参数,不能当 dry-run 预览用")}async function N(K){const W=typeof K.text==="string"?K.text:void 0,G=typeof K.file==="string"?K.file:void 0;if(W&&G)throw new F("INVALID_INPUT","正文来源只能二选一:<text> 或 --file,不能同时指定");let V=W??"";if(G){let Y;try{Y=await _(G)}catch{throw new F("INVALID_INPUT",`文件不存在:${G}`)}if(!Y.isFile())throw new F("INVALID_INPUT",`必须是普通文本文件:${G}`);let Q;try{Q=await S(G)}catch{throw new F("INVALID_INPUT",`文件无法读取:${G}`)}try{V=new TextDecoder("utf-8",{fatal:!0}).decode(Q)}catch{throw new F("INVALID_INPUT",`文件无法解码为 UTF-8:${G}`)}}if(!V.trim())throw new F("INVALID_INPUT","正文不能为空或仅有空白字符");return V}function y(K,W,G,V,Y={}){return[{status:"success",outcome:V,message:K,target_type:W,target:G,...Y}]}export const woshipmProfile={home:"https://www.woshipm.com/writing",outputFormat:"html",preprocessConfig:{removeEmptyLines:!0},image:{skip:["woshipm.com","image.woshipm.com"],uploadFn:async(K,W)=>{const V=(document.documentElement.innerHTML||"").match(/"jltoken"\s*:\s*"([^"]+)"/),Y=V?V[1]:"";let Q="image.png";try{const X=new URL(K).pathname.split("/"),J=X[X.length-1];if(J)Q=J}catch(B){}const Z=await fetch(K,{credentials:"omit"});if(!Z.ok)throw Error("下载图片失败:"+Z.status+" "+K);const $=await Z.blob(),z=new FormData;z.append("action","wpuf_insert_image");z.append("name",Q);z.append("files",$,Q);const L={};if(Y)L.jlstar="Bearer "+Y;const q=await(await fetch("https://www.woshipm.com/tensorflow/upyun/upload",{method:"POST",credentials:"include",headers:L,body:z})).json();if(q&&q.data&&q.data.length>0&&q.data[0].url)return{url:q.data[0].url};throw Error(q.error||"图片上传失败:接口返回无 URL")}},checkAuth:async(K)=>{const G=await(await fetch("https://www.woshipm.com/writing",{method:"GET",credentials:"include"})).text(),V=G.match(/"jltoken"\s*:\s*"([^"]+)"/),Y=V?V[1]:"",Q=G.match(/var\s+userSettings\s*=\s*\{[^}]*"uid"\s*:\s*"(\d+)"/);if(!Q)return{isAuthenticated:!1};const Z=Q[1],$=await fetch("https://www.woshipm.com/api2/user/profile?uid="+Z,{method:"GET",credentials:"include",headers:{"X-Requested-With":"XMLHttpRequest"}});let z=null;try{z=await $.json()}catch(L){}if(z&&z.CODE===200&&z.RESULT&&z.RESULT.userInfoVo&&z.RESULT.userInfoVo.uid){const L=z.RESULT.userInfoVo;return{isAuthenticated:!0,userId:String(L.uid),username:L.nickName||"",avatar:L.avartar||""}}return{isAuthenticated:!1,error:"接口返回未登录(CODE: "+(z&&z.CODE)+")"}},publish:async(K,W)=>{const G=K.content,V="https://www.woshipm.com/wp-admin/admin-ajax.php",Y={"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"};if(K.draftOnly){const P=await fetch(V,{method:"POST",credentials:"include",headers:Y,body:new URLSearchParams({action:"add_draft",post_title:K.title,post_content:G})}),q=await P.text();let B=null;try{B=JSON.parse(q)}catch(T){}if(!P.ok||!B||!B.post_id)return{ok:!1,stage:"create",status:P.status,message:B&&B.error||q.slice(0,300)};const X=String(B.post_id),J=B.url||"https://www.woshipm.com/writing?pid="+X;return{ok:!0,draft:!0,id:X,url:J}}const Q=new URLSearchParams({action:"add_pending",post_title:K.title,post_content:G,copyright:"1",copyright_pm:"1",copyright_other:"1"}),Z=await fetch(V,{method:"POST",credentials:"include",headers:Y,body:Q}),$=await Z.text();let z=null;try{z=JSON.parse($)}catch(P){}if(!Z.ok||!z||String(z.success)!=="1")return{ok:!1,stage:"publish",status:Z.status,message:z&&z.message||$.slice(0,300)};return{ok:!0,draft:!1,pending:!0,id:z&&(z.post_id||z.id)?String(z.post_id||z.id):"",url:"https://www.woshipm.com/me/posts/"}}};v({site:"woshipm",name:"article",access:"write",description:"发布文章到人人都是产品经理(woshipm.com)。默认提交审核(正式发布),加 --draft 仅存草稿。正文默认 Markdown,图片自动转存到站内图床。注意:平台为审核制,提交后稿件进入待审核(pending),运营 24h 内人工审核通过才公开。",domain:"www.woshipm.com",strategy:H.COOKIE,browser:!0,args:[{name:"title",positional:!0,required:!0,help:"文章标题(非空,长度<=200)"},{name:"text",positional:!0,help:"文章正文(默认 Markdown;传 --html 则视为 HTML)"},{name:"file",help:"正文文件路径(UTF-8,默认 Markdown)"},{name:"html",type:"boolean",help:"把正文当 HTML 而非 Markdown 处理"},{name:"draft",type:"boolean",help:"仅保存草稿,不提交审核"},{name:"execute",type:"boolean",help:"确认执行写操作。未传则拒绝写入。提交审核不可轻易撤回,请确认后再加此参数。"}],columns:["status","outcome","message","target_type","target","created_target","created_url"],func:async(K,W)=>{if(!K)throw new U("woshipm article 需要浏览器会话");A(W);const G=String(W.title??"").trim();if(!G)throw new F("INVALID_INPUT","文章标题不能为空");if(G.length>200)throw new F("INVALID_INPUT","文章标题过长(最多 200 字),当前 "+G.length+" 字");const V=await N(W),Y=Boolean(W.draft),Q=await O(K,{title:G,body:V,format:W.html?"html":"markdown",draftOnly:Y,profile:woshipmProfile}),Z=Q.images.uploaded.length|0,$=Q.images.failed.length|0;let z=Q.draft?"已保存到草稿箱":"已提交审核(稿件进入待审核 pending,运营 24h 内人工审核通过后才公开)";if(Z||$)z+=`(图片:${Z} 张已转存${$?`,${$} 张失败`:""})`;return y(z,"article","",Q.draft?"draft":"pending",{created_target:(Q.draft?"draft:":"article:")+(Q.id||""),created_url:Q.url})}});
1
+ import{CliError as d,CommandExecutionError as f}from"@jackwener/opencli/errors";import{cli as g,Strategy as y}from"@jackwener/opencli/registry";import{publishArticle as _}from"../_shared/article/publish.js";import{checkLogin as E}from"../_shared/article/auth.js";import{readFile as I,stat as T}from"node:fs/promises";function L(a){if(!a.execute)throw new d("INVALID_INPUT","此写操作需要 --execute 参数确认,未传则拒绝写入。注意:本报错仅表示缺少 --execute,并未校验其余参数,不能当 dry-run 预览用")}async function N(a){const n=typeof a.text==="string"?a.text:void 0,e=typeof a.file==="string"?a.file:void 0;if(n&&e)throw new d("INVALID_INPUT","正文来源只能二选一:<text> 或 --file,不能同时指定");let r=n??"";if(e){let i;try{i=await T(e)}catch{throw new d("INVALID_INPUT",`文件不存在:${e}`)}if(!i.isFile())throw new d("INVALID_INPUT",`必须是普通文本文件:${e}`);let o;try{o=await I(e)}catch{throw new d("INVALID_INPUT",`文件无法读取:${e}`)}try{r=new TextDecoder("utf-8",{fatal:!0}).decode(o)}catch{throw new d("INVALID_INPUT",`文件无法解码为 UTF-8:${e}`)}}if(!r.trim())throw new d("INVALID_INPUT","正文不能为空或仅有空白字符");return r}function R(a,n,e,r,i={}){return[{status:"success",outcome:r,message:a,target_type:n,target:e,...i}]}export const woshipmProfile={home:"https://www.woshipm.com/writing",outputFormat:"html",preprocessConfig:{removeEmptyLines:!0},image:{skip:["woshipm.com","image.woshipm.com"],uploadFn:async(a,n)=>{const r=(document.documentElement.innerHTML||"").match(/"jltoken"\s*:\s*"([^"]+)"/),i=r?r[1]:"";let o="image.png";try{const m=new URL(a).pathname.split("/"),w=m[m.length-1];if(w)o=w}catch(p){}const s=await fetch(a,{credentials:"omit"});if(!s.ok)throw Error("下载图片失败:"+s.status+" "+a);const c=await s.blob(),t=new FormData;t.append("action","wpuf_insert_image");t.append("name",o);t.append("files",c,o);const u={};if(i)u.jlstar="Bearer "+i;const l=await(await fetch("https://www.woshipm.com/tensorflow/upyun/upload",{method:"POST",credentials:"include",headers:u,body:t})).json();if(l&&l.data&&l.data.length>0&&l.data[0].url)return{url:l.data[0].url};throw Error(l.error||"图片上传失败:接口返回无 URL")}},checkAuth:async(a)=>{const e=await(await fetch("https://www.woshipm.com/writing",{method:"GET",credentials:"include"})).text(),r=e.match(/"jltoken"\s*:\s*"([^"]+)"/),i=r?r[1]:"",o=e.match(/var\s+userSettings\s*=\s*\{[^}]*"uid"\s*:\s*"(\d+)"/);if(!o)return{isAuthenticated:!1};const s=o[1],c=await fetch("https://www.woshipm.com/api2/user/profile?uid="+s,{method:"GET",credentials:"include",headers:{"X-Requested-With":"XMLHttpRequest"}});let t=null;try{t=await c.json()}catch(u){}if(t&&t.CODE===200&&t.RESULT&&t.RESULT.userInfoVo&&t.RESULT.userInfoVo.uid){const u=t.RESULT.userInfoVo;return{isAuthenticated:!0,userId:String(u.uid),username:u.nickName||"",avatar:u.avartar||""}}return{isAuthenticated:!1,error:"接口返回未登录(CODE: "+(t&&t.CODE)+")"}},publish:async(a,n)=>{const e=a.content,r="https://www.woshipm.com/wp-admin/admin-ajax.php",i={"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"};if(a.draftOnly){const h=await fetch(r,{method:"POST",credentials:"include",headers:i,body:new URLSearchParams({action:"add_draft",post_title:a.title,post_content:e})}),l=await h.text();let p=null;try{p=JSON.parse(l)}catch(P){}if(!h.ok||!p||!p.post_id)return{ok:!1,stage:"create",status:h.status,message:p&&p.error||l.slice(0,300)};const m=String(p.post_id),w=p.url||"https://www.woshipm.com/writing?pid="+m;return{ok:!0,draft:!0,id:m,url:w}}const o=new URLSearchParams({action:"add_pending",post_title:a.title,post_content:e,copyright:"1",copyright_pm:"1",copyright_other:"1"}),s=await fetch(r,{method:"POST",credentials:"include",headers:i,body:o}),c=await s.text();let t=null;try{t=JSON.parse(c)}catch(h){}if(!s.ok||!t||String(t.success)!=="1")return{ok:!1,stage:"publish",status:s.status,message:t&&t.message||c.slice(0,300)};return{ok:!0,draft:!1,pending:!0,id:t&&(t.post_id||t.id)?String(t.post_id||t.id):"",url:"https://www.woshipm.com/me/posts/"}}};g({site:"woshipm",name:"article",access:"write",description:"发布文章到人人都是产品经理(woshipm.com)。默认提交审核(正式发布),加 --draft 仅存草稿。正文默认 Markdown,图片自动转存到站内图床。注意:平台为审核制,提交后稿件进入待审核(pending),运营 24h 内人工审核通过才公开。",domain:"www.woshipm.com",strategy:y.COOKIE,browser:!0,args:[{name:"title",positional:!0,required:!0,help:"文章标题(非空,长度<=200)"},{name:"text",positional:!0,help:"文章正文(默认 Markdown;传 --html 则视为 HTML)"},{name:"file",help:"正文文件路径(UTF-8,默认 Markdown)"},{name:"html",type:"boolean",help:"把正文当 HTML 而非 Markdown 处理"},{name:"draft",type:"boolean",help:"仅保存草稿,不提交审核"},{name:"execute",type:"boolean",help:"确认执行写操作。未传则拒绝写入。提交审核不可轻易撤回,请确认后再加此参数。"}],columns:["status","outcome","message","target_type","target","created_target","created_url"],func:async(a,n)=>{if(!a)throw new f("woshipm article 需要浏览器会话");L(n);const e=String(n.title??"").trim();if(!e)throw new d("INVALID_INPUT","文章标题不能为空");if(e.length>200)throw new d("INVALID_INPUT","文章标题过长(最多 200 字),当前 "+e.length+" 字");const r=await N(n),i=Boolean(n.draft),o=await _(a,{title:e,body:r,format:n.html?"html":"markdown",draftOnly:i,profile:woshipmProfile}),s=o.images.uploaded.length|0,c=o.images.failed.length|0;let t=o.draft?"已保存到草稿箱":"已提交审核(稿件进入待审核 pending,运营 24h 内人工审核通过后才公开)";if(s||c)t+=`(图片:${s} 张已转存${c?`,${c} 张失败`:""})`;return R(t,"article","",o.draft?"draft":"pending",{created_target:(o.draft?"draft:":"article:")+(o.id||""),created_url:o.url})}});
@@ -1 +1 @@
1
- import{registerArticleLogin as k}from"../_shared/article/login.js";import{woshipmProfile as b}from"./article.js";k({site:"woshipm",domain:"woshipm.com",profile:{home:b.home,checkAuth:b.checkAuth},loginDescription:"打开人人都是产品经理登录页并等待浏览器完成登录(供桌面客户端引导登录)。"});
1
+ import{registerArticleLogin as i}from"../_shared/article/login.js";import{woshipmProfile as o}from"./article.js";i({site:"woshipm",domain:"woshipm.com",profile:{home:o.home,checkAuth:o.checkAuth},loginDescription:"打开人人都是产品经理登录页并等待浏览器完成登录(供桌面客户端引导登录)。"});
@@ -1,6 +1,6 @@
1
- import{cli as Q,Strategy as V}from"@jackwener/opencli/registry";import{CommandExecutionError as I,EmptyResultError as $}from"@jackwener/opencli/errors";const H="https://www.woshipm.com/me/posts/",M=30,R={publish:"已发布",draft:"草稿",pending:"审核中",future:"定时发布"},U=new Set(["id","title","permalink","date","post_status","views","view","bookmark","postlike"]);Q({site:"woshipm",name:"stats",access:"read",description:"人人都是产品经理文章数据(每篇阅读/收藏/喜欢等全量运营指标,含草稿/审核中/定时发布)",domain:"www.woshipm.com",strategy:V.COOKIE,browser:!0,args:[{name:"limit",type:"number",default:20,help:"返回条数"}],columns:["id","type","title","url","published_at","status","views","likes","comments","collects","shares","extra"],func:async(h,B)=>{if(!h)throw new I("woshipm stats 需要浏览器会话");const J=Number(B.limit)>0?Math.floor(Number(B.limit)):20;await h.goto(H);await h.wait(2);const f=await h.evaluate(`(async () => {
2
- const LIMIT = ${J};
3
- const MAX_PAGES = ${M};
1
+ import{cli as m,Strategy as u}from"@jackwener/opencli/registry";import{CommandExecutionError as c,EmptyResultError as w}from"@jackwener/opencli/errors";const d="https://www.woshipm.com/me/posts/",h=30,f={publish:"已发布",draft:"草稿",pending:"审核中",future:"定时发布"},y=new Set(["id","title","permalink","date","post_status","views","view","bookmark","postlike"]);m({site:"woshipm",name:"stats",access:"read",description:"人人都是产品经理文章数据(每篇阅读/收藏/喜欢等全量运营指标,含草稿/审核中/定时发布)",domain:"www.woshipm.com",strategy:u.COOKIE,browser:!0,args:[{name:"limit",type:"number",default:20,help:"返回条数"}],columns:["id","type","title","url","published_at","status","views","likes","comments","collects","shares","extra"],func:async(s,a)=>{if(!s)throw new c("woshipm stats 需要浏览器会话");const l=Number(a.limit)>0?Math.floor(Number(a.limit)):20;await s.goto(d);await s.wait(2);const e=await s.evaluate(`(async () => {
2
+ const LIMIT = ${l};
3
+ const MAX_PAGES = ${h};
4
4
 
5
5
  // ── nonce:页面内嵌 var PURE = {...,"nonce":"xxx",...}(misc-js-extra 脚本)──
6
6
  const html = document.documentElement.innerHTML || '';
@@ -49,4 +49,4 @@ import{cli as Q,Strategy as V}from"@jackwener/opencli/registry";import{CommandEx
49
49
  if (!rows.length || !added || (total > 0 && posts.length >= total)) break;
50
50
  }
51
51
  return { posts: posts.slice(0, LIMIT), total };
52
- })()`);if(!f||f.err)throw new I(f&&f.err||"人人都是产品经理文章数据获取失败:页面未返回任何数据(请确认已登录 www.woshipm.com)");const D=Array.isArray(f.posts)?f.posts:[];if(!D.length)throw new $("woshipm stats","该账号名下没有任何文章(含草稿)。请先在 woshipm.com 发布内容后再查数据。");return D.map((b)=>{const q={};for(const[F,z]of Object.entries(b)){if(U.has(F))continue;if(z===""||z==null)continue;q[F]=z}const L=R[b.post_status]||b.post_status||"";return{id:b.id!=null?String(b.id):"",type:"article",title:b.title||"",url:b.permalink||"",published_at:b.date||"",status:L,views:typeof b.views==="number"?b.views:typeof b.view==="number"?b.view:"",likes:typeof b.postlike==="number"?b.postlike:"",comments:"",collects:typeof b.bookmark==="number"?b.bookmark:"",shares:"",extra:Object.keys(q).length?JSON.stringify(q):""}})}});
52
+ })()`);if(!e||e.err)throw new c(e&&e.err||"人人都是产品经理文章数据获取失败:页面未返回任何数据(请确认已登录 www.woshipm.com)");const r=Array.isArray(e.posts)?e.posts:[];if(!r.length)throw new w("woshipm stats","该账号名下没有任何文章(含草稿)。请先在 woshipm.com 发布内容后再查数据。");return r.map((t)=>{const o={};for(const[i,n]of Object.entries(t)){if(y.has(i))continue;if(n===""||n==null)continue;o[i]=n}const p=f[t.post_status]||t.post_status||"";return{id:t.id!=null?String(t.id):"",type:"article",title:t.title||"",url:t.permalink||"",published_at:t.date||"",status:p,views:typeof t.views==="number"?t.views:typeof t.view==="number"?t.view:"",likes:typeof t.postlike==="number"?t.postlike:"",comments:"",collects:typeof t.bookmark==="number"?t.bookmark:"",shares:"",extra:Object.keys(o).length?JSON.stringify(o):""}})}});
@@ -1 +1 @@
1
- import{cli as x,Strategy as z}from"@jackwener/opencli/registry";import{checkLogin as A,cookieQuickCheck as B}from"../_shared/article/auth.js";import{woshipmProfile as q}from"./article.js";const D={home:q.home,checkAuth:q.checkAuth};x({site:"woshipm",name:"whoami",access:"read",description:"显示当前登录人人都是产品经理(woshipm.com)的账号信息。",domain:"www.woshipm.com",strategy:z.COOKIE,browser:!0,columns:["logged_in","user_id","username"],authStatus:{quickCheck:B("https://www.woshipm.com",[],["wordpress_logged_in_"])},func:async(v)=>{const b=await A(v,D);return[{logged_in:b.isAuthenticated,user_id:b.userId||"",username:b.username||""}]}});
1
+ import{cli as r,Strategy as s}from"@jackwener/opencli/registry";import{checkLogin as t,cookieQuickCheck as c}from"../_shared/article/auth.js";import{woshipmProfile as o}from"./article.js";const m={home:o.home,checkAuth:o.checkAuth};r({site:"woshipm",name:"whoami",access:"read",description:"显示当前登录人人都是产品经理(woshipm.com)的账号信息。",domain:"www.woshipm.com",strategy:s.COOKIE,browser:!0,columns:["logged_in","user_id","username"],authStatus:{quickCheck:c("https://www.woshipm.com",[],["wordpress_logged_in_"])},func:async(i)=>{const e=await t(i,m);return[{logged_in:e.isAuthenticated,user_id:e.userId||"",username:e.username||""}]}});
@@ -1 +1 @@
1
- import{cli as o,Strategy as u}from"@jackwener/opencli/registry";import{EmptyResultError as c}from"@jackwener/opencli/errors";import{requireString as a,wttrFetch as s,pickWeatherDesc as i}from"./utils.js";o({site:"wttr",name:"current",access:"read",description:"Current weather conditions for a location (city, lat,lon, or airport code)",domain:"wttr.in",strategy:u.PUBLIC,browser:!1,args:[{name:"location",positional:!0,required:!0,help:'City name, "lat,lon", airport ICAO code, or "@domain"'}],columns:["location","region","country","latitude","longitude","observedAt","tempC","tempF","feelsLikeC","feelsLikeF","description","humidity","cloudCover","pressure","precipMm","visibilityKm","uvIndex","windKmph","windDirection","windDirectionDegree"],func:async(l)=>{const t=a(l.location,"location"),n=await s(t,"wttr current"),e=Array.isArray(n?.current_condition)?n.current_condition[0]:null;if(!e)throw new c("wttr current",`wttr.in returned no current conditions for "${t}".`);const r=Array.isArray(n?.nearest_area)?n.nearest_area[0]:null;return[{location:i(r?.areaName)||t,region:i(r?.region),country:i(r?.country),latitude:r?.latitude??null,longitude:r?.longitude??null,observedAt:e.localObsDateTime??null,tempC:e.temp_C!=null?Number(e.temp_C):null,tempF:e.temp_F!=null?Number(e.temp_F):null,feelsLikeC:e.FeelsLikeC!=null?Number(e.FeelsLikeC):null,feelsLikeF:e.FeelsLikeF!=null?Number(e.FeelsLikeF):null,description:i(e.weatherDesc),humidity:e.humidity!=null?Number(e.humidity):null,cloudCover:e.cloudcover!=null?Number(e.cloudcover):null,pressure:e.pressure!=null?Number(e.pressure):null,precipMm:e.precipMM!=null?Number(e.precipMM):null,visibilityKm:e.visibility!=null?Number(e.visibility):null,uvIndex:e.uvIndex!=null?Number(e.uvIndex):null,windKmph:e.windspeedKmph!=null?Number(e.windspeedKmph):null,windDirection:e.winddir16Point??null,windDirectionDegree:e.winddirDegree!=null?Number(e.winddirDegree):null}]}});
1
+ import{cli as u,Strategy as o}from"@jackwener/opencli/registry";import{EmptyResultError as c}from"@jackwener/opencli/errors";import{requireString as d,wttrFetch as s,pickWeatherDesc as n}from"./utils.js";u({site:"wttr",name:"current",access:"read",description:"Current weather conditions for a location (city, lat,lon, or airport code)",domain:"wttr.in",strategy:o.PUBLIC,browser:!1,args:[{name:"location",positional:!0,required:!0,help:'City name, "lat,lon", airport ICAO code, or "@domain"'}],columns:["location","region","country","latitude","longitude","observedAt","tempC","tempF","feelsLikeC","feelsLikeF","description","humidity","cloudCover","pressure","precipMm","visibilityKm","uvIndex","windKmph","windDirection","windDirectionDegree"],func:async(l)=>{const t=d(l.location,"location"),i=await s(t,"wttr current"),e=Array.isArray(i?.current_condition)?i.current_condition[0]:null;if(!e)throw new c("wttr current",`wttr.in returned no current conditions for "${t}".`);const r=Array.isArray(i?.nearest_area)?i.nearest_area[0]:null;return[{location:n(r?.areaName)||t,region:n(r?.region),country:n(r?.country),latitude:r?.latitude??null,longitude:r?.longitude??null,observedAt:e.localObsDateTime??null,tempC:e.temp_C!=null?Number(e.temp_C):null,tempF:e.temp_F!=null?Number(e.temp_F):null,feelsLikeC:e.FeelsLikeC!=null?Number(e.FeelsLikeC):null,feelsLikeF:e.FeelsLikeF!=null?Number(e.FeelsLikeF):null,description:n(e.weatherDesc),humidity:e.humidity!=null?Number(e.humidity):null,cloudCover:e.cloudcover!=null?Number(e.cloudcover):null,pressure:e.pressure!=null?Number(e.pressure):null,precipMm:e.precipMM!=null?Number(e.precipMM):null,visibilityKm:e.visibility!=null?Number(e.visibility):null,uvIndex:e.uvIndex!=null?Number(e.uvIndex):null,windKmph:e.windspeedKmph!=null?Number(e.windspeedKmph):null,windDirection:e.winddir16Point??null,windDirectionDegree:e.winddirDegree!=null?Number(e.winddirDegree):null}]}});
@@ -1 +1 @@
1
- import{cli as L,Strategy as M}from"@jackwener/opencli/registry";import{ArgumentError as N,EmptyResultError as O}from"@jackwener/opencli/errors";import{requireString as P,wttrFetch as Q,pickWeatherDesc as T}from"./utils.js";L({site:"wttr",name:"forecast",access:"read",description:"Multi-day weather forecast (up to 3 days, wttr.in free tier max)",domain:"wttr.in",strategy:M.PUBLIC,browser:!1,args:[{name:"location",positional:!0,required:!0,help:'City name, "lat,lon", airport ICAO code, or "@domain"'},{name:"days",type:"int",default:3,help:"Max forecast days (1-3, wttr.in caps the response at 3 days)"}],columns:["rank","date","minTempC","maxTempC","avgTempC","minTempF","maxTempF","avgTempF","sunHour","totalSnowCm","uvIndex","description","sunrise","sunset"],func:async(z)=>{const B=P(z.location,"location"),v=Number(z.days??3);if(!Number.isInteger(v)||v<1||v>3)throw new N("--days must be an integer between 1 and 3 (wttr.in caps the free-tier forecast at 3 days)");const C=await Q(B,"wttr forecast"),G=Array.isArray(C?.weather)?C.weather:[];if(!G.length)throw new O("wttr forecast",`wttr.in returned no forecast for "${B}".`);return G.slice(0,v).map((f,J)=>{const K=Array.isArray(f.hourly)&&f.hourly[4]?f.hourly[4]:f.hourly?.[0]??{},H=Array.isArray(f.astronomy)?f.astronomy[0]:null;return{rank:J+1,date:f.date??null,minTempC:f.mintempC!=null?Number(f.mintempC):null,maxTempC:f.maxtempC!=null?Number(f.maxtempC):null,avgTempC:f.avgtempC!=null?Number(f.avgtempC):null,minTempF:f.mintempF!=null?Number(f.mintempF):null,maxTempF:f.maxtempF!=null?Number(f.maxtempF):null,avgTempF:f.avgtempF!=null?Number(f.avgtempF):null,sunHour:f.sunHour!=null?Number(f.sunHour):null,totalSnowCm:f.totalSnow_cm!=null?Number(f.totalSnow_cm):null,uvIndex:f.uvIndex!=null?Number(f.uvIndex):null,description:T(K?.weatherDesc),sunrise:H?.sunrise??null,sunset:H?.sunset??null}})}});
1
+ import{cli as a,Strategy as i}from"@jackwener/opencli/registry";import{ArgumentError as p,EmptyResultError as c}from"@jackwener/opencli/errors";import{requireString as w,wttrFetch as f,pickWeatherDesc as h}from"./utils.js";a({site:"wttr",name:"forecast",access:"read",description:"Multi-day weather forecast (up to 3 days, wttr.in free tier max)",domain:"wttr.in",strategy:i.PUBLIC,browser:!1,args:[{name:"location",positional:!0,required:!0,help:'City name, "lat,lon", airport ICAO code, or "@domain"'},{name:"days",type:"int",default:3,help:"Max forecast days (1-3, wttr.in caps the response at 3 days)"}],columns:["rank","date","minTempC","maxTempC","avgTempC","minTempF","maxTempF","avgTempF","sunHour","totalSnowCm","uvIndex","description","sunrise","sunset"],func:async(r)=>{const n=w(r.location,"location"),t=Number(r.days??3);if(!Number.isInteger(t)||t<1||t>3)throw new p("--days must be an integer between 1 and 3 (wttr.in caps the free-tier forecast at 3 days)");const m=await f(n,"wttr forecast"),o=Array.isArray(m?.weather)?m.weather:[];if(!o.length)throw new c("wttr forecast",`wttr.in returned no forecast for "${n}".`);return o.slice(0,t).map((e,u)=>{const s=Array.isArray(e.hourly)&&e.hourly[4]?e.hourly[4]:e.hourly?.[0]??{},l=Array.isArray(e.astronomy)?e.astronomy[0]:null;return{rank:u+1,date:e.date??null,minTempC:e.mintempC!=null?Number(e.mintempC):null,maxTempC:e.maxtempC!=null?Number(e.maxtempC):null,avgTempC:e.avgtempC!=null?Number(e.avgtempC):null,minTempF:e.mintempF!=null?Number(e.mintempF):null,maxTempF:e.maxtempF!=null?Number(e.maxtempF):null,avgTempF:e.avgtempF!=null?Number(e.avgtempF):null,sunHour:e.sunHour!=null?Number(e.sunHour):null,totalSnowCm:e.totalSnow_cm!=null?Number(e.totalSnow_cm):null,uvIndex:e.uvIndex!=null?Number(e.uvIndex):null,description:h(s?.weatherDesc),sunrise:l?.sunrise??null,sunset:l?.sunset??null}})}});
@@ -1 +1 @@
1
- import{ArgumentError as K,EmptyResultError as H,CommandExecutionError as I}from"@jackwener/opencli/errors";export const WTTR_BASE="https://wttr.in";const L="opencli-wttr/1.0";export function requireString(z,q){if(typeof z!=="string"||!z.trim())throw new K(`--${q} is required`);return z.trim()}export async function wttrFetch(z,q){const J=`${WTTR_BASE}/${encodeURIComponent(z)}?format=j1`;let D;try{D=await fetch(J,{headers:{"User-Agent":L,accept:"application/json"}})}catch(G){throw new I(`${q} request failed: ${G.message}`)}if(D.status===404)throw new H(q,`${q} could not find location "${z}".`);if(!D.ok)throw new I(`${q} returned HTTP ${D.status}.`);let F;try{F=await D.json()}catch(G){throw new H(q,`${q} returned non-JSON body (likely unknown location).`)}return F}export function pickWeatherDesc(z){if(!Array.isArray(z)||!z.length)return"";const q=z[0];return typeof q?.value==="string"?q.value.trim():""}
1
+ import{ArgumentError as u,EmptyResultError as i,CommandExecutionError as s}from"@jackwener/opencli/errors";export const WTTR_BASE="https://wttr.in";const p="opencli-wttr/1.0";export function requireString(r,t){if(typeof r!=="string"||!r.trim())throw new u(`--${t} is required`);return r.trim()}export async function wttrFetch(r,t){const c=`${WTTR_BASE}/${encodeURIComponent(r)}?format=j1`;let e;try{e=await fetch(c,{headers:{"User-Agent":p,accept:"application/json"}})}catch(o){throw new s(`${t} request failed: ${o.message}`)}if(e.status===404)throw new i(t,`${t} could not find location "${r}".`);if(!e.ok)throw new s(`${t} returned HTTP ${e.status}.`);let n;try{n=await e.json()}catch(o){throw new i(t,`${t} returned non-JSON body (likely unknown location).`)}return n}export function pickWeatherDesc(r){if(!Array.isArray(r)||!r.length)return"";const t=r[0];return typeof t?.value==="string"?t.value.trim():""}
@@ -1 +1 @@
1
- import{ArgumentError as J}from"@jackwener/opencli/errors";import{cli as K,Strategy as Q}from"@jackwener/opencli/registry";import{HOME_URL as T,mtopRequest as V}from"./mtop.js";function F(C,D){const x=String(C??"").trim();if(!x)return 1;if(!/^\d+$/.test(x)||Number(x)<1)throw new J(`xianyu collect ${D} must be a positive integer`);return Number(x)}K({site:"xianyu",name:"collect",access:"read",description:"列出我收藏的商品(分页)",domain:"www.goofish.com",strategy:Q.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"page",type:"int",default:1,help:"页码,从 1 开始"},{name:"page_size",type:"int",default:20,help:"每页条数"}],columns:["item_id","title","price","seller_nick","want_cnt","status_str"],func:async(C,D)=>{const x=F(D.page,"page"),I=F(D.page_size,"page_size");await C.goto(T);await C.wait(1);const B=await V(C,"collect",{api:"mtop.taobao.idle.web.favor.item.list",data:{pageNumber:x,pageSize:I},version:"1.0"}),G=(Array.isArray(B.items)?B.items:Array.isArray(B.itemList)?B.itemList:Array.isArray(B.list)?B.list:[]).filter((h)=>h&&typeof h==="object").map((h)=>({item_id:String(h.itemId||h.id||""),title:h.title||"",price:String(h.price||h.soldPrice||""),main_pic:h.picUrl||h.mainPic||"",seller_id:String(h.sellerId||h.userId||""),seller_nick:h.sellerNick||h.userNick||"",want_cnt:Number(h.wantCnt||0),status_str:h.itemStatusStr||""}));return G.length?G:[{item_id:"",title:"(无收藏)",price:"",seller_nick:"",want_cnt:0,status_str:""}]}});export const __test__={normalizePage:F};
1
+ import{ArgumentError as c}from"@jackwener/opencli/errors";import{cli as l,Strategy as m}from"@jackwener/opencli/registry";import{HOME_URL as p,mtopRequest as u}from"./mtop.js";function s(i,a){const t=String(i??"").trim();if(!t)return 1;if(!/^\d+$/.test(t)||Number(t)<1)throw new c(`xianyu collect ${a} must be a positive integer`);return Number(t)}l({site:"xianyu",name:"collect",access:"read",description:"列出我收藏的商品(分页)",domain:"www.goofish.com",strategy:m.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"page",type:"int",default:1,help:"页码,从 1 开始"},{name:"page_size",type:"int",default:20,help:"每页条数"}],columns:["item_id","title","price","seller_nick","want_cnt","status_str"],func:async(i,a)=>{const t=s(a.page,"page"),o=s(a.page_size,"page_size");await i.goto(p);await i.wait(1);const r=await u(i,"collect",{api:"mtop.taobao.idle.web.favor.item.list",data:{pageNumber:t,pageSize:o},version:"1.0"}),n=(Array.isArray(r.items)?r.items:Array.isArray(r.itemList)?r.itemList:Array.isArray(r.list)?r.list:[]).filter((e)=>e&&typeof e==="object").map((e)=>({item_id:String(e.itemId||e.id||""),title:e.title||"",price:String(e.price||e.soldPrice||""),main_pic:e.picUrl||e.mainPic||"",seller_id:String(e.sellerId||e.userId||""),seller_nick:e.sellerNick||e.userNick||"",want_cnt:Number(e.wantCnt||0),status_str:e.itemStatusStr||""}));return n.length?n:[{item_id:"",title:"(无收藏)",price:"",seller_nick:"",want_cnt:0,status_str:""}]}});export const __test__={normalizePage:s};
@@ -1 +1 @@
1
- import{AuthRequiredError as H,CommandExecutionError as S,EmptyResultError as T}from"@jackwener/opencli/errors";import{cli as V,Strategy as W}from"@jackwener/opencli/registry";import{buildClickInboxConversationEvaluate as X,buildExtractInboxEvaluate as J,buildInboxUrl as K,buildReadCurrentConversationUrlEvaluate as Y,DEFAULT_INBOX_LIMIT as L,MAX_INBOX_LIMIT as Z,normalizeLimit as M,requireClickResult as _,requireEvaluateObject as N}from"./im.js";V({site:"xianyu",name:"inbox",access:"read",description:"列出闲鱼最近私信会话",domain:"www.goofish.com",strategy:W.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"limit",type:"int",default:L,help:"Number of conversations to return"},{name:"unread-only",type:"bool",default:!1,help:"Return only conversations with unread messages"},{name:"resolve-ids",type:"bool",default:!1,help:"Click each visible conversation to resolve item_id and peer_user_id from the chat URL"}],columns:["rank","peer_name","peer_user_id","item_id","item_title","price","last_message","unread","unread_count","url"],func:async(h,A)=>{const F=M(A.limit,L,Z,"inbox --limit"),P=Boolean(A["unread-only"]),Q=Boolean(A["resolve-ids"]);let B="";if(h.getCurrentUrl)try{B=await h.getCurrentUrl()}catch{B=""}if(!/https:\/\/www\.goofish\.com\/im\b/.test(B))await h.goto(K());await h.wait(4);const q=N(await h.evaluate(J(F)),"inbox");if(q?.requiresAuth)throw new H("www.goofish.com","Xianyu inbox requires a logged-in browser session");if(q?.blocked)throw new H("www.goofish.com","Xianyu inbox is blocked by verification or risk control");if(!Array.isArray(q.items))throw new S("Xianyu inbox returned malformed conversation list");const G=q.items;if(!G.length)throw new T("xianyu inbox","No Xianyu inbox conversations were found");let z=G.slice(0,F);if(P)z=z.filter((f)=>Boolean(f.unread));if(Q)for(const f of z){if(f.item_id&&f.peer_user_id)continue;const j=Number(f.row_index);if(!Number.isInteger(j)||j<0)continue;_(await h.evaluate(X(j)),"inbox resolve-ids click");await h.wait(1);const D=N(await h.evaluate(Y()),"inbox current-url");f.item_id=D?.item_id||f.item_id||"";f.peer_user_id=D?.peer_user_id||f.peer_user_id||"";f.url=D?.url||f.url||""}return z.map((f,j)=>({rank:j+1,peer_name:f.peer_name||"",peer_user_id:f.peer_user_id||"",item_id:f.item_id||"",item_title:f.item_title||"",price:f.price||"",last_message:f.last_message||"",unread:Boolean(f.unread),unread_count:Number(f.unread_count||0),url:f.url||""}))}});export const __test__={buildInboxUrl:K,buildExtractInboxEvaluate:J,normalizeLimit:M};
1
+ import{AuthRequiredError as c,CommandExecutionError as p,EmptyResultError as y}from"@jackwener/opencli/errors";import{cli as h,Strategy as x}from"@jackwener/opencli/registry";import{buildClickInboxConversationEvaluate as I,buildExtractInboxEvaluate as d,buildInboxUrl as m,buildReadCurrentConversationUrlEvaluate as E,DEFAULT_INBOX_LIMIT as _,MAX_INBOX_LIMIT as g,normalizeLimit as f,requireClickResult as C,requireEvaluateObject as w}from"./im.js";h({site:"xianyu",name:"inbox",access:"read",description:"列出闲鱼最近私信会话",domain:"www.goofish.com",strategy:x.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"limit",type:"int",default:_,help:"Number of conversations to return"},{name:"unread-only",type:"bool",default:!1,help:"Return only conversations with unread messages"},{name:"resolve-ids",type:"bool",default:!1,help:"Click each visible conversation to resolve item_id and peer_user_id from the chat URL"}],columns:["rank","peer_name","peer_user_id","item_id","item_title","price","last_message","unread","unread_count","url"],func:async(r,n)=>{const l=f(n.limit,_,g,"inbox --limit"),b=Boolean(n["unread-only"]),v=Boolean(n["resolve-ids"]);let a="";if(r.getCurrentUrl)try{a=await r.getCurrentUrl()}catch{a=""}if(!/https:\/\/www\.goofish\.com\/im\b/.test(a))await r.goto(m());await r.wait(4);const t=w(await r.evaluate(d(l)),"inbox");if(t?.requiresAuth)throw new c("www.goofish.com","Xianyu inbox requires a logged-in browser session");if(t?.blocked)throw new c("www.goofish.com","Xianyu inbox is blocked by verification or risk control");if(!Array.isArray(t.items))throw new p("Xianyu inbox returned malformed conversation list");const u=t.items;if(!u.length)throw new y("xianyu inbox","No Xianyu inbox conversations were found");let o=u.slice(0,l);if(b)o=o.filter((e)=>Boolean(e.unread));if(v)for(const e of o){if(e.item_id&&e.peer_user_id)continue;const i=Number(e.row_index);if(!Number.isInteger(i)||i<0)continue;C(await r.evaluate(I(i)),"inbox resolve-ids click");await r.wait(1);const s=w(await r.evaluate(E()),"inbox current-url");e.item_id=s?.item_id||e.item_id||"";e.peer_user_id=s?.peer_user_id||e.peer_user_id||"";e.url=s?.url||e.url||""}return o.map((e,i)=>({rank:i+1,peer_name:e.peer_name||"",peer_user_id:e.peer_user_id||"",item_id:e.item_id||"",item_title:e.item_title||"",price:e.price||"",last_message:e.last_message||"",unread:Boolean(e.unread),unread_count:Number(e.unread_count||0),url:e.url||""}))}});export const __test__={buildInboxUrl:m,buildExtractInboxEvaluate:d,normalizeLimit:f};
@@ -1,2 +1,2 @@
1
- import{CommandExecutionError as Y,ArgumentError as O}from"@jackwener/opencli/errors";import{cli as P,Strategy as f}from"@jackwener/opencli/registry";const $={recent1d:"近1天",recent7d:"近7天",recent30d:"近30天"},C="https://seller.goofish.com/?site=COMMONPRO#/seller-data/commodity",b={商品曝光次数:"exposureCount",商品曝光人数:"exposureUsers",商品浏览次数:"viewCount",商品浏览人数:"viewUsers",询单人数:"inquiryUsers",支付人数:"payUsers",支付订单数:"payOrders",支付金额:"payAmount",浏览支付转化率:"viewPayCvr",发起退款人数:"refundUsers",发起退款订单数:"refundOrders",发起退款金额:"refundAmount",成功退款人数:"refundOkUsers",成功退款订单数:"refundOkOrders",成功退款金额:"refundOkAmount"};function j(q){const W=Array.from(document.querySelectorAll("thead th")).map((z)=>(z.innerText||"").trim());if(!W.length)return{error:"no-table"};const F={};W.forEach((z,v)=>{if(q[z]!=null)F[q[z]]=v});const J=[];document.querySelectorAll("tbody tr").forEach((z)=>{const v=Array.from(z.querySelectorAll("td"));if(!v.length)return;if(v.every((V)=>!(V.innerText||"").trim()))return;const Q=(v[0].innerText||"").replace(/\r/g,""),B=Q.match(/(\d{10,})/),L=Q.match(/¥\s*([\d.]+)/),H=Q.split(`
2
- `).map((V)=>V.trim()).filter(Boolean)[0]||"";if(!B)return;const S={itemId:B[1],title:H,price:L?L[1]:""};for(const V of Object.keys(q)){const U=q[V],Z=F[U];S[U]=Z!=null&&v[Z]?(v[Z].innerText||"").trim():""}J.push(S)});return{rows:J}}P({site:"xianyu",name:"item-stats",access:"read",description:"读每个在售商品的经营数据(曝光/浏览/询单/支付/退款,逐商品一行)",domain:"seller.goofish.com",strategy:f.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"range",default:"recent1d",help:"时间范围:recent1d / recent7d / recent30d"}],columns:["itemId","title","price","exposureCount","exposureUsers","viewCount","viewUsers","inquiryUsers","payUsers","payOrders","payAmount","viewPayCvr","refundUsers","refundOrders","refundAmount","refundOkUsers","refundOkOrders","refundOkAmount"],func:async(q,W)=>{const F=String(W.range||"recent1d").trim(),J=$[F];if(!J)throw new O(`--range 只能是 ${Object.keys($).join(" / ")},收到 "${F}"`);await q.goto(C);await q.wait(3);if(F!=="recent1d"){await q.evaluate((Q)=>{Array.from(document.querySelectorAll("label,span,div,button")).filter((B)=>B.children.length===0&&(B.innerText||"").trim()===Q).forEach((B)=>B.click())},J);await q.wait(2)}const z=await q.evaluate(j,b);if(z.error==="no-table")throw new Y("商品数据表未渲染 —— 可能未登录卖家中心 / 页面改版 / 无权限");const v=z.rows||[];if(v.length===0)throw new Y("商品数据表为空 —— 该账号可能无在售商品或当前范围无数据");return v}});export const __test__={readItemTable:j,HEADER_MAP:b,RANGE_TEXT:$};
1
+ import{CommandExecutionError as y,ArgumentError as p}from"@jackwener/opencli/errors";import{cli as A,Strategy as x}from"@jackwener/opencli/registry";const d={recent1d:"近1天",recent7d:"近7天",recent30d:"近30天"},g="https://seller.goofish.com/?site=COMMONPRO#/seller-data/commodity",w={商品曝光次数:"exposureCount",商品曝光人数:"exposureUsers",商品浏览次数:"viewCount",商品浏览人数:"viewUsers",询单人数:"inquiryUsers",支付人数:"payUsers",支付订单数:"payOrders",支付金额:"payAmount",浏览支付转化率:"viewPayCvr",发起退款人数:"refundUsers",发起退款订单数:"refundOrders",发起退款金额:"refundAmount",成功退款人数:"refundOkUsers",成功退款订单数:"refundOkOrders",成功退款金额:"refundOkAmount"};function O(e){const a=Array.from(document.querySelectorAll("thead th")).map((t)=>(t.innerText||"").trim());if(!a.length)return{error:"no-table"};const o={};a.forEach((t,r)=>{if(e[t]!=null)o[e[t]]=r});const s=[];document.querySelectorAll("tbody tr").forEach((t)=>{const r=Array.from(t.querySelectorAll("td"));if(!r.length)return;if(r.every((c)=>!(c.innerText||"").trim()))return;const i=(r[0].innerText||"").replace(/\r/g,""),n=i.match(/(\d{10,})/),l=i.match(/¥\s*([\d.]+)/),h=i.split(`
2
+ `).map((c)=>c.trim()).filter(Boolean)[0]||"";if(!n)return;const f={itemId:n[1],title:h,price:l?l[1]:""};for(const c of Object.keys(e)){const m=e[c],u=o[m];f[m]=u!=null&&r[u]?(r[u].innerText||"").trim():""}s.push(f)});return{rows:s}}A({site:"xianyu",name:"item-stats",access:"read",description:"读每个在售商品的经营数据(曝光/浏览/询单/支付/退款,逐商品一行)",domain:"seller.goofish.com",strategy:x.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"range",default:"recent1d",help:"时间范围:recent1d / recent7d / recent30d"}],columns:["itemId","title","price","exposureCount","exposureUsers","viewCount","viewUsers","inquiryUsers","payUsers","payOrders","payAmount","viewPayCvr","refundUsers","refundOrders","refundAmount","refundOkUsers","refundOkOrders","refundOkAmount"],func:async(e,a)=>{const o=String(a.range||"recent1d").trim(),s=d[o];if(!s)throw new p(`--range 只能是 ${Object.keys(d).join(" / ")},收到 "${o}"`);await e.goto(g);await e.wait(3);if(o!=="recent1d"){await e.evaluate((i)=>{Array.from(document.querySelectorAll("label,span,div,button")).filter((n)=>n.children.length===0&&(n.innerText||"").trim()===i).forEach((n)=>n.click())},s);await e.wait(2)}const t=await e.evaluate(O,w);if(t.error==="no-table")throw new y("商品数据表未渲染 —— 可能未登录卖家中心 / 页面改版 / 无权限");const r=t.rows||[];if(r.length===0)throw new y("商品数据表为空 —— 该账号可能无在售商品或当前范围无数据");return r}});export const __test__={readItemTable:O,HEADER_MAP:w,RANGE_TEXT:d};
@@ -1 +1 @@
1
- import{cli as D,Strategy as F}from"@jackwener/opencli/registry";import{HOME_URL as G,mtopRequest as I}from"./mtop.js";D({site:"xianyu",name:"location",access:"read",description:"获取账号默认发布地址",domain:"www.goofish.com",strategy:F.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"longitude",type:"float",default:121.4737,help:"经度(默认上海)"},{name:"latitude",type:"float",default:31.2304,help:"纬度(默认上海)"}],columns:["prov","city","area","poi","division_id"],func:async(h,z)=>{const B=Number(z.longitude??121.4737),C=Number(z.latitude??31.2304);await h.goto(G);await h.wait(1);const x=await I(h,"location",{api:"mtop.taobao.idle.local.poi.get",data:{longitude:B,latitude:C},version:"1.0"}),A=Array.isArray(x.commonAddresses)?x.commonAddresses:[],f=x.selectedPoi||(A.length?A[0]:null);if(!f)return[{prov:"",city:"",area:"",poi:"",division_id:""}];return[{prov:f.prov||"",city:f.city||"",area:f.area||"",poi:f.poi||"",division_id:String(f.divisionId||"")}]}});export const __test__={};
1
+ import{cli as s,Strategy as d}from"@jackwener/opencli/registry";import{HOME_URL as c,mtopRequest as l}from"./mtop.js";s({site:"xianyu",name:"location",access:"read",description:"获取账号默认发布地址",domain:"www.goofish.com",strategy:d.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"longitude",type:"float",default:121.4737,help:"经度(默认上海)"},{name:"latitude",type:"float",default:31.2304,help:"纬度(默认上海)"}],columns:["prov","city","area","poi","division_id"],func:async(o,e)=>{const r=Number(e.longitude??121.4737),n=Number(e.latitude??31.2304);await o.goto(c);await o.wait(1);const i=await l(o,"location",{api:"mtop.taobao.idle.local.poi.get",data:{longitude:r,latitude:n},version:"1.0"}),a=Array.isArray(i.commonAddresses)?i.commonAddresses:[],t=i.selectedPoi||(a.length?a[0]:null);if(!t)return[{prov:"",city:"",area:"",poi:"",division_id:""}];return[{prov:t.prov||"",city:t.city||"",area:t.area||"",poi:t.poi||"",division_id:String(t.divisionId||"")}]}});export const __test__={};
@@ -1 +1 @@
1
- import{ArgumentError as P,CommandExecutionError as j}from"@jackwener/opencli/errors";import{cli as Z,Strategy as $}from"@jackwener/opencli/registry";import{HOME_URL as f,mtopRequest as W}from"./mtop.js";import{normalizeNumericId as A}from"./utils.js";function C(F,B){const G=String(F??"").trim();if(!G)return 1;if(!/^\d+$/.test(G)||Number(G)<1)throw new P(`xianyu ${B} must be a positive integer`);return Number(G)}function H(F){const B=F.cardData||{},G=B.priceInfo||{},J=B.picInfo||{},K=B.detailParams||{};return{item_id:String(B.id||K.itemId||""),title:B.title||K.title||"",price:G.price||K.soldPrice||"",status:B.itemStatus,main_pic:J.picUrl||K.picUrl||"",post_info:K.postInfo||""}}Z({site:"xianyu",name:"mine",access:"read",description:"列出当前账号在售/已发布商品(分页)",domain:"www.goofish.com",strategy:$.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"page",type:"int",default:1,help:"页码,从 1 开始"},{name:"page_size",type:"int",default:20,help:"每页条数"}],columns:["item_id","title","price","status","main_pic"],func:async(F,B)=>{const G=C(B.page,"page"),J=C(B.page_size,"page_size");await F.goto(f);await F.wait(1);const K=await W(F,"item mine",{api:"mtop.idle.web.user.page.head",data:{self:!0},version:"1.0"}),Q=String((K.base||K.baseInfo||{}).kcUserId||"").trim();if(!Q)throw new j("无法解析当前账号 userId,请确认已登录闲鱼");const V=await W(F,"item mine",{api:"mtop.idle.web.xyh.item.list",data:{userId:Q,pageNumber:G,pageSize:J},version:"1.0"}),X=(Array.isArray(V.cardList)?V.cardList:Array.isArray(V.itemList)?V.itemList:[]).filter((Y)=>Y&&typeof Y==="object").map(H);return X.length?X:[{item_id:"",title:"(无在售商品)",price:"",status:"",main_pic:""}]}});Z({site:"xianyu",name:"polish",access:"write",description:"擦亮商品(刷新曝光排序,不改内容)",domain:"www.goofish.com",strategy:$.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"item_id",required:!0,positional:!0,help:"商品 itemId"}],columns:["item_id","ok","already_polished"],func:async(F,B)=>{const G=A(B.item_id,"item_id","1017530128619");await F.goto(f);await F.wait(1);let J;try{J=await W(F,"item polish",{api:"mtop.taobao.idle.item.polish",data:{itemId:G},version:"1.0"})}catch(K){const Q=String(K?.message||K);if(/POLISH_AGAIN|已经擦亮/.test(Q))return[{item_id:G,ok:!0,already_polished:!0,note:"今天已擦亮过,明天再来"}];throw K}return[{item_id:G,ok:!0,already_polished:!1,data:J}]}});Z({site:"xianyu",name:"delete",access:"write",description:"下架/删除商品",domain:"www.goofish.com",strategy:$.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"item_id",required:!0,positional:!0,help:"商品 itemId"}],columns:["item_id","ok"],func:async(F,B)=>{const G=A(B.item_id,"item_id","1017530128619");await F.goto(f);await F.wait(1);const J=await W(F,"item delete",{api:"com.taobao.idle.item.delete",data:{itemId:G},version:"1.1"});return[{item_id:G,ok:!0,data:J}]}});Z({site:"xianyu",name:"edit",access:"write",description:"编辑商品(标题/详情/价格/划线价/库存,按需传)",domain:"www.goofish.com",strategy:$.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"item_id",required:!0,positional:!0,help:"商品 itemId"},{name:"title",help:"新标题"},{name:"desc",fromFile:!0,help:"新详情描述"},{name:"price",type:"float",help:"新价格(元)"},{name:"original_price",type:"float",help:"新划线价(元),传 0 清除"},{name:"quantity",type:"int",help:"新库存数量"}],columns:["item_id","ok"],func:async(F,B)=>{const G=A(B.item_id,"item_id","1017530128619"),J=(T)=>T!=null&&String(T).trim()!=="";if(![B.title,B.desc,B.price,B.original_price,B.quantity].some(J))throw new P("至少传一个待改字段:--title / --desc / --price / --original-price / --quantity");await F.goto(f);await F.wait(1);const K=await W(F,"item edit",{api:"mtop.idle.pc.idleitem.editDetail",data:{itemId:G},version:"1.0"});if(!K||!Object.keys(K).length)throw new j(`editDetail 返回为空:itemId=${G}(可能已下架 / 不属于当前账号 / 风控)`);const Q={...K,itemId:G};if(J(B.title)||J(B.desc)){const T={...K.itemTextDTO||{}};if(J(B.title))T.title=String(B.title);if(J(B.desc))T.desc=String(B.desc);if(T.titleDescSeparate==null)T.titleDescSeparate=!0;Q.itemTextDTO=T}if(J(B.price)||J(B.original_price)){const T={...K.itemPriceDTO||{}},X=Number(B.price),Y=Number(B.original_price);if(J(B.price)&&X>0)T.priceInCent=String(Math.round(X*100));if(J(B.original_price))if(Y>0)T.origPriceInCent=String(Math.round(Y*100));else delete T.origPriceInCent;Q.itemPriceDTO=T}if(J(B.quantity))Q.quantity=String(Number(B.quantity));if(Q.uniqueCode==null)Q.uniqueCode=String(Date.now()*1000);if(Q.sourceId==null)Q.sourceId="pcMainPublish";if(Q.bizcode==null)Q.bizcode="pcMainPublish";if(Q.publishScene==null)Q.publishScene="pcMainPublish";const V=await W(F,"item edit",{api:"mtop.idle.pc.idleitem.edit",data:Q,version:"1.0"});return[{item_id:G,ok:!0,data:V}]}});export const __test__={normalizeMyItem:H,normalizePage:C};
1
+ import{ArgumentError as h,CommandExecutionError as y}from"@jackwener/opencli/errors";import{cli as l,Strategy as u}from"@jackwener/opencli/registry";import{HOME_URL as p,mtopRequest as c}from"./mtop.js";import{normalizeNumericId as f}from"./utils.js";function _(i,e){const t=String(i??"").trim();if(!t)return 1;if(!/^\d+$/.test(t)||Number(t)<1)throw new h(`xianyu ${e} must be a positive integer`);return Number(t)}function w(i){const e=i.cardData||{},t=e.priceInfo||{},r=e.picInfo||{},a=e.detailParams||{};return{item_id:String(e.id||a.itemId||""),title:e.title||a.title||"",price:t.price||a.soldPrice||"",status:e.itemStatus,main_pic:r.picUrl||a.picUrl||"",post_info:a.postInfo||""}}l({site:"xianyu",name:"mine",access:"read",description:"列出当前账号在售/已发布商品(分页)",domain:"www.goofish.com",strategy:u.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"page",type:"int",default:1,help:"页码,从 1 开始"},{name:"page_size",type:"int",default:20,help:"每页条数"}],columns:["item_id","title","price","status","main_pic"],func:async(i,e)=>{const t=_(e.page,"page"),r=_(e.page_size,"page_size");await i.goto(p);await i.wait(1);const a=await c(i,"item mine",{api:"mtop.idle.web.user.page.head",data:{self:!0},version:"1.0"}),n=String((a.base||a.baseInfo||{}).kcUserId||"").trim();if(!n)throw new y("无法解析当前账号 userId,请确认已登录闲鱼");const s=await c(i,"item mine",{api:"mtop.idle.web.xyh.item.list",data:{userId:n,pageNumber:t,pageSize:r},version:"1.0"}),m=(Array.isArray(s.cardList)?s.cardList:Array.isArray(s.itemList)?s.itemList:[]).filter((d)=>d&&typeof d==="object").map(w);return m.length?m:[{item_id:"",title:"(无在售商品)",price:"",status:"",main_pic:""}]}});l({site:"xianyu",name:"polish",access:"write",description:"擦亮商品(刷新曝光排序,不改内容)",domain:"www.goofish.com",strategy:u.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"item_id",required:!0,positional:!0,help:"商品 itemId"}],columns:["item_id","ok","already_polished"],func:async(i,e)=>{const t=f(e.item_id,"item_id","1017530128619");await i.goto(p);await i.wait(1);let r;try{r=await c(i,"item polish",{api:"mtop.taobao.idle.item.polish",data:{itemId:t},version:"1.0"})}catch(a){const n=String(a?.message||a);if(/POLISH_AGAIN|已经擦亮/.test(n))return[{item_id:t,ok:!0,already_polished:!0,note:"今天已擦亮过,明天再来"}];throw a}return[{item_id:t,ok:!0,already_polished:!1,data:r}]}});l({site:"xianyu",name:"delete",access:"write",description:"下架/删除商品",domain:"www.goofish.com",strategy:u.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"item_id",required:!0,positional:!0,help:"商品 itemId"}],columns:["item_id","ok"],func:async(i,e)=>{const t=f(e.item_id,"item_id","1017530128619");await i.goto(p);await i.wait(1);const r=await c(i,"item delete",{api:"com.taobao.idle.item.delete",data:{itemId:t},version:"1.1"});return[{item_id:t,ok:!0,data:r}]}});l({site:"xianyu",name:"edit",access:"write",description:"编辑商品(标题/详情/价格/划线价/库存,按需传)",domain:"www.goofish.com",strategy:u.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"item_id",required:!0,positional:!0,help:"商品 itemId"},{name:"title",help:"新标题"},{name:"desc",fromFile:!0,help:"新详情描述"},{name:"price",type:"float",help:"新价格(元)"},{name:"original_price",type:"float",help:"新划线价(元),传 0 清除"},{name:"quantity",type:"int",help:"新库存数量"}],columns:["item_id","ok"],func:async(i,e)=>{const t=f(e.item_id,"item_id","1017530128619"),r=(o)=>o!=null&&String(o).trim()!=="";if(![e.title,e.desc,e.price,e.original_price,e.quantity].some(r))throw new h("至少传一个待改字段:--title / --desc / --price / --original-price / --quantity");await i.goto(p);await i.wait(1);const a=await c(i,"item edit",{api:"mtop.idle.pc.idleitem.editDetail",data:{itemId:t},version:"1.0"});if(!a||!Object.keys(a).length)throw new y(`editDetail 返回为空:itemId=${t}(可能已下架 / 不属于当前账号 / 风控)`);const n={...a,itemId:t};if(r(e.title)||r(e.desc)){const o={...a.itemTextDTO||{}};if(r(e.title))o.title=String(e.title);if(r(e.desc))o.desc=String(e.desc);if(o.titleDescSeparate==null)o.titleDescSeparate=!0;n.itemTextDTO=o}if(r(e.price)||r(e.original_price)){const o={...a.itemPriceDTO||{}},m=Number(e.price),d=Number(e.original_price);if(r(e.price)&&m>0)o.priceInCent=String(Math.round(m*100));if(r(e.original_price))if(d>0)o.origPriceInCent=String(Math.round(d*100));else delete o.origPriceInCent;n.itemPriceDTO=o}if(r(e.quantity))n.quantity=String(Number(e.quantity));if(n.uniqueCode==null)n.uniqueCode=String(Date.now()*1000);if(n.sourceId==null)n.sourceId="pcMainPublish";if(n.bizcode==null)n.bizcode="pcMainPublish";if(n.publishScene==null)n.publishScene="pcMainPublish";const s=await c(i,"item edit",{api:"mtop.idle.pc.idleitem.edit",data:n,version:"1.0"});return[{item_id:t,ok:!0,data:s}]}});export const __test__={normalizeMyItem:w,normalizePage:_};
@@ -1 +1 @@
1
- import{ArgumentError as K,AuthRequiredError as _,CommandExecutionError as $,EmptyResultError as q}from"@jackwener/opencli/errors";import{cli as S,Strategy as v}from"@jackwener/opencli/registry";import{buildChatUrl as P,buildClickInboxConversationEvaluate as y,buildExtractChatStateEvaluate as Q,DEFAULT_MESSAGE_LIMIT as T,MAX_MESSAGE_LIMIT as z,normalizeLimit as V,normalizeRank as W,requireClickResult as c,requireEvaluateObject as A}from"./im.js";import{normalizeNumericId as X}from"./utils.js";S({site:"xianyu",name:"messages",access:"read",description:"读取指定闲鱼私信会话的最近聊天内容",domain:"www.goofish.com",strategy:v.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"item_id",positional:!0,help:"闲鱼商品 item_id"},{name:"user_id",positional:!0,help:"聊一聊对方的 user_id / peerUserId"},{name:"limit",type:"int",default:T,help:"Number of visible messages to return"},{name:"rank",type:"int",default:0,help:"Conversation rank from xianyu inbox; clicks the visible row instead of requiring IDs"}],columns:["index","peer_name","item_title","message","item_id","peer_user_id","url"],func:async(f,j)=>{const F=j.item_id!=null&&j.item_id!=="",G=j.user_id!=null&&j.user_id!=="",B=W(j.rank);if(B>0&&(F||G))throw new K("xianyu messages accepts either item_id/user_id or --rank, not both");if(B===0&&F!==G)throw new K("xianyu messages requires both item_id and user_id, or --rank from xianyu inbox");if(B===0&&!F&&!G)throw new K("xianyu messages requires item_id/user_id or --rank from xianyu inbox");const H=F&&G,L=H?X(j.item_id,"item_id","1038951278192"):"",M=H?X(j.user_id,"user_id","3650092411"):"",N=V(j.limit,T,z,"messages --limit");let J="";if(H){J=P(L,M);await f.goto(J)}else if(!f.getCurrentUrl||!/https:\/\/www\.goofish\.com\/im\b/.test(await f.getCurrentUrl()))await f.goto("https://www.goofish.com/im");await f.wait(2);if(B>0){c(await f.evaluate(y(B-1)),"messages rank click");await f.wait(2)}const D=A(await f.evaluate(Q(N)),"messages");if(D?.requiresAuth)throw new _("www.goofish.com","Xianyu messages requires a logged-in browser session");if(!Array.isArray(D.messages))throw new $("Xianyu messages returned malformed message list");const O=D.messages;if(!O.length)throw new q("xianyu messages","No visible messages were found in this Xianyu conversation");return O.slice(-N).map((Y,Z)=>({index:Z+1,peer_name:D.peer_name||"",item_title:D.item_title||"",message:Y.text||"",item_id:L,peer_user_id:M,url:J||""}))}});export const __test__={buildChatUrl:P,buildExtractChatStateEvaluate:Q,normalizeLimit:V,normalizeRank:W};
1
+ import{ArgumentError as m,AuthRequiredError as b,CommandExecutionError as E,EmptyResultError as I}from"@jackwener/opencli/errors";import{cli as v,Strategy as C}from"@jackwener/opencli/registry";import{buildChatUrl as c,buildClickInboxConversationEvaluate as A,buildExtractChatStateEvaluate as w,DEFAULT_MESSAGE_LIMIT as f,MAX_MESSAGE_LIMIT as q,normalizeLimit as h,normalizeRank as g,requireClickResult as k,requireEvaluateObject as S}from"./im.js";import{normalizeNumericId as y}from"./utils.js";v({site:"xianyu",name:"messages",access:"read",description:"读取指定闲鱼私信会话的最近聊天内容",domain:"www.goofish.com",strategy:C.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"item_id",positional:!0,help:"闲鱼商品 item_id"},{name:"user_id",positional:!0,help:"聊一聊对方的 user_id / peerUserId"},{name:"limit",type:"int",default:f,help:"Number of visible messages to return"},{name:"rank",type:"int",default:0,help:"Conversation rank from xianyu inbox; clicks the visible row instead of requiring IDs"}],columns:["index","peer_name","item_title","message","item_id","peer_user_id","url"],func:async(e,i)=>{const r=i.item_id!=null&&i.item_id!=="",a=i.user_id!=null&&i.user_id!=="",t=g(i.rank);if(t>0&&(r||a))throw new m("xianyu messages accepts either item_id/user_id or --rank, not both");if(t===0&&r!==a)throw new m("xianyu messages requires both item_id and user_id, or --rank from xianyu inbox");if(t===0&&!r&&!a)throw new m("xianyu messages requires item_id/user_id or --rank from xianyu inbox");const n=r&&a,u=n?y(i.item_id,"item_id","1038951278192"):"",l=n?y(i.user_id,"user_id","3650092411"):"",d=h(i.limit,f,q,"messages --limit");let o="";if(n){o=c(u,l);await e.goto(o)}else if(!e.getCurrentUrl||!/https:\/\/www\.goofish\.com\/im\b/.test(await e.getCurrentUrl()))await e.goto("https://www.goofish.com/im");await e.wait(2);if(t>0){k(await e.evaluate(A(t-1)),"messages rank click");await e.wait(2)}const s=S(await e.evaluate(w(d)),"messages");if(s?.requiresAuth)throw new b("www.goofish.com","Xianyu messages requires a logged-in browser session");if(!Array.isArray(s.messages))throw new E("Xianyu messages returned malformed message list");const _=s.messages;if(!_.length)throw new I("xianyu messages","No visible messages were found in this Xianyu conversation");return _.slice(-d).map((p,x)=>({index:x+1,peer_name:s.peer_name||"",item_title:s.item_title||"",message:p.text||"",item_id:u,peer_user_id:l,url:o||""}))}});export const __test__={buildChatUrl:c,buildExtractChatStateEvaluate:w,normalizeLimit:h,normalizeRank:g};
@@ -1,4 +1,4 @@
1
- import{AuthRequiredError as P,CommandExecutionError as $,EmptyResultError as N,selectorError as j}from"@jackwener/opencli/errors";export const HOME_URL="https://www.goofish.com";const Q=["RGV587_ERROR","FAIL_SYS_USER_VALIDATE","哎哟喂","/punish"],V=["FAIL_SYS_SESSION_EXPIRED","FAIL_SYS_TOKEN_EXOIRED","FAIL_SYS_TOKEN_EMPTY","FAIL_SYS_ILLEGAL_ACCESS","令牌过期","NEED_LOGIN"];function X(B,z,F){return`
1
+ import{AuthRequiredError as a,CommandExecutionError as p,EmptyResultError as i,selectorError as S}from"@jackwener/opencli/errors";export const HOME_URL="https://www.goofish.com";const c=["RGV587_ERROR","FAIL_SYS_USER_VALIDATE","哎哟喂","/punish"],w=["FAIL_SYS_SESSION_EXPIRED","FAIL_SYS_TOKEN_EXOIRED","FAIL_SYS_TOKEN_EMPTY","FAIL_SYS_ILLEGAL_ACCESS","令牌过期","NEED_LOGIN"];function u(e,r,t){return`
2
2
  (async () => {
3
3
  const clean = (v) => String(v ?? '').replace(/\\s+/g, ' ').trim();
4
4
  const extractRetCode = (ret) => clean(Array.isArray(ret) ? ret[0] : '').split('::')[0] || '';
@@ -15,10 +15,10 @@ import{AuthRequiredError as P,CommandExecutionError as $,EmptyResultError as N,s
15
15
  let response;
16
16
  try {
17
17
  response = await window.lib.mtop.request({
18
- api: ${JSON.stringify(B)},
19
- data: ${JSON.stringify(z)},
18
+ api: ${JSON.stringify(e)},
19
+ data: ${JSON.stringify(r)},
20
20
  type: 'POST',
21
- v: ${JSON.stringify(String(F))},
21
+ v: ${JSON.stringify(String(t))},
22
22
  dataType: 'json',
23
23
  needLogin: false,
24
24
  needLoginPC: false,
@@ -44,4 +44,4 @@ import{AuthRequiredError as P,CommandExecutionError as $,EmptyResultError as N,s
44
44
  }
45
45
  return { ok: true, ret: response?.ret || [], data: response?.data || {} };
46
46
  })()
47
- `}function Z(B,z){if(z?.error==="auth-required")throw new P("www.goofish.com",`闲鱼 ${B} 需要已登录的浏览器会话`);if(z?.error==="blocked")throw new N(`xianyu ${B}`,"闲鱼页面被验证码 / 安全验证拦截,请人工处理后重试");if(z?.error==="mtop-not-ready")throw j("window.lib.mtop","闲鱼页面未完成初始化,无法调用 mtop 接口");const F=String(z?.error_code||""),J=String(z?.error_message||""),L=`${F} ${J}`;if(V.some((G)=>L.includes(G)))throw new P("www.goofish.com",`闲鱼 ${B} 登录态失效:${J||F}`);if(Q.some((G)=>L.includes(G)))throw new N(`xianyu ${B}`,`闲鱼 ${B} 触发风控:${J||F},请人工处理`);if(z?.error)throw new $(`闲鱼 ${B} 接口调用失败:${J||F||z.error}`)}export async function mtopRequest(B,z,{api:F,data:J,version:L="1.0"}){const G=await B.evaluate(X(F,J,L));Z(z,G);if(!G||typeof G!=="object")throw new N(`xianyu ${z}`,"闲鱼接口未返回有效数据");return G.data||{}}export function retOk(B){return Array.isArray(B)&&B.some((z)=>String(z).includes("SUCCESS"))}export const __test__={buildMtopEvaluate:X,classifyAndThrow:Z,RISK_KEYWORDS:Q,AUTH_KEYWORDS:V};
47
+ `}function d(e,r){if(r?.error==="auth-required")throw new a("www.goofish.com",`闲鱼 ${e} 需要已登录的浏览器会话`);if(r?.error==="blocked")throw new i(`xianyu ${e}`,"闲鱼页面被验证码 / 安全验证拦截,请人工处理后重试");if(r?.error==="mtop-not-ready")throw S("window.lib.mtop","闲鱼页面未完成初始化,无法调用 mtop 接口");const t=String(r?.error_code||""),n=String(r?.error_message||""),s=`${t} ${n}`;if(w.some((o)=>s.includes(o)))throw new a("www.goofish.com",`闲鱼 ${e} 登录态失效:${n||t}`);if(c.some((o)=>s.includes(o)))throw new i(`xianyu ${e}`,`闲鱼 ${e} 触发风控:${n||t},请人工处理`);if(r?.error)throw new p(`闲鱼 ${e} 接口调用失败:${n||t||r.error}`)}export async function mtopRequest(e,r,{api:t,data:n,version:s="1.0"}){const o=await e.evaluate(u(t,n,s));d(r,o);if(!o||typeof o!=="object")throw new i(`xianyu ${r}`,"闲鱼接口未返回有效数据");return o.data||{}}export function retOk(e){return Array.isArray(e)&&e.some((r)=>String(r).includes("SUCCESS"))}export const __test__={buildMtopEvaluate:u,classifyAndThrow:d,RISK_KEYWORDS:c,AUTH_KEYWORDS:w};
@@ -1 +1 @@
1
- import{ArgumentError as M}from"@jackwener/opencli/errors";import{cli as $,Strategy as C}from"@jackwener/opencli/registry";import{HOME_URL as h,mtopRequest as f}from"./mtop.js";import{normalizeNumericId as Y}from"./utils.js";const j=["ALL","WAITING_PAY","WAITING_SEND","WAITING_RECEIVE","WAITING_RATE","SUCCESS","REFUND"];function q(x){const B=String(x||"ALL").trim().toUpperCase();if(!j.includes(B))throw new M(`xianyu order --status must be one of: ${j.join(", ")}`);return B}function L(x,B){const F=String(x??"").trim();if(!F)return 1;if(!/^\d+$/.test(F)||Number(F)<1)throw new M(`xianyu order ${B} must be a positive integer`);return Number(F)}$({site:"xianyu",name:"order",access:"read",description:"列出卖家已售订单(可按状态筛选)",domain:"www.goofish.com",strategy:C.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"page",type:"int",default:1,help:"页码,从 1 开始"},{name:"page_size",type:"int",default:20,help:"每页条数"},{name:"status",default:"ALL",help:`订单状态筛选:${j.join(" / ")}`}],columns:["order_id","item_id","buyer_nick","status_str","total_price","create_time"],func:async(x,B)=>{const F=L(B.page,"page"),Q=L(B.page_size,"page_size"),J=q(B.status);await x.goto(h);await x.wait(1);const X=(await f(x,"order list",{api:"mtop.taobao.idle.trade.merchant.sold.get",data:{pageNumber:F,rowsPerPage:Q,orderIds:"",queryCode:J,orderSearchParam:"{}"},version:"1.0"})).module||{},W=(Array.isArray(X.items)?X.items:[]).map((K)=>{const G=K.order||K.orderInfo||K,Z=K.buyer||K.buyerInfo||{},H=K.item||K.itemInfo||{};return{order_id:String(G.orderId||G.bizOrderId||G.id||""),item_id:String(H.itemId||H.id||""),item_title:H.title||"",buyer_id:String(Z.userId||Z.buyerId||""),buyer_nick:Z.nick||Z.userNick||"",status:G.status??G.orderStatus??"",status_str:G.statusStr||G.orderStatusStr||"",total_price:String(G.totalPrice||G.actualPrice||""),create_time:String(G.createTime||G.gmtCreate||"")}});return W.length?W:[{order_id:"",status_str:"(无已售订单)",total_price:"",buyer_nick:"",item_id:"",create_time:""}]}});$({site:"xianyu",name:"order-get",access:"read",description:"查询单个闲鱼订单详情",domain:"www.goofish.com",strategy:C.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"order_id",required:!0,positional:!0,help:"订单号 orderId"},{name:"role",default:"seller",help:"视角:seller / buyer"}],columns:["order_id","item_id","status_str","total_price","buyer_nick"],func:async(x,B)=>{const F=Y(B.order_id,"order_id","2800000000000000000"),Q=String(B.role||"seller").trim()==="buyer"?"buyer":"seller";await x.goto(h);await x.wait(1);const J=await f(x,"order get",{api:"mtop.idle.web.trade.order.detail",data:{orderId:F,role:Q},version:"1.0"}),V=J.itemInfoDTO||{},X=J.buyerInfoDTO||{},D=J.sellerInfoDTO||{},W=J.priceInfoDTO||{},K=J.logisticsInfoDTO||{},G=J.statusInfoDTO||{};return[{order_id:F,role:Q,item_id:String(V.itemId||""),title:V.title||"",main_pic:V.picUrl||"",quantity:Number(V.quantity||1),buyer_id:String(X.buyerId||""),buyer_nick:X.userNick||"",seller_id:String(D.sellerId||""),seller_nick:D.userNick||"",total_price:String(W.totalPrice||""),auction_price:String(W.auctionPrice||""),post_fee:String(W.postFee||""),status:G.orderStatus,status_str:G.orderStatusStr||"",logistic_no:K.logisticsNo||"",logistic_company:K.logisticsCompany||""}]}});$({site:"xianyu",name:"order-ship-dummy",access:"write",description:"虚拟发货(仅虚拟商品,无需物流单号)",domain:"www.goofish.com",strategy:C.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"order_id",required:!0,positional:!0,help:"订单号 orderId"},{name:"text",fromFile:!0,default:"",help:"发货附言(可选)"}],columns:["order_id","ok"],func:async(x,B)=>{const F=Y(B.order_id,"order_id","2800000000000000000");await x.goto(h);await x.wait(1);const Q=await f(x,"order ship-dummy",{api:"mtop.taobao.idle.logistic.consign.dummy",data:{orderId:F,tradeText:String(B.text||""),picList:[],newUnconsign:!0},version:"1.0"});return[{order_id:F,ok:!0,data:Q}]}});$({site:"xianyu",name:"order-ship-freeshipping",access:"write",description:"包邮发货(拼团活动专用)",domain:"www.goofish.com",strategy:C.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"order_id",required:!0,positional:!0,help:"订单号 bizOrderId"},{name:"item_id",required:!0,help:"商品 itemId"},{name:"buyer_id",required:!0,help:"买家 userId"}],columns:["order_id","ok"],func:async(x,B)=>{const F=Y(B.order_id,"order_id","2800000000000000000"),Q=Y(B.item_id,"item_id","1017530128619"),J=Y(B.buyer_id,"buyer_id","2208502750464");await x.goto(h);await x.wait(1);const V=await f(x,"order ship-freeshipping",{api:"mtop.idle.groupon.activity.seller.freeshipping",data:{bizOrderId:F,itemId:Number(Q),buyerId:Number(J)},version:"1.0"});return[{order_id:F,ok:!0,data:V}]}});export const __test__={normalizeStatus:q,normalizePage:L,ORDER_STATUS:j};
1
+ import{ArgumentError as w}from"@jackwener/opencli/errors";import{cli as l,Strategy as _}from"@jackwener/opencli/registry";import{HOME_URL as p,mtopRequest as g}from"./mtop.js";import{normalizeNumericId as c}from"./utils.js";const y=["ALL","WAITING_PAY","WAITING_SEND","WAITING_RECEIVE","WAITING_RATE","SUCCESS","REFUND"];function S(e){const r=String(e||"ALL").trim().toUpperCase();if(!y.includes(r))throw new w(`xianyu order --status must be one of: ${y.join(", ")}`);return r}function b(e,r){const t=String(e??"").trim();if(!t)return 1;if(!/^\d+$/.test(t)||Number(t)<1)throw new w(`xianyu order ${r} must be a positive integer`);return Number(t)}l({site:"xianyu",name:"order",access:"read",description:"列出卖家已售订单(可按状态筛选)",domain:"www.goofish.com",strategy:_.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"page",type:"int",default:1,help:"页码,从 1 开始"},{name:"page_size",type:"int",default:20,help:"每页条数"},{name:"status",default:"ALL",help:`订单状态筛选:${y.join(" / ")}`}],columns:["order_id","item_id","buyer_nick","status_str","total_price","create_time"],func:async(e,r)=>{const t=b(r.page,"page"),s=b(r.page_size,"page_size"),o=S(r.status);await e.goto(p);await e.wait(1);const u=(await g(e,"order list",{api:"mtop.taobao.idle.trade.merchant.sold.get",data:{pageNumber:t,rowsPerPage:s,orderIds:"",queryCode:o,orderSearchParam:"{}"},version:"1.0"})).module||{},d=(Array.isArray(u.items)?u.items:[]).map((a)=>{const i=a.order||a.orderInfo||a,m=a.buyer||a.buyerInfo||{},I=a.item||a.itemInfo||{};return{order_id:String(i.orderId||i.bizOrderId||i.id||""),item_id:String(I.itemId||I.id||""),item_title:I.title||"",buyer_id:String(m.userId||m.buyerId||""),buyer_nick:m.nick||m.userNick||"",status:i.status??i.orderStatus??"",status_str:i.statusStr||i.orderStatusStr||"",total_price:String(i.totalPrice||i.actualPrice||""),create_time:String(i.createTime||i.gmtCreate||"")}});return d.length?d:[{order_id:"",status_str:"(无已售订单)",total_price:"",buyer_nick:"",item_id:"",create_time:""}]}});l({site:"xianyu",name:"order-get",access:"read",description:"查询单个闲鱼订单详情",domain:"www.goofish.com",strategy:_.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"order_id",required:!0,positional:!0,help:"订单号 orderId"},{name:"role",default:"seller",help:"视角:seller / buyer"}],columns:["order_id","item_id","status_str","total_price","buyer_nick"],func:async(e,r)=>{const t=c(r.order_id,"order_id","2800000000000000000"),s=String(r.role||"seller").trim()==="buyer"?"buyer":"seller";await e.goto(p);await e.wait(1);const o=await g(e,"order get",{api:"mtop.idle.web.trade.order.detail",data:{orderId:t,role:s},version:"1.0"}),n=o.itemInfoDTO||{},u=o.buyerInfoDTO||{},f=o.sellerInfoDTO||{},d=o.priceInfoDTO||{},a=o.logisticsInfoDTO||{},i=o.statusInfoDTO||{};return[{order_id:t,role:s,item_id:String(n.itemId||""),title:n.title||"",main_pic:n.picUrl||"",quantity:Number(n.quantity||1),buyer_id:String(u.buyerId||""),buyer_nick:u.userNick||"",seller_id:String(f.sellerId||""),seller_nick:f.userNick||"",total_price:String(d.totalPrice||""),auction_price:String(d.auctionPrice||""),post_fee:String(d.postFee||""),status:i.orderStatus,status_str:i.orderStatusStr||"",logistic_no:a.logisticsNo||"",logistic_company:a.logisticsCompany||""}]}});l({site:"xianyu",name:"order-ship-dummy",access:"write",description:"虚拟发货(仅虚拟商品,无需物流单号)",domain:"www.goofish.com",strategy:_.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"order_id",required:!0,positional:!0,help:"订单号 orderId"},{name:"text",fromFile:!0,default:"",help:"发货附言(可选)"}],columns:["order_id","ok"],func:async(e,r)=>{const t=c(r.order_id,"order_id","2800000000000000000");await e.goto(p);await e.wait(1);const s=await g(e,"order ship-dummy",{api:"mtop.taobao.idle.logistic.consign.dummy",data:{orderId:t,tradeText:String(r.text||""),picList:[],newUnconsign:!0},version:"1.0"});return[{order_id:t,ok:!0,data:s}]}});l({site:"xianyu",name:"order-ship-freeshipping",access:"write",description:"包邮发货(拼团活动专用)",domain:"www.goofish.com",strategy:_.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"order_id",required:!0,positional:!0,help:"订单号 bizOrderId"},{name:"item_id",required:!0,help:"商品 itemId"},{name:"buyer_id",required:!0,help:"买家 userId"}],columns:["order_id","ok"],func:async(e,r)=>{const t=c(r.order_id,"order_id","2800000000000000000"),s=c(r.item_id,"item_id","1017530128619"),o=c(r.buyer_id,"buyer_id","2208502750464");await e.goto(p);await e.wait(1);const n=await g(e,"order ship-freeshipping",{api:"mtop.idle.groupon.activity.seller.freeshipping",data:{bizOrderId:t,itemId:Number(s),buyerId:Number(o)},version:"1.0"});return[{order_id:t,ok:!0,data:n}]}});export const __test__={normalizeStatus:S,normalizePage:b,ORDER_STATUS:y};
@@ -1,2 +1,2 @@
1
- import{CommandExecutionError as C,ArgumentError as H}from"@jackwener/opencli/errors";import{cli as M,Strategy as O}from"@jackwener/opencli/registry";const Z={today:"今日",yesterday:"昨日",recent7d:"近7日",recent30d:"近30日",recent90d:"近90日"},S="https://seller.goofish.com/?site=COMMONPRO#/seller-ad/home";function $(){const B=[],I=(z,f,q)=>{if(z&&f!==""&&f!=null)B.push({metric:z,value:f,compare:q||""})};document.querySelectorAll('[class*="metricCard--"]').forEach((z)=>{const f=(z.innerText||"").split(`
2
- `).map((U)=>U.trim()).filter(Boolean);if(f.length<2)return;const q=f[0],L=f[1],Y=f.slice(2).join(" ");I(q,L,Y)});const P=(z)=>{const f=Array.from(document.querySelectorAll("div,span")).filter((q)=>q.children.length===0&&(q.innerText||"").trim().replace(/(.*)|\(.*\)/g,"")===z);for(const q of f){let L=q.parentElement;for(let Y=0;Y<3&&L;Y++){const U=(L.innerText||"").match(/-?[\d,]+(\.\d+)?%?/);if(U&&U[0]!==z)return U[0];L=L.parentElement}}return null};[["擦亮中计划","擦亮中计划"],["已暂停擦亮计划","已暂停擦亮计划"],["即将消耗完成计划","即将消耗完成计划"],["已完成擦亮计划","已完成擦亮计划"]].forEach(([z,f])=>{const q=P(f);if(q!=null)I(z,q,"")});const Q=document.body?document.body.innerText.replace(/\s+/g," "):"",J=/[^\d-]*(-?[\d,]+(?:\s*\.\s*\d+)?)/,W=Q.match(new RegExp("可用余额[((]元[))]"+J.source));if(W)I("可用余额(元)",W[1].replace(/\s+/g,""),"");const F=Q.match(new RegExp("今日花费[((]元[))]"+J.source));if(F)I("今日花费(元)",F[1].replace(/\s+/g,""),"");return B}M({site:"xianyu",name:"promote-stats",access:"read",description:"读超级擦亮(付费推广)投放数据:花费/曝光/点击/询单/下单/单次成本 + 账户余额 + 计划状态",domain:"seller.goofish.com",strategy:O.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"range",default:"today",help:"时间范围:today / yesterday / recent7d / recent30d / recent90d"}],columns:["metric","value","compare"],func:async(B,I)=>{const P=String(I.range||"today").trim(),Q=Z[P];if(!Q)throw new H(`--range 只能是 ${Object.keys(Z).join(" / ")},收到 "${P}"`);await B.goto(S);await B.wait(4);if(P!=="today"){await B.evaluate((W)=>{Array.from(document.querySelectorAll("label,span,div,button")).filter((F)=>F.children.length===0&&(F.innerText||"").trim()===W).forEach((F)=>F.click())},Q);await B.wait(2)}const J=await B.evaluate($);if(!Array.isArray(J)||J.length===0)throw new C("未读到擦亮数据 —— 可能未开通超级擦亮 / 未登录 / 页面改版");return J}});export const __test__={readAdDashboard:$,RANGE_TEXT:Z};
1
+ import{CommandExecutionError as h,ArgumentError as p}from"@jackwener/opencli/errors";import{cli as g,Strategy as w}from"@jackwener/opencli/registry";const f={today:"今日",yesterday:"昨日",recent7d:"近7日",recent30d:"近30日",recent90d:"近90日"},E="https://seller.goofish.com/?site=COMMONPRO#/seller-ad/home";function y(){const n=[],a=(r,e,t)=>{if(r&&e!==""&&e!=null)n.push({metric:r,value:e,compare:t||""})};document.querySelectorAll('[class*="metricCard--"]').forEach((r)=>{const e=(r.innerText||"").split(`
2
+ `).map((d)=>d.trim()).filter(Boolean);if(e.length<2)return;const t=e[0],s=e[1],u=e.slice(2).join(" ");a(t,s,u)});const i=(r)=>{const e=Array.from(document.querySelectorAll("div,span")).filter((t)=>t.children.length===0&&(t.innerText||"").trim().replace(/(.*)|\(.*\)/g,"")===r);for(const t of e){let s=t.parentElement;for(let u=0;u<3&&s;u++){const d=(s.innerText||"").match(/-?[\d,]+(\.\d+)?%?/);if(d&&d[0]!==r)return d[0];s=s.parentElement}}return null};[["擦亮中计划","擦亮中计划"],["已暂停擦亮计划","已暂停擦亮计划"],["即将消耗完成计划","即将消耗完成计划"],["已完成擦亮计划","已完成擦亮计划"]].forEach(([r,e])=>{const t=i(e);if(t!=null)a(r,t,"")});const l=document.body?document.body.innerText.replace(/\s+/g," "):"",c=/[^\d-]*(-?[\d,]+(?:\s*\.\s*\d+)?)/,m=l.match(new RegExp("可用余额[((]元[))]"+c.source));if(m)a("可用余额(元)",m[1].replace(/\s+/g,""),"");const o=l.match(new RegExp("今日花费[((]元[))]"+c.source));if(o)a("今日花费(元)",o[1].replace(/\s+/g,""),"");return n}g({site:"xianyu",name:"promote-stats",access:"read",description:"读超级擦亮(付费推广)投放数据:花费/曝光/点击/询单/下单/单次成本 + 账户余额 + 计划状态",domain:"seller.goofish.com",strategy:w.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"range",default:"today",help:"时间范围:today / yesterday / recent7d / recent30d / recent90d"}],columns:["metric","value","compare"],func:async(n,a)=>{const i=String(a.range||"today").trim(),l=f[i];if(!l)throw new p(`--range 只能是 ${Object.keys(f).join(" / ")},收到 "${i}"`);await n.goto(E);await n.wait(4);if(i!=="today"){await n.evaluate((m)=>{Array.from(document.querySelectorAll("label,span,div,button")).filter((o)=>o.children.length===0&&(o.innerText||"").trim()===m).forEach((o)=>o.click())},l);await n.wait(2)}const c=await n.evaluate(y);if(!Array.isArray(c)||c.length===0)throw new h("未读到擦亮数据 —— 可能未开通超级擦亮 / 未登录 / 页面改版");return c}});export const __test__={readAdDashboard:y,RANGE_TEXT:f};