@sovovs/bycli 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +191 -0
- package/NOTICE +27 -0
- package/README.md +41 -0
- package/README.zh-CN.md +39 -0
- package/cli-manifest.json +32818 -0
- package/clis/12306/me.js +73 -0
- package/clis/12306/orders.js +96 -0
- package/clis/12306/passengers.js +90 -0
- package/clis/12306/price.js +166 -0
- package/clis/12306/stations.js +66 -0
- package/clis/12306/train.js +91 -0
- package/clis/12306/trains.js +119 -0
- package/clis/12306/utils.js +272 -0
- package/clis/12306/utils.test.js +331 -0
- package/clis/1688/assets.js +205 -0
- package/clis/1688/assets.test.js +39 -0
- package/clis/1688/download.js +77 -0
- package/clis/1688/download.test.js +31 -0
- package/clis/1688/item.js +188 -0
- package/clis/1688/item.test.js +67 -0
- package/clis/1688/search.js +310 -0
- package/clis/1688/search.test.js +75 -0
- package/clis/1688/shared.js +557 -0
- package/clis/1688/shared.test.js +57 -0
- package/clis/1688/store.js +227 -0
- package/clis/1688/store.test.js +62 -0
- package/clis/1point3acres/digest.js +35 -0
- package/clis/1point3acres/forum.js +51 -0
- package/clis/1point3acres/forums.js +44 -0
- package/clis/1point3acres/hot.js +35 -0
- package/clis/1point3acres/latest.js +35 -0
- package/clis/1point3acres/notifications.js +64 -0
- package/clis/1point3acres/search.js +71 -0
- package/clis/1point3acres/thread.js +117 -0
- package/clis/1point3acres/user.js +77 -0
- package/clis/1point3acres/utils.js +247 -0
- package/clis/36kr/article.js +66 -0
- package/clis/36kr/article.test.js +46 -0
- package/clis/36kr/hot.js +87 -0
- package/clis/36kr/hot.test.js +15 -0
- package/clis/36kr/news.js +52 -0
- package/clis/36kr/news.test.js +85 -0
- package/clis/36kr/search.js +79 -0
- package/clis/51job/company.js +126 -0
- package/clis/51job/detail.js +109 -0
- package/clis/51job/hot.js +56 -0
- package/clis/51job/search.js +80 -0
- package/clis/51job/utils.js +302 -0
- package/clis/51job/utils.test.js +69 -0
- package/clis/_atlassian/shared.js +577 -0
- package/clis/_atlassian/shared.test.js +170 -0
- package/clis/_shared/common.js +32 -0
- package/clis/_shared/desktop-commands.js +112 -0
- package/clis/_shared/search-adapter.js +70 -0
- package/clis/aibase/news.js +110 -0
- package/clis/aibase/news.test.js +59 -0
- package/clis/amazon/bestsellers.js +8 -0
- package/clis/amazon/bestsellers.test.js +29 -0
- package/clis/amazon/discussion.js +123 -0
- package/clis/amazon/discussion.test.js +124 -0
- package/clis/amazon/movers-shakers.js +8 -0
- package/clis/amazon/new-releases.js +8 -0
- package/clis/amazon/offer.js +141 -0
- package/clis/amazon/offer.test.js +29 -0
- package/clis/amazon/product.js +93 -0
- package/clis/amazon/product.test.js +24 -0
- package/clis/amazon/rankings.js +227 -0
- package/clis/amazon/rankings.test.js +41 -0
- package/clis/amazon/search.js +88 -0
- package/clis/amazon/search.test.js +22 -0
- package/clis/amazon/shared.js +365 -0
- package/clis/amazon/shared.test.js +44 -0
- package/clis/antigravity/SKILL.md +38 -0
- package/clis/antigravity/dump.js +29 -0
- package/clis/antigravity/extract-code.js +33 -0
- package/clis/antigravity/model.js +45 -0
- package/clis/antigravity/new.js +26 -0
- package/clis/antigravity/read.js +35 -0
- package/clis/antigravity/send.js +36 -0
- package/clis/antigravity/serve.js +558 -0
- package/clis/antigravity/status.js +19 -0
- package/clis/antigravity/watch.js +43 -0
- package/clis/apple-podcasts/commands.test.js +119 -0
- package/clis/apple-podcasts/episodes.js +29 -0
- package/clis/apple-podcasts/search.js +31 -0
- package/clis/apple-podcasts/top.js +45 -0
- package/clis/apple-podcasts/utils.js +30 -0
- package/clis/apple-podcasts/utils.test.js +57 -0
- package/clis/arxiv/arxiv.test.js +112 -0
- package/clis/arxiv/author.js +44 -0
- package/clis/arxiv/paper.js +22 -0
- package/clis/arxiv/recent.js +33 -0
- package/clis/arxiv/search.js +36 -0
- package/clis/arxiv/utils.js +112 -0
- package/clis/baidu-scholar/search.js +87 -0
- package/clis/baidu-scholar/search.test.js +23 -0
- package/clis/band/bands.js +73 -0
- package/clis/band/mentions.js +128 -0
- package/clis/band/post.js +176 -0
- package/clis/band/posts.js +95 -0
- package/clis/barchart/flow.js +116 -0
- package/clis/barchart/greeks.js +208 -0
- package/clis/barchart/greeks.test.js +138 -0
- package/clis/barchart/options.js +107 -0
- package/clis/barchart/quote.js +135 -0
- package/clis/bbc/news.js +42 -0
- package/clis/bbc/topic.js +57 -0
- package/clis/bbc/utils.js +79 -0
- package/clis/bilibili/comment.js +125 -0
- package/clis/bilibili/comment.test.js +153 -0
- package/clis/bilibili/comments.js +136 -0
- package/clis/bilibili/comments.test.js +142 -0
- package/clis/bilibili/download.js +82 -0
- package/clis/bilibili/dynamic.js +34 -0
- package/clis/bilibili/dynamic.test.js +68 -0
- package/clis/bilibili/favorite.js +47 -0
- package/clis/bilibili/feed.js +220 -0
- package/clis/bilibili/following.js +44 -0
- package/clis/bilibili/history.js +45 -0
- package/clis/bilibili/hot.js +40 -0
- package/clis/bilibili/hot.test.js +17 -0
- package/clis/bilibili/me.js +13 -0
- package/clis/bilibili/ranking.js +25 -0
- package/clis/bilibili/search.js +24 -0
- package/clis/bilibili/subtitle.js +138 -0
- package/clis/bilibili/subtitle.test.js +196 -0
- package/clis/bilibili/summary.js +167 -0
- package/clis/bilibili/summary.test.js +210 -0
- package/clis/bilibili/user-videos.js +39 -0
- package/clis/bilibili/utils.js +184 -0
- package/clis/bilibili/utils.test.js +61 -0
- package/clis/bilibili/video.js +69 -0
- package/clis/bilibili/video.test.js +132 -0
- package/clis/binance/asks.js +22 -0
- package/clis/binance/commands.test.js +70 -0
- package/clis/binance/depth.js +21 -0
- package/clis/binance/gainers.js +23 -0
- package/clis/binance/klines.js +22 -0
- package/clis/binance/losers.js +23 -0
- package/clis/binance/pairs.js +22 -0
- package/clis/binance/price.js +19 -0
- package/clis/binance/prices.js +20 -0
- package/clis/binance/ticker.js +22 -0
- package/clis/binance/top.js +22 -0
- package/clis/binance/trades.js +21 -0
- package/clis/bloomberg/businessweek.js +18 -0
- package/clis/bloomberg/economics.js +18 -0
- package/clis/bloomberg/feeds.js +16 -0
- package/clis/bloomberg/industries.js +18 -0
- package/clis/bloomberg/main.js +18 -0
- package/clis/bloomberg/markets.js +18 -0
- package/clis/bloomberg/news.js +106 -0
- package/clis/bloomberg/opinions.js +18 -0
- package/clis/bloomberg/politics.js +18 -0
- package/clis/bloomberg/tech.js +18 -0
- package/clis/bloomberg/utils.js +364 -0
- package/clis/bloomberg/utils.test.js +129 -0
- package/clis/bluesky/feeds.js +28 -0
- package/clis/bluesky/followers.js +28 -0
- package/clis/bluesky/following.js +28 -0
- package/clis/bluesky/profile.js +30 -0
- package/clis/bluesky/search.js +29 -0
- package/clis/bluesky/starter-packs.js +29 -0
- package/clis/bluesky/thread.js +31 -0
- package/clis/bluesky/trending.js +20 -0
- package/clis/bluesky/user.js +35 -0
- package/clis/booking/booking.test.js +356 -0
- package/clis/booking/search.js +351 -0
- package/clis/boss/batchgreet.js +61 -0
- package/clis/boss/chatlist.js +116 -0
- package/clis/boss/chatlist.test.js +211 -0
- package/clis/boss/chatmsg.js +117 -0
- package/clis/boss/chatmsg.test.js +230 -0
- package/clis/boss/detail.js +63 -0
- package/clis/boss/exchange.js +46 -0
- package/clis/boss/greet.js +49 -0
- package/clis/boss/invite.js +64 -0
- package/clis/boss/joblist.js +31 -0
- package/clis/boss/mark.js +70 -0
- package/clis/boss/recommend.js +45 -0
- package/clis/boss/resume.js +150 -0
- package/clis/boss/search.js +197 -0
- package/clis/boss/search.test.js +78 -0
- package/clis/boss/send.js +44 -0
- package/clis/boss/stats.js +66 -0
- package/clis/boss/utils.js +468 -0
- package/clis/boss/utils.test.js +34 -0
- package/clis/brave/search.js +80 -0
- package/clis/brave/search.test.js +76 -0
- package/clis/chaoxing/assignments.js +76 -0
- package/clis/chaoxing/exams.js +75 -0
- package/clis/chaoxing/utils.js +223 -0
- package/clis/chaoxing/utils.test.js +45 -0
- package/clis/chatgpt/ask.js +58 -0
- package/clis/chatgpt/commands.test.js +45 -0
- package/clis/chatgpt/detail.js +51 -0
- package/clis/chatgpt/envelope.test.js +108 -0
- package/clis/chatgpt/history.js +39 -0
- package/clis/chatgpt/image.js +162 -0
- package/clis/chatgpt/image.test.js +188 -0
- package/clis/chatgpt/new.js +25 -0
- package/clis/chatgpt/read.js +44 -0
- package/clis/chatgpt/send.js +47 -0
- package/clis/chatgpt/status.js +29 -0
- package/clis/chatgpt/utils.js +961 -0
- package/clis/chatgpt/utils.test.js +330 -0
- package/clis/chatgpt-app/ask.js +76 -0
- package/clis/chatgpt-app/ax.js +385 -0
- package/clis/chatgpt-app/ax.test.js +35 -0
- package/clis/chatgpt-app/model.js +25 -0
- package/clis/chatgpt-app/new.js +28 -0
- package/clis/chatgpt-app/read.js +32 -0
- package/clis/chatgpt-app/send.js +34 -0
- package/clis/chatgpt-app/status.js +26 -0
- package/clis/chatwise/ask.js +54 -0
- package/clis/chatwise/composer.test.js +186 -0
- package/clis/chatwise/export.js +47 -0
- package/clis/chatwise/history.js +61 -0
- package/clis/chatwise/model.js +85 -0
- package/clis/chatwise/new.js +2 -0
- package/clis/chatwise/read.js +40 -0
- package/clis/chatwise/screenshot.js +2 -0
- package/clis/chatwise/send.js +28 -0
- package/clis/chatwise/status.js +2 -0
- package/clis/chatwise/utils.js +143 -0
- package/clis/chess/analyze.js +35 -0
- package/clis/chess/analyze.test.js +79 -0
- package/clis/chess/game.js +114 -0
- package/clis/chess/game.test.js +178 -0
- package/clis/chess/games.js +67 -0
- package/clis/chess/games.test.js +164 -0
- package/clis/chess/stats.js +32 -0
- package/clis/chess/stats.test.js +79 -0
- package/clis/chess/utils.js +170 -0
- package/clis/chess/utils.test.js +230 -0
- package/clis/claude/ask.js +144 -0
- package/clis/claude/ask.test.js +338 -0
- package/clis/claude/commands.test.js +118 -0
- package/clis/claude/detail.js +38 -0
- package/clis/claude/history.js +33 -0
- package/clis/claude/new.js +29 -0
- package/clis/claude/read.js +27 -0
- package/clis/claude/send.js +48 -0
- package/clis/claude/status.js +26 -0
- package/clis/claude/utils.js +463 -0
- package/clis/claude/utils.test.js +148 -0
- package/clis/cnki/search.js +61 -0
- package/clis/cnki/search.test.js +18 -0
- package/clis/codex/ask.js +78 -0
- package/clis/codex/dump.js +2 -0
- package/clis/codex/export.js +38 -0
- package/clis/codex/extract-diff.js +45 -0
- package/clis/codex/history.js +27 -0
- package/clis/codex/model.js +56 -0
- package/clis/codex/new.js +2 -0
- package/clis/codex/projects.js +28 -0
- package/clis/codex/read.js +41 -0
- package/clis/codex/screenshot.js +2 -0
- package/clis/codex/send.js +51 -0
- package/clis/codex/sidebar.js +356 -0
- package/clis/codex/sidebar.test.js +329 -0
- package/clis/codex/status.js +2 -0
- package/clis/coingecko/categories.js +75 -0
- package/clis/coingecko/coin.js +107 -0
- package/clis/coingecko/coingecko.test.js +109 -0
- package/clis/coingecko/derivatives.js +84 -0
- package/clis/coingecko/exchanges.js +74 -0
- package/clis/coingecko/global.js +71 -0
- package/clis/coingecko/top.js +64 -0
- package/clis/coingecko/trending.js +55 -0
- package/clis/confluence/commands.test.js +195 -0
- package/clis/confluence/create.js +39 -0
- package/clis/confluence/page.js +23 -0
- package/clis/confluence/search.js +34 -0
- package/clis/confluence/shared.js +173 -0
- package/clis/confluence/update.js +38 -0
- package/clis/coupang/add-to-cart.js +149 -0
- package/clis/coupang/coupang.test.js +159 -0
- package/clis/coupang/product.js +257 -0
- package/clis/coupang/search.js +474 -0
- package/clis/coupang/utils.js +316 -0
- package/clis/coupang/utils.test.js +62 -0
- package/clis/crates/crate.js +62 -0
- package/clis/crates/search.js +44 -0
- package/clis/crates/utils.js +72 -0
- package/clis/ctrip/ctrip.test.js +719 -0
- package/clis/ctrip/flight.js +136 -0
- package/clis/ctrip/hotel-search.js +132 -0
- package/clis/ctrip/hotel-suggest.js +45 -0
- package/clis/ctrip/search.js +41 -0
- package/clis/ctrip/utils.js +473 -0
- package/clis/cursor/ask.js +74 -0
- package/clis/cursor/composer.js +43 -0
- package/clis/cursor/dump.js +2 -0
- package/clis/cursor/export.js +52 -0
- package/clis/cursor/extract-code.js +36 -0
- package/clis/cursor/history.js +44 -0
- package/clis/cursor/model.js +54 -0
- package/clis/cursor/new.js +2 -0
- package/clis/cursor/read.js +45 -0
- package/clis/cursor/screenshot.js +2 -0
- package/clis/cursor/send.js +41 -0
- package/clis/cursor/status.js +2 -0
- package/clis/dblp/author.js +133 -0
- package/clis/dblp/dblp.test.js +397 -0
- package/clis/dblp/paper.js +40 -0
- package/clis/dblp/search.js +45 -0
- package/clis/dblp/utils.js +290 -0
- package/clis/dblp/venue.js +64 -0
- package/clis/deepseek/ask.js +158 -0
- package/clis/deepseek/ask.test.js +312 -0
- package/clis/deepseek/detail.js +46 -0
- package/clis/deepseek/detail.test.js +81 -0
- package/clis/deepseek/history.js +27 -0
- package/clis/deepseek/new.js +33 -0
- package/clis/deepseek/read.js +25 -0
- package/clis/deepseek/send.js +140 -0
- package/clis/deepseek/send.test.js +107 -0
- package/clis/deepseek/status.js +26 -0
- package/clis/deepseek/utils.js +487 -0
- package/clis/deepseek/utils.test.js +370 -0
- package/clis/defillama/defillama.test.js +99 -0
- package/clis/defillama/protocol.js +84 -0
- package/clis/defillama/protocols.js +55 -0
- package/clis/defillama/utils.js +99 -0
- package/clis/devto/devto.test.js +236 -0
- package/clis/devto/latest.js +74 -0
- package/clis/devto/read.js +103 -0
- package/clis/devto/tag.js +36 -0
- package/clis/devto/top.js +30 -0
- package/clis/devto/user.js +35 -0
- package/clis/dianping/__fixtures__/search.html +168 -0
- package/clis/dianping/__fixtures__/shop.html +6 -0
- package/clis/dianping/cityResolver.js +185 -0
- package/clis/dianping/dianping.test.js +578 -0
- package/clis/dianping/search.js +157 -0
- package/clis/dianping/shop.js +173 -0
- package/clis/dianping/utils.js +157 -0
- package/clis/dictionary/examples.js +28 -0
- package/clis/dictionary/search.js +30 -0
- package/clis/dictionary/synonyms.js +28 -0
- package/clis/discord-app/channels.js +58 -0
- package/clis/discord-app/delete.js +115 -0
- package/clis/discord-app/members.js +39 -0
- package/clis/discord-app/read.js +46 -0
- package/clis/discord-app/search.js +57 -0
- package/clis/discord-app/send.js +28 -0
- package/clis/discord-app/servers.js +37 -0
- package/clis/discord-app/status.js +17 -0
- package/clis/dockerhub/image.js +52 -0
- package/clis/dockerhub/search.js +47 -0
- package/clis/dockerhub/utils.js +100 -0
- package/clis/douban/book-hot.js +15 -0
- package/clis/douban/download.js +68 -0
- package/clis/douban/download.test.js +170 -0
- package/clis/douban/marks.js +116 -0
- package/clis/douban/movie-hot.js +15 -0
- package/clis/douban/movie-hot.test.js +14 -0
- package/clis/douban/photos.js +35 -0
- package/clis/douban/reviews.js +107 -0
- package/clis/douban/search.js +18 -0
- package/clis/douban/search.test.js +11 -0
- package/clis/douban/subject.js +46 -0
- package/clis/douban/subject.test.js +11 -0
- package/clis/douban/top250.js +68 -0
- package/clis/douban/utils.js +656 -0
- package/clis/douban/utils.test.js +438 -0
- package/clis/doubao/ask.js +40 -0
- package/clis/doubao/detail.js +35 -0
- package/clis/doubao/detail.test.js +42 -0
- package/clis/doubao/history.js +30 -0
- package/clis/doubao/history.test.js +37 -0
- package/clis/doubao/meeting-summary.js +41 -0
- package/clis/doubao/meeting-transcript.js +38 -0
- package/clis/doubao/new.js +22 -0
- package/clis/doubao/read.js +21 -0
- package/clis/doubao/send.js +24 -0
- package/clis/doubao/status.js +26 -0
- package/clis/doubao/utils.js +1149 -0
- package/clis/doubao/utils.test.js +344 -0
- package/clis/doubao-app/ask.js +54 -0
- package/clis/doubao-app/dump.js +25 -0
- package/clis/doubao-app/new.js +21 -0
- package/clis/doubao-app/read.js +19 -0
- package/clis/doubao-app/screenshot.js +19 -0
- package/clis/doubao-app/send.js +28 -0
- package/clis/doubao-app/status.js +17 -0
- package/clis/doubao-app/utils.js +110 -0
- package/clis/douyin/_shared/browser-fetch.js +66 -0
- package/clis/douyin/_shared/browser-fetch.test.js +64 -0
- package/clis/douyin/_shared/creation-id.js +5 -0
- package/clis/douyin/_shared/creation-id.test.js +22 -0
- package/clis/douyin/_shared/evaluate-result.js +16 -0
- package/clis/douyin/_shared/imagex-upload.js +53 -0
- package/clis/douyin/_shared/imagex-upload.test.js +87 -0
- package/clis/douyin/_shared/public-api.js +29 -0
- package/clis/douyin/_shared/sts2.js +21 -0
- package/clis/douyin/_shared/sts2.test.js +27 -0
- package/clis/douyin/_shared/text-extra.js +15 -0
- package/clis/douyin/_shared/text-extra.test.js +37 -0
- package/clis/douyin/_shared/timing.js +22 -0
- package/clis/douyin/_shared/timing.test.js +28 -0
- package/clis/douyin/_shared/tos-upload-short-read.test.js +83 -0
- package/clis/douyin/_shared/tos-upload.js +331 -0
- package/clis/douyin/_shared/tos-upload.test.js +229 -0
- package/clis/douyin/_shared/transcode.js +45 -0
- package/clis/douyin/_shared/transcode.test.js +91 -0
- package/clis/douyin/_shared/types.js +1 -0
- package/clis/douyin/_shared/vod-upload.js +212 -0
- package/clis/douyin/_shared/vod-upload.test.js +38 -0
- package/clis/douyin/activities.js +23 -0
- package/clis/douyin/activities.test.js +55 -0
- package/clis/douyin/collections.js +23 -0
- package/clis/douyin/collections.test.js +45 -0
- package/clis/douyin/delete.js +152 -0
- package/clis/douyin/delete.test.js +100 -0
- package/clis/douyin/draft.js +355 -0
- package/clis/douyin/draft.test.js +335 -0
- package/clis/douyin/drafts.js +24 -0
- package/clis/douyin/drafts.test.js +11 -0
- package/clis/douyin/hashtag.js +114 -0
- package/clis/douyin/hashtag.test.js +171 -0
- package/clis/douyin/location.js +25 -0
- package/clis/douyin/location.test.js +23 -0
- package/clis/douyin/profile.js +29 -0
- package/clis/douyin/profile.test.js +46 -0
- package/clis/douyin/publish-upload-id.test.js +170 -0
- package/clis/douyin/publish.js +335 -0
- package/clis/douyin/publish.test.js +38 -0
- package/clis/douyin/stats.js +28 -0
- package/clis/douyin/stats.test.js +22 -0
- package/clis/douyin/update.js +32 -0
- package/clis/douyin/update.test.js +11 -0
- package/clis/douyin/user-videos.js +82 -0
- package/clis/douyin/user-videos.test.js +151 -0
- package/clis/douyin/videos.js +52 -0
- package/clis/douyin/videos.test.js +54 -0
- package/clis/duckduckgo/search.js +131 -0
- package/clis/duckduckgo/search.test.js +128 -0
- package/clis/duckduckgo/suggest.js +45 -0
- package/clis/duckduckgo/suggest.test.js +66 -0
- package/clis/eastmoney/_secid.js +78 -0
- package/clis/eastmoney/announcement.js +53 -0
- package/clis/eastmoney/convertible.js +74 -0
- package/clis/eastmoney/etf.js +66 -0
- package/clis/eastmoney/holders.js +79 -0
- package/clis/eastmoney/hot-rank.js +51 -0
- package/clis/eastmoney/hot-rank.test.js +59 -0
- package/clis/eastmoney/index-board.js +97 -0
- package/clis/eastmoney/kline.js +88 -0
- package/clis/eastmoney/kuaixun.js +55 -0
- package/clis/eastmoney/longhu.js +68 -0
- package/clis/eastmoney/money-flow.js +79 -0
- package/clis/eastmoney/northbound.js +58 -0
- package/clis/eastmoney/quote.js +108 -0
- package/clis/eastmoney/rank.js +95 -0
- package/clis/eastmoney/sectors.js +77 -0
- package/clis/endoflife/endoflife.test.js +51 -0
- package/clis/endoflife/product.js +55 -0
- package/clis/endoflife/utils.js +89 -0
- package/clis/facebook/__fixtures__/notifications-page.html +13 -0
- package/clis/facebook/add-friend.js +44 -0
- package/clis/facebook/events.js +41 -0
- package/clis/facebook/feed.js +305 -0
- package/clis/facebook/feed.test.js +169 -0
- package/clis/facebook/friends.js +39 -0
- package/clis/facebook/groups.js +47 -0
- package/clis/facebook/join-group.js +45 -0
- package/clis/facebook/marketplace-inbox.js +84 -0
- package/clis/facebook/marketplace-listings.js +84 -0
- package/clis/facebook/marketplace.test.js +91 -0
- package/clis/facebook/memories.js +36 -0
- package/clis/facebook/notifications.js +333 -0
- package/clis/facebook/notifications.test.js +458 -0
- package/clis/facebook/profile.js +38 -0
- package/clis/facebook/search.js +39 -0
- package/clis/facebook/search.test.js +55 -0
- package/clis/flathub/app.js +71 -0
- package/clis/flathub/flathub.test.js +90 -0
- package/clis/flathub/search.js +80 -0
- package/clis/flathub/utils.js +114 -0
- package/clis/flomo/memos.js +228 -0
- package/clis/flomo/memos.test.js +144 -0
- package/clis/gemini/ask.js +51 -0
- package/clis/gemini/ask.test.js +100 -0
- package/clis/gemini/deep-research-result.js +96 -0
- package/clis/gemini/deep-research-result.test.js +155 -0
- package/clis/gemini/deep-research.js +103 -0
- package/clis/gemini/deep-research.test.js +181 -0
- package/clis/gemini/image.js +111 -0
- package/clis/gemini/new.js +22 -0
- package/clis/gemini/reply-state.test.js +671 -0
- package/clis/gemini/utils.js +1938 -0
- package/clis/gemini/utils.test.js +198 -0
- package/clis/geogebra/add-circle.js +46 -0
- package/clis/geogebra/add-line.js +35 -0
- package/clis/geogebra/add-point.js +27 -0
- package/clis/geogebra/add-polygon.js +25 -0
- package/clis/geogebra/eval.js +35 -0
- package/clis/geogebra/geogebra.test.js +175 -0
- package/clis/geogebra/hexagon.js +62 -0
- package/clis/geogebra/info.js +72 -0
- package/clis/geogebra/list.js +35 -0
- package/clis/geogebra/triangle.js +60 -0
- package/clis/geogebra/utils.js +271 -0
- package/clis/gitee/index.js +3 -0
- package/clis/gitee/search.js +137 -0
- package/clis/gitee/search.test.js +65 -0
- package/clis/gitee/trending.js +568 -0
- package/clis/gitee/user.js +200 -0
- package/clis/gitee/user.test.js +63 -0
- package/clis/google/news.js +59 -0
- package/clis/google/search.js +138 -0
- package/clis/google/suggest.js +35 -0
- package/clis/google/trends.js +39 -0
- package/clis/google/utils.js +23 -0
- package/clis/google/utils.test.js +75 -0
- package/clis/google-scholar/cite.js +74 -0
- package/clis/google-scholar/cite.test.js +47 -0
- package/clis/google-scholar/profile.js +92 -0
- package/clis/google-scholar/profile.test.js +49 -0
- package/clis/google-scholar/search.js +73 -0
- package/clis/google-scholar/search.test.js +71 -0
- package/clis/goproxy/goproxy.test.js +103 -0
- package/clis/goproxy/module.js +47 -0
- package/clis/goproxy/utils.js +165 -0
- package/clis/goproxy/versions.js +59 -0
- package/clis/gov-law/commands.test.js +39 -0
- package/clis/gov-law/recent.js +22 -0
- package/clis/gov-law/search.js +41 -0
- package/clis/gov-law/shared.js +51 -0
- package/clis/gov-policy/__fixtures__/recent.html +16 -0
- package/clis/gov-policy/__fixtures__/search.html +41 -0
- package/clis/gov-policy/gov-policy.test.js +224 -0
- package/clis/gov-policy/recent.js +90 -0
- package/clis/gov-policy/search.js +91 -0
- package/clis/gov-policy/utils.js +54 -0
- package/clis/grok/ask.js +77 -0
- package/clis/grok/ask.test.js +29 -0
- package/clis/grok/detail.js +60 -0
- package/clis/grok/history.js +48 -0
- package/clis/grok/image.js +343 -0
- package/clis/grok/image.test.ts +127 -0
- package/clis/grok/new.js +20 -0
- package/clis/grok/read.js +39 -0
- package/clis/grok/send.js +50 -0
- package/clis/grok/status.js +41 -0
- package/clis/grok/utils.js +326 -0
- package/clis/grok/utils.test.js +103 -0
- package/clis/hackernews/ask.js +31 -0
- package/clis/hackernews/best.js +31 -0
- package/clis/hackernews/hackernews.test.js +132 -0
- package/clis/hackernews/jobs.js +29 -0
- package/clis/hackernews/new.js +31 -0
- package/clis/hackernews/read.js +188 -0
- package/clis/hackernews/search.js +38 -0
- package/clis/hackernews/show.js +31 -0
- package/clis/hackernews/top.js +31 -0
- package/clis/hackernews/user.js +23 -0
- package/clis/hf/datasets.js +88 -0
- package/clis/hf/hf.test.js +16 -0
- package/clis/hf/models.js +91 -0
- package/clis/hf/paper.js +79 -0
- package/clis/hf/spaces.js +101 -0
- package/clis/hf/top.js +121 -0
- package/clis/homebrew/cask.js +39 -0
- package/clis/homebrew/formula.js +41 -0
- package/clis/homebrew/popular.js +54 -0
- package/clis/homebrew/utils.js +100 -0
- package/clis/hupu/__fixtures__/hot-home.html +64 -0
- package/clis/hupu/detail.js +72 -0
- package/clis/hupu/hot.js +163 -0
- package/clis/hupu/hot.test.js +224 -0
- package/clis/hupu/like.js +76 -0
- package/clis/hupu/mentions.js +160 -0
- package/clis/hupu/reply.js +72 -0
- package/clis/hupu/search.js +60 -0
- package/clis/hupu/unlike.js +76 -0
- package/clis/hupu/utils.js +319 -0
- package/clis/imdb/person.js +204 -0
- package/clis/imdb/reviews.js +89 -0
- package/clis/imdb/search.js +162 -0
- package/clis/imdb/title.js +94 -0
- package/clis/imdb/top.js +54 -0
- package/clis/imdb/trending.js +53 -0
- package/clis/imdb/utils.js +285 -0
- package/clis/imdb/utils.test.js +88 -0
- package/clis/indeed/indeed.test.js +375 -0
- package/clis/indeed/job.js +86 -0
- package/clis/indeed/search.js +110 -0
- package/clis/indeed/utils.js +152 -0
- package/clis/instagram/_shared/private-publish.js +1030 -0
- package/clis/instagram/_shared/private-publish.test.js +705 -0
- package/clis/instagram/_shared/protocol-capture.js +282 -0
- package/clis/instagram/_shared/protocol-capture.test.js +114 -0
- package/clis/instagram/_shared/runtime-info.js +81 -0
- package/clis/instagram/collection-create.js +58 -0
- package/clis/instagram/collection-delete.js +92 -0
- package/clis/instagram/comment.js +48 -0
- package/clis/instagram/download.js +226 -0
- package/clis/instagram/download.test.js +118 -0
- package/clis/instagram/explore.js +42 -0
- package/clis/instagram/follow.js +44 -0
- package/clis/instagram/followers.js +46 -0
- package/clis/instagram/following.js +46 -0
- package/clis/instagram/like.js +46 -0
- package/clis/instagram/note.js +223 -0
- package/clis/instagram/note.test.js +53 -0
- package/clis/instagram/post.js +1497 -0
- package/clis/instagram/post.test.js +1647 -0
- package/clis/instagram/profile.js +40 -0
- package/clis/instagram/reel.js +827 -0
- package/clis/instagram/reel.test.js +167 -0
- package/clis/instagram/save.js +46 -0
- package/clis/instagram/saved.js +53 -0
- package/clis/instagram/search.js +39 -0
- package/clis/instagram/story.js +116 -0
- package/clis/instagram/story.test.js +134 -0
- package/clis/instagram/unfollow.js +41 -0
- package/clis/instagram/unlike.js +46 -0
- package/clis/instagram/unsave.js +46 -0
- package/clis/instagram/user.js +49 -0
- package/clis/jd/add-cart.js +72 -0
- package/clis/jd/cart.js +80 -0
- package/clis/jd/commands.test.js +41 -0
- package/clis/jd/detail.js +63 -0
- package/clis/jd/item.js +730 -0
- package/clis/jd/item.test.js +354 -0
- package/clis/jd/item.test.ts +517 -0
- package/clis/jd/reviews.js +55 -0
- package/clis/jd/search.js +66 -0
- package/clis/jianyu/detail.js +21 -0
- package/clis/jianyu/search.js +634 -0
- package/clis/jianyu/search.test.js +153 -0
- package/clis/jianyu/shared/china-bid-search.js +165 -0
- package/clis/jianyu/shared/procurement-contract.js +324 -0
- package/clis/jianyu/shared/procurement-contract.test.js +72 -0
- package/clis/jianyu/shared/procurement-detail.js +107 -0
- package/clis/jianyu/shared/procurement-detail.test.js +84 -0
- package/clis/jike/comment.js +107 -0
- package/clis/jike/create.js +106 -0
- package/clis/jike/feed.js +68 -0
- package/clis/jike/like.js +61 -0
- package/clis/jike/notifications.js +169 -0
- package/clis/jike/post.js +72 -0
- package/clis/jike/read.test.js +86 -0
- package/clis/jike/repost.js +103 -0
- package/clis/jike/search.js +68 -0
- package/clis/jike/topic.js +65 -0
- package/clis/jike/user.js +65 -0
- package/clis/jike/utils.js +25 -0
- package/clis/jimeng/generate.js +84 -0
- package/clis/jimeng/history.js +48 -0
- package/clis/jimeng/new.js +44 -0
- package/clis/jimeng/workspaces.js +42 -0
- package/clis/jira/attachments.js +28 -0
- package/clis/jira/commands.test.js +287 -0
- package/clis/jira/comments.js +28 -0
- package/clis/jira/issue.js +28 -0
- package/clis/jira/links.js +28 -0
- package/clis/jira/search.js +47 -0
- package/clis/jira/shared.js +256 -0
- package/clis/juejin/search.js +123 -0
- package/clis/juejin/search.test.js +98 -0
- package/clis/ke/chengjiao.js +78 -0
- package/clis/ke/ershoufang.js +101 -0
- package/clis/ke/utils.js +104 -0
- package/clis/ke/xiaoqu.js +78 -0
- package/clis/ke/zufang.js +95 -0
- package/clis/lesswrong/_helpers.js +75 -0
- package/clis/lesswrong/comments.js +65 -0
- package/clis/lesswrong/curated.js +31 -0
- package/clis/lesswrong/frontpage.js +31 -0
- package/clis/lesswrong/frontpage.test.js +37 -0
- package/clis/lesswrong/new.js +31 -0
- package/clis/lesswrong/read.js +46 -0
- package/clis/lesswrong/sequences.js +28 -0
- package/clis/lesswrong/shortform.js +31 -0
- package/clis/lesswrong/tag.js +46 -0
- package/clis/lesswrong/tags.js +28 -0
- package/clis/lesswrong/top-month.js +31 -0
- package/clis/lesswrong/top-week.js +31 -0
- package/clis/lesswrong/top-year.js +31 -0
- package/clis/lesswrong/top.js +31 -0
- package/clis/lesswrong/user-posts.js +42 -0
- package/clis/lesswrong/user.js +45 -0
- package/clis/lichess/lichess.test.js +85 -0
- package/clis/lichess/top.js +46 -0
- package/clis/lichess/user.js +91 -0
- package/clis/lichess/utils.js +97 -0
- package/clis/linkedin/connect.js +401 -0
- package/clis/linkedin/connect.test.js +213 -0
- package/clis/linkedin/inbox.js +234 -0
- package/clis/linkedin/inbox.test.js +152 -0
- package/clis/linkedin/job-detail.js +167 -0
- package/clis/linkedin/job-detail.test.js +38 -0
- package/clis/linkedin/jobs-preferences.js +113 -0
- package/clis/linkedin/jobs-preferences.test.js +43 -0
- package/clis/linkedin/people-search.js +262 -0
- package/clis/linkedin/people-search.test.js +216 -0
- package/clis/linkedin/post-analytics.js +74 -0
- package/clis/linkedin/post-analytics.test.js +40 -0
- package/clis/linkedin/posts-core.js +241 -0
- package/clis/linkedin/posts.js +22 -0
- package/clis/linkedin/posts.test.js +40 -0
- package/clis/linkedin/profile-analytics.js +104 -0
- package/clis/linkedin/profile-analytics.test.js +67 -0
- package/clis/linkedin/profile-experience.js +671 -0
- package/clis/linkedin/profile-experience.test.js +152 -0
- package/clis/linkedin/profile-projects.js +311 -0
- package/clis/linkedin/profile-projects.test.js +111 -0
- package/clis/linkedin/profile-read.js +148 -0
- package/clis/linkedin/profile-read.test.js +77 -0
- package/clis/linkedin/safe-send.js +357 -0
- package/clis/linkedin/safe-send.test.js +204 -0
- package/clis/linkedin/salesnav-inbox.js +210 -0
- package/clis/linkedin/salesnav-inbox.test.js +113 -0
- package/clis/linkedin/salesnav-message.js +360 -0
- package/clis/linkedin/salesnav-message.test.js +172 -0
- package/clis/linkedin/salesnav-search.js +186 -0
- package/clis/linkedin/salesnav-search.test.js +76 -0
- package/clis/linkedin/salesnav-thread.js +212 -0
- package/clis/linkedin/salesnav-thread.test.js +79 -0
- package/clis/linkedin/search.js +462 -0
- package/clis/linkedin/search.test.js +222 -0
- package/clis/linkedin/sent-invitations.js +92 -0
- package/clis/linkedin/sent-invitations.test.js +62 -0
- package/clis/linkedin/services-read.js +213 -0
- package/clis/linkedin/services-read.test.js +105 -0
- package/clis/linkedin/shared.js +124 -0
- package/clis/linkedin/thread-snapshot.js +214 -0
- package/clis/linkedin/thread-snapshot.test.js +89 -0
- package/clis/linkedin/timeline.js +511 -0
- package/clis/linkedin/timeline.test.js +81 -0
- package/clis/linkedin-learning/course.js +138 -0
- package/clis/linkedin-learning/course.test.js +114 -0
- package/clis/linkedin-learning/search.js +155 -0
- package/clis/linkedin-learning/search.test.js +144 -0
- package/clis/linkedin-learning/trending.js +133 -0
- package/clis/linkedin-learning/trending.test.js +123 -0
- package/clis/linux-do/categories.js +50 -0
- package/clis/linux-do/feed.js +395 -0
- package/clis/linux-do/feed.test.js +153 -0
- package/clis/linux-do/search.js +29 -0
- package/clis/linux-do/tags.js +28 -0
- package/clis/linux-do/topic-content.js +155 -0
- package/clis/linux-do/topic-content.test.js +59 -0
- package/clis/linux-do/topic.js +53 -0
- package/clis/linux-do/user-posts.js +57 -0
- package/clis/linux-do/user-topics.js +37 -0
- package/clis/lobsters/active.js +29 -0
- package/clis/lobsters/domain.js +92 -0
- package/clis/lobsters/hot.js +29 -0
- package/clis/lobsters/lobsters.test.js +169 -0
- package/clis/lobsters/newest.js +29 -0
- package/clis/lobsters/read.js +196 -0
- package/clis/lobsters/tag.js +35 -0
- package/clis/maimai/search-talents.js +177 -0
- package/clis/maven/artifact.js +49 -0
- package/clis/maven/search.js +51 -0
- package/clis/maven/utils.js +110 -0
- package/clis/mdn/search.js +97 -0
- package/clis/medium/feed.js +16 -0
- package/clis/medium/search.js +16 -0
- package/clis/medium/tag.js +135 -0
- package/clis/medium/user.js +16 -0
- package/clis/medium/utils.js +79 -0
- package/clis/mubu/doc.js +41 -0
- package/clis/mubu/docs.js +44 -0
- package/clis/mubu/notes.js +245 -0
- package/clis/mubu/recent.js +28 -0
- package/clis/mubu/search.js +63 -0
- package/clis/mubu/utils.js +304 -0
- package/clis/notebooklm/add-source.js +269 -0
- package/clis/notebooklm/add-source.test.js +97 -0
- package/clis/notebooklm/compat.test.js +16 -0
- package/clis/notebooklm/create.js +76 -0
- package/clis/notebooklm/create.test.js +58 -0
- package/clis/notebooklm/current.js +28 -0
- package/clis/notebooklm/generate-audio.js +91 -0
- package/clis/notebooklm/generate-audio.test.js +63 -0
- package/clis/notebooklm/generate-slides.js +106 -0
- package/clis/notebooklm/generate-slides.test.js +75 -0
- package/clis/notebooklm/get.js +37 -0
- package/clis/notebooklm/history.js +25 -0
- package/clis/notebooklm/history.test.js +58 -0
- package/clis/notebooklm/list.js +36 -0
- package/clis/notebooklm/note-list.js +28 -0
- package/clis/notebooklm/note-list.test.js +56 -0
- package/clis/notebooklm/notes-get.js +47 -0
- package/clis/notebooklm/notes-get.test.js +72 -0
- package/clis/notebooklm/open.js +42 -0
- package/clis/notebooklm/open.test.js +63 -0
- package/clis/notebooklm/rpc.js +203 -0
- package/clis/notebooklm/rpc.test.js +131 -0
- package/clis/notebooklm/shared.js +3 -0
- package/clis/notebooklm/source-fulltext.js +44 -0
- package/clis/notebooklm/source-fulltext.test.js +106 -0
- package/clis/notebooklm/source-get.js +40 -0
- package/clis/notebooklm/source-get.test.js +84 -0
- package/clis/notebooklm/source-guide.js +44 -0
- package/clis/notebooklm/source-guide.test.js +104 -0
- package/clis/notebooklm/source-list.js +30 -0
- package/clis/notebooklm/status.js +31 -0
- package/clis/notebooklm/summary.js +30 -0
- package/clis/notebooklm/summary.test.js +78 -0
- package/clis/notebooklm/utils.js +814 -0
- package/clis/notebooklm/utils.test.js +449 -0
- package/clis/notebooklm/write-note.js +103 -0
- package/clis/notebooklm/write-note.test.js +70 -0
- package/clis/nowcoder/companies.js +24 -0
- package/clis/nowcoder/creators.js +28 -0
- package/clis/nowcoder/detail.js +62 -0
- package/clis/nowcoder/experience.js +37 -0
- package/clis/nowcoder/hot.js +25 -0
- package/clis/nowcoder/jobs.js +22 -0
- package/clis/nowcoder/notifications.js +30 -0
- package/clis/nowcoder/papers.js +41 -0
- package/clis/nowcoder/practice.js +38 -0
- package/clis/nowcoder/recommend.js +31 -0
- package/clis/nowcoder/referral.js +40 -0
- package/clis/nowcoder/salary.js +41 -0
- package/clis/nowcoder/search.js +50 -0
- package/clis/nowcoder/suggest.js +34 -0
- package/clis/nowcoder/topics.js +28 -0
- package/clis/nowcoder/trending.js +26 -0
- package/clis/npm/downloads.js +59 -0
- package/clis/npm/package.js +70 -0
- package/clis/npm/search.js +49 -0
- package/clis/npm/utils.js +76 -0
- package/clis/nuget/nuget.test.js +111 -0
- package/clis/nuget/package.js +101 -0
- package/clis/nuget/search.js +69 -0
- package/clis/nuget/utils.js +87 -0
- package/clis/nvd/cve.js +121 -0
- package/clis/oeis/oeis.test.js +88 -0
- package/clis/oeis/search.js +63 -0
- package/clis/oeis/sequence.js +71 -0
- package/clis/oeis/utils.js +88 -0
- package/clis/ones/common.js +144 -0
- package/clis/ones/enrich-tasks.js +37 -0
- package/clis/ones/login.js +81 -0
- package/clis/ones/logout.js +18 -0
- package/clis/ones/me.js +31 -0
- package/clis/ones/my-tasks.js +121 -0
- package/clis/ones/resolve-labels.js +64 -0
- package/clis/ones/task-helpers.js +212 -0
- package/clis/ones/task-helpers.test.js +12 -0
- package/clis/ones/task.js +67 -0
- package/clis/ones/tasks.js +80 -0
- package/clis/ones/token-info.js +43 -0
- package/clis/ones/worklog.js +268 -0
- package/clis/ones/worklog.test.js +20 -0
- package/clis/openalex/search.js +69 -0
- package/clis/openalex/utils.js +160 -0
- package/clis/openalex/work.js +65 -0
- package/clis/openfda/drug-label.js +74 -0
- package/clis/openfda/food-recall.js +65 -0
- package/clis/openfda/openfda.test.js +114 -0
- package/clis/openfda/utils.js +67 -0
- package/clis/openreview/author.js +58 -0
- package/clis/openreview/openreview.test.js +427 -0
- package/clis/openreview/paper.js +43 -0
- package/clis/openreview/reviews.js +131 -0
- package/clis/openreview/search.js +46 -0
- package/clis/openreview/utils.js +172 -0
- package/clis/openreview/venue.js +63 -0
- package/clis/osv/osv.test.js +97 -0
- package/clis/osv/query.js +72 -0
- package/clis/osv/utils.js +169 -0
- package/clis/osv/vulnerability.js +54 -0
- package/clis/packagist/package.js +49 -0
- package/clis/packagist/search.js +43 -0
- package/clis/packagist/utils.js +113 -0
- package/clis/paperreview/commands.test.js +243 -0
- package/clis/paperreview/feedback.js +53 -0
- package/clis/paperreview/review.js +38 -0
- package/clis/paperreview/submit.js +86 -0
- package/clis/paperreview/utils.js +197 -0
- package/clis/paperreview/utils.test.js +49 -0
- package/clis/pixiv/detail.js +59 -0
- package/clis/pixiv/download.js +79 -0
- package/clis/pixiv/download.test.js +87 -0
- package/clis/pixiv/illusts.js +66 -0
- package/clis/pixiv/illusts.test.js +99 -0
- package/clis/pixiv/ranking.js +60 -0
- package/clis/pixiv/search.js +44 -0
- package/clis/pixiv/search.test.js +83 -0
- package/clis/pixiv/user.js +54 -0
- package/clis/pixiv/utils.js +49 -0
- package/clis/powerchina/search.js +251 -0
- package/clis/powerchina/search.test.js +93 -0
- package/clis/producthunt/browse.js +100 -0
- package/clis/producthunt/hot.js +111 -0
- package/clis/producthunt/posts.js +29 -0
- package/clis/producthunt/today.js +36 -0
- package/clis/producthunt/utils.js +99 -0
- package/clis/producthunt/utils.test.js +64 -0
- package/clis/pubmed/article.js +50 -0
- package/clis/pubmed/author.js +64 -0
- package/clis/pubmed/citations.js +36 -0
- package/clis/pubmed/pubmed.test.js +276 -0
- package/clis/pubmed/related.js +45 -0
- package/clis/pubmed/search.js +75 -0
- package/clis/pubmed/utils.js +309 -0
- package/clis/pypi/downloads.js +66 -0
- package/clis/pypi/package.js +79 -0
- package/clis/pypi/utils.js +55 -0
- package/clis/qqmail/inbox.js +189 -0
- package/clis/quark/ls.js +64 -0
- package/clis/quark/mkdir.js +37 -0
- package/clis/quark/mv.js +54 -0
- package/clis/quark/rename.js +27 -0
- package/clis/quark/rm.js +25 -0
- package/clis/quark/save.js +81 -0
- package/clis/quark/share-tree.js +46 -0
- package/clis/quark/utils.js +146 -0
- package/clis/quark/utils.test.js +58 -0
- package/clis/qwen/ask.js +85 -0
- package/clis/qwen/detail.js +62 -0
- package/clis/qwen/history.js +61 -0
- package/clis/qwen/image.js +179 -0
- package/clis/qwen/new.js +23 -0
- package/clis/qwen/read.js +41 -0
- package/clis/qwen/send.js +55 -0
- package/clis/qwen/status.js +37 -0
- package/clis/qwen/utils.js +409 -0
- package/clis/qwen/utils.test.js +45 -0
- package/clis/reddit/comment.js +58 -0
- package/clis/reddit/extract-media.test.js +149 -0
- package/clis/reddit/frontpage.js +70 -0
- package/clis/reddit/frontpage.test.js +34 -0
- package/clis/reddit/home.js +146 -0
- package/clis/reddit/home.test.js +170 -0
- package/clis/reddit/hot.js +81 -0
- package/clis/reddit/hot.test.js +32 -0
- package/clis/reddit/popular.js +80 -0
- package/clis/reddit/popular.test.js +26 -0
- package/clis/reddit/read.js +532 -0
- package/clis/reddit/read.test.js +335 -0
- package/clis/reddit/reply.js +182 -0
- package/clis/reddit/reply.test.js +89 -0
- package/clis/reddit/save.js +52 -0
- package/clis/reddit/saved.js +50 -0
- package/clis/reddit/search.js +103 -0
- package/clis/reddit/search.test.js +26 -0
- package/clis/reddit/subreddit-info.js +116 -0
- package/clis/reddit/subreddit-info.test.js +163 -0
- package/clis/reddit/subreddit.js +98 -0
- package/clis/reddit/subreddit.test.js +31 -0
- package/clis/reddit/subscribe.js +51 -0
- package/clis/reddit/subscribed.js +165 -0
- package/clis/reddit/subscribed.test.js +168 -0
- package/clis/reddit/upvote.js +65 -0
- package/clis/reddit/upvoted.js +50 -0
- package/clis/reddit/user-comments.js +45 -0
- package/clis/reddit/user-posts.js +43 -0
- package/clis/reddit/user.js +38 -0
- package/clis/reddit/whoami.js +83 -0
- package/clis/reddit/whoami.test.js +105 -0
- package/clis/rednote/comments.js +76 -0
- package/clis/rednote/download.js +59 -0
- package/clis/rednote/feed.js +95 -0
- package/clis/rednote/navigation.test.js +26 -0
- package/clis/rednote/note.js +68 -0
- package/clis/rednote/notifications.js +139 -0
- package/clis/rednote/rednote.test.js +222 -0
- package/clis/rednote/search.js +107 -0
- package/clis/rednote/user.js +55 -0
- package/clis/rest-countries/country.js +65 -0
- package/clis/rest-countries/region.js +64 -0
- package/clis/rest-countries/rest-countries.test.js +83 -0
- package/clis/rest-countries/utils.js +126 -0
- package/clis/reuters/article-detail.js +53 -0
- package/clis/reuters/reuters.test.js +299 -0
- package/clis/reuters/search.js +63 -0
- package/clis/reuters/utils.js +159 -0
- package/clis/rfc/rfc.js +52 -0
- package/clis/rfc/rfc.test.js +74 -0
- package/clis/rfc/utils.js +72 -0
- package/clis/rubygems/gem.js +42 -0
- package/clis/rubygems/search.js +47 -0
- package/clis/rubygems/utils.js +86 -0
- package/clis/sinablog/article.js +15 -0
- package/clis/sinablog/hot.js +15 -0
- package/clis/sinablog/search.js +52 -0
- package/clis/sinablog/user.js +16 -0
- package/clis/sinablog/utils.js +186 -0
- package/clis/sinafinance/news.js +62 -0
- package/clis/sinafinance/rolling-news.js +41 -0
- package/clis/sinafinance/stock-rank.js +66 -0
- package/clis/sinafinance/stock.js +121 -0
- package/clis/sinafinance/stock.test.js +59 -0
- package/clis/smzdm/search.js +55 -0
- package/clis/spotify/spotify.js +327 -0
- package/clis/spotify/utils.js +66 -0
- package/clis/spotify/utils.test.js +67 -0
- package/clis/stackoverflow/bounties.js +35 -0
- package/clis/stackoverflow/hot.js +32 -0
- package/clis/stackoverflow/read.js +314 -0
- package/clis/stackoverflow/related.js +66 -0
- package/clis/stackoverflow/search.js +35 -0
- package/clis/stackoverflow/stackoverflow.test.js +404 -0
- package/clis/stackoverflow/tag.js +60 -0
- package/clis/stackoverflow/unanswered.js +33 -0
- package/clis/stackoverflow/user.js +50 -0
- package/clis/stackoverflow/utils.js +118 -0
- package/clis/steam/app.js +67 -0
- package/clis/steam/search.js +58 -0
- package/clis/steam/steam.test.js +46 -0
- package/clis/steam/top-sellers.js +26 -0
- package/clis/steam/utils.js +107 -0
- package/clis/substack/feed.js +16 -0
- package/clis/substack/publication.js +16 -0
- package/clis/substack/search.js +79 -0
- package/clis/substack/utils.js +136 -0
- package/clis/substack/utils.test.js +44 -0
- package/clis/suno/commands.test.js +188 -0
- package/clis/suno/download.js +140 -0
- package/clis/suno/download.test.js +151 -0
- package/clis/suno/generate.js +231 -0
- package/clis/suno/generate.test.js +252 -0
- package/clis/suno/list.js +79 -0
- package/clis/suno/status.js +63 -0
- package/clis/suno/utils.js +549 -0
- package/clis/suno/utils.test.js +329 -0
- package/clis/taobao/add-cart.js +150 -0
- package/clis/taobao/cart.js +96 -0
- package/clis/taobao/commands.test.js +41 -0
- package/clis/taobao/detail.js +71 -0
- package/clis/taobao/reviews.js +77 -0
- package/clis/taobao/search.js +97 -0
- package/clis/tdx/hot-rank.js +48 -0
- package/clis/tdx/hot-rank.test.js +59 -0
- package/clis/test-utils.js +61 -0
- package/clis/ths/hot-rank.js +50 -0
- package/clis/ths/hot-rank.test.js +64 -0
- package/clis/tieba/commands.test.js +79 -0
- package/clis/tieba/hot.js +48 -0
- package/clis/tieba/posts.js +86 -0
- package/clis/tieba/read.js +141 -0
- package/clis/tieba/search.js +109 -0
- package/clis/tieba/utils.js +240 -0
- package/clis/tieba/utils.test.js +290 -0
- package/clis/tiktok/comment.js +145 -0
- package/clis/tiktok/creator-videos.js +270 -0
- package/clis/tiktok/creator-videos.test.js +113 -0
- package/clis/tiktok/explore.js +144 -0
- package/clis/tiktok/follow.js +122 -0
- package/clis/tiktok/following.js +164 -0
- package/clis/tiktok/friends.js +146 -0
- package/clis/tiktok/like.js +34 -0
- package/clis/tiktok/live.js +144 -0
- package/clis/tiktok/notifications.js +153 -0
- package/clis/tiktok/profile.js +55 -0
- package/clis/tiktok/refactor.test.js +389 -0
- package/clis/tiktok/save.js +30 -0
- package/clis/tiktok/search.js +40 -0
- package/clis/tiktok/unfollow.js +131 -0
- package/clis/tiktok/unlike.js +34 -0
- package/clis/tiktok/unsave.js +32 -0
- package/clis/tiktok/user.js +216 -0
- package/clis/tiktok/utils.js +505 -0
- package/clis/tiktok/write-refactor.test.js +370 -0
- package/clis/toutiao/articles.js +55 -0
- package/clis/toutiao/hot.js +63 -0
- package/clis/toutiao/toutiao.test.js +378 -0
- package/clis/toutiao/utils.js +161 -0
- package/clis/tvmaze/search.js +61 -0
- package/clis/tvmaze/show.js +60 -0
- package/clis/tvmaze/tvmaze.test.js +93 -0
- package/clis/tvmaze/utils.js +110 -0
- package/clis/twitter/accept.js +204 -0
- package/clis/twitter/article.js +167 -0
- package/clis/twitter/block.js +90 -0
- package/clis/twitter/bookmark-folder.js +190 -0
- package/clis/twitter/bookmark-folder.test.js +395 -0
- package/clis/twitter/bookmark-folders.js +114 -0
- package/clis/twitter/bookmark-folders.test.js +152 -0
- package/clis/twitter/bookmark.js +74 -0
- package/clis/twitter/bookmark.test.js +74 -0
- package/clis/twitter/bookmarks.js +181 -0
- package/clis/twitter/bookmarks.test.js +205 -0
- package/clis/twitter/delete.js +85 -0
- package/clis/twitter/delete.test.js +85 -0
- package/clis/twitter/device-follow.js +193 -0
- package/clis/twitter/device-follow.test.js +287 -0
- package/clis/twitter/download.js +481 -0
- package/clis/twitter/download.test.js +457 -0
- package/clis/twitter/follow.js +67 -0
- package/clis/twitter/followers.js +193 -0
- package/clis/twitter/followers.test.js +62 -0
- package/clis/twitter/following.js +270 -0
- package/clis/twitter/following.test.js +338 -0
- package/clis/twitter/hide-reply.js +87 -0
- package/clis/twitter/hide-reply.test.js +76 -0
- package/clis/twitter/like.js +80 -0
- package/clis/twitter/like.test.js +73 -0
- package/clis/twitter/likes.js +241 -0
- package/clis/twitter/likes.test.js +220 -0
- package/clis/twitter/list-add.js +263 -0
- package/clis/twitter/list-add.test.js +133 -0
- package/clis/twitter/list-create.js +155 -0
- package/clis/twitter/list-create.test.js +169 -0
- package/clis/twitter/list-remove.js +306 -0
- package/clis/twitter/list-remove.test.js +110 -0
- package/clis/twitter/list-tweets.js +198 -0
- package/clis/twitter/list-tweets.test.js +196 -0
- package/clis/twitter/lists.js +177 -0
- package/clis/twitter/lists.test.js +253 -0
- package/clis/twitter/notifications.js +128 -0
- package/clis/twitter/post.js +313 -0
- package/clis/twitter/post.test.js +258 -0
- package/clis/twitter/profile.js +115 -0
- package/clis/twitter/profile.test.js +39 -0
- package/clis/twitter/quote.js +172 -0
- package/clis/twitter/quote.test.js +194 -0
- package/clis/twitter/reply-dm.js +183 -0
- package/clis/twitter/reply.js +248 -0
- package/clis/twitter/reply.test.js +237 -0
- package/clis/twitter/retweet.js +94 -0
- package/clis/twitter/retweet.test.js +73 -0
- package/clis/twitter/search.js +346 -0
- package/clis/twitter/search.test.js +349 -0
- package/clis/twitter/shared.js +455 -0
- package/clis/twitter/shared.test.js +794 -0
- package/clis/twitter/thread.js +161 -0
- package/clis/twitter/thread.test.js +58 -0
- package/clis/twitter/timeline.js +211 -0
- package/clis/twitter/timeline.test.js +104 -0
- package/clis/twitter/trending.js +58 -0
- package/clis/twitter/trending.test.js +15 -0
- package/clis/twitter/tweets.js +315 -0
- package/clis/twitter/tweets.test.js +362 -0
- package/clis/twitter/unblock.js +73 -0
- package/clis/twitter/unbookmark.js +71 -0
- package/clis/twitter/unbookmark.test.js +73 -0
- package/clis/twitter/unfollow.js +73 -0
- package/clis/twitter/unlike.js +80 -0
- package/clis/twitter/unlike.test.js +75 -0
- package/clis/twitter/unretweet.js +94 -0
- package/clis/twitter/unretweet.test.js +73 -0
- package/clis/twitter/utils.js +323 -0
- package/clis/twitter/utils.test.js +169 -0
- package/clis/uisdc/news.js +105 -0
- package/clis/uisdc/news.test.js +66 -0
- package/clis/uiverse/_shared.js +427 -0
- package/clis/uiverse/_shared.test.js +62 -0
- package/clis/uiverse/code.js +49 -0
- package/clis/uiverse/navigation.test.js +12 -0
- package/clis/uiverse/preview.js +73 -0
- package/clis/upwork/detail.js +132 -0
- package/clis/upwork/feed.js +109 -0
- package/clis/upwork/search.js +115 -0
- package/clis/upwork/upwork.test.js +566 -0
- package/clis/upwork/utils.js +323 -0
- package/clis/v2ex/daily.js +99 -0
- package/clis/v2ex/hot.js +26 -0
- package/clis/v2ex/latest.js +26 -0
- package/clis/v2ex/me.js +100 -0
- package/clis/v2ex/member.js +28 -0
- package/clis/v2ex/node.js +39 -0
- package/clis/v2ex/nodes.js +26 -0
- package/clis/v2ex/notifications.js +72 -0
- package/clis/v2ex/replies.js +27 -0
- package/clis/v2ex/topic.js +31 -0
- package/clis/v2ex/user.js +34 -0
- package/clis/wanfang/search.js +66 -0
- package/clis/wanfang/search.test.js +23 -0
- package/clis/web/read.js +491 -0
- package/clis/web/read.test.js +392 -0
- package/clis/weibo/comments.js +53 -0
- package/clis/weibo/delete.js +172 -0
- package/clis/weibo/delete.test.js +94 -0
- package/clis/weibo/envelope.test.js +85 -0
- package/clis/weibo/favorites.js +170 -0
- package/clis/weibo/favorites.test.js +114 -0
- package/clis/weibo/feed.js +69 -0
- package/clis/weibo/hot.js +39 -0
- package/clis/weibo/me.js +75 -0
- package/clis/weibo/post.js +75 -0
- package/clis/weibo/publish.js +306 -0
- package/clis/weibo/publish.test.js +192 -0
- package/clis/weibo/search.js +80 -0
- package/clis/weibo/user-posts.js +234 -0
- package/clis/weibo/user-posts.test.js +92 -0
- package/clis/weibo/user.js +63 -0
- package/clis/weibo/utils.js +59 -0
- package/clis/weibo/utils.test.js +36 -0
- package/clis/weixin/create-draft.js +226 -0
- package/clis/weixin/download.js +323 -0
- package/clis/weixin/drafts.js +66 -0
- package/clis/weixin/drafts.test.js +69 -0
- package/clis/weixin/search.js +157 -0
- package/clis/weixin/search.test.js +227 -0
- package/clis/weread/ai-outline.js +171 -0
- package/clis/weread/ai-outline.test.js +83 -0
- package/clis/weread/book-search.js +438 -0
- package/clis/weread/book-search.test.js +242 -0
- package/clis/weread/book.js +233 -0
- package/clis/weread/commands.test.js +398 -0
- package/clis/weread/highlights.js +24 -0
- package/clis/weread/notebooks.js +22 -0
- package/clis/weread/notes.js +30 -0
- package/clis/weread/private-api-regression.test.js +369 -0
- package/clis/weread/ranking.js +29 -0
- package/clis/weread/search-regression.test.js +494 -0
- package/clis/weread/search.js +186 -0
- package/clis/weread/shelf.js +66 -0
- package/clis/weread/utils.js +321 -0
- package/clis/weread/utils.test.js +128 -0
- package/clis/weread-official/book.js +135 -0
- package/clis/weread-official/commands.test.js +385 -0
- package/clis/weread-official/discover.js +107 -0
- package/clis/weread-official/list-apis.js +95 -0
- package/clis/weread-official/notes.js +171 -0
- package/clis/weread-official/readdata.js +158 -0
- package/clis/weread-official/review.js +93 -0
- package/clis/weread-official/search.js +106 -0
- package/clis/weread-official/shelf.js +97 -0
- package/clis/weread-official/utils.js +293 -0
- package/clis/weread-official/utils.test.js +242 -0
- package/clis/wikidata/entity.js +60 -0
- package/clis/wikidata/search.js +50 -0
- package/clis/wikidata/utils.js +117 -0
- package/clis/wikidata/wikidata.test.js +83 -0
- package/clis/wikipedia/page.js +95 -0
- package/clis/wikipedia/random.js +20 -0
- package/clis/wikipedia/search.js +31 -0
- package/clis/wikipedia/summary.js +24 -0
- package/clis/wikipedia/trending.js +40 -0
- package/clis/wikipedia/trending.test.js +57 -0
- package/clis/wikipedia/utils.js +31 -0
- package/clis/wttr/current.js +63 -0
- package/clis/wttr/forecast.js +71 -0
- package/clis/wttr/utils.js +50 -0
- package/clis/wttr/wttr.test.js +84 -0
- package/clis/xianyu/chat.js +74 -0
- package/clis/xianyu/chat.test.js +84 -0
- package/clis/xianyu/im.js +322 -0
- package/clis/xianyu/im.test.js +253 -0
- package/clis/xianyu/inbox.js +96 -0
- package/clis/xianyu/item.js +153 -0
- package/clis/xianyu/item.test.js +56 -0
- package/clis/xianyu/messages.js +91 -0
- package/clis/xianyu/publish.js +485 -0
- package/clis/xianyu/publish.test.js +220 -0
- package/clis/xianyu/reply.js +82 -0
- package/clis/xianyu/search.js +135 -0
- package/clis/xianyu/search.test.js +17 -0
- package/clis/xianyu/utils.js +8 -0
- package/clis/xiaoe/catalog.js +227 -0
- package/clis/xiaoe/content.js +175 -0
- package/clis/xiaoe/courses.js +127 -0
- package/clis/xiaoe/detail.js +36 -0
- package/clis/xiaoe/play-url.js +121 -0
- package/clis/xiaoe/xiaoe.test.js +486 -0
- package/clis/xiaohongshu/comments.js +177 -0
- package/clis/xiaohongshu/comments.test.js +258 -0
- package/clis/xiaohongshu/creator-note-detail.js +482 -0
- package/clis/xiaohongshu/creator-note-detail.test.js +451 -0
- package/clis/xiaohongshu/creator-notes-summary.js +98 -0
- package/clis/xiaohongshu/creator-notes-summary.test.js +94 -0
- package/clis/xiaohongshu/creator-notes.js +479 -0
- package/clis/xiaohongshu/creator-notes.test.js +281 -0
- package/clis/xiaohongshu/creator-profile.js +55 -0
- package/clis/xiaohongshu/creator-stats.js +76 -0
- package/clis/xiaohongshu/creator-stats.test.js +24 -0
- package/clis/xiaohongshu/delete-note.js +260 -0
- package/clis/xiaohongshu/delete-note.test.js +172 -0
- package/clis/xiaohongshu/download.js +246 -0
- package/clis/xiaohongshu/download.test.js +316 -0
- package/clis/xiaohongshu/feed.js +41 -0
- package/clis/xiaohongshu/navigation.test.js +34 -0
- package/clis/xiaohongshu/note-helpers.js +69 -0
- package/clis/xiaohongshu/note.js +104 -0
- package/clis/xiaohongshu/note.test.js +249 -0
- package/clis/xiaohongshu/notifications.js +46 -0
- package/clis/xiaohongshu/publish.js +707 -0
- package/clis/xiaohongshu/publish.test.js +608 -0
- package/clis/xiaohongshu/search.js +330 -0
- package/clis/xiaohongshu/search.test.js +325 -0
- package/clis/xiaohongshu/user-helpers.js +78 -0
- package/clis/xiaohongshu/user-helpers.test.js +160 -0
- package/clis/xiaohongshu/user.js +86 -0
- package/clis/xiaoyuzhou/auth.js +303 -0
- package/clis/xiaoyuzhou/auth.test.js +124 -0
- package/clis/xiaoyuzhou/download.js +54 -0
- package/clis/xiaoyuzhou/download.test.js +135 -0
- package/clis/xiaoyuzhou/episode.js +34 -0
- package/clis/xiaoyuzhou/podcast-episodes.js +41 -0
- package/clis/xiaoyuzhou/podcast-episodes.test.js +78 -0
- package/clis/xiaoyuzhou/podcast.js +33 -0
- package/clis/xiaoyuzhou/transcript.js +77 -0
- package/clis/xiaoyuzhou/transcript.test.js +195 -0
- package/clis/xiaoyuzhou/utils.js +15 -0
- package/clis/xiaoyuzhou/utils.test.js +39 -0
- package/clis/xueqiu/comments.js +355 -0
- package/clis/xueqiu/comments.test.js +696 -0
- package/clis/xueqiu/danjuan-utils.js +126 -0
- package/clis/xueqiu/danjuan-utils.test.js +41 -0
- package/clis/xueqiu/earnings-date.js +45 -0
- package/clis/xueqiu/feed.js +39 -0
- package/clis/xueqiu/fund-holdings.js +29 -0
- package/clis/xueqiu/fund-snapshot.js +26 -0
- package/clis/xueqiu/groups.js +23 -0
- package/clis/xueqiu/hot-stock.js +32 -0
- package/clis/xueqiu/hot.js +37 -0
- package/clis/xueqiu/kline.js +44 -0
- package/clis/xueqiu/search.js +37 -0
- package/clis/xueqiu/stock.js +65 -0
- package/clis/xueqiu/utils.js +48 -0
- package/clis/xueqiu/utils.test.js +26 -0
- package/clis/xueqiu/watchlist.js +37 -0
- package/clis/yahoo/search.js +92 -0
- package/clis/yahoo/search.test.js +94 -0
- package/clis/yahoo-finance/quote.js +74 -0
- package/clis/yollomi/background.js +46 -0
- package/clis/yollomi/edit.js +57 -0
- package/clis/yollomi/face-swap.js +44 -0
- package/clis/yollomi/generate.js +101 -0
- package/clis/yollomi/models.js +34 -0
- package/clis/yollomi/object-remover.js +43 -0
- package/clis/yollomi/remove-bg.js +39 -0
- package/clis/yollomi/restore.js +39 -0
- package/clis/yollomi/try-on.js +47 -0
- package/clis/yollomi/upload.js +72 -0
- package/clis/yollomi/upscale.js +54 -0
- package/clis/yollomi/utils.js +180 -0
- package/clis/yollomi/video.js +57 -0
- package/clis/youdao/note.js +258 -0
- package/clis/youdao/note.test.js +99 -0
- package/clis/youtube/channel.js +209 -0
- package/clis/youtube/channel.test.js +59 -0
- package/clis/youtube/comments.js +96 -0
- package/clis/youtube/feed.js +121 -0
- package/clis/youtube/feed.test.js +131 -0
- package/clis/youtube/history.js +119 -0
- package/clis/youtube/like.js +67 -0
- package/clis/youtube/playlist.js +98 -0
- package/clis/youtube/search.js +100 -0
- package/clis/youtube/subscribe.js +76 -0
- package/clis/youtube/subscriptions.js +58 -0
- package/clis/youtube/transcript-group.js +226 -0
- package/clis/youtube/transcript-group.test.js +99 -0
- package/clis/youtube/transcript.js +656 -0
- package/clis/youtube/transcript.test.js +296 -0
- package/clis/youtube/unlike.js +67 -0
- package/clis/youtube/unsubscribe.js +76 -0
- package/clis/youtube/utils.js +220 -0
- package/clis/youtube/utils.test.js +84 -0
- package/clis/youtube/video.js +117 -0
- package/clis/youtube/watch-later.js +77 -0
- package/clis/yuanbao/ask.js +362 -0
- package/clis/yuanbao/ask.test.js +124 -0
- package/clis/yuanbao/detail.js +65 -0
- package/clis/yuanbao/history.js +51 -0
- package/clis/yuanbao/new.js +72 -0
- package/clis/yuanbao/new.test.js +30 -0
- package/clis/yuanbao/read.js +38 -0
- package/clis/yuanbao/send.js +57 -0
- package/clis/yuanbao/shared.js +341 -0
- package/clis/yuanbao/shared.test.js +80 -0
- package/clis/yuanbao/status.js +44 -0
- package/clis/zhihu/answer-comments.js +280 -0
- package/clis/zhihu/answer-comments.test.js +287 -0
- package/clis/zhihu/answer-detail.js +216 -0
- package/clis/zhihu/answer-detail.test.js +338 -0
- package/clis/zhihu/answer.js +54 -0
- package/clis/zhihu/answer.test.js +54 -0
- package/clis/zhihu/collection.js +199 -0
- package/clis/zhihu/collection.test.js +337 -0
- package/clis/zhihu/collections.js +128 -0
- package/clis/zhihu/collections.test.js +182 -0
- package/clis/zhihu/comment.js +55 -0
- package/clis/zhihu/comment.test.js +50 -0
- package/clis/zhihu/download.js +80 -0
- package/clis/zhihu/download.test.js +12 -0
- package/clis/zhihu/favorite.js +87 -0
- package/clis/zhihu/favorite.test.js +59 -0
- package/clis/zhihu/follow.js +50 -0
- package/clis/zhihu/follow.test.js +42 -0
- package/clis/zhihu/hot.js +44 -0
- package/clis/zhihu/like.js +47 -0
- package/clis/zhihu/like.test.js +41 -0
- package/clis/zhihu/question.js +113 -0
- package/clis/zhihu/question.test.js +251 -0
- package/clis/zhihu/recommend.js +103 -0
- package/clis/zhihu/recommend.test.js +143 -0
- package/clis/zhihu/search.js +206 -0
- package/clis/zhihu/search.test.js +198 -0
- package/clis/zhihu/target.js +91 -0
- package/clis/zhihu/target.test.js +77 -0
- package/clis/zhihu/text.js +29 -0
- package/clis/zhihu/text.test.js +24 -0
- package/clis/zhihu/write-shared.js +228 -0
- package/clis/zhihu/write-shared.test.js +176 -0
- package/clis/zlibrary/commands.test.js +65 -0
- package/clis/zlibrary/info.js +48 -0
- package/clis/zlibrary/search.js +47 -0
- package/clis/zlibrary/utils.js +136 -0
- package/clis/zsxq/dynamics.js +48 -0
- package/clis/zsxq/groups.js +33 -0
- package/clis/zsxq/search.js +44 -0
- package/clis/zsxq/search.test.js +24 -0
- package/clis/zsxq/topic.js +50 -0
- package/clis/zsxq/topic.test.js +30 -0
- package/clis/zsxq/topics.js +26 -0
- package/clis/zsxq/topics.test.js +24 -0
- package/clis/zsxq/utils.js +233 -0
- package/clis/zsxq/utils.test.js +31 -0
- package/dist/src/adapter-shadow.d.ts +11 -0
- package/dist/src/adapter-shadow.js +72 -0
- package/dist/src/adapter-shadow.test.d.ts +1 -0
- package/dist/src/adapter-shadow.test.js +49 -0
- package/dist/src/adapter-source.d.ts +11 -0
- package/dist/src/adapter-source.js +24 -0
- package/dist/src/adapter-source.test.d.ts +1 -0
- package/dist/src/adapter-source.test.js +29 -0
- package/dist/src/browser/analyze.d.ts +103 -0
- package/dist/src/browser/analyze.js +230 -0
- package/dist/src/browser/analyze.test.d.ts +1 -0
- package/dist/src/browser/analyze.test.js +166 -0
- package/dist/src/browser/article-extract.d.ts +57 -0
- package/dist/src/browser/article-extract.e2e.test.d.ts +1 -0
- package/dist/src/browser/article-extract.e2e.test.js +105 -0
- package/dist/src/browser/article-extract.js +169 -0
- package/dist/src/browser/article-extract.test.d.ts +1 -0
- package/dist/src/browser/article-extract.test.js +94 -0
- package/dist/src/browser/ax-snapshot.d.ts +37 -0
- package/dist/src/browser/ax-snapshot.js +217 -0
- package/dist/src/browser/ax-snapshot.test.d.ts +1 -0
- package/dist/src/browser/ax-snapshot.test.js +91 -0
- package/dist/src/browser/base-page.d.ts +145 -0
- package/dist/src/browser/base-page.js +1054 -0
- package/dist/src/browser/base-page.test.d.ts +1 -0
- package/dist/src/browser/base-page.test.js +758 -0
- package/dist/src/browser/bridge.d.ts +28 -0
- package/dist/src/browser/bridge.js +155 -0
- package/dist/src/browser/cdp-click-fixture.test.d.ts +1 -0
- package/dist/src/browser/cdp-click-fixture.test.js +87 -0
- package/dist/src/browser/cdp.d.ts +46 -0
- package/dist/src/browser/cdp.js +536 -0
- package/dist/src/browser/cdp.test.d.ts +1 -0
- package/dist/src/browser/cdp.test.js +79 -0
- package/dist/src/browser/compound.d.ts +59 -0
- package/dist/src/browser/compound.js +112 -0
- package/dist/src/browser/compound.test.d.ts +1 -0
- package/dist/src/browser/compound.test.js +175 -0
- package/dist/src/browser/daemon-client.d.ts +133 -0
- package/dist/src/browser/daemon-client.js +154 -0
- package/dist/src/browser/daemon-client.test.d.ts +1 -0
- package/dist/src/browser/daemon-client.test.js +199 -0
- package/dist/src/browser/daemon-lifecycle.d.ts +23 -0
- package/dist/src/browser/daemon-lifecycle.js +67 -0
- package/dist/src/browser/daemon-version.d.ts +4 -0
- package/dist/src/browser/daemon-version.js +12 -0
- package/dist/src/browser/dom-helpers.d.ts +41 -0
- package/dist/src/browser/dom-helpers.js +239 -0
- package/dist/src/browser/dom-helpers.test.d.ts +1 -0
- package/dist/src/browser/dom-helpers.test.js +106 -0
- package/dist/src/browser/dom-snapshot.d.ts +93 -0
- package/dist/src/browser/dom-snapshot.js +894 -0
- package/dist/src/browser/dom-snapshot.test.d.ts +11 -0
- package/dist/src/browser/dom-snapshot.test.js +313 -0
- package/dist/src/browser/errors.d.ts +38 -0
- package/dist/src/browser/errors.js +78 -0
- package/dist/src/browser/errors.test.d.ts +1 -0
- package/dist/src/browser/errors.test.js +60 -0
- package/dist/src/browser/extract.d.ts +69 -0
- package/dist/src/browser/extract.js +132 -0
- package/dist/src/browser/extract.test.d.ts +1 -0
- package/dist/src/browser/extract.test.js +129 -0
- package/dist/src/browser/find.d.ts +84 -0
- package/dist/src/browser/find.js +398 -0
- package/dist/src/browser/find.test.d.ts +1 -0
- package/dist/src/browser/find.test.js +180 -0
- package/dist/src/browser/html-tree.d.ts +75 -0
- package/dist/src/browser/html-tree.js +112 -0
- package/dist/src/browser/html-tree.test.d.ts +1 -0
- package/dist/src/browser/html-tree.test.js +181 -0
- package/dist/src/browser/index.d.ts +14 -0
- package/dist/src/browser/index.js +12 -0
- package/dist/src/browser/network-cache.d.ts +49 -0
- package/dist/src/browser/network-cache.js +66 -0
- package/dist/src/browser/network-cache.test.d.ts +1 -0
- package/dist/src/browser/network-cache.test.js +58 -0
- package/dist/src/browser/network-key.d.ts +22 -0
- package/dist/src/browser/network-key.js +66 -0
- package/dist/src/browser/network-key.test.d.ts +1 -0
- package/dist/src/browser/network-key.test.js +49 -0
- package/dist/src/browser/page.d.ts +83 -0
- package/dist/src/browser/page.js +453 -0
- package/dist/src/browser/page.test.d.ts +1 -0
- package/dist/src/browser/page.test.js +378 -0
- package/dist/src/browser/profile.d.ts +14 -0
- package/dist/src/browser/profile.js +85 -0
- package/dist/src/browser/shape-filter.d.ts +52 -0
- package/dist/src/browser/shape-filter.js +101 -0
- package/dist/src/browser/shape-filter.test.d.ts +1 -0
- package/dist/src/browser/shape-filter.test.js +101 -0
- package/dist/src/browser/shape.d.ts +23 -0
- package/dist/src/browser/shape.js +95 -0
- package/dist/src/browser/shape.test.d.ts +1 -0
- package/dist/src/browser/shape.test.js +82 -0
- package/dist/src/browser/stealth.d.ts +11 -0
- package/dist/src/browser/stealth.js +359 -0
- package/dist/src/browser/stealth.test.d.ts +1 -0
- package/dist/src/browser/stealth.test.js +134 -0
- package/dist/src/browser/tabs.d.ts +13 -0
- package/dist/src/browser/tabs.js +70 -0
- package/dist/src/browser/target-errors.d.ts +39 -0
- package/dist/src/browser/target-errors.js +45 -0
- package/dist/src/browser/target-errors.test.d.ts +1 -0
- package/dist/src/browser/target-errors.test.js +94 -0
- package/dist/src/browser/target-resolver.d.ts +158 -0
- package/dist/src/browser/target-resolver.js +570 -0
- package/dist/src/browser/target-resolver.test.d.ts +1 -0
- package/dist/src/browser/target-resolver.test.js +118 -0
- package/dist/src/browser/utils.d.ts +20 -0
- package/dist/src/browser/utils.js +64 -0
- package/dist/src/browser/utils.test.d.ts +1 -0
- package/dist/src/browser/utils.test.js +29 -0
- package/dist/src/browser/verify-fixture.d.ts +65 -0
- package/dist/src/browser/verify-fixture.js +318 -0
- package/dist/src/browser/verify-fixture.test.d.ts +1 -0
- package/dist/src/browser/verify-fixture.test.js +219 -0
- package/dist/src/browser/visual-refs.d.ts +11 -0
- package/dist/src/browser/visual-refs.js +108 -0
- package/dist/src/browser.test.d.ts +1 -0
- package/dist/src/browser.test.js +232 -0
- package/dist/src/build-manifest.d.ts +103 -0
- package/dist/src/build-manifest.js +362 -0
- package/dist/src/build-manifest.test.d.ts +1 -0
- package/dist/src/build-manifest.test.js +341 -0
- package/dist/src/capabilityRouting.d.ts +19 -0
- package/dist/src/capabilityRouting.js +56 -0
- package/dist/src/capabilityRouting.test.d.ts +1 -0
- package/dist/src/capabilityRouting.test.js +63 -0
- package/dist/src/cli-argv-preprocess.d.ts +63 -0
- package/dist/src/cli-argv-preprocess.js +269 -0
- package/dist/src/cli-argv-preprocess.test.d.ts +1 -0
- package/dist/src/cli-argv-preprocess.test.js +209 -0
- package/dist/src/cli.d.ts +61 -0
- package/dist/src/cli.js +3173 -0
- package/dist/src/cli.test.d.ts +1 -0
- package/dist/src/cli.test.js +2803 -0
- package/dist/src/commanderAdapter.d.ts +21 -0
- package/dist/src/commanderAdapter.js +208 -0
- package/dist/src/commanderAdapter.test.d.ts +1 -0
- package/dist/src/commanderAdapter.test.js +352 -0
- package/dist/src/commands/daemon.d.ts +9 -0
- package/dist/src/commands/daemon.js +81 -0
- package/dist/src/commands/daemon.test.d.ts +1 -0
- package/dist/src/commands/daemon.test.js +219 -0
- package/dist/src/completion-fast.d.ts +22 -0
- package/dist/src/completion-fast.js +88 -0
- package/dist/src/completion-shared.d.ts +13 -0
- package/dist/src/completion-shared.js +59 -0
- package/dist/src/completion.d.ts +21 -0
- package/dist/src/completion.js +68 -0
- package/dist/src/completion.test.d.ts +1 -0
- package/dist/src/completion.test.js +24 -0
- package/dist/src/constants.d.ts +15 -0
- package/dist/src/constants.js +32 -0
- package/dist/src/convention-audit.d.ts +50 -0
- package/dist/src/convention-audit.js +553 -0
- package/dist/src/convention-audit.test.d.ts +1 -0
- package/dist/src/convention-audit.test.js +247 -0
- package/dist/src/daemon-utils.d.ts +18 -0
- package/dist/src/daemon-utils.js +37 -0
- package/dist/src/daemon.d.ts +22 -0
- package/dist/src/daemon.js +437 -0
- package/dist/src/daemon.test.d.ts +1 -0
- package/dist/src/daemon.test.js +60 -0
- package/dist/src/discovery.d.ts +43 -0
- package/dist/src/discovery.js +265 -0
- package/dist/src/doctor.d.ts +39 -0
- package/dist/src/doctor.js +230 -0
- package/dist/src/doctor.test.d.ts +1 -0
- package/dist/src/doctor.test.js +263 -0
- package/dist/src/download/article-download.d.ts +72 -0
- package/dist/src/download/article-download.js +305 -0
- package/dist/src/download/article-download.test.d.ts +1 -0
- package/dist/src/download/article-download.test.js +235 -0
- package/dist/src/download/index.d.ts +71 -0
- package/dist/src/download/index.js +345 -0
- package/dist/src/download/index.test.d.ts +1 -0
- package/dist/src/download/index.test.js +140 -0
- package/dist/src/download/media-download.d.ts +49 -0
- package/dist/src/download/media-download.js +127 -0
- package/dist/src/download/media-download.test.d.ts +1 -0
- package/dist/src/download/media-download.test.js +112 -0
- package/dist/src/download/progress.d.ts +36 -0
- package/dist/src/download/progress.js +120 -0
- package/dist/src/download/progress.test.d.ts +1 -0
- package/dist/src/download/progress.test.js +36 -0
- package/dist/src/electron-apps.d.ts +31 -0
- package/dist/src/electron-apps.js +70 -0
- package/dist/src/electron-apps.test.d.ts +1 -0
- package/dist/src/electron-apps.test.js +49 -0
- package/dist/src/engine.test.d.ts +1 -0
- package/dist/src/engine.test.js +312 -0
- package/dist/src/errors.d.ts +114 -0
- package/dist/src/errors.js +174 -0
- package/dist/src/errors.test.d.ts +1 -0
- package/dist/src/errors.test.js +109 -0
- package/dist/src/execution.d.ts +24 -0
- package/dist/src/execution.js +509 -0
- package/dist/src/execution.test.d.ts +1 -0
- package/dist/src/execution.test.js +623 -0
- package/dist/src/extension-manifest-regression.test.d.ts +1 -0
- package/dist/src/extension-manifest-regression.test.js +12 -0
- package/dist/src/external-clis.yaml +109 -0
- package/dist/src/external.d.ts +49 -0
- package/dist/src/external.js +219 -0
- package/dist/src/external.test.d.ts +1 -0
- package/dist/src/external.test.js +146 -0
- package/dist/src/help.d.ts +88 -0
- package/dist/src/help.js +544 -0
- package/dist/src/help.test.d.ts +1 -0
- package/dist/src/help.test.js +58 -0
- package/dist/src/hooks.d.ts +46 -0
- package/dist/src/hooks.js +58 -0
- package/dist/src/hooks.test.d.ts +4 -0
- package/dist/src/hooks.test.js +92 -0
- package/dist/src/interceptor.d.ts +44 -0
- package/dist/src/interceptor.js +183 -0
- package/dist/src/interceptor.test.d.ts +4 -0
- package/dist/src/interceptor.test.js +81 -0
- package/dist/src/launcher.d.ts +40 -0
- package/dist/src/launcher.js +208 -0
- package/dist/src/launcher.test.d.ts +1 -0
- package/dist/src/launcher.test.js +138 -0
- package/dist/src/logger.d.ts +26 -0
- package/dist/src/logger.js +49 -0
- package/dist/src/main.d.ts +5 -0
- package/dist/src/main.js +171 -0
- package/dist/src/manifest-types.d.ts +41 -0
- package/dist/src/manifest-types.js +9 -0
- package/dist/src/node-network.d.ts +10 -0
- package/dist/src/node-network.js +174 -0
- package/dist/src/node-network.test.d.ts +1 -0
- package/dist/src/node-network.test.js +55 -0
- package/dist/src/observation/artifact.d.ts +16 -0
- package/dist/src/observation/artifact.js +260 -0
- package/dist/src/observation/artifact.test.d.ts +1 -0
- package/dist/src/observation/artifact.test.js +121 -0
- package/dist/src/observation/events.d.ts +89 -0
- package/dist/src/observation/events.js +1 -0
- package/dist/src/observation/index.d.ts +7 -0
- package/dist/src/observation/index.js +7 -0
- package/dist/src/observation/manager.d.ts +9 -0
- package/dist/src/observation/manager.js +27 -0
- package/dist/src/observation/manager.test.d.ts +1 -0
- package/dist/src/observation/manager.test.js +13 -0
- package/dist/src/observation/redaction.d.ts +11 -0
- package/dist/src/observation/redaction.js +81 -0
- package/dist/src/observation/redaction.test.d.ts +1 -0
- package/dist/src/observation/redaction.test.js +32 -0
- package/dist/src/observation/retention.d.ts +32 -0
- package/dist/src/observation/retention.js +160 -0
- package/dist/src/observation/retention.test.d.ts +1 -0
- package/dist/src/observation/retention.test.js +118 -0
- package/dist/src/observation/ring-buffer.d.ts +22 -0
- package/dist/src/observation/ring-buffer.js +45 -0
- package/dist/src/observation/ring-buffer.test.d.ts +1 -0
- package/dist/src/observation/ring-buffer.test.js +22 -0
- package/dist/src/observation/session.d.ts +25 -0
- package/dist/src/observation/session.js +50 -0
- package/dist/src/output.d.ts +14 -0
- package/dist/src/output.js +152 -0
- package/dist/src/output.test.d.ts +1 -0
- package/dist/src/output.test.js +53 -0
- package/dist/src/package-exports.test.d.ts +1 -0
- package/dist/src/package-exports.test.js +112 -0
- package/dist/src/package-paths.d.ts +8 -0
- package/dist/src/package-paths.js +41 -0
- package/dist/src/pipeline/executor.d.ts +11 -0
- package/dist/src/pipeline/executor.js +93 -0
- package/dist/src/pipeline/executor.test.d.ts +4 -0
- package/dist/src/pipeline/executor.test.js +182 -0
- package/dist/src/pipeline/index.d.ts +5 -0
- package/dist/src/pipeline/index.js +5 -0
- package/dist/src/pipeline/registry.d.ts +28 -0
- package/dist/src/pipeline/registry.js +55 -0
- package/dist/src/pipeline/steps/browser.d.ts +13 -0
- package/dist/src/pipeline/steps/browser.js +86 -0
- package/dist/src/pipeline/steps/download.d.ts +18 -0
- package/dist/src/pipeline/steps/download.js +252 -0
- package/dist/src/pipeline/steps/download.test.d.ts +1 -0
- package/dist/src/pipeline/steps/download.test.js +102 -0
- package/dist/src/pipeline/steps/fetch.d.ts +5 -0
- package/dist/src/pipeline/steps/fetch.js +122 -0
- package/dist/src/pipeline/steps/fetch.test.d.ts +1 -0
- package/dist/src/pipeline/steps/fetch.test.js +117 -0
- package/dist/src/pipeline/steps/intercept.d.ts +5 -0
- package/dist/src/pipeline/steps/intercept.js +50 -0
- package/dist/src/pipeline/steps/tap.d.ts +12 -0
- package/dist/src/pipeline/steps/tap.js +93 -0
- package/dist/src/pipeline/steps/transform.d.ts +9 -0
- package/dist/src/pipeline/steps/transform.js +70 -0
- package/dist/src/pipeline/template.d.ts +17 -0
- package/dist/src/pipeline/template.js +338 -0
- package/dist/src/pipeline/template.test.d.ts +4 -0
- package/dist/src/pipeline/template.test.js +175 -0
- package/dist/src/pipeline/transform.test.d.ts +4 -0
- package/dist/src/pipeline/transform.test.js +133 -0
- package/dist/src/plugin-manifest.d.ts +70 -0
- package/dist/src/plugin-manifest.js +160 -0
- package/dist/src/plugin-manifest.test.d.ts +4 -0
- package/dist/src/plugin-manifest.test.js +179 -0
- package/dist/src/plugin-scaffold.d.ts +28 -0
- package/dist/src/plugin-scaffold.js +143 -0
- package/dist/src/plugin-scaffold.test.d.ts +4 -0
- package/dist/src/plugin-scaffold.test.js +83 -0
- package/dist/src/plugin.d.ts +145 -0
- package/dist/src/plugin.js +1245 -0
- package/dist/src/plugin.test.d.ts +4 -0
- package/dist/src/plugin.test.js +1324 -0
- package/dist/src/registry-api.d.ts +13 -0
- package/dist/src/registry-api.js +10 -0
- package/dist/src/registry.d.ts +143 -0
- package/dist/src/registry.js +123 -0
- package/dist/src/registry.test.d.ts +4 -0
- package/dist/src/registry.test.js +209 -0
- package/dist/src/runtime-detect.d.ts +31 -0
- package/dist/src/runtime-detect.js +47 -0
- package/dist/src/runtime-detect.test.d.ts +1 -0
- package/dist/src/runtime-detect.test.js +39 -0
- package/dist/src/runtime.d.ts +47 -0
- package/dist/src/runtime.js +66 -0
- package/dist/src/scripts/framework.d.ts +7 -0
- package/dist/src/scripts/framework.js +25 -0
- package/dist/src/scripts/interact.d.ts +4 -0
- package/dist/src/scripts/interact.js +20 -0
- package/dist/src/scripts/store.d.ts +13 -0
- package/dist/src/scripts/store.js +48 -0
- package/dist/src/serialization.d.ts +42 -0
- package/dist/src/serialization.js +102 -0
- package/dist/src/serialization.test.d.ts +1 -0
- package/dist/src/serialization.test.js +78 -0
- package/dist/src/snapshotFormatter.d.ts +11 -0
- package/dist/src/snapshotFormatter.js +338 -0
- package/dist/src/snapshotFormatter.test.d.ts +7 -0
- package/dist/src/snapshotFormatter.test.js +521 -0
- package/dist/src/tui.d.ts +28 -0
- package/dist/src/tui.js +179 -0
- package/dist/src/tui.test.d.ts +1 -0
- package/dist/src/tui.test.js +19 -0
- package/dist/src/types.d.ts +236 -0
- package/dist/src/types.js +7 -0
- package/dist/src/update-check.d.ts +66 -0
- package/dist/src/update-check.js +202 -0
- package/dist/src/update-check.test.d.ts +1 -0
- package/dist/src/update-check.test.js +116 -0
- package/dist/src/utils.d.ts +57 -0
- package/dist/src/utils.js +152 -0
- package/dist/src/utils.test.d.ts +1 -0
- package/dist/src/utils.test.js +155 -0
- package/dist/src/validate.d.ts +21 -0
- package/dist/src/validate.js +129 -0
- package/dist/src/validate.test.d.ts +9 -0
- package/dist/src/validate.test.js +90 -0
- package/dist/src/verify.d.ts +26 -0
- package/dist/src/verify.js +67 -0
- package/dist/src/version.d.ts +4 -0
- package/dist/src/version.js +22 -0
- package/dist/src/weixin-download.test.d.ts +1 -0
- package/dist/src/weixin-download.test.js +45 -0
- package/package.json +113 -0
- package/scripts/check-doc-coverage.sh +81 -0
- package/scripts/check-listing-id-pairing.mjs +193 -0
- package/scripts/check-silent-column-drop.mjs +105 -0
- package/scripts/check-typed-error-lint.mjs +118 -0
- package/scripts/clean-dist.cjs +13 -0
- package/scripts/copy-yaml.cjs +12 -0
- package/scripts/fetch-adapters.js +293 -0
- package/scripts/postinstall.js +174 -0
- package/scripts/silent-column-drop-baseline.json +910 -0
- package/scripts/typed-error-lint-baseline.json +1162 -0
|
@@ -0,0 +1,707 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Xiaohongshu 图文笔记 publisher — creator center UI automation.
|
|
3
|
+
*
|
|
4
|
+
* Flow:
|
|
5
|
+
* 1. Navigate to creator publish page
|
|
6
|
+
* 2. Upload images via CDP DOM.setFileInputFiles (with base64 fallback)
|
|
7
|
+
* 3. Fill title and body text
|
|
8
|
+
* 4. Add topic hashtags
|
|
9
|
+
* 5. Publish (or save as draft)
|
|
10
|
+
*
|
|
11
|
+
* Requires: logged into creator.xiaohongshu.com in Chrome.
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* bycli xiaohongshu publish --title "标题" "正文内容" \
|
|
15
|
+
* --images /path/a.jpg,/path/b.jpg \
|
|
16
|
+
* --topics 生活,旅行
|
|
17
|
+
*/
|
|
18
|
+
import * as fs from 'node:fs';
|
|
19
|
+
import * as path from 'node:path';
|
|
20
|
+
import { cli, Strategy } from '@sovovs/bycli/registry';
|
|
21
|
+
const PUBLISH_URL = 'https://creator.xiaohongshu.com/publish/publish?from=menu_left&target=image';
|
|
22
|
+
const MAX_IMAGES = 9;
|
|
23
|
+
const MAX_TITLE_LEN = 20;
|
|
24
|
+
const UPLOAD_SETTLE_MS = 3000;
|
|
25
|
+
/**
|
|
26
|
+
* XHS creator center wraps the publish/save button in an `<xhs-publish-btn>`
|
|
27
|
+
* web component backed by a CLOSED shadow root. Host-level `.click()` does
|
|
28
|
+
* not dispatch into the internal handler. Invoke these instance methods on
|
|
29
|
+
* the host element to trigger publish / save-draft directly (#1606).
|
|
30
|
+
*/
|
|
31
|
+
const PUBLISH_METHOD_NAMES = ['_onPublish', 'onPublish', '_onSubmit', '_handlePublish'];
|
|
32
|
+
const DRAFT_METHOD_NAMES = ['_onSave', '_onSaveDraft', '_onDraft'];
|
|
33
|
+
/** Selectors for the title field, ordered by priority across current UI variants. */
|
|
34
|
+
const TITLE_SELECTORS = [
|
|
35
|
+
// Some creator-center variants expose the title as contenteditable,
|
|
36
|
+
// others use a normal <input> with the same placeholder.
|
|
37
|
+
'[contenteditable="true"][placeholder*="标题"]',
|
|
38
|
+
'[contenteditable="true"][placeholder*="赞"]',
|
|
39
|
+
'[contenteditable="true"][class*="title"]',
|
|
40
|
+
'input[maxlength="20"]',
|
|
41
|
+
'input[class*="title"]',
|
|
42
|
+
'input[placeholder*="标题"]',
|
|
43
|
+
'input[placeholder*="title" i]',
|
|
44
|
+
'.title-input input',
|
|
45
|
+
'.note-title input',
|
|
46
|
+
'input[maxlength]',
|
|
47
|
+
];
|
|
48
|
+
const SUPPORTED_EXTENSIONS = {
|
|
49
|
+
'.jpg': 'image/jpeg',
|
|
50
|
+
'.jpeg': 'image/jpeg',
|
|
51
|
+
'.png': 'image/png',
|
|
52
|
+
'.gif': 'image/gif',
|
|
53
|
+
'.webp': 'image/webp',
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Validate image paths: check existence and extension.
|
|
57
|
+
* Returns resolved absolute paths.
|
|
58
|
+
*/
|
|
59
|
+
function validateImagePaths(filePaths) {
|
|
60
|
+
return filePaths.map((filePath) => {
|
|
61
|
+
const absPath = path.resolve(filePath);
|
|
62
|
+
if (!fs.existsSync(absPath))
|
|
63
|
+
throw new Error(`Image file not found: ${absPath}`);
|
|
64
|
+
const ext = path.extname(absPath).toLowerCase();
|
|
65
|
+
if (!SUPPORTED_EXTENSIONS[ext]) {
|
|
66
|
+
throw new Error(`Unsupported image format "${ext}". Supported: jpg, png, gif, webp`);
|
|
67
|
+
}
|
|
68
|
+
return absPath;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/** CSS selector for image-accepting file inputs. */
|
|
72
|
+
const IMAGE_INPUT_SELECTOR = 'input[type="file"][accept*="image"],'
|
|
73
|
+
+ 'input[type="file"][accept*=".jpg"],'
|
|
74
|
+
+ 'input[type="file"][accept*=".jpeg"],'
|
|
75
|
+
+ 'input[type="file"][accept*=".png"],'
|
|
76
|
+
+ 'input[type="file"][accept*=".gif"],'
|
|
77
|
+
+ 'input[type="file"][accept*=".webp"]';
|
|
78
|
+
/**
|
|
79
|
+
* Upload images via CDP DOM.setFileInputFiles — Chrome reads files directly
|
|
80
|
+
* from the local filesystem, avoiding base64 payload size limits.
|
|
81
|
+
*
|
|
82
|
+
* Falls back to the legacy base64 DataTransfer approach if the extension
|
|
83
|
+
* does not support set-file-input (e.g. older extension version).
|
|
84
|
+
*/
|
|
85
|
+
async function uploadImages(page, absPaths) {
|
|
86
|
+
// ── Primary: CDP DOM.setFileInputFiles ──────────────────────────────
|
|
87
|
+
if (page.setFileInput) {
|
|
88
|
+
try {
|
|
89
|
+
// Find image-accepting file input on the page
|
|
90
|
+
const selector = await page.evaluate(`
|
|
91
|
+
(() => {
|
|
92
|
+
const sels = ${JSON.stringify(IMAGE_INPUT_SELECTOR)};
|
|
93
|
+
const el = document.querySelector(sels);
|
|
94
|
+
return el ? sels : null;
|
|
95
|
+
})()
|
|
96
|
+
`);
|
|
97
|
+
if (!selector) {
|
|
98
|
+
return { ok: false, count: 0, error: 'No file input found on page' };
|
|
99
|
+
}
|
|
100
|
+
await page.setFileInput(absPaths, selector);
|
|
101
|
+
return { ok: true, count: absPaths.length };
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
// If set-file-input action is not supported by extension, fall through to legacy
|
|
105
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
106
|
+
if (msg.includes('Unknown action') || msg.includes('not supported') || msg.includes('Not allowed')) {
|
|
107
|
+
// Extension too old — fall through to legacy base64 method
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
return { ok: false, count: 0, error: msg };
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// ── Fallback: legacy base64 DataTransfer injection ─────────────────
|
|
115
|
+
const images = absPaths.map((absPath) => {
|
|
116
|
+
const base64 = fs.readFileSync(absPath).toString('base64');
|
|
117
|
+
const ext = path.extname(absPath).toLowerCase();
|
|
118
|
+
return { name: path.basename(absPath), mimeType: SUPPORTED_EXTENSIONS[ext], base64 };
|
|
119
|
+
});
|
|
120
|
+
// Warn if total payload is large — this may fail with older extensions
|
|
121
|
+
const totalBytes = images.reduce((sum, img) => sum + img.base64.length, 0);
|
|
122
|
+
if (totalBytes > 500_000) {
|
|
123
|
+
console.warn(`[warn] Total image payload is ${(totalBytes / 1024 / 1024).toFixed(1)}MB (base64). ` +
|
|
124
|
+
'This may fail with the browser bridge. Update the extension to v1.6+ for CDP-based upload, ' +
|
|
125
|
+
'or compress images before publishing.');
|
|
126
|
+
}
|
|
127
|
+
const payload = JSON.stringify(images);
|
|
128
|
+
return page.evaluate(`
|
|
129
|
+
(async () => {
|
|
130
|
+
const images = ${payload};
|
|
131
|
+
|
|
132
|
+
const inputs = Array.from(document.querySelectorAll('input[type="file"]'));
|
|
133
|
+
const input = inputs.find(el => {
|
|
134
|
+
const accept = el.getAttribute('accept') || '';
|
|
135
|
+
return (
|
|
136
|
+
accept.includes('image') ||
|
|
137
|
+
accept.includes('.jpg') ||
|
|
138
|
+
accept.includes('.jpeg') ||
|
|
139
|
+
accept.includes('.png') ||
|
|
140
|
+
accept.includes('.gif') ||
|
|
141
|
+
accept.includes('.webp')
|
|
142
|
+
);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
if (!input) return { ok: false, count: 0, error: 'No image file input found on page' };
|
|
146
|
+
|
|
147
|
+
const dt = new DataTransfer();
|
|
148
|
+
for (const img of images) {
|
|
149
|
+
try {
|
|
150
|
+
const binary = atob(img.base64);
|
|
151
|
+
const bytes = new Uint8Array(binary.length);
|
|
152
|
+
for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
|
|
153
|
+
const blob = new Blob([bytes], { type: img.mimeType });
|
|
154
|
+
dt.items.add(new File([blob], img.name, { type: img.mimeType }));
|
|
155
|
+
} catch (e) {
|
|
156
|
+
return { ok: false, count: 0, error: 'Failed to create File: ' + e.message };
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
Object.defineProperty(input, 'files', { value: dt.files, writable: false });
|
|
161
|
+
input.dispatchEvent(new Event('change', { bubbles: true }));
|
|
162
|
+
input.dispatchEvent(new Event('input', { bubbles: true }));
|
|
163
|
+
|
|
164
|
+
return { ok: true, count: dt.files.length };
|
|
165
|
+
})()
|
|
166
|
+
`);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Wait until all upload progress indicators have disappeared (up to maxWaitMs).
|
|
170
|
+
*/
|
|
171
|
+
async function waitForUploads(page, maxWaitMs = 30_000) {
|
|
172
|
+
const pollMs = 2_000;
|
|
173
|
+
const maxAttempts = Math.ceil(maxWaitMs / pollMs);
|
|
174
|
+
for (let i = 0; i < maxAttempts; i++) {
|
|
175
|
+
const uploading = await page.evaluate(`
|
|
176
|
+
() => !!document.querySelector(
|
|
177
|
+
'[class*="upload"][class*="progress"], [class*="uploading"], [class*="loading"][class*="image"]'
|
|
178
|
+
)
|
|
179
|
+
`);
|
|
180
|
+
if (!uploading)
|
|
181
|
+
return;
|
|
182
|
+
await page.wait({ time: pollMs / 1_000 });
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Fill a visible text input or contenteditable with the given text.
|
|
187
|
+
* Tries multiple selectors in priority order.
|
|
188
|
+
* Returns { ok, sel }.
|
|
189
|
+
*/
|
|
190
|
+
async function fillField(page, selectors, text, fieldName) {
|
|
191
|
+
const located = await page.evaluate(`
|
|
192
|
+
(function(selectors) {
|
|
193
|
+
const __bycli_xhs_fill_phase = "locate";
|
|
194
|
+
for (const sel of selectors) {
|
|
195
|
+
const candidates = document.querySelectorAll(sel);
|
|
196
|
+
for (const el of candidates) {
|
|
197
|
+
if (!el || el.offsetParent === null) continue;
|
|
198
|
+
const kind = el.isContentEditable
|
|
199
|
+
? 'contenteditable'
|
|
200
|
+
: (el.tagName === 'TEXTAREA' ? 'textarea' : 'input');
|
|
201
|
+
return { ok: true, sel, kind };
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return { ok: false };
|
|
205
|
+
})(${JSON.stringify(selectors)})
|
|
206
|
+
`);
|
|
207
|
+
if (!located.ok) {
|
|
208
|
+
await page.screenshot({ path: `/tmp/xhs_publish_${fieldName}_debug.png` });
|
|
209
|
+
throw new Error(`Could not find ${fieldName} input. Debug screenshot: /tmp/xhs_publish_${fieldName}_debug.png`);
|
|
210
|
+
}
|
|
211
|
+
const applyInPage = () => page.evaluate(`
|
|
212
|
+
((selector, expectedText) => {
|
|
213
|
+
const __bycli_xhs_fill_phase = "apply";
|
|
214
|
+
const normalize = (value) => (value || '').replace(/\\s+/g, ' ').trim();
|
|
215
|
+
const fireBeforeInput = (el, value) => {
|
|
216
|
+
try {
|
|
217
|
+
el.dispatchEvent(new InputEvent('beforeinput', {
|
|
218
|
+
bubbles: true,
|
|
219
|
+
data: value,
|
|
220
|
+
inputType: 'insertText',
|
|
221
|
+
}));
|
|
222
|
+
} catch {
|
|
223
|
+
el.dispatchEvent(new Event('beforeinput', { bubbles: true }));
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
const fireInput = (el, value) => {
|
|
227
|
+
try {
|
|
228
|
+
el.dispatchEvent(new InputEvent('input', {
|
|
229
|
+
bubbles: true,
|
|
230
|
+
data: value,
|
|
231
|
+
inputType: 'insertText',
|
|
232
|
+
}));
|
|
233
|
+
} catch {
|
|
234
|
+
el.dispatchEvent(new Event('input', { bubbles: true }));
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
const el = Array.from(document.querySelectorAll(selector)).find(node => node && node.offsetParent !== null);
|
|
238
|
+
if (!el) return { ok: false, actual: '' };
|
|
239
|
+
el.focus();
|
|
240
|
+
fireBeforeInput(el, expectedText);
|
|
241
|
+
if (el.tagName === 'INPUT' || el.tagName === 'TEXTAREA') {
|
|
242
|
+
const proto = el.tagName === 'TEXTAREA'
|
|
243
|
+
? HTMLTextAreaElement.prototype
|
|
244
|
+
: HTMLInputElement.prototype;
|
|
245
|
+
const nativeSetter = Object.getOwnPropertyDescriptor(proto, 'value')?.set;
|
|
246
|
+
if (nativeSetter) nativeSetter.call(el, expectedText);
|
|
247
|
+
else el.value = expectedText;
|
|
248
|
+
fireInput(el, expectedText);
|
|
249
|
+
el.dispatchEvent(new Event('change', { bubbles: true }));
|
|
250
|
+
el.blur();
|
|
251
|
+
return { ok: el.value === expectedText, actual: el.value || '' };
|
|
252
|
+
}
|
|
253
|
+
el.textContent = '';
|
|
254
|
+
const selection = window.getSelection();
|
|
255
|
+
const range = document.createRange();
|
|
256
|
+
range.selectNodeContents(el);
|
|
257
|
+
range.collapse(false);
|
|
258
|
+
selection?.removeAllRanges();
|
|
259
|
+
selection?.addRange(range);
|
|
260
|
+
const inserted = document.execCommand('insertText', false, expectedText);
|
|
261
|
+
if (!inserted) el.textContent = expectedText;
|
|
262
|
+
fireInput(el, expectedText);
|
|
263
|
+
el.dispatchEvent(new Event('change', { bubbles: true }));
|
|
264
|
+
el.blur();
|
|
265
|
+
const actual = normalize(el.innerText || el.textContent || '');
|
|
266
|
+
return { ok: actual === normalize(expectedText), actual };
|
|
267
|
+
})(${JSON.stringify(located.sel)}, ${JSON.stringify(text)})
|
|
268
|
+
`);
|
|
269
|
+
let result;
|
|
270
|
+
if (located.kind === 'contenteditable' && page.insertText) {
|
|
271
|
+
const prepared = await page.evaluate(`
|
|
272
|
+
((selector, nextText) => {
|
|
273
|
+
const __bycli_xhs_fill_phase = "prepare";
|
|
274
|
+
const fireBeforeInput = (el, value) => {
|
|
275
|
+
try {
|
|
276
|
+
el.dispatchEvent(new InputEvent('beforeinput', {
|
|
277
|
+
bubbles: true,
|
|
278
|
+
data: value,
|
|
279
|
+
inputType: 'insertText',
|
|
280
|
+
}));
|
|
281
|
+
} catch {
|
|
282
|
+
el.dispatchEvent(new Event('beforeinput', { bubbles: true }));
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
const el = Array.from(document.querySelectorAll(selector)).find(node => node && node.offsetParent !== null);
|
|
286
|
+
if (!el) return { ok: false };
|
|
287
|
+
el.focus();
|
|
288
|
+
el.textContent = '';
|
|
289
|
+
const selection = window.getSelection();
|
|
290
|
+
const range = document.createRange();
|
|
291
|
+
range.selectNodeContents(el);
|
|
292
|
+
range.collapse(false);
|
|
293
|
+
selection?.removeAllRanges();
|
|
294
|
+
selection?.addRange(range);
|
|
295
|
+
fireBeforeInput(el, nextText);
|
|
296
|
+
return { ok: true };
|
|
297
|
+
})(${JSON.stringify(located.sel)}, ${JSON.stringify(text)})
|
|
298
|
+
`);
|
|
299
|
+
if (!prepared?.ok) {
|
|
300
|
+
await page.screenshot({ path: `/tmp/xhs_publish_${fieldName}_debug.png` });
|
|
301
|
+
throw new Error(`Could not prepare ${fieldName} input. Debug screenshot: /tmp/xhs_publish_${fieldName}_debug.png`);
|
|
302
|
+
}
|
|
303
|
+
try {
|
|
304
|
+
await page.insertText(text);
|
|
305
|
+
result = await page.evaluate(`
|
|
306
|
+
((selector, expectedText) => {
|
|
307
|
+
const __bycli_xhs_fill_phase = "verify";
|
|
308
|
+
const normalize = (value) => (value || '').replace(/\\s+/g, ' ').trim();
|
|
309
|
+
const fireInput = (el, value) => {
|
|
310
|
+
try {
|
|
311
|
+
el.dispatchEvent(new InputEvent('input', {
|
|
312
|
+
bubbles: true,
|
|
313
|
+
data: value,
|
|
314
|
+
inputType: 'insertText',
|
|
315
|
+
}));
|
|
316
|
+
} catch {
|
|
317
|
+
el.dispatchEvent(new Event('input', { bubbles: true }));
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
const el = Array.from(document.querySelectorAll(selector)).find(node => node && node.offsetParent !== null);
|
|
321
|
+
if (!el) return { ok: false, actual: '' };
|
|
322
|
+
fireInput(el, expectedText);
|
|
323
|
+
el.dispatchEvent(new Event('change', { bubbles: true }));
|
|
324
|
+
el.blur();
|
|
325
|
+
const actual = normalize(el.innerText || el.textContent || '');
|
|
326
|
+
return { ok: actual === normalize(expectedText), actual };
|
|
327
|
+
})(${JSON.stringify(located.sel)}, ${JSON.stringify(text)})
|
|
328
|
+
`);
|
|
329
|
+
}
|
|
330
|
+
catch {
|
|
331
|
+
result = await applyInPage();
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
result = await applyInPage();
|
|
336
|
+
}
|
|
337
|
+
if (!result?.ok) {
|
|
338
|
+
await page.screenshot({ path: `/tmp/xhs_publish_${fieldName}_debug.png` });
|
|
339
|
+
const actual = typeof result?.actual === 'string' ? result.actual : '';
|
|
340
|
+
throw new Error(`Failed to set ${fieldName}. Expected "${text}", got "${actual}". Debug screenshot: /tmp/xhs_publish_${fieldName}_debug.png`);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
async function selectImageTextTab(page) {
|
|
344
|
+
const result = await page.evaluate(`
|
|
345
|
+
() => {
|
|
346
|
+
const isVisible = (el) => {
|
|
347
|
+
if (!el || el.offsetParent === null) return false;
|
|
348
|
+
const rect = el.getBoundingClientRect();
|
|
349
|
+
return rect.width > 0 && rect.height > 0;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
const normalize = (value) => (value || '').replace(/\\s+/g, ' ').trim();
|
|
353
|
+
const selector = 'button, [role="tab"], [role="button"], a, label, div, span, li';
|
|
354
|
+
const nodes = Array.from(document.querySelectorAll(selector));
|
|
355
|
+
const targets = ['上传图文', '图文', '图片'];
|
|
356
|
+
|
|
357
|
+
for (const target of targets) {
|
|
358
|
+
for (const node of nodes) {
|
|
359
|
+
if (!isVisible(node)) continue;
|
|
360
|
+
const text = normalize(node.innerText || node.textContent || '');
|
|
361
|
+
if (!text || text.includes('视频')) continue;
|
|
362
|
+
if (text === target) {
|
|
363
|
+
const clickable = node.closest('button, [role="tab"], [role="button"], a, label') || node;
|
|
364
|
+
clickable.click();
|
|
365
|
+
return { ok: true, target, text };
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
for (const target of targets) {
|
|
371
|
+
for (const node of nodes) {
|
|
372
|
+
if (!isVisible(node)) continue;
|
|
373
|
+
const text = normalize(node.innerText || node.textContent || '');
|
|
374
|
+
if (!text || text.includes('视频')) continue;
|
|
375
|
+
if (text.startsWith(target) || text.includes(target)) {
|
|
376
|
+
const clickable = node.closest('button, [role="tab"], [role="button"], a, label') || node;
|
|
377
|
+
clickable.click();
|
|
378
|
+
return { ok: true, target, text };
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
const visibleTexts = [];
|
|
384
|
+
for (const node of nodes) {
|
|
385
|
+
if (!isVisible(node)) continue;
|
|
386
|
+
const text = normalize(node.innerText || node.textContent || '');
|
|
387
|
+
if (!text || text.length > 20) continue;
|
|
388
|
+
visibleTexts.push(text);
|
|
389
|
+
if (visibleTexts.length >= 20) break;
|
|
390
|
+
}
|
|
391
|
+
return { ok: false, visibleTexts };
|
|
392
|
+
}
|
|
393
|
+
`);
|
|
394
|
+
if (result?.ok) {
|
|
395
|
+
await page.wait({ time: 1 });
|
|
396
|
+
}
|
|
397
|
+
return result;
|
|
398
|
+
}
|
|
399
|
+
async function inspectPublishSurfaceState(page) {
|
|
400
|
+
return page.evaluate(`
|
|
401
|
+
() => {
|
|
402
|
+
const text = (document.body?.innerText || '').replace(/\s+/g, ' ').trim();
|
|
403
|
+
const hasTitleInput = !!Array.from(document.querySelectorAll('input, textarea')).find((el) => {
|
|
404
|
+
if (!el || el.offsetParent === null) return false;
|
|
405
|
+
const placeholder = (el.getAttribute('placeholder') || '').trim();
|
|
406
|
+
const cls = el.className ? String(el.className) : '';
|
|
407
|
+
const maxLength = Number(el.getAttribute('maxlength') || 0);
|
|
408
|
+
return (
|
|
409
|
+
placeholder.includes('标题') ||
|
|
410
|
+
/title/i.test(placeholder) ||
|
|
411
|
+
/title/i.test(cls) ||
|
|
412
|
+
maxLength === 20
|
|
413
|
+
);
|
|
414
|
+
});
|
|
415
|
+
const hasImageInput = !!Array.from(document.querySelectorAll('input[type="file"]')).find((el) => {
|
|
416
|
+
const accept = el.getAttribute('accept') || '';
|
|
417
|
+
return (
|
|
418
|
+
accept.includes('image') ||
|
|
419
|
+
accept.includes('.jpg') ||
|
|
420
|
+
accept.includes('.jpeg') ||
|
|
421
|
+
accept.includes('.png') ||
|
|
422
|
+
accept.includes('.gif') ||
|
|
423
|
+
accept.includes('.webp')
|
|
424
|
+
);
|
|
425
|
+
});
|
|
426
|
+
const hasVideoSurface = text.includes('拖拽视频到此处点击上传') || text.includes('上传视频');
|
|
427
|
+
const state = hasTitleInput ? 'editor_ready' : hasImageInput || !hasVideoSurface ? 'image_surface' : 'video_surface';
|
|
428
|
+
return { state, hasTitleInput, hasImageInput, hasVideoSurface };
|
|
429
|
+
}
|
|
430
|
+
`);
|
|
431
|
+
}
|
|
432
|
+
async function waitForPublishSurfaceState(page, maxWaitMs = 5_000) {
|
|
433
|
+
const pollMs = 500;
|
|
434
|
+
const maxAttempts = Math.max(1, Math.ceil(maxWaitMs / pollMs));
|
|
435
|
+
let surface = await inspectPublishSurfaceState(page);
|
|
436
|
+
for (let i = 0; i < maxAttempts; i++) {
|
|
437
|
+
if (surface.state !== 'video_surface') {
|
|
438
|
+
return surface;
|
|
439
|
+
}
|
|
440
|
+
if (i < maxAttempts - 1) {
|
|
441
|
+
await page.wait({ time: pollMs / 1_000 });
|
|
442
|
+
surface = await inspectPublishSurfaceState(page);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
return surface;
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Poll until the title/content editing form appears on the page.
|
|
449
|
+
* The new creator center UI only renders the editor after images are uploaded.
|
|
450
|
+
*/
|
|
451
|
+
async function waitForEditForm(page, maxWaitMs = 10_000) {
|
|
452
|
+
const pollMs = 1_000;
|
|
453
|
+
const maxAttempts = Math.ceil(maxWaitMs / pollMs);
|
|
454
|
+
for (let i = 0; i < maxAttempts; i++) {
|
|
455
|
+
const found = await page.evaluate(`
|
|
456
|
+
(() => {
|
|
457
|
+
const sels = ${JSON.stringify(TITLE_SELECTORS)};
|
|
458
|
+
for (const sel of sels) {
|
|
459
|
+
const el = document.querySelector(sel);
|
|
460
|
+
if (el && el.offsetParent !== null) return true;
|
|
461
|
+
}
|
|
462
|
+
return false;
|
|
463
|
+
})()`);
|
|
464
|
+
if (found)
|
|
465
|
+
return true;
|
|
466
|
+
if (i < maxAttempts - 1)
|
|
467
|
+
await page.wait({ time: pollMs / 1_000 });
|
|
468
|
+
}
|
|
469
|
+
return false;
|
|
470
|
+
}
|
|
471
|
+
cli({
|
|
472
|
+
site: 'xiaohongshu',
|
|
473
|
+
name: 'publish',
|
|
474
|
+
access: 'write',
|
|
475
|
+
description: '小红书发布图文笔记 (creator center UI automation)',
|
|
476
|
+
domain: 'creator.xiaohongshu.com',
|
|
477
|
+
strategy: Strategy.COOKIE,
|
|
478
|
+
browser: true,
|
|
479
|
+
navigateBefore: false,
|
|
480
|
+
args: [
|
|
481
|
+
{ name: 'title', required: true, help: '笔记标题 (最多20字)' },
|
|
482
|
+
{ name: 'content', required: true, positional: true, help: '笔记正文' },
|
|
483
|
+
{ name: 'images', required: true, help: '图片路径,逗号分隔,最多9张 (jpg/png/gif/webp)' },
|
|
484
|
+
{ name: 'topics', required: false, help: '话题标签,逗号分隔,不含 # 号' },
|
|
485
|
+
{ name: 'draft', type: 'bool', default: false, help: '保存为草稿,不直接发布' },
|
|
486
|
+
],
|
|
487
|
+
columns: ['status', 'detail'],
|
|
488
|
+
func: async (page, kwargs) => {
|
|
489
|
+
if (!page)
|
|
490
|
+
throw new Error('Browser page required');
|
|
491
|
+
const title = String(kwargs.title ?? '').trim();
|
|
492
|
+
const content = String(kwargs.content ?? '').trim();
|
|
493
|
+
const imagePaths = kwargs.images
|
|
494
|
+
? String(kwargs.images).split(',').map((s) => s.trim()).filter(Boolean)
|
|
495
|
+
: [];
|
|
496
|
+
const topics = kwargs.topics
|
|
497
|
+
? String(kwargs.topics).split(',').map((s) => s.trim()).filter(Boolean)
|
|
498
|
+
: [];
|
|
499
|
+
const isDraft = Boolean(kwargs.draft);
|
|
500
|
+
// ── Validate inputs ────────────────────────────────────────────────────────
|
|
501
|
+
if (!title)
|
|
502
|
+
throw new Error('--title is required');
|
|
503
|
+
if (title.length > MAX_TITLE_LEN)
|
|
504
|
+
throw new Error(`Title is ${title.length} chars — must be ≤ ${MAX_TITLE_LEN}`);
|
|
505
|
+
if (!content)
|
|
506
|
+
throw new Error('Positional argument <content> is required');
|
|
507
|
+
if (imagePaths.length === 0)
|
|
508
|
+
throw new Error('At least one --images path is required. The creator center now requires images before showing the editor.');
|
|
509
|
+
if (imagePaths.length > MAX_IMAGES)
|
|
510
|
+
throw new Error(`Too many images: ${imagePaths.length} (max ${MAX_IMAGES})`);
|
|
511
|
+
// Validate image paths before navigating (fast-fail on bad paths / unsupported formats)
|
|
512
|
+
const absImagePaths = validateImagePaths(imagePaths);
|
|
513
|
+
// ── Step 1: Navigate to publish page ──────────────────────────────────────
|
|
514
|
+
await page.goto(PUBLISH_URL);
|
|
515
|
+
await page.wait({ time: 3 });
|
|
516
|
+
// Verify we landed on the creator site (not redirected to login)
|
|
517
|
+
const pageUrl = await page.evaluate('() => location.href');
|
|
518
|
+
if (!pageUrl.includes('creator.xiaohongshu.com')) {
|
|
519
|
+
throw new Error('Redirected away from creator center — session may have expired. ' +
|
|
520
|
+
'Re-capture browser login via: bycli xiaohongshu creator-profile');
|
|
521
|
+
}
|
|
522
|
+
// ── Step 2: Select 图文 (image+text) note type if tabs are present ─────────
|
|
523
|
+
const tabResult = await selectImageTextTab(page);
|
|
524
|
+
const surface = await waitForPublishSurfaceState(page, tabResult?.ok ? 5_000 : 2_000);
|
|
525
|
+
if (surface.state === 'video_surface') {
|
|
526
|
+
await page.screenshot({ path: '/tmp/xhs_publish_tab_debug.png' });
|
|
527
|
+
const detail = tabResult?.ok
|
|
528
|
+
? `clicked "${tabResult.text}"`
|
|
529
|
+
: `visible candidates: ${(tabResult?.visibleTexts || []).join(' | ') || 'none'}`;
|
|
530
|
+
throw new Error('Still on the video publish page after trying to select 图文. ' +
|
|
531
|
+
`Details: ${detail}. Debug screenshot: /tmp/xhs_publish_tab_debug.png`);
|
|
532
|
+
}
|
|
533
|
+
// ── Step 3: Upload images ──────────────────────────────────────────────────
|
|
534
|
+
const upload = await uploadImages(page, absImagePaths);
|
|
535
|
+
if (!upload.ok) {
|
|
536
|
+
await page.screenshot({ path: '/tmp/xhs_publish_upload_debug.png' });
|
|
537
|
+
throw new Error(`Image injection failed: ${upload.error ?? 'unknown'}. ` +
|
|
538
|
+
'Debug screenshot: /tmp/xhs_publish_upload_debug.png');
|
|
539
|
+
}
|
|
540
|
+
// Allow XHS to process and upload images to its CDN
|
|
541
|
+
await page.wait({ time: UPLOAD_SETTLE_MS / 1_000 });
|
|
542
|
+
await waitForUploads(page);
|
|
543
|
+
// ── Step 3b: Wait for editor form to render ───────────────────────────────
|
|
544
|
+
const formReady = await waitForEditForm(page);
|
|
545
|
+
if (!formReady) {
|
|
546
|
+
await page.screenshot({ path: '/tmp/xhs_publish_form_debug.png' });
|
|
547
|
+
throw new Error('Editing form did not appear after image upload. The page layout may have changed. ' +
|
|
548
|
+
'Debug screenshot: /tmp/xhs_publish_form_debug.png');
|
|
549
|
+
}
|
|
550
|
+
// ── Step 4: Fill title ─────────────────────────────────────────────────────
|
|
551
|
+
await fillField(page, TITLE_SELECTORS, title, 'title');
|
|
552
|
+
await page.wait({ time: 0.5 });
|
|
553
|
+
// ── Step 5: Fill content / body ────────────────────────────────────────────
|
|
554
|
+
await fillField(page, [
|
|
555
|
+
'[contenteditable="true"][class*="content"]',
|
|
556
|
+
'[contenteditable="true"][class*="editor"]',
|
|
557
|
+
'[contenteditable="true"][placeholder*="描述"]',
|
|
558
|
+
'[contenteditable="true"][placeholder*="正文"]',
|
|
559
|
+
'[contenteditable="true"][placeholder*="内容"]',
|
|
560
|
+
'.note-content [contenteditable="true"]',
|
|
561
|
+
'.editor-content [contenteditable="true"]',
|
|
562
|
+
// Broad fallback — last resort; filter out any title contenteditable
|
|
563
|
+
'[contenteditable="true"]:not([placeholder*="标题"]):not([placeholder*="赞"]):not([placeholder*="title" i])',
|
|
564
|
+
], content, 'content');
|
|
565
|
+
await page.wait({ time: 0.5 });
|
|
566
|
+
// ── Step 6: Add topic hashtags ─────────────────────────────────────────────
|
|
567
|
+
for (const topic of topics) {
|
|
568
|
+
// Click the "添加话题" button
|
|
569
|
+
const btnClicked = await page.evaluate(`
|
|
570
|
+
() => {
|
|
571
|
+
const candidates = document.querySelectorAll('*');
|
|
572
|
+
for (const el of candidates) {
|
|
573
|
+
const text = (el.innerText || el.textContent || '').trim();
|
|
574
|
+
if (
|
|
575
|
+
(text === '添加话题' || text === '# 话题' || text.startsWith('添加话题')) &&
|
|
576
|
+
el.offsetParent !== null &&
|
|
577
|
+
el.children.length === 0
|
|
578
|
+
) {
|
|
579
|
+
el.click();
|
|
580
|
+
return true;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
// fallback: look for a hashtag icon button
|
|
584
|
+
const hashBtn = document.querySelector('[class*="topic"][class*="btn"], [class*="hashtag"][class*="btn"]');
|
|
585
|
+
if (hashBtn) { hashBtn.click(); return true; }
|
|
586
|
+
return false;
|
|
587
|
+
}
|
|
588
|
+
`);
|
|
589
|
+
if (!btnClicked)
|
|
590
|
+
continue; // Skip topic if UI not found — non-fatal
|
|
591
|
+
await page.wait({ time: 1 });
|
|
592
|
+
// Type into the topic search input
|
|
593
|
+
const typed = await page.evaluate(`
|
|
594
|
+
(topicName => {
|
|
595
|
+
const input = document.querySelector(
|
|
596
|
+
'[class*="topic"] input, [class*="hashtag"] input, input[placeholder*="搜索话题"]'
|
|
597
|
+
);
|
|
598
|
+
if (!input || input.offsetParent === null) return false;
|
|
599
|
+
input.focus();
|
|
600
|
+
document.execCommand('insertText', false, topicName);
|
|
601
|
+
input.dispatchEvent(new Event('input', { bubbles: true }));
|
|
602
|
+
return true;
|
|
603
|
+
})(${JSON.stringify(topic)})
|
|
604
|
+
`);
|
|
605
|
+
if (!typed)
|
|
606
|
+
continue;
|
|
607
|
+
await page.wait({ time: 1.5 }); // Wait for autocomplete suggestions
|
|
608
|
+
// Click the first suggestion
|
|
609
|
+
await page.evaluate(`
|
|
610
|
+
() => {
|
|
611
|
+
const item = document.querySelector(
|
|
612
|
+
'[class*="topic-item"], [class*="hashtag-item"], [class*="suggest-item"], [class*="suggestion"] li'
|
|
613
|
+
);
|
|
614
|
+
if (item) item.click();
|
|
615
|
+
}
|
|
616
|
+
`);
|
|
617
|
+
await page.wait({ time: 0.5 });
|
|
618
|
+
}
|
|
619
|
+
// ── Step 7: Publish or save draft ─────────────────────────────────────────
|
|
620
|
+
const actionLabels = isDraft ? ['暂存离开', '存草稿'] : ['发布', '发布笔记'];
|
|
621
|
+
const invokeResult = await page.evaluate(`
|
|
622
|
+
(cfg => {
|
|
623
|
+
const { isDraftMode, publishNames, draftNames, labels } = cfg;
|
|
624
|
+
const isVisible = (el) => {
|
|
625
|
+
if (!el || el.offsetParent === null) return false;
|
|
626
|
+
const rect = el.getBoundingClientRect();
|
|
627
|
+
return rect.width > 0 && rect.height > 0;
|
|
628
|
+
};
|
|
629
|
+
// Path 1: web component method invoke on <xhs-publish-btn>.
|
|
630
|
+
const hosts = Array.from(document.querySelectorAll('xhs-publish-btn')).filter(isVisible);
|
|
631
|
+
const wanted = isDraftMode ? draftNames : publishNames;
|
|
632
|
+
// Try every host + every candidate; do NOT bail on the first throw
|
|
633
|
+
// (multiple hosts can exist, and a later name may succeed).
|
|
634
|
+
let lastMethodError = null;
|
|
635
|
+
for (const host of hosts) {
|
|
636
|
+
for (const name of wanted) {
|
|
637
|
+
if (typeof host[name] !== 'function') continue;
|
|
638
|
+
try {
|
|
639
|
+
host[name]();
|
|
640
|
+
return { ok: true, via: 'method', name };
|
|
641
|
+
} catch (err) {
|
|
642
|
+
lastMethodError = String(err && err.message || err);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
// Path 2: legacy <button>/[role=button] text-match click fallback.
|
|
647
|
+
const buttons = document.querySelectorAll('button, [role="button"]');
|
|
648
|
+
for (const btn of buttons) {
|
|
649
|
+
const text = (btn.innerText || btn.textContent || '').trim();
|
|
650
|
+
if (
|
|
651
|
+
labels.some(l => text === l || text.includes(l)) &&
|
|
652
|
+
isVisible(btn) &&
|
|
653
|
+
!btn.disabled
|
|
654
|
+
) {
|
|
655
|
+
btn.click();
|
|
656
|
+
return { ok: true, via: 'click', text };
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
return { ok: false, via: 'none', hosts: hosts.length, lastMethodError };
|
|
660
|
+
})(${JSON.stringify({
|
|
661
|
+
isDraftMode: isDraft,
|
|
662
|
+
publishNames: PUBLISH_METHOD_NAMES,
|
|
663
|
+
draftNames: DRAFT_METHOD_NAMES,
|
|
664
|
+
labels: actionLabels,
|
|
665
|
+
})})
|
|
666
|
+
`);
|
|
667
|
+
if (!invokeResult?.ok) {
|
|
668
|
+
await page.screenshot({ path: '/tmp/xhs_publish_submit_debug.png' });
|
|
669
|
+
const viaClause = invokeResult?.via ? ` (via=${invokeResult.via})` : '';
|
|
670
|
+
const errorClause = invokeResult?.error ? `, error=${invokeResult.error}` : '';
|
|
671
|
+
const lastMethodClause = invokeResult?.lastMethodError ? `, lastMethodError=${invokeResult.lastMethodError}` : '';
|
|
672
|
+
throw new Error(`Could not trigger "${actionLabels[0]}" action${viaClause}${errorClause}${lastMethodClause}. ` +
|
|
673
|
+
'Debug screenshot: /tmp/xhs_publish_submit_debug.png');
|
|
674
|
+
}
|
|
675
|
+
// ── Step 8: Verify success ─────────────────────────────────────────────────
|
|
676
|
+
await page.wait({ time: 4 });
|
|
677
|
+
const finalUrl = await page.evaluate('() => location.href');
|
|
678
|
+
const successMarkers = isDraft
|
|
679
|
+
? ['草稿已保存', '暂存成功', '保存成功', '上传成功']
|
|
680
|
+
: ['发布成功', '上传成功'];
|
|
681
|
+
const successMsg = await page.evaluate(`
|
|
682
|
+
(markers => {
|
|
683
|
+
for (const el of document.querySelectorAll('*')) {
|
|
684
|
+
const text = (el.innerText || '').trim();
|
|
685
|
+
if (el.children.length === 0 && markers.some(marker => text.includes(marker))) return text;
|
|
686
|
+
}
|
|
687
|
+
return '';
|
|
688
|
+
})(${JSON.stringify(successMarkers)})
|
|
689
|
+
`);
|
|
690
|
+
const navigatedAway = !finalUrl.includes('/publish/publish');
|
|
691
|
+
const isSuccess = successMsg.length > 0 || navigatedAway;
|
|
692
|
+
const verb = isDraft ? '暂存成功' : '发布成功';
|
|
693
|
+
return [
|
|
694
|
+
{
|
|
695
|
+
status: isSuccess ? `✅ ${verb}` : '⚠️ 操作完成,请在浏览器中确认',
|
|
696
|
+
detail: [
|
|
697
|
+
`"${title}"`,
|
|
698
|
+
`${absImagePaths.length}张图片`,
|
|
699
|
+
topics.length ? `话题: ${topics.join(' ')}` : '',
|
|
700
|
+
successMsg || finalUrl || '',
|
|
701
|
+
]
|
|
702
|
+
.filter(Boolean)
|
|
703
|
+
.join(' · '),
|
|
704
|
+
},
|
|
705
|
+
];
|
|
706
|
+
},
|
|
707
|
+
});
|