publishport-opencli 1.8.4-pp.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +300 -0
- package/README.zh-CN.md +341 -0
- package/cli-manifest.json +44212 -0
- package/clis/12306/auth.js +59 -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 +166 -0
- package/clis/12306/utils.js +272 -0
- package/clis/12306/utils.test.js +424 -0
- package/clis/1688/assets.js +205 -0
- package/clis/1688/assets.test.js +39 -0
- package/clis/1688/auth.js +46 -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/auth.js +52 -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/_shared/site-auth.js +118 -0
- package/clis/_shared/site-auth.test.js +98 -0
- package/clis/aibase/news.js +110 -0
- package/clis/aibase/news.test.js +59 -0
- package/clis/amazon/auth.js +53 -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/_actions.js +318 -0
- package/clis/antigravity/antigravity.test.js +172 -0
- package/clis/antigravity/audit-extras.js +341 -0
- package/clis/antigravity/delete.js +60 -0
- package/clis/antigravity/dump.js +29 -0
- package/clis/antigravity/extract-code.js +33 -0
- package/clis/antigravity/history.js +26 -0
- package/clis/antigravity/mark-read.js +52 -0
- package/clis/antigravity/model.js +161 -0
- package/clis/antigravity/new.js +26 -0
- package/clis/antigravity/read.js +35 -0
- package/clis/antigravity/rename.js +33 -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/storage.js +366 -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/archive/archive.test.js +262 -0
- package/clis/archive/item.js +92 -0
- package/clis/archive/search.js +115 -0
- package/clis/archive/snapshots.js +129 -0
- package/clis/archive/wayback.js +83 -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/autohome/__fixtures__/catalog.html +11 -0
- package/clis/autohome/__fixtures__/koubei.json +116 -0
- package/clis/autohome/autohome.test.js +115 -0
- package/clis/autohome/brand.js +108 -0
- package/clis/autohome/score.js +103 -0
- package/clis/autohome/utils.js +157 -0
- package/clis/baidu-scholar/search.js +87 -0
- package/clis/baidu-scholar/search.test.js +23 -0
- package/clis/band/auth.js +62 -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/auth.js +36 -0
- package/clis/bilibili/comment.js +107 -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 +178 -0
- package/clis/bilibili/download.test.js +173 -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/follow.js +140 -0
- package/clis/bilibili/follow.test.js +203 -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 +141 -0
- package/clis/bilibili/subtitle.test.js +240 -0
- package/clis/bilibili/summary.js +167 -0
- package/clis/bilibili/summary.test.js +210 -0
- package/clis/bilibili/unfollow.js +121 -0
- package/clis/bilibili/user-videos.js +39 -0
- package/clis/bilibili/utils.js +273 -0
- package/clis/bilibili/utils.test.js +97 -0
- package/clis/bilibili/video.js +155 -0
- package/clis/bilibili/video.test.js +308 -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 +125 -0
- package/clis/bloomberg/businessweek.test.js +149 -0
- package/clis/bloomberg/crypto.js +18 -0
- package/clis/bloomberg/economics.js +18 -0
- package/clis/bloomberg/feeds.js +16 -0
- package/clis/bloomberg/green.js +18 -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/pursuits.js +18 -0
- package/clis/bloomberg/tech.js +18 -0
- package/clis/bloomberg/utils.js +380 -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/auth.js +47 -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/auth.js +54 -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 +129 -0
- package/clis/chatgpt/auth.js +52 -0
- package/clis/chatgpt/commands.test.js +204 -0
- package/clis/chatgpt/detail.js +63 -0
- package/clis/chatgpt/envelope.test.js +108 -0
- package/clis/chatgpt/history.js +39 -0
- package/clis/chatgpt/image.js +167 -0
- package/clis/chatgpt/image.test.js +207 -0
- package/clis/chatgpt/model.js +31 -0
- package/clis/chatgpt/model.test.js +36 -0
- package/clis/chatgpt/new.js +32 -0
- package/clis/chatgpt/project-file-add.js +74 -0
- package/clis/chatgpt/project-list.js +37 -0
- package/clis/chatgpt/read.js +44 -0
- package/clis/chatgpt/send.js +68 -0
- package/clis/chatgpt/status.js +29 -0
- package/clis/chatgpt/utils.js +2226 -0
- package/clis/chatgpt/utils.test.js +1453 -0
- package/clis/chatgpt-app/ask.js +87 -0
- package/clis/chatgpt-app/ax.js +603 -0
- package/clis/chatgpt-app/ax.test.js +95 -0
- package/clis/chatgpt-app/commands.test.js +45 -0
- package/clis/chatgpt-app/model.js +25 -0
- package/clis/chatgpt-app/new.js +61 -0
- package/clis/chatgpt-app/read.js +32 -0
- package/clis/chatgpt-app/send.js +37 -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/auth.js +55 -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/_actions.js +270 -0
- package/clis/codex/archive.js +37 -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 +264 -0
- package/clis/codex/new.js +2 -0
- package/clis/codex/pin.js +30 -0
- package/clis/codex/projects.js +28 -0
- package/clis/codex/read.js +41 -0
- package/clis/codex/rename.js +86 -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 +388 -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/auth.js +48 -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/auth.js +50 -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 +399 -0
- package/clis/deepseek/auth.js +54 -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/auth.js +49 -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 +26 -0
- package/clis/discord-app/commands.test.js +395 -0
- package/clis/discord-app/delete.js +115 -0
- package/clis/discord-app/goto.js +38 -0
- package/clis/discord-app/members.js +39 -0
- package/clis/discord-app/read.js +42 -0
- package/clis/discord-app/search.js +67 -0
- package/clis/discord-app/send.js +28 -0
- package/clis/discord-app/servers.js +26 -0
- package/clis/discord-app/status.js +17 -0
- package/clis/discord-app/thread-read.js +45 -0
- package/clis/discord-app/threads.js +37 -0
- package/clis/discord-app/utils.js +610 -0
- package/clis/dockerhub/image.js +52 -0
- package/clis/dockerhub/search.js +47 -0
- package/clis/dockerhub/utils.js +100 -0
- package/clis/dongchedi/__fixtures__/search.json +60 -0
- package/clis/dongchedi/__fixtures__/series-detail.json +911 -0
- package/clis/dongchedi/__fixtures__/series-score.json +1396 -0
- package/clis/dongchedi/dongchedi.test.js +191 -0
- package/clis/dongchedi/koubei.js +85 -0
- package/clis/dongchedi/models.js +91 -0
- package/clis/dongchedi/score.js +83 -0
- package/clis/dongchedi/search.js +83 -0
- package/clis/dongchedi/series.js +87 -0
- package/clis/dongchedi/specs.js +115 -0
- package/clis/dongchedi/utils.js +180 -0
- package/clis/douban/auth.js +50 -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 +657 -0
- package/clis/douban/utils.test.js +488 -0
- package/clis/doubao/ask.js +40 -0
- package/clis/doubao/auth.js +66 -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 +1156 -0
- package/clis/doubao/utils.test.js +396 -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/auth.js +39 -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 +206 -0
- package/clis/douyin/publish.js +341 -0
- package/clis/douyin/publish.test.js +38 -0
- package/clis/douyin/search.js +308 -0
- package/clis/douyin/search.test.js +307 -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/auth.js +43 -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/auth.js +55 -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/auth.js +48 -0
- package/clis/gemini/commands.test.js +212 -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/detail.js +82 -0
- package/clis/gemini/history.js +70 -0
- package/clis/gemini/image.js +111 -0
- package/clis/gemini/new.js +22 -0
- package/clis/gemini/read.js +36 -0
- package/clis/gemini/reply-state.test.js +671 -0
- package/clis/gemini/status.js +32 -0
- package/clis/gemini/utils.js +2056 -0
- package/clis/gemini/utils.test.js +392 -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/auth.js +41 -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/github/auth.js +44 -0
- package/clis/github-trending/repos.js +168 -0
- package/clis/github-trending/repos.test.js +149 -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/auth.js +52 -0
- package/clis/grok/delete.js +54 -0
- package/clis/grok/detail.js +60 -0
- package/clis/grok/export-all.js +409 -0
- package/clis/grok/export-utils.js +94 -0
- package/clis/grok/export.js +189 -0
- package/clis/grok/export.test.js +210 -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/pin.js +68 -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 +640 -0
- package/clis/grok/utils.test.js +141 -0
- package/clis/guazi/__fixtures__/detail.html +7 -0
- package/clis/guazi/__fixtures__/list.html +5 -0
- package/clis/guazi/browse.js +95 -0
- package/clis/guazi/car.js +110 -0
- package/clis/guazi/guazi.test.js +126 -0
- package/clis/guazi/utils.js +133 -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/auth.js +41 -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/huodongxing/events.js +322 -0
- package/clis/huodongxing/events.test.js +296 -0
- package/clis/hupu/__fixtures__/hot-home.html +64 -0
- package/clis/hupu/auth.js +47 -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/auth.js +57 -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 +90 -0
- package/clis/instagram/instagram.test.js +381 -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/auth.js +46 -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/auth.js +62 -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/auth.js +48 -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/auth.js +46 -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/hot.js +37 -0
- package/clis/juejin/juejin.test.js +241 -0
- package/clis/juejin/recommend.js +61 -0
- package/clis/juejin/utils.js +199 -0
- package/clis/ke/auth.js +46 -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/kimi/_utils.js +110 -0
- package/clis/kimi/audit-extras.js +268 -0
- package/clis/kimi/auth.js +57 -0
- package/clis/kimi/chat.js +470 -0
- package/clis/kimi/kimi.test.js +187 -0
- package/clis/kimi/storage.js +169 -0
- package/clis/kimi/ui.js +314 -0
- package/clis/kimi/usage.js +144 -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/auth.js +62 -0
- package/clis/linkedin/connect.js +524 -0
- package/clis/linkedin/connect.test.js +328 -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/auth.js +62 -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/auth.js +55 -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/auth.js +47 -0
- package/clis/maimai/search-talents.js +192 -0
- package/clis/maimai/search-talents.test.js +29 -0
- package/clis/manus/_utils.js +133 -0
- package/clis/manus/auth.js +54 -0
- package/clis/manus/connectors.js +40 -0
- package/clis/manus/credits.js +39 -0
- package/clis/manus/list.js +66 -0
- package/clis/manus/manus.test.js +382 -0
- package/clis/manus/read.js +63 -0
- package/clis/manus/skills.js +61 -0
- package/clis/manus/status.js +43 -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/auth.js +55 -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/auth.js +65 -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/auth.js +64 -0
- package/clis/pixiv/detail.js +66 -0
- package/clis/pixiv/detail.test.js +93 -0
- package/clis/pixiv/download.js +82 -0
- package/clis/pixiv/download.test.js +97 -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 +59 -0
- package/clis/pixiv/user.test.js +100 -0
- package/clis/pixiv/utils.js +98 -0
- package/clis/powerchina/auth.js +52 -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 +55 -0
- package/clis/pubmed/author.js +64 -0
- package/clis/pubmed/citations.js +36 -0
- package/clis/pubmed/clinical-trial.js +59 -0
- package/clis/pubmed/journal.js +59 -0
- package/clis/pubmed/mesh.js +47 -0
- package/clis/pubmed/pubmed.test.js +464 -0
- package/clis/pubmed/related.js +45 -0
- package/clis/pubmed/review.js +58 -0
- package/clis/pubmed/search.js +75 -0
- package/clis/pubmed/utils.js +325 -0
- package/clis/pypi/downloads.js +66 -0
- package/clis/pypi/package.js +79 -0
- package/clis/pypi/utils.js +55 -0
- package/clis/qoder/_utils.js +191 -0
- package/clis/qoder/composer.js +45 -0
- package/clis/qoder/history.js +49 -0
- package/clis/qoder/qoder.test.js +125 -0
- package/clis/qoder/quest.js +147 -0
- package/clis/qoder/read.js +29 -0
- package/clis/qoder/status.js +21 -0
- package/clis/qoder/ui.js +332 -0
- package/clis/quark/auth.js +47 -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 +104 -0
- package/clis/qwen/ask.test.js +36 -0
- package/clis/qwen/auth.js +56 -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 +461 -0
- package/clis/qwen/utils.test.js +128 -0
- package/clis/reddit/auth.js +52 -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 +79 -0
- package/clis/reddit/popular.test.js +26 -0
- package/clis/reddit/read.js +588 -0
- package/clis/reddit/read.test.js +402 -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 +102 -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 +97 -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/auth.js +52 -0
- package/clis/rednote/comments.js +85 -0
- package/clis/rednote/download.js +59 -0
- package/clis/rednote/feed.js +27 -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 +240 -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/auth.js +67 -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/semanticscholar/citations.js +61 -0
- package/clis/semanticscholar/paper.js +52 -0
- package/clis/semanticscholar/recommendations.js +47 -0
- package/clis/semanticscholar/search.js +48 -0
- package/clis/semanticscholar/semanticscholar.test.js +279 -0
- package/clis/semanticscholar/utils.js +196 -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/slock/api-base-canary.test.js +62 -0
- package/clis/slock/attachment-download.js +72 -0
- package/clis/slock/attachment-download.test.js +102 -0
- package/clis/slock/attachment-upload.js +112 -0
- package/clis/slock/attachment-upload.test.js +131 -0
- package/clis/slock/attachment-url.js +53 -0
- package/clis/slock/attachment-url.test.js +41 -0
- package/clis/slock/auth-verify.js +19 -0
- package/clis/slock/bookmark-add.js +43 -0
- package/clis/slock/bookmark-add.test.js +38 -0
- package/clis/slock/bookmark-list.js +50 -0
- package/clis/slock/bookmark-list.test.js +47 -0
- package/clis/slock/bookmark-remove.js +42 -0
- package/clis/slock/bookmark-remove.test.js +24 -0
- package/clis/slock/channel-action.js +63 -0
- package/clis/slock/channel-action.test.js +65 -0
- package/clis/slock/channel-archive.js +9 -0
- package/clis/slock/channel-create.js +48 -0
- package/clis/slock/channel-create.test.js +40 -0
- package/clis/slock/channel-files.js +51 -0
- package/clis/slock/channel-files.test.js +32 -0
- package/clis/slock/channel-info.js +42 -0
- package/clis/slock/channel-info.test.js +25 -0
- package/clis/slock/channel-join.js +9 -0
- package/clis/slock/channel-leave.js +9 -0
- package/clis/slock/channel-list.js +40 -0
- package/clis/slock/channel-list.test.js +37 -0
- package/clis/slock/channel-mark.js +71 -0
- package/clis/slock/channel-mark.test.js +49 -0
- package/clis/slock/channel-members.js +64 -0
- package/clis/slock/channel-members.test.js +44 -0
- package/clis/slock/channel-unarchive.js +11 -0
- package/clis/slock/cross-command.test.js +21 -0
- package/clis/slock/dm-list.js +41 -0
- package/clis/slock/dm-list.test.js +26 -0
- package/clis/slock/error-detail-canary.test.js +144 -0
- package/clis/slock/errors.js +30 -0
- package/clis/slock/errors.test.js +29 -0
- package/clis/slock/in-page.js +213 -0
- package/clis/slock/in-page.test.js +362 -0
- package/clis/slock/inbox-done.js +40 -0
- package/clis/slock/inbox-done.test.js +21 -0
- package/clis/slock/inbox-read-all.js +32 -0
- package/clis/slock/inbox-read-all.test.js +20 -0
- package/clis/slock/inbox.js +74 -0
- package/clis/slock/inbox.test.js +46 -0
- package/clis/slock/login.js +3 -0
- package/clis/slock/message-read.js +168 -0
- package/clis/slock/message-read.test.js +83 -0
- package/clis/slock/message-search.js +72 -0
- package/clis/slock/message-search.test.js +61 -0
- package/clis/slock/message-send.js +149 -0
- package/clis/slock/message-send.test.js +127 -0
- package/clis/slock/reaction-add.js +42 -0
- package/clis/slock/reaction-add.test.js +36 -0
- package/clis/slock/reaction-remove.js +42 -0
- package/clis/slock/reaction-remove.test.js +29 -0
- package/clis/slock/resolve.js +74 -0
- package/clis/slock/resolve.test.js +102 -0
- package/clis/slock/server-list.js +38 -0
- package/clis/slock/server-list.test.js +24 -0
- package/clis/slock/server-override-canary.test.js +87 -0
- package/clis/slock/server-use.js +53 -0
- package/clis/slock/server-use.test.js +48 -0
- package/clis/slock/shared.js +14 -0
- package/clis/slock/short-id-canary.test.js +86 -0
- package/clis/slock/site-session-canary.test.js +49 -0
- package/clis/slock/task-claim.js +72 -0
- package/clis/slock/task-claim.test.js +81 -0
- package/clis/slock/task-convert.js +106 -0
- package/clis/slock/task-convert.test.js +82 -0
- package/clis/slock/task-create.js +82 -0
- package/clis/slock/task-create.test.js +65 -0
- package/clis/slock/task-delete.js +55 -0
- package/clis/slock/task-delete.test.js +52 -0
- package/clis/slock/task-get.js +59 -0
- package/clis/slock/task-get.test.js +45 -0
- package/clis/slock/task-list-server.js +63 -0
- package/clis/slock/task-list-server.test.js +48 -0
- package/clis/slock/task-list.js +70 -0
- package/clis/slock/task-list.test.js +59 -0
- package/clis/slock/task-status.js +93 -0
- package/clis/slock/task-status.test.js +76 -0
- package/clis/slock/task-unclaim.js +66 -0
- package/clis/slock/task-unclaim.test.js +49 -0
- package/clis/slock/thread-done.js +9 -0
- package/clis/slock/thread-follow.js +46 -0
- package/clis/slock/thread-follow.test.js +34 -0
- package/clis/slock/thread-list.js +44 -0
- package/clis/slock/thread-list.test.js +24 -0
- package/clis/slock/thread-state.js +45 -0
- package/clis/slock/thread-state.test.js +38 -0
- package/clis/slock/thread-undone.js +9 -0
- package/clis/slock/thread-unfollow.js +9 -0
- package/clis/slock/unread-summary.js +49 -0
- package/clis/slock/unread-summary.test.js +31 -0
- package/clis/slock/whoami.js +12 -0
- package/clis/slock/whoami.test.js +23 -0
- package/clis/smzdm/search.js +149 -0
- package/clis/smzdm/search.test.js +114 -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/auth.js +63 -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/auth.js +58 -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/auth.js +65 -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/auth.js +70 -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/trae-cn/activity.js +22 -0
- package/clis/trae-cn/approve.js +52 -0
- package/clis/trae-cn/ask.js +99 -0
- package/clis/trae-cn/dump.js +5 -0
- package/clis/trae-cn/export.js +40 -0
- package/clis/trae-cn/model.js +22 -0
- package/clis/trae-cn/new.js +63 -0
- package/clis/trae-cn/read.js +23 -0
- package/clis/trae-cn/screenshot.js +5 -0
- package/clis/trae-cn/select-model.js +25 -0
- package/clis/trae-cn/send.js +23 -0
- package/clis/trae-cn/setup.js +75 -0
- package/clis/trae-cn/status.js +27 -0
- package/clis/trae-cn/targets.js +96 -0
- package/clis/trae-cn/trae-cn.test.js +412 -0
- package/clis/trae-cn/utils.js +750 -0
- package/clis/trae-cn/watch.js +119 -0
- package/clis/trae-solo/_actions.js +60 -0
- package/clis/trae-solo/_fs.js +118 -0
- package/clis/trae-solo/_state.js +111 -0
- package/clis/trae-solo/automation.js +97 -0
- package/clis/trae-solo/history.js +54 -0
- package/clis/trae-solo/mode.js +81 -0
- package/clis/trae-solo/model.js +134 -0
- package/clis/trae-solo/renderer-storage.js +170 -0
- package/clis/trae-solo/settings.js +54 -0
- package/clis/trae-solo/skill-fs.js +123 -0
- package/clis/trae-solo/skill.js +220 -0
- package/clis/trae-solo/state-fs.js +156 -0
- package/clis/trae-solo/status.js +2 -0
- package/clis/trae-solo/task-fs.js +181 -0
- package/clis/trae-solo/trae-solo.test.js +67 -0
- package/clis/trae-solo/user-rules.js +29 -0
- package/clis/trae-solo/workspaces-fs.js +113 -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 +170 -0
- package/clis/twitter/auth.js +41 -0
- package/clis/twitter/block.js +90 -0
- package/clis/twitter/bookmark-folder.js +190 -0
- package/clis/twitter/bookmark-folder.test.js +396 -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 +206 -0
- package/clis/twitter/delete.js +85 -0
- package/clis/twitter/delete.test.js +85 -0
- package/clis/twitter/device-follow.js +194 -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-batch.js +162 -0
- package/clis/twitter/follow-batch.test.js +137 -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 +274 -0
- package/clis/twitter/following.test.js +359 -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-batch.js +32 -0
- package/clis/twitter/list-add-core.js +245 -0
- package/clis/twitter/list-add.js +20 -0
- package/clis/twitter/list-add.test.js +133 -0
- package/clis/twitter/list-batch-utils.js +95 -0
- package/clis/twitter/list-batch.test.js +113 -0
- package/clis/twitter/list-create.js +155 -0
- package/clis/twitter/list-create.test.js +169 -0
- package/clis/twitter/list-delete.js +158 -0
- package/clis/twitter/list-delete.test.js +102 -0
- package/clis/twitter/list-remove-batch.js +32 -0
- package/clis/twitter/list-remove-core.js +291 -0
- package/clis/twitter/list-remove.js +20 -0
- package/clis/twitter/list-remove.test.js +147 -0
- package/clis/twitter/list-tweets.js +199 -0
- package/clis/twitter/list-tweets.test.js +198 -0
- package/clis/twitter/lists.js +178 -0
- package/clis/twitter/lists.test.js +253 -0
- package/clis/twitter/notifications.js +128 -0
- package/clis/twitter/post.js +316 -0
- package/clis/twitter/post.test.js +275 -0
- package/clis/twitter/profile.js +174 -0
- package/clis/twitter/profile.test.js +150 -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 +400 -0
- package/clis/twitter/shared.js +564 -0
- package/clis/twitter/shared.test.js +1012 -0
- package/clis/twitter/thread.js +164 -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 +314 -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/auth.js +53 -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/auth.js +44 -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/wechat-channels/auth.js +62 -0
- package/clis/wechat-channels/publish.js +732 -0
- package/clis/wechat-channels/publish.test.js +144 -0
- package/clis/weibo/auth.js +53 -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 +371 -0
- package/clis/weixin/download.test.js +106 -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/auth.js +59 -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/auth.js +68 -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/auth.js +55 -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/ask.js +426 -0
- package/clis/xiaohongshu/ask.test.js +271 -0
- package/clis/xiaohongshu/auth.js +53 -0
- package/clis/xiaohongshu/collection-helpers.js +283 -0
- package/clis/xiaohongshu/collection-helpers.test.js +125 -0
- package/clis/xiaohongshu/comments.js +228 -0
- package/clis/xiaohongshu/comments.test.js +320 -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 +249 -0
- package/clis/xiaohongshu/download.test.js +339 -0
- package/clis/xiaohongshu/draft-clear.js +91 -0
- package/clis/xiaohongshu/draft-delete.js +103 -0
- package/clis/xiaohongshu/draft-open.js +43 -0
- package/clis/xiaohongshu/draft-utils.js +142 -0
- package/clis/xiaohongshu/drafts.js +28 -0
- package/clis/xiaohongshu/drafts.test.js +172 -0
- package/clis/xiaohongshu/feed.js +163 -0
- package/clis/xiaohongshu/feed.test.js +126 -0
- package/clis/xiaohongshu/follow.js +226 -0
- package/clis/xiaohongshu/follow.test.js +211 -0
- package/clis/xiaohongshu/liked.js +29 -0
- package/clis/xiaohongshu/liked.test.js +82 -0
- package/clis/xiaohongshu/navigation.test.js +38 -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 +1423 -0
- package/clis/xiaohongshu/publish.test.js +1141 -0
- package/clis/xiaohongshu/saved.js +29 -0
- package/clis/xiaohongshu/saved.test.js +143 -0
- package/clis/xiaohongshu/search.js +330 -0
- package/clis/xiaohongshu/search.test.js +325 -0
- package/clis/xiaohongshu/unfollow.js +285 -0
- package/clis/xiaohongshu/user-helpers.js +78 -0
- package/clis/xiaohongshu/user-helpers.test.js +160 -0
- package/clis/xiaohongshu/user.js +140 -0
- package/clis/xiaohongshu/user.test.js +141 -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/auth.js +63 -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/auth.js +54 -0
- package/clis/youtube/channel.js +227 -0
- package/clis/youtube/channel.test.js +283 -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 +152 -0
- package/clis/youtube/video.test.js +111 -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/auth.js +59 -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/auth.js +59 -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/followers.js +40 -0
- package/clis/zhihu/followers.test.js +42 -0
- package/clis/zhihu/following.js +40 -0
- package/clis/zhihu/following.test.js +44 -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/paginate.js +128 -0
- package/clis/zhihu/pins.js +41 -0
- package/clis/zhihu/pins.test.js +44 -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/user-answers.js +41 -0
- package/clis/zhihu/user-answers.test.js +69 -0
- package/clis/zhihu/user-arg.js +34 -0
- package/clis/zhihu/user-articles.js +40 -0
- package/clis/zhihu/user-articles.test.js +44 -0
- package/clis/zhihu/user.js +59 -0
- package/clis/zhihu/user.test.js +73 -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/auth.js +68 -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 +118 -0
- package/dist/src/browser/analyze.js +405 -0
- package/dist/src/browser/analyze.test.d.ts +1 -0
- package/dist/src/browser/analyze.test.js +209 -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 +151 -0
- package/dist/src/browser/base-page.js +1060 -0
- package/dist/src/browser/base-page.test.d.ts +1 -0
- package/dist/src/browser/base-page.test.js +803 -0
- package/dist/src/browser/bridge.d.ts +28 -0
- package/dist/src/browser/bridge.js +172 -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 +78 -0
- package/dist/src/browser/network-cache.test.d.ts +1 -0
- package/dist/src/browser/network-cache.test.js +75 -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 +406 -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 +287 -0
- package/dist/src/build-manifest.d.ts +103 -0
- package/dist/src/build-manifest.js +363 -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 +303 -0
- package/dist/src/cli-argv-preprocess.test.d.ts +1 -0
- package/dist/src/cli-argv-preprocess.test.js +304 -0
- package/dist/src/cli.d.ts +79 -0
- package/dist/src/cli.js +3357 -0
- package/dist/src/cli.test.d.ts +1 -0
- package/dist/src/cli.test.js +3003 -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/auth.d.ts +40 -0
- package/dist/src/commands/auth.js +434 -0
- package/dist/src/commands/auth.test.d.ts +1 -0
- package/dist/src/commands/auth.test.js +252 -0
- package/dist/src/commands/daemon.d.ts +9 -0
- package/dist/src/commands/daemon.js +98 -0
- package/dist/src/commands/daemon.test.d.ts +1 -0
- package/dist/src/commands/daemon.test.js +283 -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 +60 -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 +266 -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 +363 -0
- package/dist/src/download/index.test.d.ts +1 -0
- package/dist/src/download/index.test.js +174 -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 +91 -0
- package/dist/src/electron-apps.test.d.ts +1 -0
- package/dist/src/electron-apps.test.js +76 -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 +645 -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 +211 -0
- package/dist/src/external.test.d.ts +1 -0
- package/dist/src/external.test.js +110 -0
- package/dist/src/help.d.ts +88 -0
- package/dist/src/help.js +555 -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 +41 -0
- package/dist/src/launcher.js +226 -0
- package/dist/src/launcher.test.d.ts +1 -0
- package/dist/src/launcher.test.js +153 -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 +43 -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 +123 -0
- package/dist/src/registry.js +125 -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/skills.d.ts +14 -0
- package/dist/src/skills.js +127 -0
- package/dist/src/skills.test.d.ts +1 -0
- package/dist/src/skills.test.js +71 -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 +109 -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
- package/skills/opencli-adapter-author/SKILL.md +256 -0
- package/skills/opencli-adapter-author/references/adapter-template.md +471 -0
- package/skills/opencli-adapter-author/references/api-discovery.md +295 -0
- package/skills/opencli-adapter-author/references/coverage-matrix.md +81 -0
- package/skills/opencli-adapter-author/references/field-conventions.md +172 -0
- package/skills/opencli-adapter-author/references/field-decode-playbook.md +181 -0
- package/skills/opencli-adapter-author/references/jsdom-fixture-pattern.md +196 -0
- package/skills/opencli-adapter-author/references/output-design.md +149 -0
- package/skills/opencli-adapter-author/references/site-memory/bilibili.md +70 -0
- package/skills/opencli-adapter-author/references/site-memory/eastmoney.md +70 -0
- package/skills/opencli-adapter-author/references/site-memory/tonghuashun.md +51 -0
- package/skills/opencli-adapter-author/references/site-memory/xueqiu.md +58 -0
- package/skills/opencli-adapter-author/references/site-memory.md +231 -0
- package/skills/opencli-adapter-author/references/site-recon.md +134 -0
- package/skills/opencli-adapter-author/references/strategy-selection.md +169 -0
- package/skills/opencli-adapter-author/references/success-rate-pitfalls.md +162 -0
- package/skills/opencli-adapter-author/references/typed-errors.md +234 -0
- package/skills/opencli-autofix/SKILL.md +297 -0
- package/skills/opencli-browser/SKILL.md +444 -0
- package/skills/opencli-browser-sitemap/SKILL.md +96 -0
- package/skills/opencli-sitemap-author/SKILL.md +161 -0
- package/skills/opencli-sitemap-author/references/sitemap-schema.md +660 -0
- package/skills/opencli-usage/SKILL.md +169 -0
|
@@ -0,0 +1,1647 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as os from 'node:os';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import { afterAll, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
|
+
import { AuthRequiredError, CommandExecutionError } from '@jackwener/opencli/errors';
|
|
6
|
+
import { getRegistry } from '@jackwener/opencli/registry';
|
|
7
|
+
import * as privatePublish from './_shared/private-publish.js';
|
|
8
|
+
import { buildClickActionJs, buildEnsureComposerOpenJs, buildInspectUploadStageJs, buildPublishStatusProbeJs } from './post.js';
|
|
9
|
+
import './post.js';
|
|
10
|
+
const tempDirs = [];
|
|
11
|
+
function createTempImage(name = 'demo.jpg', bytes = Buffer.from([0xff, 0xd8, 0xff, 0xd9])) {
|
|
12
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'opencli-instagram-post-'));
|
|
13
|
+
tempDirs.push(dir);
|
|
14
|
+
const filePath = path.join(dir, name);
|
|
15
|
+
fs.writeFileSync(filePath, bytes);
|
|
16
|
+
return filePath;
|
|
17
|
+
}
|
|
18
|
+
function createTempVideo(name = 'demo.mp4', bytes = Buffer.from('video')) {
|
|
19
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'opencli-instagram-post-video-'));
|
|
20
|
+
tempDirs.push(dir);
|
|
21
|
+
const filePath = path.join(dir, name);
|
|
22
|
+
fs.writeFileSync(filePath, bytes);
|
|
23
|
+
return filePath;
|
|
24
|
+
}
|
|
25
|
+
function withInitialDialogDismiss(results) {
|
|
26
|
+
return [{ ok: false }, ...results];
|
|
27
|
+
}
|
|
28
|
+
function createPageMock(evaluateResults, overrides = {}) {
|
|
29
|
+
const evaluate = vi.fn();
|
|
30
|
+
for (const result of evaluateResults) {
|
|
31
|
+
evaluate.mockResolvedValueOnce(result);
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
goto: vi.fn().mockResolvedValue(undefined),
|
|
35
|
+
evaluate,
|
|
36
|
+
getCookies: vi.fn().mockResolvedValue([]),
|
|
37
|
+
snapshot: vi.fn().mockResolvedValue(undefined),
|
|
38
|
+
click: vi.fn().mockResolvedValue(undefined),
|
|
39
|
+
typeText: vi.fn().mockResolvedValue(undefined),
|
|
40
|
+
pressKey: vi.fn().mockResolvedValue(undefined),
|
|
41
|
+
scrollTo: vi.fn().mockResolvedValue(undefined),
|
|
42
|
+
getFormState: vi.fn().mockResolvedValue({ forms: [], orphanFields: [] }),
|
|
43
|
+
wait: vi.fn().mockResolvedValue(undefined),
|
|
44
|
+
tabs: vi.fn().mockResolvedValue([]),
|
|
45
|
+
closeTab: vi.fn().mockResolvedValue(undefined),
|
|
46
|
+
newTab: vi.fn().mockResolvedValue(undefined),
|
|
47
|
+
selectTab: vi.fn().mockResolvedValue(undefined),
|
|
48
|
+
networkRequests: vi.fn().mockResolvedValue([]),
|
|
49
|
+
consoleMessages: vi.fn().mockResolvedValue([]),
|
|
50
|
+
scroll: vi.fn().mockResolvedValue(undefined),
|
|
51
|
+
autoScroll: vi.fn().mockResolvedValue(undefined),
|
|
52
|
+
installInterceptor: vi.fn().mockResolvedValue(undefined),
|
|
53
|
+
getInterceptedRequests: vi.fn().mockResolvedValue([]),
|
|
54
|
+
waitForCapture: vi.fn().mockResolvedValue(undefined),
|
|
55
|
+
screenshot: vi.fn().mockResolvedValue(''),
|
|
56
|
+
setFileInput: vi.fn().mockResolvedValue(undefined),
|
|
57
|
+
insertText: undefined,
|
|
58
|
+
getCurrentUrl: vi.fn().mockResolvedValue(null),
|
|
59
|
+
...overrides,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
afterAll(() => {
|
|
63
|
+
for (const dir of tempDirs) {
|
|
64
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
65
|
+
}
|
|
66
|
+
delete process.env.OPENCLI_INSTAGRAM_CAPTURE;
|
|
67
|
+
});
|
|
68
|
+
describe('instagram auth detection', () => {
|
|
69
|
+
it('does not treat generic homepage text containing "log in" as an auth failure', () => {
|
|
70
|
+
const globalState = globalThis;
|
|
71
|
+
const originalDocument = globalState.document;
|
|
72
|
+
const originalWindow = globalState.window;
|
|
73
|
+
globalState.document = {
|
|
74
|
+
body: { innerText: 'Suggested for you Log in to see more content' },
|
|
75
|
+
querySelector: () => null,
|
|
76
|
+
querySelectorAll: () => [],
|
|
77
|
+
};
|
|
78
|
+
globalState.window = { location: { pathname: '/' } };
|
|
79
|
+
try {
|
|
80
|
+
expect(eval(buildEnsureComposerOpenJs())).toEqual({ ok: true });
|
|
81
|
+
}
|
|
82
|
+
finally {
|
|
83
|
+
globalState.document = originalDocument;
|
|
84
|
+
globalState.window = originalWindow;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
describe('instagram publish status detection', () => {
|
|
89
|
+
it('does not treat unrelated page text as share failure while the sharing dialog is still visible', () => {
|
|
90
|
+
const globalState = globalThis;
|
|
91
|
+
class MockHTMLElement {
|
|
92
|
+
}
|
|
93
|
+
const visibleDialog = new MockHTMLElement();
|
|
94
|
+
visibleDialog.textContent = 'Sharing';
|
|
95
|
+
visibleDialog.querySelector = () => null;
|
|
96
|
+
visibleDialog.getBoundingClientRect = () => ({ width: 100, height: 100 });
|
|
97
|
+
const originalDocument = globalState.document;
|
|
98
|
+
const originalWindow = globalState.window;
|
|
99
|
+
const originalHTMLElement = globalState.HTMLElement;
|
|
100
|
+
globalState.HTMLElement = MockHTMLElement;
|
|
101
|
+
globalState.document = {
|
|
102
|
+
querySelectorAll: (selector) => selector === '[role="dialog"]' ? [visibleDialog] : [],
|
|
103
|
+
};
|
|
104
|
+
globalState.window = {
|
|
105
|
+
location: { href: 'https://www.instagram.com/' },
|
|
106
|
+
getComputedStyle: () => ({ display: 'block', visibility: 'visible' }),
|
|
107
|
+
};
|
|
108
|
+
try {
|
|
109
|
+
expect(eval(buildPublishStatusProbeJs())).toEqual({
|
|
110
|
+
ok: false,
|
|
111
|
+
failed: false,
|
|
112
|
+
settled: false,
|
|
113
|
+
url: '',
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
finally {
|
|
117
|
+
globalState.document = originalDocument;
|
|
118
|
+
globalState.window = originalWindow;
|
|
119
|
+
globalState.HTMLElement = originalHTMLElement;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
it('does not treat a stale visible error dialog as share failure while sharing is still in progress', () => {
|
|
123
|
+
const globalState = globalThis;
|
|
124
|
+
class MockHTMLElement {
|
|
125
|
+
}
|
|
126
|
+
const sharingDialog = new MockHTMLElement();
|
|
127
|
+
sharingDialog.textContent = 'Sharing';
|
|
128
|
+
sharingDialog.querySelector = () => null;
|
|
129
|
+
sharingDialog.getBoundingClientRect = () => ({ width: 100, height: 100 });
|
|
130
|
+
const staleErrorDialog = new MockHTMLElement();
|
|
131
|
+
staleErrorDialog.textContent = 'Something went wrong. Please try again. Try again';
|
|
132
|
+
staleErrorDialog.querySelector = () => null;
|
|
133
|
+
staleErrorDialog.getBoundingClientRect = () => ({ width: 100, height: 100 });
|
|
134
|
+
const originalDocument = globalState.document;
|
|
135
|
+
const originalWindow = globalState.window;
|
|
136
|
+
const originalHTMLElement = globalState.HTMLElement;
|
|
137
|
+
globalState.HTMLElement = MockHTMLElement;
|
|
138
|
+
globalState.document = {
|
|
139
|
+
querySelectorAll: (selector) => selector === '[role="dialog"]' ? [sharingDialog, staleErrorDialog] : [],
|
|
140
|
+
};
|
|
141
|
+
globalState.window = {
|
|
142
|
+
location: { href: 'https://www.instagram.com/' },
|
|
143
|
+
getComputedStyle: () => ({ display: 'block', visibility: 'visible' }),
|
|
144
|
+
};
|
|
145
|
+
try {
|
|
146
|
+
expect(eval(buildPublishStatusProbeJs())).toEqual({
|
|
147
|
+
ok: false,
|
|
148
|
+
failed: false,
|
|
149
|
+
settled: false,
|
|
150
|
+
url: '',
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
finally {
|
|
154
|
+
globalState.document = originalDocument;
|
|
155
|
+
globalState.window = originalWindow;
|
|
156
|
+
globalState.HTMLElement = originalHTMLElement;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
it('prefers explicit post-shared success over stale visible error text', () => {
|
|
160
|
+
const globalState = globalThis;
|
|
161
|
+
class MockHTMLElement {
|
|
162
|
+
}
|
|
163
|
+
const sharedDialog = new MockHTMLElement();
|
|
164
|
+
sharedDialog.textContent = 'Post shared Your post has been shared.';
|
|
165
|
+
sharedDialog.querySelector = () => null;
|
|
166
|
+
sharedDialog.getBoundingClientRect = () => ({ width: 100, height: 100 });
|
|
167
|
+
const staleErrorDialog = new MockHTMLElement();
|
|
168
|
+
staleErrorDialog.textContent = 'Something went wrong. Please try again. Try again';
|
|
169
|
+
staleErrorDialog.querySelector = () => null;
|
|
170
|
+
staleErrorDialog.getBoundingClientRect = () => ({ width: 100, height: 100 });
|
|
171
|
+
const originalDocument = globalState.document;
|
|
172
|
+
const originalWindow = globalState.window;
|
|
173
|
+
const originalHTMLElement = globalState.HTMLElement;
|
|
174
|
+
globalState.HTMLElement = MockHTMLElement;
|
|
175
|
+
globalState.document = {
|
|
176
|
+
querySelectorAll: (selector) => selector === '[role="dialog"]' ? [sharedDialog, staleErrorDialog] : [],
|
|
177
|
+
};
|
|
178
|
+
globalState.window = {
|
|
179
|
+
location: { href: 'https://www.instagram.com/' },
|
|
180
|
+
getComputedStyle: () => ({ display: 'block', visibility: 'visible' }),
|
|
181
|
+
};
|
|
182
|
+
try {
|
|
183
|
+
expect(eval(buildPublishStatusProbeJs())).toEqual({
|
|
184
|
+
ok: true,
|
|
185
|
+
failed: false,
|
|
186
|
+
settled: false,
|
|
187
|
+
url: '',
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
finally {
|
|
191
|
+
globalState.document = originalDocument;
|
|
192
|
+
globalState.window = originalWindow;
|
|
193
|
+
globalState.HTMLElement = originalHTMLElement;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
describe('instagram click action detection', () => {
|
|
198
|
+
it('matches aria-label-only Next buttons in the media dialog', () => {
|
|
199
|
+
const globalState = globalThis;
|
|
200
|
+
class MockHTMLElement {
|
|
201
|
+
textContent = '';
|
|
202
|
+
ariaLabel = '';
|
|
203
|
+
clicked = false;
|
|
204
|
+
querySelectorAll = (_selector) => [];
|
|
205
|
+
querySelector = (_selector) => null;
|
|
206
|
+
getAttribute(name) {
|
|
207
|
+
if (name === 'aria-label')
|
|
208
|
+
return this.ariaLabel || null;
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
getBoundingClientRect() {
|
|
212
|
+
return { width: 100, height: 40 };
|
|
213
|
+
}
|
|
214
|
+
click() {
|
|
215
|
+
this.clicked = true;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
const nextButton = new MockHTMLElement();
|
|
219
|
+
nextButton.ariaLabel = 'Next';
|
|
220
|
+
const dialog = new MockHTMLElement();
|
|
221
|
+
dialog.textContent = 'Crop Back Select crop Open media gallery';
|
|
222
|
+
dialog.querySelector = (selector) => selector === 'input[type="file"]' ? {} : null;
|
|
223
|
+
dialog.querySelectorAll = (selector) => selector === 'button, div[role="button"]' ? [nextButton] : [];
|
|
224
|
+
const body = new MockHTMLElement();
|
|
225
|
+
const originalDocument = globalState.document;
|
|
226
|
+
const originalWindow = globalState.window;
|
|
227
|
+
const originalHTMLElement = globalState.HTMLElement;
|
|
228
|
+
globalState.HTMLElement = MockHTMLElement;
|
|
229
|
+
globalState.document = {
|
|
230
|
+
body,
|
|
231
|
+
querySelectorAll: (selector) => selector === '[role="dialog"]' ? [dialog] : [],
|
|
232
|
+
};
|
|
233
|
+
globalState.window = {
|
|
234
|
+
getComputedStyle: () => ({ display: 'block', visibility: 'visible' }),
|
|
235
|
+
};
|
|
236
|
+
try {
|
|
237
|
+
expect(eval(buildClickActionJs(['Next', '下一步'], 'media'))).toEqual({
|
|
238
|
+
ok: true,
|
|
239
|
+
label: 'Next',
|
|
240
|
+
});
|
|
241
|
+
expect(nextButton.clicked).toBe(true);
|
|
242
|
+
}
|
|
243
|
+
finally {
|
|
244
|
+
globalState.document = originalDocument;
|
|
245
|
+
globalState.window = originalWindow;
|
|
246
|
+
globalState.HTMLElement = originalHTMLElement;
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
it('does not click a body-level Next button when media scope has no matching dialog controls', () => {
|
|
250
|
+
const globalState = globalThis;
|
|
251
|
+
class MockHTMLElement {
|
|
252
|
+
textContent = '';
|
|
253
|
+
ariaLabel = '';
|
|
254
|
+
clicked = false;
|
|
255
|
+
children = [];
|
|
256
|
+
querySelectorAll = (_selector) => this.children;
|
|
257
|
+
querySelector = (_selector) => null;
|
|
258
|
+
getAttribute(name) {
|
|
259
|
+
if (name === 'aria-label')
|
|
260
|
+
return this.ariaLabel || null;
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
getBoundingClientRect() {
|
|
264
|
+
return { width: 100, height: 40 };
|
|
265
|
+
}
|
|
266
|
+
click() {
|
|
267
|
+
this.clicked = true;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
const bodyNext = new MockHTMLElement();
|
|
271
|
+
bodyNext.ariaLabel = 'Next';
|
|
272
|
+
const errorDialog = new MockHTMLElement();
|
|
273
|
+
errorDialog.textContent = 'Something went wrong Try again';
|
|
274
|
+
errorDialog.children = [];
|
|
275
|
+
const body = new MockHTMLElement();
|
|
276
|
+
body.children = [bodyNext];
|
|
277
|
+
const originalDocument = globalState.document;
|
|
278
|
+
const originalWindow = globalState.window;
|
|
279
|
+
const originalHTMLElement = globalState.HTMLElement;
|
|
280
|
+
globalState.HTMLElement = MockHTMLElement;
|
|
281
|
+
globalState.document = {
|
|
282
|
+
body,
|
|
283
|
+
querySelectorAll: (selector) => selector === '[role="dialog"]' ? [errorDialog] : [],
|
|
284
|
+
};
|
|
285
|
+
globalState.window = {
|
|
286
|
+
getComputedStyle: () => ({ display: 'block', visibility: 'visible' }),
|
|
287
|
+
};
|
|
288
|
+
try {
|
|
289
|
+
expect(eval(buildClickActionJs(['Next', '下一步'], 'media'))).toEqual({ ok: false });
|
|
290
|
+
expect(bodyNext.clicked).toBe(false);
|
|
291
|
+
}
|
|
292
|
+
finally {
|
|
293
|
+
globalState.document = originalDocument;
|
|
294
|
+
globalState.window = originalWindow;
|
|
295
|
+
globalState.HTMLElement = originalHTMLElement;
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
});
|
|
299
|
+
describe('instagram upload stage detection', () => {
|
|
300
|
+
it('does not treat a body-level Next button as upload preview when the visible dialog is an error', () => {
|
|
301
|
+
const globalState = globalThis;
|
|
302
|
+
class MockHTMLElement {
|
|
303
|
+
textContent = '';
|
|
304
|
+
ariaLabel = '';
|
|
305
|
+
children = [];
|
|
306
|
+
querySelectorAll = (_selector) => this.children;
|
|
307
|
+
querySelector = (_selector) => null;
|
|
308
|
+
getAttribute(name) {
|
|
309
|
+
if (name === 'aria-label')
|
|
310
|
+
return this.ariaLabel || null;
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
getBoundingClientRect() {
|
|
314
|
+
return { width: 100, height: 40 };
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
const bodyNext = new MockHTMLElement();
|
|
318
|
+
bodyNext.ariaLabel = 'Next';
|
|
319
|
+
const errorDialog = new MockHTMLElement();
|
|
320
|
+
errorDialog.textContent = 'Something went wrong. Please try again. Try again';
|
|
321
|
+
const body = new MockHTMLElement();
|
|
322
|
+
body.children = [bodyNext];
|
|
323
|
+
const originalDocument = globalState.document;
|
|
324
|
+
const originalWindow = globalState.window;
|
|
325
|
+
const originalHTMLElement = globalState.HTMLElement;
|
|
326
|
+
globalState.HTMLElement = MockHTMLElement;
|
|
327
|
+
globalState.document = {
|
|
328
|
+
body,
|
|
329
|
+
querySelectorAll: (selector) => {
|
|
330
|
+
if (selector === '[role="dialog"]')
|
|
331
|
+
return [errorDialog];
|
|
332
|
+
return [];
|
|
333
|
+
},
|
|
334
|
+
};
|
|
335
|
+
globalState.window = {
|
|
336
|
+
getComputedStyle: () => ({ display: 'block', visibility: 'visible' }),
|
|
337
|
+
};
|
|
338
|
+
try {
|
|
339
|
+
expect(eval(buildInspectUploadStageJs())).toEqual({
|
|
340
|
+
state: 'failed',
|
|
341
|
+
detail: 'Something went wrong. Please try again. Try again',
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
finally {
|
|
345
|
+
globalState.document = originalDocument;
|
|
346
|
+
globalState.window = originalWindow;
|
|
347
|
+
globalState.HTMLElement = originalHTMLElement;
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
});
|
|
351
|
+
describe('instagram post registration', () => {
|
|
352
|
+
beforeEach(() => {
|
|
353
|
+
vi.spyOn(privatePublish, 'resolveInstagramPrivatePublishConfig').mockResolvedValue({
|
|
354
|
+
apiContext: {
|
|
355
|
+
asbdId: '',
|
|
356
|
+
csrfToken: 'csrf-token',
|
|
357
|
+
igAppId: '936619743392459',
|
|
358
|
+
igWwwClaim: '',
|
|
359
|
+
instagramAjax: '1036523242',
|
|
360
|
+
webSessionId: '',
|
|
361
|
+
},
|
|
362
|
+
jazoest: '22047',
|
|
363
|
+
});
|
|
364
|
+
vi.spyOn(privatePublish, 'publishImagesViaPrivateApi').mockRejectedValue(new CommandExecutionError('Instagram private publish configure failed: 400 {"message":"fallback to ui"}'));
|
|
365
|
+
});
|
|
366
|
+
afterEach(() => {
|
|
367
|
+
vi.restoreAllMocks();
|
|
368
|
+
});
|
|
369
|
+
it('registers the post command with a required-value media arg', () => {
|
|
370
|
+
const cmd = getRegistry().get('instagram/post');
|
|
371
|
+
expect(cmd).toBeDefined();
|
|
372
|
+
expect(cmd?.browser).toBe(true);
|
|
373
|
+
expect(cmd?.args.some((arg) => arg.name === 'timeout' && arg.default === 300)).toBe(true);
|
|
374
|
+
expect(cmd?.args.some((arg) => arg.name === 'media' && !arg.required && arg.valueRequired)).toBe(true);
|
|
375
|
+
expect(cmd?.args.some((arg) => arg.name === 'content' && !arg.required && arg.positional)).toBe(true);
|
|
376
|
+
});
|
|
377
|
+
it('prefers the private route by default and returns without touching UI upload steps when private publish succeeds', async () => {
|
|
378
|
+
const imagePath = createTempImage('private-default.jpg');
|
|
379
|
+
const privateSpy = vi.spyOn(privatePublish, 'publishImagesViaPrivateApi').mockResolvedValueOnce({
|
|
380
|
+
code: 'PRIVATEDEFAULT123',
|
|
381
|
+
uploadIds: ['111'],
|
|
382
|
+
});
|
|
383
|
+
const evaluate = vi.fn(async (js) => {
|
|
384
|
+
if (js.includes('sharing') && js.includes('create new post'))
|
|
385
|
+
return { ok: false };
|
|
386
|
+
if (js.includes('window.location?.pathname'))
|
|
387
|
+
return { ok: true };
|
|
388
|
+
if (js.includes('const data = Array.isArray(window[') && js.includes('__opencli_ig_protocol_capture'))
|
|
389
|
+
return { data: [], errors: [] };
|
|
390
|
+
return { ok: true };
|
|
391
|
+
});
|
|
392
|
+
const page = createPageMock([], {
|
|
393
|
+
evaluate,
|
|
394
|
+
getCookies: vi.fn().mockResolvedValue([{ name: 'csrftoken', value: 'csrf-token', domain: 'instagram.com' }]),
|
|
395
|
+
});
|
|
396
|
+
const cmd = getRegistry().get('instagram/post');
|
|
397
|
+
const result = await cmd.func(page, { media: imagePath, content: 'private default' });
|
|
398
|
+
expect(privateSpy).toHaveBeenCalledTimes(1);
|
|
399
|
+
expect(page.setFileInput).not.toHaveBeenCalled();
|
|
400
|
+
expect(result).toEqual([
|
|
401
|
+
{
|
|
402
|
+
status: '✅ Posted',
|
|
403
|
+
detail: 'Single image post shared successfully',
|
|
404
|
+
url: 'https://www.instagram.com/p/PRIVATEDEFAULT123/',
|
|
405
|
+
},
|
|
406
|
+
]);
|
|
407
|
+
privateSpy.mockRestore();
|
|
408
|
+
});
|
|
409
|
+
it('falls back to the UI route when the default private route fails safely before publishing', async () => {
|
|
410
|
+
const imagePath = createTempImage('private-fallback-ui.jpg');
|
|
411
|
+
const privateSpy = vi.spyOn(privatePublish, 'publishImagesViaPrivateApi').mockRejectedValueOnce(new CommandExecutionError('Instagram private publish configure_sidecar failed: 400 {"message":"Uploaded image is invalid"}'));
|
|
412
|
+
const evaluate = vi.fn(async (js) => {
|
|
413
|
+
if (js.includes('sharing') && js.includes('create new post'))
|
|
414
|
+
return { ok: false };
|
|
415
|
+
if (js.includes('window.location?.pathname'))
|
|
416
|
+
return { ok: true };
|
|
417
|
+
if (js.includes('data-opencli-ig-upload-index'))
|
|
418
|
+
return { ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] };
|
|
419
|
+
if (js.includes("dispatchEvent(new Event('input'"))
|
|
420
|
+
return { ok: true };
|
|
421
|
+
if (js.includes('const hasPreviewUi ='))
|
|
422
|
+
return { ok: true, state: 'preview' };
|
|
423
|
+
if (js.includes("scope === 'media'"))
|
|
424
|
+
return { ok: true, label: 'Next' };
|
|
425
|
+
if (js.includes("scope === 'caption'"))
|
|
426
|
+
return { ok: true, label: 'Share' };
|
|
427
|
+
if (js.includes('post shared') && js.includes('your post has been shared'))
|
|
428
|
+
return { ok: true, url: 'https://www.instagram.com/p/PRIVATEFALLBACK123/' };
|
|
429
|
+
return { ok: true };
|
|
430
|
+
});
|
|
431
|
+
const page = createPageMock([], {
|
|
432
|
+
evaluate,
|
|
433
|
+
getCookies: vi.fn().mockResolvedValue([{ name: 'csrftoken', value: 'csrf-token', domain: 'instagram.com' }]),
|
|
434
|
+
});
|
|
435
|
+
const cmd = getRegistry().get('instagram/post');
|
|
436
|
+
const result = await cmd.func(page, { media: imagePath, content: 'private fallback' });
|
|
437
|
+
expect(privateSpy).toHaveBeenCalledTimes(1);
|
|
438
|
+
expect(page.setFileInput).toHaveBeenCalledWith([imagePath], '[data-opencli-ig-upload-index="0"]');
|
|
439
|
+
expect(result).toEqual([
|
|
440
|
+
{
|
|
441
|
+
status: '✅ Posted',
|
|
442
|
+
detail: 'Single image post shared successfully',
|
|
443
|
+
url: 'https://www.instagram.com/p/PRIVATEFALLBACK123/',
|
|
444
|
+
},
|
|
445
|
+
]);
|
|
446
|
+
privateSpy.mockRestore();
|
|
447
|
+
});
|
|
448
|
+
it('falls back to the UI route for mixed-media posts when the private route fails safely before publishing', async () => {
|
|
449
|
+
const imagePath = createTempImage('mixed-fallback-image.jpg');
|
|
450
|
+
const videoPath = createTempVideo('mixed-fallback-video.mp4');
|
|
451
|
+
const privateSpy = vi.spyOn(privatePublish, 'publishMediaViaPrivateApi').mockRejectedValueOnce(new CommandExecutionError('Instagram private publish configure_sidecar failed: 400 {"message":"fallback to ui"}'));
|
|
452
|
+
const evaluate = vi.fn(async (js) => {
|
|
453
|
+
if (js.includes('sharing') && js.includes('create new post'))
|
|
454
|
+
return { ok: false };
|
|
455
|
+
if (js.includes('window.location?.pathname'))
|
|
456
|
+
return { ok: true };
|
|
457
|
+
if (js.includes('data-opencli-ig-upload-index'))
|
|
458
|
+
return { ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] };
|
|
459
|
+
if (js.includes("dispatchEvent(new Event('input'"))
|
|
460
|
+
return { ok: true };
|
|
461
|
+
if (js.includes('const hasPreviewUi ='))
|
|
462
|
+
return { ok: true, state: 'preview' };
|
|
463
|
+
if (js.includes("scope === 'media'"))
|
|
464
|
+
return { ok: true, label: 'Next' };
|
|
465
|
+
if (js.includes("scope === 'caption'"))
|
|
466
|
+
return { ok: true, label: 'Share' };
|
|
467
|
+
if (js.includes('post shared') && js.includes('your post has been shared'))
|
|
468
|
+
return { ok: true, url: 'https://www.instagram.com/p/MIXEDFALLBACK123/' };
|
|
469
|
+
return { ok: true };
|
|
470
|
+
});
|
|
471
|
+
const page = createPageMock([], {
|
|
472
|
+
evaluate,
|
|
473
|
+
getCookies: vi.fn().mockResolvedValue([{ name: 'csrftoken', value: 'csrf-token', domain: 'instagram.com' }]),
|
|
474
|
+
});
|
|
475
|
+
const cmd = getRegistry().get('instagram/post');
|
|
476
|
+
const result = await cmd.func(page, {
|
|
477
|
+
media: `${imagePath},${videoPath}`,
|
|
478
|
+
content: 'mixed ui fallback',
|
|
479
|
+
});
|
|
480
|
+
expect(privateSpy).toHaveBeenCalledTimes(1);
|
|
481
|
+
expect(page.setFileInput).toHaveBeenCalledWith([imagePath, videoPath], '[data-opencli-ig-upload-index="0"]');
|
|
482
|
+
expect(result).toEqual([
|
|
483
|
+
{
|
|
484
|
+
status: '✅ Posted',
|
|
485
|
+
detail: '2-item mixed-media carousel post shared successfully',
|
|
486
|
+
url: 'https://www.instagram.com/p/MIXEDFALLBACK123/',
|
|
487
|
+
},
|
|
488
|
+
]);
|
|
489
|
+
privateSpy.mockRestore();
|
|
490
|
+
});
|
|
491
|
+
it('prefers the private route by default for mixed-media posts and preserves input order', async () => {
|
|
492
|
+
const imagePath = createTempImage('mixed-default.jpg');
|
|
493
|
+
const videoPath = createTempVideo('mixed-default.mp4');
|
|
494
|
+
const privateSpy = vi.spyOn(privatePublish, 'publishMediaViaPrivateApi').mockResolvedValueOnce({
|
|
495
|
+
code: 'MIXEDPRIVATE123',
|
|
496
|
+
uploadIds: ['111', '222'],
|
|
497
|
+
});
|
|
498
|
+
const page = createPageMock([], {
|
|
499
|
+
evaluate: vi.fn(async () => ({ ok: true })),
|
|
500
|
+
getCookies: vi.fn().mockResolvedValue([{ name: 'csrftoken', value: 'csrf-token', domain: 'instagram.com' }]),
|
|
501
|
+
});
|
|
502
|
+
const cmd = getRegistry().get('instagram/post');
|
|
503
|
+
const result = await cmd.func(page, {
|
|
504
|
+
media: `${imagePath},${videoPath}`,
|
|
505
|
+
content: 'mixed private default',
|
|
506
|
+
});
|
|
507
|
+
expect(privateSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
508
|
+
mediaItems: [
|
|
509
|
+
{ type: 'image', filePath: imagePath },
|
|
510
|
+
{ type: 'video', filePath: videoPath },
|
|
511
|
+
],
|
|
512
|
+
caption: 'mixed private default',
|
|
513
|
+
}));
|
|
514
|
+
expect(page.setFileInput).not.toHaveBeenCalled();
|
|
515
|
+
expect(result).toEqual([
|
|
516
|
+
{
|
|
517
|
+
status: '✅ Posted',
|
|
518
|
+
detail: '2-item mixed-media carousel post shared successfully',
|
|
519
|
+
url: 'https://www.instagram.com/p/MIXEDPRIVATE123/',
|
|
520
|
+
},
|
|
521
|
+
]);
|
|
522
|
+
privateSpy.mockRestore();
|
|
523
|
+
});
|
|
524
|
+
it('rejects missing --media before browser work', async () => {
|
|
525
|
+
const page = createPageMock([]);
|
|
526
|
+
const cmd = getRegistry().get('instagram/post');
|
|
527
|
+
await expect(cmd.func(page, {
|
|
528
|
+
content: 'missing media',
|
|
529
|
+
})).rejects.toThrow('Argument "media" is required.');
|
|
530
|
+
});
|
|
531
|
+
it('rejects empty or invalid --media inputs', async () => {
|
|
532
|
+
const imagePath = createTempImage('invalid-media-image.jpg');
|
|
533
|
+
const page = createPageMock([]);
|
|
534
|
+
const cmd = getRegistry().get('instagram/post');
|
|
535
|
+
await expect(cmd.func(page, {
|
|
536
|
+
media: '',
|
|
537
|
+
})).rejects.toThrow('Argument "media" is required.');
|
|
538
|
+
await expect(cmd.func(page, {
|
|
539
|
+
media: `${imagePath},/tmp/does-not-exist.mp4`,
|
|
540
|
+
})).rejects.toThrow('Media file not found');
|
|
541
|
+
});
|
|
542
|
+
it('uploads a single image, fills caption, and shares the post', async () => {
|
|
543
|
+
const imagePath = createTempImage();
|
|
544
|
+
const page = createPageMock(withInitialDialogDismiss([
|
|
545
|
+
{ ok: true },
|
|
546
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] },
|
|
547
|
+
{ ok: true },
|
|
548
|
+
{ ok: true },
|
|
549
|
+
{ ok: false },
|
|
550
|
+
{ ok: true, label: 'Next' },
|
|
551
|
+
{ ok: true },
|
|
552
|
+
{ ok: true },
|
|
553
|
+
{ ok: true },
|
|
554
|
+
{ ok: true, label: 'Share' },
|
|
555
|
+
{ ok: true, url: 'https://www.instagram.com/p/ABC123xyz/' },
|
|
556
|
+
]));
|
|
557
|
+
const cmd = getRegistry().get('instagram/post');
|
|
558
|
+
const result = await cmd.func(page, {
|
|
559
|
+
media: imagePath,
|
|
560
|
+
content: 'hello from opencli',
|
|
561
|
+
});
|
|
562
|
+
expect(page.goto).toHaveBeenCalledWith('https://www.instagram.com/');
|
|
563
|
+
expect(page.setFileInput).toHaveBeenCalledWith([imagePath], '[data-opencli-ig-upload-index="0"]');
|
|
564
|
+
expect(page.evaluate.mock.calls.some((args) => String(args[0]).includes("dispatchEvent(new Event('change'"))).toBe(true);
|
|
565
|
+
expect(result).toEqual([
|
|
566
|
+
{
|
|
567
|
+
status: '✅ Posted',
|
|
568
|
+
detail: 'Single image post shared successfully',
|
|
569
|
+
url: 'https://www.instagram.com/p/ABC123xyz/',
|
|
570
|
+
},
|
|
571
|
+
]);
|
|
572
|
+
});
|
|
573
|
+
it('uploads multiple images as a carousel and shares the post', async () => {
|
|
574
|
+
const firstImagePath = createTempImage('carousel-1.jpg');
|
|
575
|
+
const secondImagePath = createTempImage('carousel-2.jpg');
|
|
576
|
+
const page = createPageMock(withInitialDialogDismiss([
|
|
577
|
+
{ ok: true },
|
|
578
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] },
|
|
579
|
+
{ ok: true },
|
|
580
|
+
{ ok: true },
|
|
581
|
+
{ ok: false },
|
|
582
|
+
{ ok: true, label: 'Next' },
|
|
583
|
+
{ ok: true },
|
|
584
|
+
{ ok: true },
|
|
585
|
+
{ ok: true },
|
|
586
|
+
{ ok: true, label: 'Share' },
|
|
587
|
+
{ ok: true, url: 'https://www.instagram.com/p/CAROUSEL123/' },
|
|
588
|
+
]));
|
|
589
|
+
const cmd = getRegistry().get('instagram/post');
|
|
590
|
+
const result = await cmd.func(page, {
|
|
591
|
+
media: `${firstImagePath},${secondImagePath}`,
|
|
592
|
+
content: 'hello carousel',
|
|
593
|
+
});
|
|
594
|
+
expect(page.setFileInput).toHaveBeenCalledWith([firstImagePath, secondImagePath], '[data-opencli-ig-upload-index="0"]');
|
|
595
|
+
expect(result).toEqual([
|
|
596
|
+
{
|
|
597
|
+
status: '✅ Posted',
|
|
598
|
+
detail: '2-image carousel post shared successfully',
|
|
599
|
+
url: 'https://www.instagram.com/p/CAROUSEL123/',
|
|
600
|
+
},
|
|
601
|
+
]);
|
|
602
|
+
});
|
|
603
|
+
it('installs and dumps protocol capture when OPENCLI_INSTAGRAM_CAPTURE is enabled', async () => {
|
|
604
|
+
process.env.OPENCLI_INSTAGRAM_CAPTURE = '1';
|
|
605
|
+
const imagePath = createTempImage('capture-enabled.jpg');
|
|
606
|
+
const evaluate = vi.fn(async (js) => {
|
|
607
|
+
if (js.includes('__opencli_ig_protocol_capture') && js.includes('PATCH_GUARD'))
|
|
608
|
+
return { ok: true };
|
|
609
|
+
if (js.includes('const data = Array.isArray(window[') && js.includes('__opencli_ig_protocol_capture')) {
|
|
610
|
+
return { data: [], errors: [] };
|
|
611
|
+
}
|
|
612
|
+
if (js.includes('sharing') && js.includes('create new post'))
|
|
613
|
+
return { ok: false };
|
|
614
|
+
if (js.includes('window.location?.pathname'))
|
|
615
|
+
return { ok: true };
|
|
616
|
+
if (js.includes('data-opencli-ig-upload-index'))
|
|
617
|
+
return { ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] };
|
|
618
|
+
if (js.includes("dispatchEvent(new Event('input'"))
|
|
619
|
+
return { ok: true };
|
|
620
|
+
if (js.includes('const hasPreviewUi ='))
|
|
621
|
+
return { ok: true, state: 'preview' };
|
|
622
|
+
if (js.includes("scope === 'media'"))
|
|
623
|
+
return { ok: true, label: 'Next' };
|
|
624
|
+
if (js.includes("scope === 'caption'"))
|
|
625
|
+
return { ok: true, label: 'Share' };
|
|
626
|
+
if (js.includes('post shared') && js.includes('your post has been shared'))
|
|
627
|
+
return { ok: true, url: 'https://www.instagram.com/p/CAPTURE123/' };
|
|
628
|
+
return { ok: true };
|
|
629
|
+
});
|
|
630
|
+
const page = createPageMock([], { evaluate });
|
|
631
|
+
const cmd = getRegistry().get('instagram/post');
|
|
632
|
+
const result = await cmd.func(page, {
|
|
633
|
+
media: imagePath,
|
|
634
|
+
content: 'capture enabled',
|
|
635
|
+
});
|
|
636
|
+
const evaluateCalls = evaluate.mock.calls.map((args) => String(args[0]));
|
|
637
|
+
expect(evaluateCalls.some((js) => js.includes('__opencli_ig_protocol_capture') && js.includes('PATCH_GUARD'))).toBe(true);
|
|
638
|
+
expect(evaluateCalls.some((js) => js.includes('const data = Array.isArray(window[') && js.includes('__opencli_ig_protocol_capture'))).toBe(true);
|
|
639
|
+
expect(result).toEqual([
|
|
640
|
+
{
|
|
641
|
+
status: '✅ Posted',
|
|
642
|
+
detail: 'Single image post shared successfully',
|
|
643
|
+
url: 'https://www.instagram.com/p/CAPTURE123/',
|
|
644
|
+
},
|
|
645
|
+
]);
|
|
646
|
+
delete process.env.OPENCLI_INSTAGRAM_CAPTURE;
|
|
647
|
+
});
|
|
648
|
+
it('retries media Next when preview is visible before the button becomes clickable', async () => {
|
|
649
|
+
const firstImagePath = createTempImage('carousel-delay-1.jpg');
|
|
650
|
+
const secondImagePath = createTempImage('carousel-delay-2.jpg');
|
|
651
|
+
let nextAttempts = 0;
|
|
652
|
+
const evaluate = vi.fn(async (js) => {
|
|
653
|
+
if (js.includes('sharing') && js.includes('create new post'))
|
|
654
|
+
return { ok: false };
|
|
655
|
+
if (js.includes('window.location?.pathname'))
|
|
656
|
+
return { ok: true };
|
|
657
|
+
if (js.includes('data-opencli-ig-upload-index'))
|
|
658
|
+
return { ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] };
|
|
659
|
+
if (js.includes("dispatchEvent(new Event('input'"))
|
|
660
|
+
return { ok: true };
|
|
661
|
+
if (js.includes('const hasVisibleButtonInDialogs'))
|
|
662
|
+
return { state: 'preview', detail: 'Crop Back Next Select crop' };
|
|
663
|
+
if (js.includes("dialogText.includes('write a caption')") || js.includes("const editable = document.querySelector('textarea, [contenteditable=\"true\"]');")) {
|
|
664
|
+
return { ok: nextAttempts >= 2 };
|
|
665
|
+
}
|
|
666
|
+
if (js.includes("!labels.includes(text) && !labels.includes(aria)")) {
|
|
667
|
+
nextAttempts += 1;
|
|
668
|
+
if (nextAttempts === 1)
|
|
669
|
+
return { ok: false };
|
|
670
|
+
return { ok: true, label: 'Next' };
|
|
671
|
+
}
|
|
672
|
+
if (js.includes('ClipboardEvent') && js.includes('textarea'))
|
|
673
|
+
return { ok: true, mode: 'textarea' };
|
|
674
|
+
if (js.includes('readLexicalText'))
|
|
675
|
+
return { ok: true };
|
|
676
|
+
if (js.includes('post shared') && js.includes('your post has been shared'))
|
|
677
|
+
return { ok: true, url: 'https://www.instagram.com/p/CAROUSELRETRY123/' };
|
|
678
|
+
return { ok: true };
|
|
679
|
+
});
|
|
680
|
+
const page = createPageMock([], { evaluate });
|
|
681
|
+
const cmd = getRegistry().get('instagram/post');
|
|
682
|
+
const result = await cmd.func(page, {
|
|
683
|
+
media: `${firstImagePath},${secondImagePath}`,
|
|
684
|
+
content: 'hello delayed carousel',
|
|
685
|
+
});
|
|
686
|
+
expect(result).toEqual([
|
|
687
|
+
{
|
|
688
|
+
status: '✅ Posted',
|
|
689
|
+
detail: '2-image carousel post shared successfully',
|
|
690
|
+
url: 'https://www.instagram.com/p/CAROUSELRETRY123/',
|
|
691
|
+
},
|
|
692
|
+
]);
|
|
693
|
+
});
|
|
694
|
+
it('retries the whole carousel flow when preview briefly appears and then degrades into an upload error before Next is usable', async () => {
|
|
695
|
+
const firstImagePath = createTempImage('carousel-race-1.jpg');
|
|
696
|
+
const secondImagePath = createTempImage('carousel-race-2.jpg');
|
|
697
|
+
let composerRuns = 0;
|
|
698
|
+
let uploadStageChecks = 0;
|
|
699
|
+
let secondAttemptAdvanced = false;
|
|
700
|
+
const evaluate = vi.fn(async (js) => {
|
|
701
|
+
if (js.includes('sharing') && js.includes('create new post'))
|
|
702
|
+
return { ok: false };
|
|
703
|
+
if (js.includes('window.location?.pathname')) {
|
|
704
|
+
composerRuns += 1;
|
|
705
|
+
return { ok: true };
|
|
706
|
+
}
|
|
707
|
+
if (js.includes('data-opencli-ig-upload-index'))
|
|
708
|
+
return { ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] };
|
|
709
|
+
if (js.includes("dispatchEvent(new Event('input'"))
|
|
710
|
+
return { ok: true };
|
|
711
|
+
if (js.includes('const hasVisibleButtonInDialogs')) {
|
|
712
|
+
uploadStageChecks += 1;
|
|
713
|
+
if (composerRuns === 1 && uploadStageChecks === 1) {
|
|
714
|
+
return { state: 'preview', detail: 'Crop Back Next Select crop' };
|
|
715
|
+
}
|
|
716
|
+
if (composerRuns === 1) {
|
|
717
|
+
return { state: 'failed', detail: 'Something went wrong. Please try again.' };
|
|
718
|
+
}
|
|
719
|
+
return { state: 'preview', detail: 'Crop Back Next Select crop' };
|
|
720
|
+
}
|
|
721
|
+
if (js.includes("dialogText.includes('write a caption')") || js.includes("const editable = document.querySelector('textarea, [contenteditable=\"true\"]');")) {
|
|
722
|
+
return { ok: composerRuns >= 2 && secondAttemptAdvanced };
|
|
723
|
+
}
|
|
724
|
+
if (js.includes("!labels.includes(text) && !labels.includes(aria)")) {
|
|
725
|
+
if (composerRuns === 1)
|
|
726
|
+
return { ok: false };
|
|
727
|
+
secondAttemptAdvanced = true;
|
|
728
|
+
return { ok: true, label: 'Next' };
|
|
729
|
+
}
|
|
730
|
+
if (js.includes('button[aria-label="Close"]'))
|
|
731
|
+
return { ok: true };
|
|
732
|
+
if (js.includes('ClipboardEvent') && js.includes('textarea'))
|
|
733
|
+
return { ok: true, mode: 'textarea' };
|
|
734
|
+
if (js.includes('readLexicalText'))
|
|
735
|
+
return { ok: true };
|
|
736
|
+
if (js.includes('post shared') && js.includes('your post has been shared'))
|
|
737
|
+
return { ok: true, url: 'https://www.instagram.com/p/CAROUSELFRESH123/' };
|
|
738
|
+
return { ok: true };
|
|
739
|
+
});
|
|
740
|
+
const page = createPageMock([], { evaluate });
|
|
741
|
+
const cmd = getRegistry().get('instagram/post');
|
|
742
|
+
const result = await cmd.func(page, {
|
|
743
|
+
media: `${firstImagePath},${secondImagePath}`,
|
|
744
|
+
content: 'hello recovered carousel',
|
|
745
|
+
});
|
|
746
|
+
expect(result).toEqual([
|
|
747
|
+
{
|
|
748
|
+
status: '✅ Posted',
|
|
749
|
+
detail: '2-image carousel post shared successfully',
|
|
750
|
+
url: 'https://www.instagram.com/p/CAROUSELFRESH123/',
|
|
751
|
+
},
|
|
752
|
+
]);
|
|
753
|
+
});
|
|
754
|
+
it('uploads a single image and shares it without a caption when content is omitted', async () => {
|
|
755
|
+
const imagePath = createTempImage('no-caption.jpg');
|
|
756
|
+
const evaluate = vi.fn(async (js) => {
|
|
757
|
+
if (js.includes('sharing') && js.includes('create new post'))
|
|
758
|
+
return { ok: false };
|
|
759
|
+
if (js.includes('window.location?.pathname'))
|
|
760
|
+
return { ok: true };
|
|
761
|
+
if (js.includes('data-opencli-ig-upload-index'))
|
|
762
|
+
return { ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] };
|
|
763
|
+
if (js.includes("dispatchEvent(new Event('input'"))
|
|
764
|
+
return { ok: true };
|
|
765
|
+
if (js.includes('const hasPreviewUi ='))
|
|
766
|
+
return { ok: true, state: 'preview' };
|
|
767
|
+
if (js.includes("scope === 'media'"))
|
|
768
|
+
return { ok: true, label: 'Next' };
|
|
769
|
+
if (js.includes("scope === 'caption'"))
|
|
770
|
+
return { ok: true, label: 'Share' };
|
|
771
|
+
if (js.includes('const editable = document.querySelector(\'textarea, [contenteditable="true"]\');'))
|
|
772
|
+
return { ok: true };
|
|
773
|
+
if (js.includes('post shared') && js.includes('your post has been shared'))
|
|
774
|
+
return { ok: true, url: 'https://www.instagram.com/p/NOCAPTION123/' };
|
|
775
|
+
return { ok: false };
|
|
776
|
+
});
|
|
777
|
+
const page = createPageMock([], { evaluate });
|
|
778
|
+
const cmd = getRegistry().get('instagram/post');
|
|
779
|
+
const result = await cmd.func(page, {
|
|
780
|
+
media: imagePath,
|
|
781
|
+
});
|
|
782
|
+
const evaluateCalls = page.evaluate.mock.calls.map((args) => String(args[0]));
|
|
783
|
+
expect(evaluateCalls.some((js) => js.includes('Write a caption'))).toBe(false);
|
|
784
|
+
expect(result).toEqual([
|
|
785
|
+
{
|
|
786
|
+
status: '✅ Posted',
|
|
787
|
+
detail: 'Single image post shared successfully',
|
|
788
|
+
url: 'https://www.instagram.com/p/NOCAPTION123/',
|
|
789
|
+
},
|
|
790
|
+
]);
|
|
791
|
+
});
|
|
792
|
+
it('falls back to browser-side file injection when the extension does not support set-file-input', async () => {
|
|
793
|
+
const imagePath = createTempImage('legacy-extension.jpg');
|
|
794
|
+
const evaluate = vi.fn(async (js) => {
|
|
795
|
+
if (js.includes('sharing') && js.includes('create new post'))
|
|
796
|
+
return { ok: false };
|
|
797
|
+
if (js.includes('window.location?.pathname'))
|
|
798
|
+
return { ok: true };
|
|
799
|
+
if (js.includes('data-opencli-ig-upload-index'))
|
|
800
|
+
return { ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] };
|
|
801
|
+
if (js.includes('__opencliInstagramUpload_') && js.includes('] = [];'))
|
|
802
|
+
return { ok: true };
|
|
803
|
+
if (js.includes('parts.push(chunk)'))
|
|
804
|
+
return { ok: true, count: 1 };
|
|
805
|
+
if (js.includes('File input not found for fallback injection'))
|
|
806
|
+
return { ok: true, count: 1 };
|
|
807
|
+
if (js.includes('const hasPreviewUi ='))
|
|
808
|
+
return { ok: true, state: 'preview' };
|
|
809
|
+
if (js.includes("scope === 'caption'"))
|
|
810
|
+
return { ok: true, label: 'Share' };
|
|
811
|
+
if (js.includes("scope === 'media'"))
|
|
812
|
+
return { ok: true, label: 'Next' };
|
|
813
|
+
if (js.includes('labels.includes(text)'))
|
|
814
|
+
return { ok: false };
|
|
815
|
+
if (js.includes('ClipboardEvent') && js.includes('textarea'))
|
|
816
|
+
return { ok: true, mode: 'textarea' };
|
|
817
|
+
if (js.includes('readLexicalText'))
|
|
818
|
+
return { ok: true };
|
|
819
|
+
if (js.includes('couldn') && js.includes('your post has been shared'))
|
|
820
|
+
return { ok: true, url: 'https://www.instagram.com/p/LEGACY123/' };
|
|
821
|
+
return { ok: true };
|
|
822
|
+
});
|
|
823
|
+
const page = createPageMock([], {
|
|
824
|
+
evaluate,
|
|
825
|
+
setFileInput: vi.fn().mockRejectedValue(new Error('Unknown action: set-file-input')),
|
|
826
|
+
});
|
|
827
|
+
const cmd = getRegistry().get('instagram/post');
|
|
828
|
+
const result = await cmd.func(page, {
|
|
829
|
+
media: imagePath,
|
|
830
|
+
content: 'legacy bridge fallback',
|
|
831
|
+
});
|
|
832
|
+
expect(page.setFileInput).toHaveBeenCalledWith([imagePath], '[data-opencli-ig-upload-index="0"]');
|
|
833
|
+
expect(result).toEqual([
|
|
834
|
+
{
|
|
835
|
+
status: '✅ Posted',
|
|
836
|
+
detail: 'Single image post shared successfully',
|
|
837
|
+
url: 'https://www.instagram.com/p/LEGACY123/',
|
|
838
|
+
},
|
|
839
|
+
]);
|
|
840
|
+
});
|
|
841
|
+
it('chunks large legacy fallback uploads instead of embedding the whole image in one evaluate payload', async () => {
|
|
842
|
+
const imagePath = createTempImage('legacy-large.jpg', Buffer.alloc(900 * 1024, 1));
|
|
843
|
+
const evaluate = vi.fn(async (js) => {
|
|
844
|
+
if (js.includes('sharing') && js.includes('create new post'))
|
|
845
|
+
return { ok: false };
|
|
846
|
+
if (js.includes('window.location?.pathname'))
|
|
847
|
+
return { ok: true };
|
|
848
|
+
if (js.includes('data-opencli-ig-upload-index'))
|
|
849
|
+
return { ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] };
|
|
850
|
+
if (js.includes('window[') && js.includes('] = [];'))
|
|
851
|
+
return { ok: true };
|
|
852
|
+
if (js.includes('parts.push(chunk)'))
|
|
853
|
+
return { ok: true, count: 1 };
|
|
854
|
+
if (js.includes('File input not found for fallback injection'))
|
|
855
|
+
return { ok: true, count: 1 };
|
|
856
|
+
if (js.includes('const hasPreviewUi ='))
|
|
857
|
+
return { ok: true, state: 'preview' };
|
|
858
|
+
if (js.includes("scope === 'caption'"))
|
|
859
|
+
return { ok: true, label: 'Share' };
|
|
860
|
+
if (js.includes("scope === 'media'"))
|
|
861
|
+
return { ok: true, label: 'Next' };
|
|
862
|
+
if (js.includes('labels.includes(text)'))
|
|
863
|
+
return { ok: false };
|
|
864
|
+
if (js.includes('ClipboardEvent') && js.includes('textarea'))
|
|
865
|
+
return { ok: true, mode: 'textarea' };
|
|
866
|
+
if (js.includes('readLexicalText'))
|
|
867
|
+
return { ok: true };
|
|
868
|
+
if (js.includes('couldn') && js.includes('your post has been shared'))
|
|
869
|
+
return { ok: true, url: 'https://www.instagram.com/p/LARGELEGACY123/' };
|
|
870
|
+
return { ok: true };
|
|
871
|
+
});
|
|
872
|
+
const page = createPageMock([], {
|
|
873
|
+
evaluate,
|
|
874
|
+
setFileInput: vi.fn().mockRejectedValue(new Error('Unknown action: set-file-input')),
|
|
875
|
+
});
|
|
876
|
+
const cmd = getRegistry().get('instagram/post');
|
|
877
|
+
const result = await cmd.func(page, {
|
|
878
|
+
media: imagePath,
|
|
879
|
+
content: 'legacy large bridge fallback',
|
|
880
|
+
});
|
|
881
|
+
const chunkCalls = evaluate.mock.calls.filter((args) => String(args[0]).includes('parts.push(chunk)'));
|
|
882
|
+
expect(chunkCalls.length).toBeGreaterThan(1);
|
|
883
|
+
expect(result).toEqual([
|
|
884
|
+
{
|
|
885
|
+
status: '✅ Posted',
|
|
886
|
+
detail: 'Single image post shared successfully',
|
|
887
|
+
url: 'https://www.instagram.com/p/LARGELEGACY123/',
|
|
888
|
+
},
|
|
889
|
+
]);
|
|
890
|
+
});
|
|
891
|
+
it('fails clearly when Browser Bridge file upload support is unavailable', async () => {
|
|
892
|
+
const imagePath = createTempImage('missing-bridge.jpg');
|
|
893
|
+
const page = createPageMock([], { setFileInput: undefined });
|
|
894
|
+
const cmd = getRegistry().get('instagram/post');
|
|
895
|
+
await expect(cmd.func(page, {
|
|
896
|
+
media: imagePath,
|
|
897
|
+
content: 'hello from opencli',
|
|
898
|
+
})).rejects.toThrow(CommandExecutionError);
|
|
899
|
+
});
|
|
900
|
+
it('maps login-gated composer access to AuthRequiredError', async () => {
|
|
901
|
+
const imagePath = createTempImage('auth.jpg');
|
|
902
|
+
const page = createPageMock(withInitialDialogDismiss([
|
|
903
|
+
{ ok: false, reason: 'auth' },
|
|
904
|
+
]));
|
|
905
|
+
const cmd = getRegistry().get('instagram/post');
|
|
906
|
+
await expect(cmd.func(page, {
|
|
907
|
+
media: imagePath,
|
|
908
|
+
content: 'login required',
|
|
909
|
+
})).rejects.toThrow(AuthRequiredError);
|
|
910
|
+
});
|
|
911
|
+
it('captures a debug screenshot when the upload preview never appears', async () => {
|
|
912
|
+
const imagePath = createTempImage('no-preview.jpg');
|
|
913
|
+
const page = createPageMock(withInitialDialogDismiss([
|
|
914
|
+
{ ok: true },
|
|
915
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] },
|
|
916
|
+
{ ok: true },
|
|
917
|
+
{ ok: false },
|
|
918
|
+
{ ok: false },
|
|
919
|
+
{ ok: false },
|
|
920
|
+
{ ok: false },
|
|
921
|
+
{ ok: false },
|
|
922
|
+
{ ok: false },
|
|
923
|
+
{ ok: false },
|
|
924
|
+
{ ok: false },
|
|
925
|
+
{ ok: false },
|
|
926
|
+
{ ok: false },
|
|
927
|
+
{ ok: false },
|
|
928
|
+
{ ok: false },
|
|
929
|
+
{ ok: false },
|
|
930
|
+
]));
|
|
931
|
+
const cmd = getRegistry().get('instagram/post');
|
|
932
|
+
await expect(cmd.func(page, {
|
|
933
|
+
media: imagePath,
|
|
934
|
+
content: 'preview missing',
|
|
935
|
+
})).rejects.toThrow('Instagram image preview did not appear after upload');
|
|
936
|
+
expect(page.screenshot).toHaveBeenCalledWith({ path: '/tmp/instagram_post_preview_debug.png' });
|
|
937
|
+
});
|
|
938
|
+
it('fails clearly when Instagram shows an upload-stage error dialog', async () => {
|
|
939
|
+
const imagePath = createTempImage('upload-error.jpg');
|
|
940
|
+
const page = createPageMock(withInitialDialogDismiss([
|
|
941
|
+
{ ok: true },
|
|
942
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] },
|
|
943
|
+
{ ok: true },
|
|
944
|
+
{ ok: false, state: 'failed', detail: 'Something went wrong. Please try again.' },
|
|
945
|
+
]));
|
|
946
|
+
const cmd = getRegistry().get('instagram/post');
|
|
947
|
+
await expect(cmd.func(page, {
|
|
948
|
+
media: imagePath,
|
|
949
|
+
content: 'upload should fail clearly',
|
|
950
|
+
})).rejects.toThrow('Instagram image upload failed');
|
|
951
|
+
});
|
|
952
|
+
it('treats crop/next preview UI as success even if stale error text is still visible', async () => {
|
|
953
|
+
const imagePath = createTempImage('upload-preview-wins.jpg');
|
|
954
|
+
const page = createPageMock(withInitialDialogDismiss([
|
|
955
|
+
{ ok: true },
|
|
956
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] },
|
|
957
|
+
{ ok: true },
|
|
958
|
+
{
|
|
959
|
+
ok: false,
|
|
960
|
+
state: 'preview',
|
|
961
|
+
detail: 'Something went wrong. Please try again. Crop Back Next Select crop Select zoom Open media gallery',
|
|
962
|
+
},
|
|
963
|
+
{ ok: false },
|
|
964
|
+
{ ok: true, label: 'Next' },
|
|
965
|
+
{ ok: true },
|
|
966
|
+
{ ok: true },
|
|
967
|
+
{ ok: true },
|
|
968
|
+
{ ok: true, label: 'Share' },
|
|
969
|
+
{ ok: true, url: 'https://www.instagram.com/p/PREVIEWWINS123/' },
|
|
970
|
+
]));
|
|
971
|
+
const cmd = getRegistry().get('instagram/post');
|
|
972
|
+
const result = await cmd.func(page, {
|
|
973
|
+
media: imagePath,
|
|
974
|
+
content: 'preview state wins over stale error text',
|
|
975
|
+
});
|
|
976
|
+
expect(result).toEqual([
|
|
977
|
+
{
|
|
978
|
+
status: '✅ Posted',
|
|
979
|
+
detail: 'Single image post shared successfully',
|
|
980
|
+
url: 'https://www.instagram.com/p/PREVIEWWINS123/',
|
|
981
|
+
},
|
|
982
|
+
]);
|
|
983
|
+
});
|
|
984
|
+
it('retries the same upload selector once after an upload-stage error and can still succeed', async () => {
|
|
985
|
+
const imagePath = createTempImage('upload-retry.jpg');
|
|
986
|
+
const setFileInput = vi.fn().mockResolvedValue(undefined);
|
|
987
|
+
let uploadProbeCount = 0;
|
|
988
|
+
const evaluate = vi.fn(async (js) => {
|
|
989
|
+
if (js.includes('sharing') && js.includes('create new post'))
|
|
990
|
+
return { ok: false };
|
|
991
|
+
if (js.includes('window.location?.pathname'))
|
|
992
|
+
return { ok: true };
|
|
993
|
+
if (js.includes('data-opencli-ig-upload-index'))
|
|
994
|
+
return { ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] };
|
|
995
|
+
if (js.includes("dispatchEvent(new Event('input'"))
|
|
996
|
+
return { ok: true };
|
|
997
|
+
if (js.includes('const failed =') && js.includes('const hasCaption =')) {
|
|
998
|
+
uploadProbeCount += 1;
|
|
999
|
+
return uploadProbeCount === 1
|
|
1000
|
+
? { ok: false, state: 'failed', detail: 'Something went wrong. Please try again.' }
|
|
1001
|
+
: { ok: true, state: 'preview' };
|
|
1002
|
+
}
|
|
1003
|
+
if (js.includes('button[aria-label="Close"]'))
|
|
1004
|
+
return { ok: true };
|
|
1005
|
+
if (js.includes("scope === 'media'"))
|
|
1006
|
+
return { ok: true, label: 'Next' };
|
|
1007
|
+
if (js.includes('ClipboardEvent') && js.includes('textarea'))
|
|
1008
|
+
return { ok: true, mode: 'textarea' };
|
|
1009
|
+
if (js.includes('readLexicalText'))
|
|
1010
|
+
return { ok: true };
|
|
1011
|
+
if (js.includes("scope === 'caption'"))
|
|
1012
|
+
return { ok: true, label: 'Share' };
|
|
1013
|
+
if (js.includes('post shared') && js.includes('your post has been shared'))
|
|
1014
|
+
return { ok: true, url: 'https://www.instagram.com/p/UPLOADRETRY123/' };
|
|
1015
|
+
return { ok: true };
|
|
1016
|
+
});
|
|
1017
|
+
const page = createPageMock([], { setFileInput, evaluate });
|
|
1018
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1019
|
+
const result = await cmd.func(page, {
|
|
1020
|
+
media: imagePath,
|
|
1021
|
+
content: 'upload retry succeeds',
|
|
1022
|
+
});
|
|
1023
|
+
expect(setFileInput).toHaveBeenCalledTimes(1);
|
|
1024
|
+
expect(result).toEqual([
|
|
1025
|
+
{
|
|
1026
|
+
status: '✅ Posted',
|
|
1027
|
+
detail: 'Single image post shared successfully',
|
|
1028
|
+
url: 'https://www.instagram.com/p/UPLOADRETRY123/',
|
|
1029
|
+
},
|
|
1030
|
+
]);
|
|
1031
|
+
});
|
|
1032
|
+
it('clicks upload Try again in-place before resetting the whole flow when Instagram shows an upload error dialog', async () => {
|
|
1033
|
+
const imagePath = createTempImage('upload-inline-retry.jpg');
|
|
1034
|
+
let uploadProbeCount = 0;
|
|
1035
|
+
const evaluate = vi.fn(async (js) => {
|
|
1036
|
+
if (js.includes('sharing') && js.includes('create new post'))
|
|
1037
|
+
return { ok: false };
|
|
1038
|
+
if (js.includes('window.location?.pathname'))
|
|
1039
|
+
return { ok: true };
|
|
1040
|
+
if (js.includes('data-opencli-ig-upload-index'))
|
|
1041
|
+
return { ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] };
|
|
1042
|
+
if (js.includes("dispatchEvent(new Event('input'"))
|
|
1043
|
+
return { ok: true };
|
|
1044
|
+
if (js.includes('const hasVisibleButtonInDialogs')) {
|
|
1045
|
+
uploadProbeCount += 1;
|
|
1046
|
+
return uploadProbeCount === 1
|
|
1047
|
+
? { state: 'failed', detail: 'Something went wrong. Please try again.' }
|
|
1048
|
+
: { state: 'preview', detail: 'Crop Back Next Select crop' };
|
|
1049
|
+
}
|
|
1050
|
+
if (js.includes('something went wrong') && js.includes('label === \'try again\''))
|
|
1051
|
+
return { ok: true };
|
|
1052
|
+
if (js.includes("dialogText.includes('write a caption')") || js.includes("const editable = document.querySelector('textarea, [contenteditable=\"true\"]');")) {
|
|
1053
|
+
return { ok: true };
|
|
1054
|
+
}
|
|
1055
|
+
if (js.includes("!labels.includes(text) && !labels.includes(aria)")) {
|
|
1056
|
+
if (js.includes('"Share"'))
|
|
1057
|
+
return { ok: true, label: 'Share' };
|
|
1058
|
+
return { ok: true, label: 'Next' };
|
|
1059
|
+
}
|
|
1060
|
+
if (js.includes('ClipboardEvent') && js.includes('textarea'))
|
|
1061
|
+
return { ok: true, mode: 'textarea' };
|
|
1062
|
+
if (js.includes('readLexicalText'))
|
|
1063
|
+
return { ok: true };
|
|
1064
|
+
if (js.includes('post shared') && js.includes('your post has been shared'))
|
|
1065
|
+
return { ok: true, url: 'https://www.instagram.com/p/UPLOADINLINERETRY123/' };
|
|
1066
|
+
return { ok: true };
|
|
1067
|
+
});
|
|
1068
|
+
const page = createPageMock([], { evaluate });
|
|
1069
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1070
|
+
const result = await cmd.func(page, {
|
|
1071
|
+
media: imagePath,
|
|
1072
|
+
content: 'upload inline retry succeeds',
|
|
1073
|
+
});
|
|
1074
|
+
expect(result).toEqual([
|
|
1075
|
+
{
|
|
1076
|
+
status: '✅ Posted',
|
|
1077
|
+
detail: 'Single image post shared successfully',
|
|
1078
|
+
url: 'https://www.instagram.com/p/UPLOADINLINERETRY123/',
|
|
1079
|
+
},
|
|
1080
|
+
]);
|
|
1081
|
+
});
|
|
1082
|
+
it('retries max-size carousel upload failures beyond the expanded large-carousel budget before succeeding', async () => {
|
|
1083
|
+
const paths = [
|
|
1084
|
+
createTempImage('carousel-10-1.jpg'),
|
|
1085
|
+
createTempImage('carousel-10-2.jpg'),
|
|
1086
|
+
createTempImage('carousel-10-3.jpg'),
|
|
1087
|
+
createTempImage('carousel-10-4.jpg'),
|
|
1088
|
+
createTempImage('carousel-10-5.jpg'),
|
|
1089
|
+
createTempImage('carousel-10-6.jpg'),
|
|
1090
|
+
createTempImage('carousel-10-7.jpg'),
|
|
1091
|
+
createTempImage('carousel-10-8.jpg'),
|
|
1092
|
+
createTempImage('carousel-10-9.jpg'),
|
|
1093
|
+
createTempImage('carousel-10-10.jpg'),
|
|
1094
|
+
];
|
|
1095
|
+
const setFileInput = vi.fn().mockResolvedValue(undefined);
|
|
1096
|
+
let uploadProbeCount = 0;
|
|
1097
|
+
const evaluate = vi.fn(async (js) => {
|
|
1098
|
+
if (js.includes('sharing') && js.includes('create new post'))
|
|
1099
|
+
return { ok: false };
|
|
1100
|
+
if (js.includes('window.location?.pathname'))
|
|
1101
|
+
return { ok: true };
|
|
1102
|
+
if (js.includes('data-opencli-ig-upload-index'))
|
|
1103
|
+
return { ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] };
|
|
1104
|
+
if (js.includes("dispatchEvent(new Event('input'"))
|
|
1105
|
+
return { ok: true };
|
|
1106
|
+
if (js.includes('const hasVisibleButtonInDialogs')) {
|
|
1107
|
+
uploadProbeCount += 1;
|
|
1108
|
+
if (uploadProbeCount <= 16) {
|
|
1109
|
+
return { state: 'failed', detail: 'Something went wrong. Please try again.' };
|
|
1110
|
+
}
|
|
1111
|
+
return { state: 'preview', detail: 'Crop Back Next Select crop' };
|
|
1112
|
+
}
|
|
1113
|
+
if (js.includes('button[aria-label="Close"]'))
|
|
1114
|
+
return { ok: true };
|
|
1115
|
+
if (js.includes("dialogText.includes('write a caption')") || js.includes("const editable = document.querySelector('textarea, [contenteditable=\"true\"]');")) {
|
|
1116
|
+
return { ok: true };
|
|
1117
|
+
}
|
|
1118
|
+
if (js.includes("!labels.includes(text) && !labels.includes(aria)")) {
|
|
1119
|
+
if (js.includes('"Share"'))
|
|
1120
|
+
return { ok: true, label: 'Share' };
|
|
1121
|
+
return { ok: true, label: 'Next' };
|
|
1122
|
+
}
|
|
1123
|
+
if (js.includes('post shared') && js.includes('your post has been shared'))
|
|
1124
|
+
return { ok: true, url: 'https://www.instagram.com/p/CAROUSEL10RETRY123/' };
|
|
1125
|
+
return { ok: true };
|
|
1126
|
+
});
|
|
1127
|
+
const page = createPageMock([], { setFileInput, evaluate });
|
|
1128
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1129
|
+
const result = await cmd.func(page, {
|
|
1130
|
+
media: paths.join(','),
|
|
1131
|
+
});
|
|
1132
|
+
expect(setFileInput).toHaveBeenCalledTimes(5);
|
|
1133
|
+
expect(result).toEqual([
|
|
1134
|
+
{
|
|
1135
|
+
status: '✅ Posted',
|
|
1136
|
+
detail: '10-image carousel post shared successfully',
|
|
1137
|
+
url: 'https://www.instagram.com/p/CAROUSEL10RETRY123/',
|
|
1138
|
+
},
|
|
1139
|
+
]);
|
|
1140
|
+
});
|
|
1141
|
+
it('forces a fresh home reload before retrying after an upload-stage error', async () => {
|
|
1142
|
+
const imagePath = createTempImage('upload-fresh-reload.jpg');
|
|
1143
|
+
const gotoUrls = [];
|
|
1144
|
+
const goto = vi.fn(async (url) => {
|
|
1145
|
+
gotoUrls.push(String(url));
|
|
1146
|
+
});
|
|
1147
|
+
let uploadProbeCount = 0;
|
|
1148
|
+
let advancedToCaption = false;
|
|
1149
|
+
const evaluate = vi.fn(async (js) => {
|
|
1150
|
+
if (js.includes('window.location?.pathname'))
|
|
1151
|
+
return { ok: true };
|
|
1152
|
+
if (js.includes('data-opencli-ig-upload-index'))
|
|
1153
|
+
return { ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] };
|
|
1154
|
+
if (js.includes("dispatchEvent(new Event('input'"))
|
|
1155
|
+
return { ok: true };
|
|
1156
|
+
if (js.includes("dialogText.includes('write a caption')") || js.includes("const editable = document.querySelector('textarea, [contenteditable=\"true\"]');")) {
|
|
1157
|
+
return { ok: advancedToCaption };
|
|
1158
|
+
}
|
|
1159
|
+
if (js.includes('const hasPreviewUi =')) {
|
|
1160
|
+
uploadProbeCount += 1;
|
|
1161
|
+
if (uploadProbeCount === 1) {
|
|
1162
|
+
return { ok: false, state: 'failed', detail: 'Something went wrong. Please try again.' };
|
|
1163
|
+
}
|
|
1164
|
+
return gotoUrls.some((url) => url.includes('__opencli_reset='))
|
|
1165
|
+
? { ok: true, state: 'preview' }
|
|
1166
|
+
: { ok: false, state: 'failed', detail: 'Something went wrong. Please try again.' };
|
|
1167
|
+
}
|
|
1168
|
+
if (js.includes('button[aria-label="Close"]'))
|
|
1169
|
+
return { ok: false };
|
|
1170
|
+
if (js.includes("scope === 'media'")) {
|
|
1171
|
+
advancedToCaption = true;
|
|
1172
|
+
return { ok: true, label: 'Next' };
|
|
1173
|
+
}
|
|
1174
|
+
if (js.includes('ClipboardEvent') && js.includes('textarea'))
|
|
1175
|
+
return { ok: true, mode: 'textarea' };
|
|
1176
|
+
if (js.includes('readLexicalText'))
|
|
1177
|
+
return { ok: true };
|
|
1178
|
+
if (js.includes("scope === 'caption'"))
|
|
1179
|
+
return { ok: true, label: 'Share' };
|
|
1180
|
+
if (js.includes('post shared') && js.includes('your post has been shared'))
|
|
1181
|
+
return { ok: true, url: 'https://www.instagram.com/p/FRESHRELOAD123/' };
|
|
1182
|
+
return { ok: false };
|
|
1183
|
+
});
|
|
1184
|
+
const page = createPageMock([], {
|
|
1185
|
+
goto,
|
|
1186
|
+
evaluate,
|
|
1187
|
+
setFileInput: vi.fn().mockResolvedValue(undefined),
|
|
1188
|
+
});
|
|
1189
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1190
|
+
const result = await cmd.func(page, {
|
|
1191
|
+
media: imagePath,
|
|
1192
|
+
content: 'fresh reload after upload failure',
|
|
1193
|
+
});
|
|
1194
|
+
expect(gotoUrls.some((url) => url.includes('__opencli_reset='))).toBe(true);
|
|
1195
|
+
expect(result).toEqual([
|
|
1196
|
+
{
|
|
1197
|
+
status: '✅ Posted',
|
|
1198
|
+
detail: 'Single image post shared successfully',
|
|
1199
|
+
url: 'https://www.instagram.com/p/FRESHRELOAD123/',
|
|
1200
|
+
},
|
|
1201
|
+
]);
|
|
1202
|
+
});
|
|
1203
|
+
it('retries the share action in-place when Instagram shows a visible try-again share failure dialog', async () => {
|
|
1204
|
+
const imagePath = createTempImage('share-retry.jpg');
|
|
1205
|
+
let shareStatusChecks = 0;
|
|
1206
|
+
const evaluate = vi.fn(async (js) => {
|
|
1207
|
+
if (js.includes('sharing') && js.includes('create new post'))
|
|
1208
|
+
return { ok: false };
|
|
1209
|
+
if (js.includes('window.location?.pathname'))
|
|
1210
|
+
return { ok: true };
|
|
1211
|
+
if (js.includes('data-opencli-ig-upload-index'))
|
|
1212
|
+
return { ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] };
|
|
1213
|
+
if (js.includes("dispatchEvent(new Event('input'"))
|
|
1214
|
+
return { ok: true };
|
|
1215
|
+
if (js.includes('const hasVisibleButtonInDialogs'))
|
|
1216
|
+
return { state: 'preview', detail: 'Crop Back Next Select crop' };
|
|
1217
|
+
if (js.includes("dialogText.includes('write a caption')") || js.includes("const editable = document.querySelector('textarea, [contenteditable=\"true\"]');")) {
|
|
1218
|
+
return { ok: true };
|
|
1219
|
+
}
|
|
1220
|
+
if (js.includes("!labels.includes(text) && !labels.includes(aria)")) {
|
|
1221
|
+
if (js.includes('"Share"'))
|
|
1222
|
+
return { ok: true, label: 'Share' };
|
|
1223
|
+
return { ok: true, label: 'Next' };
|
|
1224
|
+
}
|
|
1225
|
+
if (js.includes('ClipboardEvent') && js.includes('textarea'))
|
|
1226
|
+
return { ok: true, mode: 'textarea' };
|
|
1227
|
+
if (js.includes('readLexicalText'))
|
|
1228
|
+
return { ok: true };
|
|
1229
|
+
if (js.includes('post shared') && js.includes('your post has been shared')) {
|
|
1230
|
+
shareStatusChecks += 1;
|
|
1231
|
+
return shareStatusChecks === 1
|
|
1232
|
+
? { ok: false, failed: true, settled: false, url: '' }
|
|
1233
|
+
: { ok: true, failed: false, settled: false, url: 'https://www.instagram.com/p/SHARERETRY123/' };
|
|
1234
|
+
}
|
|
1235
|
+
if (js.includes('post couldn') && js.includes('try again'))
|
|
1236
|
+
return { ok: true };
|
|
1237
|
+
return { ok: true };
|
|
1238
|
+
});
|
|
1239
|
+
const page = createPageMock([], { evaluate });
|
|
1240
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1241
|
+
const result = await cmd.func(page, {
|
|
1242
|
+
media: imagePath,
|
|
1243
|
+
content: 'share retry succeeds',
|
|
1244
|
+
});
|
|
1245
|
+
expect(result).toEqual([
|
|
1246
|
+
{
|
|
1247
|
+
status: '✅ Posted',
|
|
1248
|
+
detail: 'Single image post shared successfully',
|
|
1249
|
+
url: 'https://www.instagram.com/p/SHARERETRY123/',
|
|
1250
|
+
},
|
|
1251
|
+
]);
|
|
1252
|
+
});
|
|
1253
|
+
it('re-resolves the upload input when the tagged selector goes stale before setFileInput runs', async () => {
|
|
1254
|
+
const imagePath = createTempImage('stale-selector.jpg');
|
|
1255
|
+
const setFileInput = vi.fn()
|
|
1256
|
+
.mockRejectedValueOnce(new Error('No element found matching selector: [data-opencli-ig-upload-index="0"]'))
|
|
1257
|
+
.mockResolvedValueOnce(undefined);
|
|
1258
|
+
const page = createPageMock(withInitialDialogDismiss([
|
|
1259
|
+
{ ok: true },
|
|
1260
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] },
|
|
1261
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] },
|
|
1262
|
+
{ ok: true },
|
|
1263
|
+
{ ok: true },
|
|
1264
|
+
{ ok: false },
|
|
1265
|
+
{ ok: true, label: 'Next' },
|
|
1266
|
+
{ ok: true },
|
|
1267
|
+
{ ok: true },
|
|
1268
|
+
{ ok: true },
|
|
1269
|
+
{ ok: true, label: 'Share' },
|
|
1270
|
+
{ ok: true, url: 'https://www.instagram.com/p/STALE123/' },
|
|
1271
|
+
]), { setFileInput });
|
|
1272
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1273
|
+
const result = await cmd.func(page, {
|
|
1274
|
+
media: imagePath,
|
|
1275
|
+
content: 'stale selector recovery',
|
|
1276
|
+
});
|
|
1277
|
+
expect(setFileInput).toHaveBeenCalledTimes(2);
|
|
1278
|
+
expect(result).toEqual([
|
|
1279
|
+
{
|
|
1280
|
+
status: '✅ Posted',
|
|
1281
|
+
detail: 'Single image post shared successfully',
|
|
1282
|
+
url: 'https://www.instagram.com/p/STALE123/',
|
|
1283
|
+
},
|
|
1284
|
+
]);
|
|
1285
|
+
});
|
|
1286
|
+
it('re-resolves the upload input when CDP loses the matched file-input node before setFileInput runs', async () => {
|
|
1287
|
+
const imagePath = createTempImage('stale-node-id.jpg');
|
|
1288
|
+
const setFileInput = vi.fn()
|
|
1289
|
+
.mockRejectedValueOnce(new Error('{"code":-32000,"message":"Could not find node with given id"}'))
|
|
1290
|
+
.mockResolvedValueOnce(undefined);
|
|
1291
|
+
const page = createPageMock(withInitialDialogDismiss([
|
|
1292
|
+
{ ok: true },
|
|
1293
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] },
|
|
1294
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] },
|
|
1295
|
+
{ ok: true },
|
|
1296
|
+
{ ok: true },
|
|
1297
|
+
{ ok: false },
|
|
1298
|
+
{ ok: true, label: 'Next' },
|
|
1299
|
+
{ ok: true },
|
|
1300
|
+
{ ok: true },
|
|
1301
|
+
{ ok: true },
|
|
1302
|
+
{ ok: true, label: 'Share' },
|
|
1303
|
+
{ ok: true, url: 'https://www.instagram.com/p/STALEID123/' },
|
|
1304
|
+
]), { setFileInput });
|
|
1305
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1306
|
+
const result = await cmd.func(page, {
|
|
1307
|
+
media: imagePath,
|
|
1308
|
+
content: 'stale node id recovery',
|
|
1309
|
+
});
|
|
1310
|
+
expect(setFileInput).toHaveBeenCalledTimes(2);
|
|
1311
|
+
expect(result).toEqual([
|
|
1312
|
+
{
|
|
1313
|
+
status: '✅ Posted',
|
|
1314
|
+
detail: 'Single image post shared successfully',
|
|
1315
|
+
url: 'https://www.instagram.com/p/STALEID123/',
|
|
1316
|
+
},
|
|
1317
|
+
]);
|
|
1318
|
+
});
|
|
1319
|
+
it('retries opening the home composer instead of navigating to the broken /create/select route', async () => {
|
|
1320
|
+
const imagePath = createTempImage('retry-composer.jpg');
|
|
1321
|
+
const page = createPageMock(withInitialDialogDismiss([
|
|
1322
|
+
{ ok: true },
|
|
1323
|
+
{ ok: false },
|
|
1324
|
+
{ ok: true },
|
|
1325
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] },
|
|
1326
|
+
{ ok: true },
|
|
1327
|
+
{ ok: true },
|
|
1328
|
+
{ ok: false },
|
|
1329
|
+
{ ok: true, label: 'Next' },
|
|
1330
|
+
{ ok: true },
|
|
1331
|
+
{ ok: true },
|
|
1332
|
+
{ ok: true },
|
|
1333
|
+
{ ok: true, label: 'Share' },
|
|
1334
|
+
{ ok: true, url: 'https://www.instagram.com/p/FALLBACK123/' },
|
|
1335
|
+
]));
|
|
1336
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1337
|
+
const result = await cmd.func(page, {
|
|
1338
|
+
media: imagePath,
|
|
1339
|
+
content: 'retry composer',
|
|
1340
|
+
});
|
|
1341
|
+
const gotoCalls = page.goto.mock.calls.map((args) => String(args[0]));
|
|
1342
|
+
expect(gotoCalls.every((url) => !url.includes('/create/select'))).toBe(true);
|
|
1343
|
+
expect(gotoCalls.some((url) => url === 'https://www.instagram.com/')).toBe(true);
|
|
1344
|
+
expect(result).toEqual([
|
|
1345
|
+
{
|
|
1346
|
+
status: '✅ Posted',
|
|
1347
|
+
detail: 'Single image post shared successfully',
|
|
1348
|
+
url: 'https://www.instagram.com/p/FALLBACK123/',
|
|
1349
|
+
},
|
|
1350
|
+
]);
|
|
1351
|
+
});
|
|
1352
|
+
it('clicks Next twice when Instagram shows an intermediate preview step before the caption editor', async () => {
|
|
1353
|
+
const imagePath = createTempImage('double-next.jpg');
|
|
1354
|
+
let nextClicks = 0;
|
|
1355
|
+
const evaluate = vi.fn(async (js) => {
|
|
1356
|
+
if (js.includes('sharing') && js.includes('create new post'))
|
|
1357
|
+
return { ok: false };
|
|
1358
|
+
if (js.includes('window.location?.pathname'))
|
|
1359
|
+
return { ok: true };
|
|
1360
|
+
if (js.includes('data-opencli-ig-upload-index'))
|
|
1361
|
+
return { ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] };
|
|
1362
|
+
if (js.includes("dispatchEvent(new Event('input'"))
|
|
1363
|
+
return { ok: true };
|
|
1364
|
+
if (js.includes('const hasVisibleButtonInDialogs'))
|
|
1365
|
+
return { state: 'preview', detail: 'Crop Back Next Select crop' };
|
|
1366
|
+
if (js.includes("dialogText.includes('write a caption')") || js.includes("const editable = document.querySelector('textarea, [contenteditable=\"true\"]');")) {
|
|
1367
|
+
return { ok: nextClicks >= 2 };
|
|
1368
|
+
}
|
|
1369
|
+
if (js.includes("!labels.includes(text) && !labels.includes(aria)")) {
|
|
1370
|
+
if (js.includes('"Share"'))
|
|
1371
|
+
return { ok: true, label: 'Share' };
|
|
1372
|
+
nextClicks += 1;
|
|
1373
|
+
return { ok: true, label: 'Next' };
|
|
1374
|
+
}
|
|
1375
|
+
if (js.includes('ClipboardEvent') && js.includes('textarea'))
|
|
1376
|
+
return { ok: true, mode: 'textarea' };
|
|
1377
|
+
if (js.includes('readLexicalText'))
|
|
1378
|
+
return { ok: true };
|
|
1379
|
+
if (js.includes('post shared') && js.includes('your post has been shared'))
|
|
1380
|
+
return { ok: true, url: 'https://www.instagram.com/p/DOUBLE123/' };
|
|
1381
|
+
return { ok: true };
|
|
1382
|
+
});
|
|
1383
|
+
const page = createPageMock([], { evaluate });
|
|
1384
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1385
|
+
const result = await cmd.func(page, {
|
|
1386
|
+
media: imagePath,
|
|
1387
|
+
content: 'double next flow',
|
|
1388
|
+
});
|
|
1389
|
+
expect(result).toEqual([
|
|
1390
|
+
{
|
|
1391
|
+
status: '✅ Posted',
|
|
1392
|
+
detail: 'Single image post shared successfully',
|
|
1393
|
+
url: 'https://www.instagram.com/p/DOUBLE123/',
|
|
1394
|
+
},
|
|
1395
|
+
]);
|
|
1396
|
+
});
|
|
1397
|
+
it('tries the next upload input when the first candidate never opens the preview', async () => {
|
|
1398
|
+
const imagePath = createTempImage('second-input.jpg');
|
|
1399
|
+
const setFileInput = vi.fn()
|
|
1400
|
+
.mockResolvedValueOnce(undefined)
|
|
1401
|
+
.mockResolvedValueOnce(undefined);
|
|
1402
|
+
const page = createPageMock(withInitialDialogDismiss([
|
|
1403
|
+
{ ok: true },
|
|
1404
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]', '[data-opencli-ig-upload-index="1"]'] },
|
|
1405
|
+
{ ok: true },
|
|
1406
|
+
{ ok: false },
|
|
1407
|
+
{ ok: false },
|
|
1408
|
+
{ ok: false },
|
|
1409
|
+
{ ok: false },
|
|
1410
|
+
{ ok: false },
|
|
1411
|
+
{ ok: false },
|
|
1412
|
+
{ ok: false },
|
|
1413
|
+
{ ok: false },
|
|
1414
|
+
{ ok: true },
|
|
1415
|
+
{ ok: true },
|
|
1416
|
+
{ ok: false },
|
|
1417
|
+
{ ok: true, label: 'Next' },
|
|
1418
|
+
{ ok: true },
|
|
1419
|
+
{ ok: true },
|
|
1420
|
+
{ ok: true },
|
|
1421
|
+
{ ok: true, label: 'Share' },
|
|
1422
|
+
{ ok: true, url: 'https://www.instagram.com/p/SECOND123/' },
|
|
1423
|
+
]), { setFileInput });
|
|
1424
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1425
|
+
const result = await cmd.func(page, {
|
|
1426
|
+
media: imagePath,
|
|
1427
|
+
content: 'second input works',
|
|
1428
|
+
});
|
|
1429
|
+
expect(setFileInput).toHaveBeenNthCalledWith(1, [imagePath], '[data-opencli-ig-upload-index="0"]');
|
|
1430
|
+
expect(setFileInput).toHaveBeenNthCalledWith(2, [imagePath], '[data-opencli-ig-upload-index="1"]');
|
|
1431
|
+
expect(result).toEqual([
|
|
1432
|
+
{
|
|
1433
|
+
status: '✅ Posted',
|
|
1434
|
+
detail: 'Single image post shared successfully',
|
|
1435
|
+
url: 'https://www.instagram.com/p/SECOND123/',
|
|
1436
|
+
},
|
|
1437
|
+
]);
|
|
1438
|
+
});
|
|
1439
|
+
it('fails fast when Instagram reports that the post could not be shared', async () => {
|
|
1440
|
+
const imagePath = createTempImage('share-failed.jpg');
|
|
1441
|
+
const page = createPageMock(withInitialDialogDismiss([
|
|
1442
|
+
{ ok: true },
|
|
1443
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] },
|
|
1444
|
+
{ ok: true },
|
|
1445
|
+
{ ok: true },
|
|
1446
|
+
{ ok: false },
|
|
1447
|
+
{ ok: true, label: 'Next' },
|
|
1448
|
+
{ ok: true },
|
|
1449
|
+
{ ok: true },
|
|
1450
|
+
{ ok: true },
|
|
1451
|
+
{ ok: true, label: 'Share' },
|
|
1452
|
+
{ ok: false, failed: true, url: '' },
|
|
1453
|
+
]));
|
|
1454
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1455
|
+
await expect(cmd.func(page, {
|
|
1456
|
+
media: imagePath,
|
|
1457
|
+
content: 'share should fail',
|
|
1458
|
+
})).rejects.toThrow('Instagram post share failed');
|
|
1459
|
+
});
|
|
1460
|
+
it('keeps waiting across the full publish timeout window instead of fast-forwarding after 30 polls', async () => {
|
|
1461
|
+
const imagePath = createTempImage('slow-share.jpg');
|
|
1462
|
+
const page = createPageMock(withInitialDialogDismiss([
|
|
1463
|
+
{ ok: true },
|
|
1464
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] },
|
|
1465
|
+
{ ok: true },
|
|
1466
|
+
{ ok: true },
|
|
1467
|
+
{ ok: false },
|
|
1468
|
+
{ ok: true, label: 'Next' },
|
|
1469
|
+
{ ok: true },
|
|
1470
|
+
{ ok: true },
|
|
1471
|
+
{ ok: true },
|
|
1472
|
+
{ ok: true, label: 'Share' },
|
|
1473
|
+
...Array.from({ length: 35 }, () => ({ ok: false, failed: false, settled: false, url: '' })),
|
|
1474
|
+
{ ok: true, url: 'https://www.instagram.com/p/SLOWSHARE123/' },
|
|
1475
|
+
]));
|
|
1476
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1477
|
+
const result = await cmd.func(page, {
|
|
1478
|
+
media: imagePath,
|
|
1479
|
+
content: 'slow share eventually succeeds',
|
|
1480
|
+
});
|
|
1481
|
+
const waitCalls = page.wait.mock.calls.filter((args) => args[0]?.time === 1);
|
|
1482
|
+
expect(waitCalls.length).toBeGreaterThanOrEqual(35);
|
|
1483
|
+
expect(result).toEqual([
|
|
1484
|
+
{
|
|
1485
|
+
status: '✅ Posted',
|
|
1486
|
+
detail: 'Single image post shared successfully',
|
|
1487
|
+
url: 'https://www.instagram.com/p/SLOWSHARE123/',
|
|
1488
|
+
},
|
|
1489
|
+
]);
|
|
1490
|
+
});
|
|
1491
|
+
it('does not retry the upload flow after Share has already been clicked', async () => {
|
|
1492
|
+
const imagePath = createTempImage('no-duplicate-retry.jpg');
|
|
1493
|
+
const setFileInput = vi.fn().mockResolvedValue(undefined);
|
|
1494
|
+
const page = createPageMock(withInitialDialogDismiss([
|
|
1495
|
+
{ ok: true },
|
|
1496
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] },
|
|
1497
|
+
{ ok: true },
|
|
1498
|
+
{ ok: true },
|
|
1499
|
+
{ ok: false },
|
|
1500
|
+
{ ok: true, label: 'Next' },
|
|
1501
|
+
{ ok: true },
|
|
1502
|
+
{ ok: true },
|
|
1503
|
+
{ ok: true },
|
|
1504
|
+
{ ok: true, label: 'Share' },
|
|
1505
|
+
...Array.from({ length: 30 }, () => ({ ok: false, failed: false, url: '' })),
|
|
1506
|
+
]), { setFileInput });
|
|
1507
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1508
|
+
await expect(cmd.func(page, {
|
|
1509
|
+
media: imagePath,
|
|
1510
|
+
content: 'share observation stalled',
|
|
1511
|
+
})).rejects.toThrow('Instagram post share confirmation did not appear');
|
|
1512
|
+
expect(setFileInput).toHaveBeenCalledTimes(1);
|
|
1513
|
+
});
|
|
1514
|
+
it('recovers the latest post URL from the current logged-in profile when success does not navigate to /p/', async () => {
|
|
1515
|
+
const imagePath = createTempImage('url-recovery.jpg');
|
|
1516
|
+
const evaluate = vi.fn(async (js) => {
|
|
1517
|
+
if (js.includes('const data = Array.isArray(window[') && js.includes('__opencli_ig_protocol_capture')) {
|
|
1518
|
+
return { data: [], errors: [] };
|
|
1519
|
+
}
|
|
1520
|
+
if (js.includes('fetch(') && js.includes('/api/v1/users/') && js.includes('X-IG-App-ID')) {
|
|
1521
|
+
return js.includes('dynamic-runtime-app-id')
|
|
1522
|
+
? { ok: true, username: 'tsezi_ray' }
|
|
1523
|
+
: { ok: false };
|
|
1524
|
+
}
|
|
1525
|
+
if (js.includes('window.location?.pathname'))
|
|
1526
|
+
return { ok: true };
|
|
1527
|
+
if (js.includes('data-opencli-ig-upload-index'))
|
|
1528
|
+
return { ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] };
|
|
1529
|
+
if (js.includes("dispatchEvent(new Event('input'"))
|
|
1530
|
+
return { ok: true };
|
|
1531
|
+
if (js.includes('const hasPreviewUi ='))
|
|
1532
|
+
return { ok: true, state: 'preview' };
|
|
1533
|
+
if (js.includes("scope === 'media'"))
|
|
1534
|
+
return { ok: true, label: 'Next' };
|
|
1535
|
+
if (js.includes("scope === 'caption'"))
|
|
1536
|
+
return { ok: true, label: 'Share' };
|
|
1537
|
+
if (js.includes('post shared') && js.includes('your post has been shared'))
|
|
1538
|
+
return { ok: true, url: '' };
|
|
1539
|
+
if (js.includes('const hrefs = Array.from(document.querySelectorAll(\'a[href*="/p/"]\'))')) {
|
|
1540
|
+
const calls = evaluate.mock.calls.filter(([script]) => typeof script === 'string' && script.includes('const hrefs = Array.from(document.querySelectorAll(\'a[href*="/p/"]\'))')).length;
|
|
1541
|
+
return calls === 1
|
|
1542
|
+
? { ok: true, hrefs: ['/tsezi_ray/p/PINNED111/', '/tsezi_ray/p/OLD222/'] }
|
|
1543
|
+
: { ok: true, hrefs: ['/tsezi_ray/p/PINNED111/', '/tsezi_ray/p/OLD222/', '/tsezi_ray/p/RECOVER123/'] };
|
|
1544
|
+
}
|
|
1545
|
+
if (js.includes('document.documentElement?.outerHTML')) {
|
|
1546
|
+
return {
|
|
1547
|
+
appId: 'dynamic-runtime-app-id',
|
|
1548
|
+
csrfToken: 'csrf-token',
|
|
1549
|
+
instagramAjax: 'dynamic-rollout',
|
|
1550
|
+
};
|
|
1551
|
+
}
|
|
1552
|
+
return { ok: true };
|
|
1553
|
+
});
|
|
1554
|
+
const page = createPageMock([], {
|
|
1555
|
+
evaluate,
|
|
1556
|
+
getCookies: vi.fn().mockResolvedValue([{ name: 'ds_user_id', value: '61236465677', domain: 'instagram.com' }]),
|
|
1557
|
+
});
|
|
1558
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1559
|
+
const result = await cmd.func(page, {
|
|
1560
|
+
media: imagePath,
|
|
1561
|
+
content: 'url recovery',
|
|
1562
|
+
});
|
|
1563
|
+
expect(result).toEqual([
|
|
1564
|
+
{
|
|
1565
|
+
status: '✅ Posted',
|
|
1566
|
+
detail: 'Single image post shared successfully',
|
|
1567
|
+
url: 'https://www.instagram.com/tsezi_ray/p/RECOVER123/',
|
|
1568
|
+
},
|
|
1569
|
+
]);
|
|
1570
|
+
});
|
|
1571
|
+
it('treats a closed composer as a successful share and falls back to URL recovery', async () => {
|
|
1572
|
+
const imagePath = createTempImage('share-settled.jpg');
|
|
1573
|
+
const page = createPageMock([
|
|
1574
|
+
{ appId: 'dynamic-runtime-app-id', csrfToken: 'csrf-token', instagramAjax: 'dynamic-rollout' },
|
|
1575
|
+
{ ok: true, username: 'tsezi_ray' },
|
|
1576
|
+
{ ok: true, hrefs: ['/p/OLD111/'] },
|
|
1577
|
+
{ ok: false },
|
|
1578
|
+
{ ok: true },
|
|
1579
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] },
|
|
1580
|
+
{ ok: true },
|
|
1581
|
+
{ ok: true },
|
|
1582
|
+
{ ok: false },
|
|
1583
|
+
{ ok: true, label: 'Next' },
|
|
1584
|
+
{ ok: true },
|
|
1585
|
+
{ ok: true },
|
|
1586
|
+
{ ok: true },
|
|
1587
|
+
{ ok: true, label: 'Share' },
|
|
1588
|
+
{ ok: false, failed: false, settled: true, url: '' },
|
|
1589
|
+
{ ok: false, failed: false, settled: true, url: '' },
|
|
1590
|
+
{ ok: false, failed: false, settled: true, url: '' },
|
|
1591
|
+
{ appId: 'dynamic-runtime-app-id', csrfToken: 'csrf-token', instagramAjax: 'dynamic-rollout' },
|
|
1592
|
+
{ ok: true, username: 'tsezi_ray' },
|
|
1593
|
+
{ ok: true, hrefs: ['/p/OLD111/', '/p/RECOVER789/'] },
|
|
1594
|
+
], {
|
|
1595
|
+
getCookies: vi.fn().mockResolvedValue([{ name: 'ds_user_id', value: '61236465677', domain: 'instagram.com' }]),
|
|
1596
|
+
});
|
|
1597
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1598
|
+
const result = await cmd.func(page, {
|
|
1599
|
+
media: imagePath,
|
|
1600
|
+
content: 'share settled recovery',
|
|
1601
|
+
});
|
|
1602
|
+
expect(result).toEqual([
|
|
1603
|
+
{
|
|
1604
|
+
status: '✅ Posted',
|
|
1605
|
+
detail: 'Single image post shared successfully',
|
|
1606
|
+
url: 'https://www.instagram.com/p/RECOVER789/',
|
|
1607
|
+
},
|
|
1608
|
+
]);
|
|
1609
|
+
});
|
|
1610
|
+
it('accepts standard /p/... profile links during URL recovery', async () => {
|
|
1611
|
+
const imagePath = createTempImage('url-recovery-standard-shape.jpg');
|
|
1612
|
+
const page = createPageMock([
|
|
1613
|
+
{ appId: 'dynamic-runtime-app-id', csrfToken: 'csrf-token', instagramAjax: 'dynamic-rollout' },
|
|
1614
|
+
{ ok: true, username: 'tsezi_ray' },
|
|
1615
|
+
{ ok: true, hrefs: ['/p/PINNED111/', '/p/OLD222/'] },
|
|
1616
|
+
{ ok: false },
|
|
1617
|
+
{ ok: true },
|
|
1618
|
+
{ ok: true, selectors: ['[data-opencli-ig-upload-index="0"]'] },
|
|
1619
|
+
{ ok: true },
|
|
1620
|
+
{ ok: true },
|
|
1621
|
+
{ ok: false },
|
|
1622
|
+
{ ok: true, label: 'Next' },
|
|
1623
|
+
{ ok: true },
|
|
1624
|
+
{ ok: true },
|
|
1625
|
+
{ ok: true },
|
|
1626
|
+
{ ok: true, label: 'Share' },
|
|
1627
|
+
{ ok: true, url: '' },
|
|
1628
|
+
{ appId: 'dynamic-runtime-app-id', csrfToken: 'csrf-token', instagramAjax: 'dynamic-rollout' },
|
|
1629
|
+
{ ok: true, username: 'tsezi_ray' },
|
|
1630
|
+
{ ok: true, hrefs: ['/p/PINNED111/', '/p/OLD222/', '/p/RECOVER456/'] },
|
|
1631
|
+
], {
|
|
1632
|
+
getCookies: vi.fn().mockResolvedValue([{ name: 'ds_user_id', value: '61236465677', domain: 'instagram.com' }]),
|
|
1633
|
+
});
|
|
1634
|
+
const cmd = getRegistry().get('instagram/post');
|
|
1635
|
+
const result = await cmd.func(page, {
|
|
1636
|
+
media: imagePath,
|
|
1637
|
+
content: 'url recovery standard shape',
|
|
1638
|
+
});
|
|
1639
|
+
expect(result).toEqual([
|
|
1640
|
+
{
|
|
1641
|
+
status: '✅ Posted',
|
|
1642
|
+
detail: 'Single image post shared successfully',
|
|
1643
|
+
url: 'https://www.instagram.com/p/RECOVER456/',
|
|
1644
|
+
},
|
|
1645
|
+
]);
|
|
1646
|
+
});
|
|
1647
|
+
});
|