@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,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barchart stock quote — price, volume, market cap, P/E, EPS, and key metrics.
|
|
3
|
+
* Auth: CSRF token from <meta name="csrf-token"> + session cookies.
|
|
4
|
+
*/
|
|
5
|
+
import { cli, Strategy } from '@sovovs/bycli/registry';
|
|
6
|
+
import { CommandExecutionError } from '@sovovs/bycli/errors';
|
|
7
|
+
cli({
|
|
8
|
+
site: 'barchart',
|
|
9
|
+
name: 'quote',
|
|
10
|
+
access: 'read',
|
|
11
|
+
description: 'Barchart stock quote with price, volume, and key metrics',
|
|
12
|
+
domain: 'www.barchart.com',
|
|
13
|
+
strategy: Strategy.COOKIE,
|
|
14
|
+
args: [
|
|
15
|
+
{ name: 'symbol', required: true, positional: true, help: 'Stock ticker (e.g. AAPL, MSFT, TSLA)' },
|
|
16
|
+
],
|
|
17
|
+
columns: [
|
|
18
|
+
'symbol', 'name', 'price', 'change', 'changePct',
|
|
19
|
+
'open', 'high', 'low', 'prevClose', 'volume',
|
|
20
|
+
'avgVolume', 'marketCap', 'peRatio', 'eps',
|
|
21
|
+
],
|
|
22
|
+
func: async (page, kwargs) => {
|
|
23
|
+
const symbol = kwargs.symbol.toUpperCase().trim();
|
|
24
|
+
await page.goto(`https://www.barchart.com/stocks/quotes/${encodeURIComponent(symbol)}/overview`);
|
|
25
|
+
await page.wait(4);
|
|
26
|
+
const data = await page.evaluate(`
|
|
27
|
+
(async () => {
|
|
28
|
+
const sym = ${JSON.stringify(symbol)};
|
|
29
|
+
const csrf = document.querySelector('meta[name="csrf-token"]')?.content || '';
|
|
30
|
+
|
|
31
|
+
// Strategy 1: internal proxy API with CSRF token
|
|
32
|
+
try {
|
|
33
|
+
const fields = [
|
|
34
|
+
'symbol','symbolName','lastPrice','priceChange','percentChange',
|
|
35
|
+
'highPrice','lowPrice','openPrice','previousPrice','volume','averageVolume',
|
|
36
|
+
'marketCap','peRatio','earningsPerShare','tradeTime',
|
|
37
|
+
].join(',');
|
|
38
|
+
const url = '/proxies/core-api/v1/quotes/get?symbol=' + encodeURIComponent(sym) + '&fields=' + fields;
|
|
39
|
+
const resp = await fetch(url, {
|
|
40
|
+
credentials: 'include',
|
|
41
|
+
headers: { 'X-CSRF-TOKEN': csrf },
|
|
42
|
+
});
|
|
43
|
+
if (resp.ok) {
|
|
44
|
+
const d = await resp.json();
|
|
45
|
+
const row = d?.data?.[0] || null;
|
|
46
|
+
if (row) {
|
|
47
|
+
return { source: 'api', row };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
} catch(e) {}
|
|
51
|
+
|
|
52
|
+
// Strategy 2: parse from DOM
|
|
53
|
+
try {
|
|
54
|
+
const priceEl = document.querySelector('span.last-change');
|
|
55
|
+
const price = priceEl ? priceEl.textContent.trim() : null;
|
|
56
|
+
|
|
57
|
+
// Change values are sibling spans inside .pricechangerow > .last-change
|
|
58
|
+
const changeParent = priceEl?.parentElement;
|
|
59
|
+
const changeSpans = changeParent ? changeParent.querySelectorAll('span') : [];
|
|
60
|
+
let change = null;
|
|
61
|
+
let changePct = null;
|
|
62
|
+
for (const s of changeSpans) {
|
|
63
|
+
const t = s.textContent.trim();
|
|
64
|
+
if (s === priceEl) continue;
|
|
65
|
+
if (t.includes('%')) changePct = t.replace(/[()]/g, '');
|
|
66
|
+
else if (t.match(/^[+-]?[\\d.]+$/)) change = t;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Financial data rows
|
|
70
|
+
const rows = document.querySelectorAll('.financial-data-row');
|
|
71
|
+
const fdata = {};
|
|
72
|
+
for (const row of rows) {
|
|
73
|
+
const spans = row.querySelectorAll('span');
|
|
74
|
+
if (spans.length >= 2) {
|
|
75
|
+
const label = spans[0].textContent.trim();
|
|
76
|
+
const valSpan = row.querySelector('span.right span:not(.ng-hide)');
|
|
77
|
+
fdata[label] = valSpan ? valSpan.textContent.trim() : '';
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Day high/low from row chart
|
|
82
|
+
const dayLow = document.querySelector('.bc-quote-row-chart .small-6:first-child .inline:not(.ng-hide)');
|
|
83
|
+
const dayHigh = document.querySelector('.bc-quote-row-chart .text-right .inline:not(.ng-hide)');
|
|
84
|
+
const openEl = document.querySelector('.mark span');
|
|
85
|
+
const openText = openEl ? openEl.textContent.trim().replace('Open ', '') : null;
|
|
86
|
+
|
|
87
|
+
const name = document.querySelector('h1 span.symbol');
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
source: 'dom',
|
|
91
|
+
row: {
|
|
92
|
+
symbol: sym,
|
|
93
|
+
symbolName: name ? name.textContent.trim() : sym,
|
|
94
|
+
lastPrice: price,
|
|
95
|
+
priceChange: change,
|
|
96
|
+
percentChange: changePct,
|
|
97
|
+
open: openText,
|
|
98
|
+
highPrice: dayHigh ? dayHigh.textContent.trim() : null,
|
|
99
|
+
lowPrice: dayLow ? dayLow.textContent.trim() : null,
|
|
100
|
+
previousClose: fdata['Previous Close'] || null,
|
|
101
|
+
volume: fdata['Volume'] || null,
|
|
102
|
+
averageVolume: fdata['Average Volume'] || null,
|
|
103
|
+
marketCap: null,
|
|
104
|
+
peRatio: null,
|
|
105
|
+
earningsPerShare: null,
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
} catch(e) {
|
|
109
|
+
return { error: 'Could not fetch quote for ' + sym + ': ' + e.message };
|
|
110
|
+
}
|
|
111
|
+
})()
|
|
112
|
+
`);
|
|
113
|
+
if (!data || data.error)
|
|
114
|
+
throw new CommandExecutionError(data?.error || `Failed to fetch quote for ${symbol}`);
|
|
115
|
+
const r = data.row || {};
|
|
116
|
+
// API returns formatted strings like "+1.41" and "+0.56%"; use raw if available
|
|
117
|
+
const raw = r.raw || {};
|
|
118
|
+
return [{
|
|
119
|
+
symbol: r.symbol || symbol,
|
|
120
|
+
name: r.symbolName || r.name || symbol,
|
|
121
|
+
price: r.lastPrice ?? null,
|
|
122
|
+
change: r.priceChange ?? null,
|
|
123
|
+
changePct: r.percentChange ?? null,
|
|
124
|
+
open: r.openPrice ?? r.open ?? null,
|
|
125
|
+
high: r.highPrice ?? null,
|
|
126
|
+
low: r.lowPrice ?? null,
|
|
127
|
+
prevClose: r.previousPrice ?? r.previousClose ?? null,
|
|
128
|
+
volume: r.volume ?? null,
|
|
129
|
+
avgVolume: r.averageVolume ?? null,
|
|
130
|
+
marketCap: r.marketCap ?? null,
|
|
131
|
+
peRatio: r.peRatio ?? null,
|
|
132
|
+
eps: r.earningsPerShare ?? null,
|
|
133
|
+
}];
|
|
134
|
+
},
|
|
135
|
+
});
|
package/clis/bbc/news.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BBC News headlines — public RSS feed, no browser needed.
|
|
3
|
+
*/
|
|
4
|
+
import { cli, Strategy } from '@sovovs/bycli/registry';
|
|
5
|
+
cli({
|
|
6
|
+
site: 'bbc',
|
|
7
|
+
name: 'news',
|
|
8
|
+
access: 'read',
|
|
9
|
+
description: 'BBC News headlines (RSS)',
|
|
10
|
+
domain: 'www.bbc.com',
|
|
11
|
+
strategy: Strategy.PUBLIC,
|
|
12
|
+
args: [
|
|
13
|
+
{ name: 'limit', type: 'int', default: 20, help: 'Number of headlines (max 50)' },
|
|
14
|
+
],
|
|
15
|
+
columns: ['rank', 'title', 'description', 'url'],
|
|
16
|
+
func: async (kwargs) => {
|
|
17
|
+
const count = Math.min(kwargs.limit || 20, 50);
|
|
18
|
+
const resp = await fetch('https://feeds.bbci.co.uk/news/rss.xml');
|
|
19
|
+
if (!resp.ok)
|
|
20
|
+
return [];
|
|
21
|
+
const xml = await resp.text();
|
|
22
|
+
// Simple XML parsing without DOMParser (works in Node)
|
|
23
|
+
const items = [];
|
|
24
|
+
const itemRegex = /<item>([\s\S]*?)<\/item>/g;
|
|
25
|
+
let match;
|
|
26
|
+
while ((match = itemRegex.exec(xml)) && items.length < count) {
|
|
27
|
+
const block = match[1];
|
|
28
|
+
const title = block.match(/<title><!\[CDATA\[(.*?)\]\]>|<title>(.*?)<\/title>/)?.[1] || block.match(/<title>(.*?)<\/title>/)?.[1] || '';
|
|
29
|
+
const desc = block.match(/<description><!\[CDATA\[(.*?)\]\]>|<description>(.*?)<\/description>/)?.[1] || block.match(/<description>(.*?)<\/description>/)?.[1] || '';
|
|
30
|
+
const link = block.match(/<link>(.*?)<\/link>/)?.[1] || block.match(/<guid[^>]*>(.*?)<\/guid>/)?.[1] || '';
|
|
31
|
+
if (title) {
|
|
32
|
+
items.push({
|
|
33
|
+
rank: items.length + 1,
|
|
34
|
+
title: title.trim(),
|
|
35
|
+
description: desc.trim().substring(0, 200),
|
|
36
|
+
url: link.trim(),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return items;
|
|
41
|
+
},
|
|
42
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// bbc topic — BBC News headlines for a specific category, via public RSS.
|
|
2
|
+
//
|
|
3
|
+
// BBC publishes per-section RSS feeds at
|
|
4
|
+
// `https://feeds.bbci.co.uk/news/<topic>/rss.xml`. We expose the eight
|
|
5
|
+
// canonical sections and reject anything else with a typed argument error
|
|
6
|
+
// so the user knows the supported set.
|
|
7
|
+
import { cli, Strategy } from '@sovovs/bycli/registry';
|
|
8
|
+
import { ArgumentError, EmptyResultError } from '@sovovs/bycli/errors';
|
|
9
|
+
import { bbcFetchRss, parseRssItems, pubDateToIso, requireBoundedInt } from './utils.js';
|
|
10
|
+
|
|
11
|
+
const TOPICS = [
|
|
12
|
+
'world',
|
|
13
|
+
'business',
|
|
14
|
+
'politics',
|
|
15
|
+
'health',
|
|
16
|
+
'education',
|
|
17
|
+
'science_and_environment',
|
|
18
|
+
'technology',
|
|
19
|
+
'entertainment_and_arts',
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
cli({
|
|
23
|
+
site: 'bbc',
|
|
24
|
+
name: 'topic',
|
|
25
|
+
access: 'read',
|
|
26
|
+
description: 'BBC News headlines for a specific section (RSS feed)',
|
|
27
|
+
domain: 'www.bbc.com',
|
|
28
|
+
strategy: Strategy.PUBLIC,
|
|
29
|
+
browser: false,
|
|
30
|
+
args: [
|
|
31
|
+
{ name: 'topic', positional: true, required: true, help: `Section name (${TOPICS.join(' / ')})` },
|
|
32
|
+
{ name: 'limit', type: 'int', default: 20, help: 'Max headlines (1-50)' },
|
|
33
|
+
],
|
|
34
|
+
columns: ['rank', 'title', 'description', 'pubDate', 'url'],
|
|
35
|
+
func: async (args) => {
|
|
36
|
+
const raw = String(args.topic ?? '').trim().toLowerCase().replace(/[\s-]+/g, '_');
|
|
37
|
+
if (!TOPICS.includes(raw)) {
|
|
38
|
+
throw new ArgumentError(
|
|
39
|
+
`bbc topic "${args.topic}" is not supported`,
|
|
40
|
+
`Supported topics: ${TOPICS.join(', ')}`,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
const limit = requireBoundedInt(args.limit, 20, 50);
|
|
44
|
+
const xml = await bbcFetchRss(`${raw}/rss.xml`, `bbc topic ${raw}`);
|
|
45
|
+
const items = parseRssItems(xml);
|
|
46
|
+
if (!items.length) {
|
|
47
|
+
throw new EmptyResultError('bbc topic', `BBC ${raw} feed returned no items.`);
|
|
48
|
+
}
|
|
49
|
+
return items.slice(0, limit).map((it, i) => ({
|
|
50
|
+
rank: i + 1,
|
|
51
|
+
title: it.title,
|
|
52
|
+
description: it.description,
|
|
53
|
+
pubDate: pubDateToIso(it.pubDate),
|
|
54
|
+
url: it.link,
|
|
55
|
+
}));
|
|
56
|
+
},
|
|
57
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Shared helpers for the bbc adapters that hit BBC's public RSS feeds.
|
|
2
|
+
import { ArgumentError, CommandExecutionError } from '@sovovs/bycli/errors';
|
|
3
|
+
|
|
4
|
+
export const BBC_FEED_BASE = 'https://feeds.bbci.co.uk/news';
|
|
5
|
+
const UA = 'bycli-bbc-adapter (+https://github.com/sovovs/byCLI)';
|
|
6
|
+
|
|
7
|
+
const HTML_ENTITIES = {
|
|
8
|
+
'&': '&', '<': '<', '>': '>', '"': '"', ''': "'", ''': "'", ' ': ' ',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function decodeHtmlEntities(value) {
|
|
12
|
+
return String(value ?? '')
|
|
13
|
+
.replace(/&#x([0-9a-fA-F]+);/g, (_, h) => String.fromCodePoint(parseInt(h, 16)))
|
|
14
|
+
.replace(/&#(\d+);/g, (_, d) => String.fromCodePoint(parseInt(d, 10)))
|
|
15
|
+
.replace(/&(amp|lt|gt|quot|apos|#39|nbsp);/g, (m) => HTML_ENTITIES[m] || m);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Extract `<tag>…</tag>` (CDATA-aware) from a block. */
|
|
19
|
+
export function extractRssTag(block, tag) {
|
|
20
|
+
const cdata = block.match(new RegExp(`<${tag}[^>]*>\\s*<!\\[CDATA\\[([\\s\\S]*?)\\]\\]>\\s*<\\/${tag}>`));
|
|
21
|
+
if (cdata) return cdata[1];
|
|
22
|
+
const plain = block.match(new RegExp(`<${tag}[^>]*>([\\s\\S]*?)<\\/${tag}>`));
|
|
23
|
+
return plain ? plain[1] : '';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function parseRssItems(xml) {
|
|
27
|
+
const out = [];
|
|
28
|
+
const re = /<item[^>]*>([\s\S]*?)<\/item>/g;
|
|
29
|
+
let m;
|
|
30
|
+
while ((m = re.exec(String(xml || ''))) !== null) {
|
|
31
|
+
const block = m[1];
|
|
32
|
+
out.push({
|
|
33
|
+
title: decodeHtmlEntities(extractRssTag(block, 'title')).trim(),
|
|
34
|
+
description: decodeHtmlEntities(extractRssTag(block, 'description')).trim(),
|
|
35
|
+
link: decodeHtmlEntities(extractRssTag(block, 'link')).trim(),
|
|
36
|
+
pubDate: decodeHtmlEntities(extractRssTag(block, 'pubDate')).trim(),
|
|
37
|
+
guid: decodeHtmlEntities(extractRssTag(block, 'guid')).trim(),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function requireBoundedInt(value, defaultValue, maxValue, label = 'limit') {
|
|
44
|
+
const raw = value ?? defaultValue;
|
|
45
|
+
const n = typeof raw === 'number' ? raw : Number(raw);
|
|
46
|
+
if (!Number.isInteger(n) || n <= 0) {
|
|
47
|
+
throw new ArgumentError(`bbc ${label} must be a positive integer`);
|
|
48
|
+
}
|
|
49
|
+
if (n > maxValue) {
|
|
50
|
+
throw new ArgumentError(`bbc ${label} must be <= ${maxValue}`);
|
|
51
|
+
}
|
|
52
|
+
return n;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export async function bbcFetchRss(path, label) {
|
|
56
|
+
const url = `${BBC_FEED_BASE}/${path}`;
|
|
57
|
+
let resp;
|
|
58
|
+
try {
|
|
59
|
+
resp = await fetch(url, { headers: { 'user-agent': UA, accept: 'application/rss+xml, application/xml' } });
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
throw new CommandExecutionError(
|
|
63
|
+
`${label} request failed: ${err?.message ?? err}`,
|
|
64
|
+
'Check that feeds.bbci.co.uk is reachable from this network.',
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
if (!resp.ok) {
|
|
68
|
+
throw new CommandExecutionError(`${label} returned HTTP ${resp.status} (${url})`);
|
|
69
|
+
}
|
|
70
|
+
return resp.text();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Convert RFC-822 pubDate to ISO `YYYY-MM-DD`; empty string on parse failure. */
|
|
74
|
+
export function pubDateToIso(value) {
|
|
75
|
+
if (!value) return '';
|
|
76
|
+
const d = new Date(value);
|
|
77
|
+
if (Number.isNaN(d.getTime())) return '';
|
|
78
|
+
return d.toISOString().slice(0, 10);
|
|
79
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bilibili comment — posts a top-level comment or a reply on a video via the official API.
|
|
3
|
+
* Uses /x/v2/reply/add, authenticated by the logged-in cookie + bili_jct CSRF token.
|
|
4
|
+
* @username mentions in the message are resolved to real mentions (at_name_to_mid).
|
|
5
|
+
*/
|
|
6
|
+
import { cli, Strategy } from '@sovovs/bycli/registry';
|
|
7
|
+
import { ArgumentError, AuthRequiredError, CommandExecutionError, EmptyResultError } from '@sovovs/bycli/errors';
|
|
8
|
+
import { apiGet, apiPost, resolveBvid, resolveUid } from './utils.js';
|
|
9
|
+
|
|
10
|
+
function isAuthLikeBilibiliError(code, message) {
|
|
11
|
+
return code === -101 || code === -111 || code === -403 || /csrf|登录|账号|权限|forbidden|permission|login/i.test(String(message ?? ''));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function requireOkPayload(payload, label) {
|
|
15
|
+
if (!payload || typeof payload !== 'object' || Array.isArray(payload) || !Object.hasOwn(payload, 'code')) {
|
|
16
|
+
throw new CommandExecutionError(`Bilibili ${label} API returned a malformed payload`);
|
|
17
|
+
}
|
|
18
|
+
if (payload.code !== 0) {
|
|
19
|
+
const message = payload.message ?? 'unknown error';
|
|
20
|
+
if (isAuthLikeBilibiliError(payload.code, message)) {
|
|
21
|
+
throw new AuthRequiredError('bilibili.com', `Bilibili ${label} API requires login or permission: ${message} (${payload.code})`);
|
|
22
|
+
}
|
|
23
|
+
throw new CommandExecutionError(`Bilibili ${label} API failed: ${message} (${payload.code})`);
|
|
24
|
+
}
|
|
25
|
+
return payload.data;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function readPositiveInteger(value, label) {
|
|
29
|
+
const n = Number(value);
|
|
30
|
+
if (!Number.isInteger(n) || n <= 0) {
|
|
31
|
+
throw new ArgumentError(`bilibili comment ${label} must be a positive integer`);
|
|
32
|
+
}
|
|
33
|
+
return n;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
cli({
|
|
37
|
+
site: 'bilibili',
|
|
38
|
+
name: 'comment',
|
|
39
|
+
access: 'write',
|
|
40
|
+
description: '在 B站视频下发表评论或回复(官方 API,需登录;消息里的 @用户 会被解析为真实提及)',
|
|
41
|
+
domain: 'www.bilibili.com',
|
|
42
|
+
strategy: Strategy.COOKIE,
|
|
43
|
+
args: [
|
|
44
|
+
{ name: 'bvid', required: true, positional: true, help: 'Video BV ID / URL / b23.tv short link' },
|
|
45
|
+
{ name: 'message', required: true, positional: true, help: 'Comment text. Any @username in it is resolved to a real mention' },
|
|
46
|
+
{ name: 'parent', type: 'int', help: 'top-level/root rpid to reply under (omit for a top-level comment)' },
|
|
47
|
+
{ name: 'execute', type: 'boolean', help: 'Actually post the comment. Without it the command refuses to write.' },
|
|
48
|
+
],
|
|
49
|
+
columns: ['rpid', 'bvid', 'oid', 'message', 'url'],
|
|
50
|
+
func: async (page, kwargs) => {
|
|
51
|
+
if (!page) {
|
|
52
|
+
throw new CommandExecutionError('Browser session required for bilibili comment');
|
|
53
|
+
}
|
|
54
|
+
const message = String(kwargs.message ?? '').trim();
|
|
55
|
+
if (!message)
|
|
56
|
+
throw new ArgumentError('bilibili comment message cannot be empty');
|
|
57
|
+
// Write guard: posting is public and irreversible-ish, so require an explicit opt-in.
|
|
58
|
+
if (!kwargs.execute)
|
|
59
|
+
throw new ArgumentError('Refusing to post: pass --execute to actually publish this comment');
|
|
60
|
+
const parent = kwargs.parent != null ? readPositiveInteger(kwargs.parent, 'parent') : null;
|
|
61
|
+
let bvid;
|
|
62
|
+
try {
|
|
63
|
+
bvid = await resolveBvid(kwargs.bvid);
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
throw new ArgumentError(`Cannot resolve Bilibili BV ID from input: ${String(kwargs.bvid ?? '')}`, error instanceof Error ? error.message : String(error));
|
|
67
|
+
}
|
|
68
|
+
// Resolve bvid → aid (the reply API addresses videos by aid, as `oid`)
|
|
69
|
+
const view = await apiGet(page, '/x/web-interface/view', { params: { bvid } });
|
|
70
|
+
const viewData = requireOkPayload(view, 'view');
|
|
71
|
+
const oid = viewData?.aid;
|
|
72
|
+
if (!oid)
|
|
73
|
+
throw new CommandExecutionError(`Cannot resolve aid for bvid: ${bvid}`);
|
|
74
|
+
// Resolve @username mentions to uids. Bilibili only turns "@name" into a real
|
|
75
|
+
// mention — one that notifies the mentioned user — when the request carries
|
|
76
|
+
// at_name_to_mid; a plain-text "@name" is otherwise inert and notifies nobody.
|
|
77
|
+
/** @type {Record<string, number>} */
|
|
78
|
+
const atNameToMid = {};
|
|
79
|
+
for (const match of message.matchAll(/@([^\s@]+)/g)) {
|
|
80
|
+
const name = match[1];
|
|
81
|
+
if (name in atNameToMid)
|
|
82
|
+
continue;
|
|
83
|
+
try {
|
|
84
|
+
const mid = Number(await resolveUid(page, name));
|
|
85
|
+
if (!Number.isInteger(mid) || mid <= 0) {
|
|
86
|
+
throw new CommandExecutionError(`Bilibili user search returned malformed mid for @${name}`);
|
|
87
|
+
}
|
|
88
|
+
atNameToMid[name] = mid;
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
if (!(error instanceof EmptyResultError)) {
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
// Unresolvable @name (typo, or not a user) — leave it as plain text.
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// For a reply, Bilibili needs both `root` (top-level comment) and `parent`.
|
|
98
|
+
// Replying to a top-level comment means root === parent.
|
|
99
|
+
const params = {
|
|
100
|
+
oid,
|
|
101
|
+
type: 1,
|
|
102
|
+
message,
|
|
103
|
+
plat: 1,
|
|
104
|
+
...(parent != null
|
|
105
|
+
? { root: parent, parent }
|
|
106
|
+
: {}),
|
|
107
|
+
...(Object.keys(atNameToMid).length > 0
|
|
108
|
+
? { at_name_to_mid: JSON.stringify(atNameToMid) }
|
|
109
|
+
: {}),
|
|
110
|
+
};
|
|
111
|
+
const payload = await apiPost(page, '/x/v2/reply/add', { params });
|
|
112
|
+
const postData = requireOkPayload(payload, 'reply add');
|
|
113
|
+
const rpid = postData?.rpid;
|
|
114
|
+
if (!rpid) {
|
|
115
|
+
throw new CommandExecutionError('Bilibili reply add API did not return rpid for the posted comment');
|
|
116
|
+
}
|
|
117
|
+
return [{
|
|
118
|
+
rpid: String(rpid),
|
|
119
|
+
bvid,
|
|
120
|
+
oid: String(oid),
|
|
121
|
+
message,
|
|
122
|
+
url: `https://www.bilibili.com/video/${bvid}#reply${rpid}`,
|
|
123
|
+
}];
|
|
124
|
+
},
|
|
125
|
+
});
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { ArgumentError, AuthRequiredError, CommandExecutionError, EmptyResultError } from '@sovovs/bycli/errors';
|
|
3
|
+
|
|
4
|
+
const { mockApiGet, mockApiPost, mockResolveUid } = vi.hoisted(() => ({
|
|
5
|
+
mockApiGet: vi.fn(),
|
|
6
|
+
mockApiPost: vi.fn(),
|
|
7
|
+
mockResolveUid: vi.fn(),
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
vi.mock('./utils.js', async (importOriginal) => ({
|
|
11
|
+
...(await importOriginal()),
|
|
12
|
+
apiGet: mockApiGet,
|
|
13
|
+
apiPost: mockApiPost,
|
|
14
|
+
resolveUid: mockResolveUid,
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
import { getRegistry } from '@sovovs/bycli/registry';
|
|
18
|
+
import './comment.js';
|
|
19
|
+
|
|
20
|
+
describe('bilibili comment', () => {
|
|
21
|
+
const command = getRegistry().get('bilibili/comment');
|
|
22
|
+
|
|
23
|
+
beforeEach(() => {
|
|
24
|
+
mockApiGet.mockReset();
|
|
25
|
+
mockApiPost.mockReset();
|
|
26
|
+
mockResolveUid.mockReset();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('refuses to post without --execute', async () => {
|
|
30
|
+
await expect(
|
|
31
|
+
command.func({}, { bvid: 'BV1WtAGzYEBm', message: 'hi' }),
|
|
32
|
+
).rejects.toThrow(/--execute/);
|
|
33
|
+
expect(mockApiPost).not.toHaveBeenCalled();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('rejects an empty message before calling the API', async () => {
|
|
37
|
+
await expect(
|
|
38
|
+
command.func({}, { bvid: 'BV1xxx', message: ' ', execute: true }),
|
|
39
|
+
).rejects.toThrow(/empty/i);
|
|
40
|
+
expect(mockApiGet).not.toHaveBeenCalled();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('posts a top-level comment, resolving @mentions to at_name_to_mid', async () => {
|
|
44
|
+
mockApiGet.mockResolvedValueOnce({ code: 0, data: { aid: 12345 } });
|
|
45
|
+
mockResolveUid.mockResolvedValueOnce('1141159409'); // @AI视频小助理 → mid
|
|
46
|
+
mockApiPost.mockResolvedValueOnce({ code: 0, data: { rpid: 99887766 } });
|
|
47
|
+
|
|
48
|
+
const result = await command.func({}, {
|
|
49
|
+
bvid: 'BV1WtAGzYEBm', message: '@AI视频小助理 总结一下', execute: true,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
expect(mockApiGet).toHaveBeenNthCalledWith(1, {}, '/x/web-interface/view', { params: { bvid: 'BV1WtAGzYEBm' } });
|
|
53
|
+
expect(mockResolveUid).toHaveBeenCalledWith({}, 'AI视频小助理');
|
|
54
|
+
expect(mockApiPost).toHaveBeenCalledWith({}, '/x/v2/reply/add', {
|
|
55
|
+
params: {
|
|
56
|
+
oid: 12345,
|
|
57
|
+
type: 1,
|
|
58
|
+
message: '@AI视频小助理 总结一下',
|
|
59
|
+
plat: 1,
|
|
60
|
+
at_name_to_mid: '{"AI视频小助理":1141159409}',
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
expect(result).toEqual([{
|
|
64
|
+
rpid: '99887766',
|
|
65
|
+
bvid: 'BV1WtAGzYEBm',
|
|
66
|
+
oid: '12345',
|
|
67
|
+
message: '@AI视频小助理 总结一下',
|
|
68
|
+
url: 'https://www.bilibili.com/video/BV1WtAGzYEBm#reply99887766',
|
|
69
|
+
}]);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('still posts when an @mention cannot be resolved, leaving it as plain text', async () => {
|
|
73
|
+
mockApiGet.mockResolvedValueOnce({ code: 0, data: { aid: 7 } });
|
|
74
|
+
mockResolveUid.mockRejectedValueOnce(new EmptyResultError('bilibili user search'));
|
|
75
|
+
mockApiPost.mockResolvedValueOnce({ code: 0, data: { rpid: 5 } });
|
|
76
|
+
|
|
77
|
+
await command.func({}, { bvid: 'BV1xxx', message: '@幽灵用户zzz hi', execute: true });
|
|
78
|
+
|
|
79
|
+
expect(mockApiPost).toHaveBeenCalledWith({}, '/x/v2/reply/add', {
|
|
80
|
+
params: { oid: 7, type: 1, message: '@幽灵用户zzz hi', plat: 1 },
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('fails closed when mention resolution has parser or transport errors', async () => {
|
|
85
|
+
mockApiGet.mockResolvedValueOnce({ code: 0, data: { aid: 7 } });
|
|
86
|
+
mockResolveUid.mockRejectedValueOnce(new CommandExecutionError('search API drift'));
|
|
87
|
+
|
|
88
|
+
await expect(
|
|
89
|
+
command.func({}, { bvid: 'BV1xxx', message: '@用户 hi', execute: true }),
|
|
90
|
+
).rejects.toBeInstanceOf(CommandExecutionError);
|
|
91
|
+
expect(mockApiPost).not.toHaveBeenCalled();
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('fails closed when mention resolution returns a malformed mid', async () => {
|
|
95
|
+
mockApiGet.mockResolvedValueOnce({ code: 0, data: { aid: 7 } });
|
|
96
|
+
mockResolveUid.mockResolvedValueOnce('not-a-mid');
|
|
97
|
+
|
|
98
|
+
await expect(
|
|
99
|
+
command.func({}, { bvid: 'BV1xxx', message: '@用户 hi', execute: true }),
|
|
100
|
+
).rejects.toBeInstanceOf(CommandExecutionError);
|
|
101
|
+
expect(mockApiPost).not.toHaveBeenCalled();
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('posts a reply under an existing comment when --parent is given', async () => {
|
|
105
|
+
mockApiGet.mockResolvedValueOnce({ code: 0, data: { aid: 1 } });
|
|
106
|
+
mockApiPost.mockResolvedValueOnce({ code: 0, data: { rpid: 2 } });
|
|
107
|
+
|
|
108
|
+
await command.func({}, { bvid: 'BV1xxx', message: 'thanks', parent: 555, execute: true });
|
|
109
|
+
|
|
110
|
+
expect(mockApiPost).toHaveBeenCalledWith({}, '/x/v2/reply/add', {
|
|
111
|
+
params: { oid: 1, type: 1, message: 'thanks', plat: 1, root: 555, parent: 555 },
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('throws when the bvid cannot be resolved to an aid', async () => {
|
|
116
|
+
mockApiGet.mockResolvedValueOnce({ code: 0, data: {} });
|
|
117
|
+
await expect(
|
|
118
|
+
command.func({}, { bvid: 'BVbroken', message: 'hi', execute: true }),
|
|
119
|
+
).rejects.toBeInstanceOf(CommandExecutionError);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('throws with the API code and message when Bilibili rejects the comment', async () => {
|
|
123
|
+
mockApiGet.mockResolvedValueOnce({ code: 0, data: { aid: 9 } });
|
|
124
|
+
mockApiPost.mockResolvedValueOnce({ code: 12025, message: '评论字数过多' });
|
|
125
|
+
await expect(
|
|
126
|
+
command.func({}, { bvid: 'BV1xxx', message: 'x', execute: true }),
|
|
127
|
+
).rejects.toBeInstanceOf(CommandExecutionError);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it('maps login/csrf failures from the write API to AuthRequiredError', async () => {
|
|
131
|
+
mockApiGet.mockResolvedValueOnce({ code: 0, data: { aid: 9 } });
|
|
132
|
+
mockApiPost.mockResolvedValueOnce({ code: -111, message: 'csrf 校验失败' });
|
|
133
|
+
await expect(
|
|
134
|
+
command.func({}, { bvid: 'BV1xxx', message: 'x', execute: true }),
|
|
135
|
+
).rejects.toBeInstanceOf(AuthRequiredError);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('rejects invalid parent ids before posting', async () => {
|
|
139
|
+
await expect(
|
|
140
|
+
command.func({}, { bvid: 'BV1xxx', message: 'x', parent: 0, execute: true }),
|
|
141
|
+
).rejects.toBeInstanceOf(ArgumentError);
|
|
142
|
+
expect(mockApiGet).not.toHaveBeenCalled();
|
|
143
|
+
expect(mockApiPost).not.toHaveBeenCalled();
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('fails closed when the write API omits rpid', async () => {
|
|
147
|
+
mockApiGet.mockResolvedValueOnce({ code: 0, data: { aid: 9 } });
|
|
148
|
+
mockApiPost.mockResolvedValueOnce({ code: 0, data: {} });
|
|
149
|
+
await expect(
|
|
150
|
+
command.func({}, { bvid: 'BV1xxx', message: 'x', execute: true }),
|
|
151
|
+
).rejects.toBeInstanceOf(CommandExecutionError);
|
|
152
|
+
});
|
|
153
|
+
});
|