publishport-opencli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +214 -0
- package/README.md +299 -0
- package/README.zh-CN.md +341 -0
- package/cli-manifest.json +51513 -0
- package/clis/12306/auth.js +25 -0
- package/clis/12306/me.js +9 -0
- package/clis/12306/orders.js +13 -0
- package/clis/12306/passengers.js +14 -0
- package/clis/12306/price.js +1 -0
- package/clis/12306/stations.js +1 -0
- package/clis/12306/train.js +1 -0
- package/clis/12306/trains.js +1 -0
- package/clis/12306/utils.js +1 -0
- package/clis/1688/assets.js +127 -0
- package/clis/1688/auth.js +1 -0
- package/clis/1688/download.js +1 -0
- package/clis/1688/item.js +21 -0
- package/clis/1688/search.js +129 -0
- package/clis/1688/shared.js +11 -0
- package/clis/1688/store.js +26 -0
- package/clis/1point3acres/auth.js +18 -0
- package/clis/1point3acres/digest.js +1 -0
- package/clis/1point3acres/forum.js +1 -0
- package/clis/1point3acres/forums.js +1 -0
- package/clis/1point3acres/hot.js +1 -0
- package/clis/1point3acres/latest.js +1 -0
- package/clis/1point3acres/notifications.js +1 -0
- package/clis/1point3acres/search.js +1 -0
- package/clis/1point3acres/thread.js +2 -0
- package/clis/1point3acres/user.js +1 -0
- package/clis/1point3acres/utils.js +6 -0
- package/clis/36kr/article.js +20 -0
- package/clis/36kr/hot.js +16 -0
- package/clis/36kr/news.js +1 -0
- package/clis/36kr/search.js +36 -0
- package/clis/51job/company.js +36 -0
- package/clis/51job/detail.js +35 -0
- package/clis/51job/hot.js +1 -0
- package/clis/51job/search.js +1 -0
- package/clis/51job/utils.js +21 -0
- package/clis/_atlassian/shared.js +21 -0
- package/clis/_shared/article/auth.js +16 -0
- package/clis/_shared/article/douban-md2draft.js +4 -0
- package/clis/_shared/article/format.js +1 -0
- package/clis/_shared/article/images.js +95 -0
- package/clis/_shared/article/login.js +1 -0
- package/clis/_shared/article/page-runtime.js +745 -0
- package/clis/_shared/article/publish.js +34 -0
- package/clis/_shared/common.js +1 -0
- package/clis/_shared/content-guard.js +1 -0
- package/clis/_shared/desktop-commands.js +1 -0
- package/clis/_shared/search-adapter.js +1 -0
- package/clis/_shared/site-auth.js +1 -0
- package/clis/_shared/token-auth.js +2 -0
- package/clis/_shared/video-publish.js +62 -0
- package/clis/aibase/news.js +31 -0
- package/clis/amazon/auth.js +19 -0
- package/clis/amazon/bestsellers.js +1 -0
- package/clis/amazon/discussion.js +20 -0
- package/clis/amazon/movers-shakers.js +1 -0
- package/clis/amazon/new-releases.js +1 -0
- package/clis/amazon/offer.js +29 -0
- package/clis/amazon/product.js +25 -0
- package/clis/amazon/rankings.js +68 -0
- package/clis/amazon/search.js +16 -0
- package/clis/amazon/shared.js +11 -0
- package/clis/antigravity/SKILL.md +38 -0
- package/clis/antigravity/_actions.js +201 -0
- package/clis/antigravity/audit-extras.js +78 -0
- package/clis/antigravity/delete.js +1 -0
- package/clis/antigravity/dump.js +1 -0
- package/clis/antigravity/extract-code.js +18 -0
- package/clis/antigravity/history.js +1 -0
- package/clis/antigravity/mark-read.js +1 -0
- package/clis/antigravity/model.js +90 -0
- package/clis/antigravity/new.js +9 -0
- package/clis/antigravity/read.js +10 -0
- package/clis/antigravity/rename.js +1 -0
- package/clis/antigravity/send.js +11 -0
- package/clis/antigravity/serve.js +97 -0
- package/clis/antigravity/status.js +1 -0
- package/clis/antigravity/storage.js +12 -0
- package/clis/antigravity/watch.js +6 -0
- package/clis/apple-podcasts/episodes.js +1 -0
- package/clis/apple-podcasts/search.js +1 -0
- package/clis/apple-podcasts/top.js +1 -0
- package/clis/apple-podcasts/utils.js +1 -0
- package/clis/archive/item.js +1 -0
- package/clis/archive/search.js +1 -0
- package/clis/archive/snapshots.js +1 -0
- package/clis/archive/wayback.js +1 -0
- package/clis/arxiv/author.js +1 -0
- package/clis/arxiv/paper.js +1 -0
- package/clis/arxiv/recent.js +1 -0
- package/clis/arxiv/search.js +1 -0
- package/clis/arxiv/utils.js +1 -0
- package/clis/autohome/__fixtures__/catalog.html +11 -0
- package/clis/autohome/__fixtures__/koubei.json +116 -0
- package/clis/autohome/brand.js +1 -0
- package/clis/autohome/score.js +1 -0
- package/clis/autohome/utils.js +1 -0
- package/clis/baidu-scholar/search.js +63 -0
- package/clis/baijiahao/article.js +1 -0
- package/clis/baijiahao/lists.js +1 -0
- package/clis/baijiahao/login.js +1 -0
- package/clis/baijiahao/publish.js +57 -0
- package/clis/baijiahao/stats.js +1 -0
- package/clis/baijiahao/whoami.js +1 -0
- package/clis/band/auth.js +29 -0
- package/clis/band/bands.js +37 -0
- package/clis/band/mentions.js +6 -0
- package/clis/band/post.js +76 -0
- package/clis/band/posts.js +50 -0
- package/clis/barchart/flow.js +70 -0
- package/clis/barchart/greeks.js +88 -0
- package/clis/barchart/options.js +61 -0
- package/clis/barchart/quote.js +87 -0
- package/clis/bbc/news.js +1 -0
- package/clis/bbc/topic.js +1 -0
- package/clis/bbc/utils.js +1 -0
- package/clis/bilibili/article.js +1 -0
- package/clis/bilibili/auth.js +1 -0
- package/clis/bilibili/categories.js +1 -0
- package/clis/bilibili/coin.js +1 -0
- package/clis/bilibili/comment-del.js +1 -0
- package/clis/bilibili/comment-like.js +1 -0
- package/clis/bilibili/comment.js +1 -0
- package/clis/bilibili/comments.js +1 -0
- package/clis/bilibili/dm-list.js +1 -0
- package/clis/bilibili/dm-read.js +1 -0
- package/clis/bilibili/dm-send.js +1 -0
- package/clis/bilibili/download.js +7 -0
- package/clis/bilibili/drafts.js +1 -0
- package/clis/bilibili/dynamic-post.js +24 -0
- package/clis/bilibili/dynamic.js +1 -0
- package/clis/bilibili/favorite-add.js +1 -0
- package/clis/bilibili/favorite.js +1 -0
- package/clis/bilibili/feed.js +2 -0
- package/clis/bilibili/follow.js +1 -0
- package/clis/bilibili/following.js +1 -0
- package/clis/bilibili/history.js +1 -0
- package/clis/bilibili/hot.js +15 -0
- package/clis/bilibili/like.js +1 -0
- package/clis/bilibili/me.js +1 -0
- package/clis/bilibili/partitions.js +1 -0
- package/clis/bilibili/ranking.js +1 -0
- package/clis/bilibili/search.js +1 -0
- package/clis/bilibili/stats.js +1 -0
- package/clis/bilibili/subtitle.js +21 -0
- package/clis/bilibili/summary.js +1 -0
- package/clis/bilibili/topics.js +1 -0
- package/clis/bilibili/unfollow.js +1 -0
- package/clis/bilibili/upload.js +1 -0
- package/clis/bilibili/user-videos.js +1 -0
- package/clis/bilibili/utils.js +50 -0
- package/clis/bilibili/video-drafts.js +1 -0
- package/clis/bilibili/video.js +1 -0
- package/clis/binance/asks.js +1 -0
- package/clis/binance/depth.js +1 -0
- package/clis/binance/gainers.js +1 -0
- package/clis/binance/klines.js +1 -0
- package/clis/binance/losers.js +1 -0
- package/clis/binance/pairs.js +1 -0
- package/clis/binance/price.js +1 -0
- package/clis/binance/prices.js +1 -0
- package/clis/binance/ticker.js +1 -0
- package/clis/binance/top.js +1 -0
- package/clis/binance/trades.js +1 -0
- package/clis/bloomberg/businessweek.js +12 -0
- package/clis/bloomberg/crypto.js +1 -0
- package/clis/bloomberg/economics.js +1 -0
- package/clis/bloomberg/feeds.js +1 -0
- package/clis/bloomberg/green.js +1 -0
- package/clis/bloomberg/industries.js +1 -0
- package/clis/bloomberg/main.js +1 -0
- package/clis/bloomberg/markets.js +1 -0
- package/clis/bloomberg/news.js +57 -0
- package/clis/bloomberg/opinions.js +1 -0
- package/clis/bloomberg/politics.js +1 -0
- package/clis/bloomberg/pursuits.js +1 -0
- package/clis/bloomberg/tech.js +1 -0
- package/clis/bloomberg/utils.js +17 -0
- package/clis/bluesky/post.js +1 -0
- package/clis/bluesky/shared.js +56 -0
- package/clis/bluesky/whoami.js +1 -0
- package/clis/booking/search.js +93 -0
- package/clis/boss/auth.js +13 -0
- package/clis/boss/batchgreet.js +1 -0
- package/clis/boss/chatlist.js +1 -0
- package/clis/boss/chatmsg.js +1 -0
- package/clis/boss/detail.js +1 -0
- package/clis/boss/exchange.js +1 -0
- package/clis/boss/greet.js +1 -0
- package/clis/boss/invite.js +4 -0
- package/clis/boss/joblist.js +1 -0
- package/clis/boss/mark.js +1 -0
- package/clis/boss/recommend.js +1 -0
- package/clis/boss/resume.js +90 -0
- package/clis/boss/search.js +1 -0
- package/clis/boss/send.js +1 -0
- package/clis/boss/stats.js +1 -0
- package/clis/boss/utils.js +161 -0
- package/clis/brave/search.js +23 -0
- package/clis/chaoxing/assignments.js +1 -0
- package/clis/chaoxing/auth.js +21 -0
- package/clis/chaoxing/exams.js +1 -0
- package/clis/chaoxing/utils.js +58 -0
- package/clis/chatgpt/ask.js +1 -0
- package/clis/chatgpt/auth.js +17 -0
- package/clis/chatgpt/detail.js +1 -0
- package/clis/chatgpt/history.js +1 -0
- package/clis/chatgpt/image.js +1 -0
- package/clis/chatgpt/model.js +1 -0
- package/clis/chatgpt/new.js +1 -0
- package/clis/chatgpt/project-file-add.js +1 -0
- package/clis/chatgpt/project-list.js +1 -0
- package/clis/chatgpt/read.js +1 -0
- package/clis/chatgpt/send.js +1 -0
- package/clis/chatgpt/status.js +1 -0
- package/clis/chatgpt/utils.js +1092 -0
- package/clis/chatgpt-app/ask.js +1 -0
- package/clis/chatgpt-app/ax.js +512 -0
- package/clis/chatgpt-app/model.js +1 -0
- package/clis/chatgpt-app/new.js +1 -0
- package/clis/chatgpt-app/read.js +1 -0
- package/clis/chatgpt-app/send.js +1 -0
- package/clis/chatgpt-app/status.js +1 -0
- package/clis/chatwise/ask.js +1 -0
- package/clis/chatwise/export.js +21 -0
- package/clis/chatwise/history.js +26 -0
- package/clis/chatwise/model.js +48 -0
- package/clis/chatwise/new.js +1 -0
- package/clis/chatwise/read.js +25 -0
- package/clis/chatwise/screenshot.js +1 -0
- package/clis/chatwise/send.js +1 -0
- package/clis/chatwise/status.js +1 -0
- package/clis/chatwise/utils.js +75 -0
- package/clis/chess/analyze.js +1 -0
- package/clis/chess/game.js +1 -0
- package/clis/chess/games.js +1 -0
- package/clis/chess/stats.js +1 -0
- package/clis/chess/utils.js +1 -0
- package/clis/claude/ask.js +4 -0
- package/clis/claude/auth.js +19 -0
- package/clis/claude/detail.js +1 -0
- package/clis/claude/history.js +1 -0
- package/clis/claude/new.js +1 -0
- package/clis/claude/read.js +1 -0
- package/clis/claude/send.js +1 -0
- package/clis/claude/status.js +1 -0
- package/clis/claude/utils.js +179 -0
- package/clis/cnblogs/article.js +1 -0
- package/clis/cnblogs/login.js +1 -0
- package/clis/cnblogs/stats.js +37 -0
- package/clis/cnblogs/whoami.js +1 -0
- package/clis/cnki/search.js +38 -0
- package/clis/codex/_actions.js +72 -0
- package/clis/codex/archive.js +1 -0
- package/clis/codex/ask.js +23 -0
- package/clis/codex/dump.js +1 -0
- package/clis/codex/export.js +12 -0
- package/clis/codex/extract-diff.js +28 -0
- package/clis/codex/history.js +1 -0
- package/clis/codex/model.js +118 -0
- package/clis/codex/new.js +1 -0
- package/clis/codex/pin.js +1 -0
- package/clis/codex/projects.js +1 -0
- package/clis/codex/read.js +16 -0
- package/clis/codex/rename.js +34 -0
- package/clis/codex/screenshot.js +1 -0
- package/clis/codex/send.js +16 -0
- package/clis/codex/sidebar.js +1 -0
- package/clis/codex/status.js +1 -0
- package/clis/coingecko/categories.js +1 -0
- package/clis/coingecko/coin.js +1 -0
- package/clis/coingecko/derivatives.js +1 -0
- package/clis/coingecko/exchanges.js +1 -0
- package/clis/coingecko/global.js +1 -0
- package/clis/coingecko/top.js +1 -0
- package/clis/coingecko/trending.js +1 -0
- package/clis/confluence/create.js +1 -0
- package/clis/confluence/page.js +1 -0
- package/clis/confluence/search.js +1 -0
- package/clis/confluence/shared.js +1 -0
- package/clis/confluence/update.js +1 -0
- package/clis/coupang/add-to-cart.js +86 -0
- package/clis/coupang/auth.js +16 -0
- package/clis/coupang/product.js +161 -0
- package/clis/coupang/search.js +385 -0
- package/clis/coupang/utils.js +1 -0
- package/clis/crates/crate.js +1 -0
- package/clis/crates/search.js +1 -0
- package/clis/crates/utils.js +1 -0
- package/clis/csdn/article.js +29 -0
- package/clis/csdn/columns.js +1 -0
- package/clis/csdn/login.js +1 -0
- package/clis/csdn/stats.js +71 -0
- package/clis/csdn/whoami.js +1 -0
- package/clis/cto51/article.js +1 -0
- package/clis/cto51/whoami.js +1 -0
- package/clis/ctrip/auth.js +1 -0
- package/clis/ctrip/flight.js +17 -0
- package/clis/ctrip/hotel-search.js +24 -0
- package/clis/ctrip/hotel-suggest.js +1 -0
- package/clis/ctrip/search.js +1 -0
- package/clis/ctrip/utils.js +119 -0
- package/clis/cursor/ask.js +22 -0
- package/clis/cursor/composer.js +12 -0
- package/clis/cursor/dump.js +1 -0
- package/clis/cursor/export.js +23 -0
- package/clis/cursor/extract-code.js +18 -0
- package/clis/cursor/history.js +26 -0
- package/clis/cursor/model.js +18 -0
- package/clis/cursor/new.js +1 -0
- package/clis/cursor/read.js +27 -0
- package/clis/cursor/screenshot.js +1 -0
- package/clis/cursor/send.js +12 -0
- package/clis/cursor/status.js +1 -0
- package/clis/dblp/author.js +1 -0
- package/clis/dblp/paper.js +1 -0
- package/clis/dblp/search.js +1 -0
- package/clis/dblp/utils.js +1 -0
- package/clis/dblp/venue.js +1 -0
- package/clis/deepseek/ask.js +1 -0
- package/clis/deepseek/auth.js +22 -0
- package/clis/deepseek/detail.js +1 -0
- package/clis/deepseek/history.js +1 -0
- package/clis/deepseek/new.js +1 -0
- package/clis/deepseek/read.js +1 -0
- package/clis/deepseek/send.js +50 -0
- package/clis/deepseek/status.js +1 -0
- package/clis/deepseek/utils.js +202 -0
- package/clis/defillama/protocol.js +1 -0
- package/clis/defillama/protocols.js +1 -0
- package/clis/defillama/utils.js +1 -0
- package/clis/devto/auth.js +9 -0
- package/clis/devto/latest.js +1 -0
- package/clis/devto/publish.js +17 -0
- package/clis/devto/read.js +3 -0
- package/clis/devto/stats.js +27 -0
- package/clis/devto/tag.js +1 -0
- package/clis/devto/top.js +1 -0
- package/clis/devto/user.js +1 -0
- package/clis/dianping/__fixtures__/search.html +168 -0
- package/clis/dianping/__fixtures__/shop.html +6 -0
- package/clis/dianping/auth.js +10 -0
- package/clis/dianping/cityResolver.js +4 -0
- package/clis/dianping/search.js +1 -0
- package/clis/dianping/shop.js +1 -0
- package/clis/dianping/utils.js +1 -0
- package/clis/dictionary/examples.js +1 -0
- package/clis/dictionary/search.js +1 -0
- package/clis/dictionary/synonyms.js +1 -0
- package/clis/discord-app/channels.js +1 -0
- package/clis/discord-app/delete.js +66 -0
- package/clis/discord-app/goto.js +1 -0
- package/clis/discord-app/members.js +21 -0
- package/clis/discord-app/read.js +1 -0
- package/clis/discord-app/search.js +29 -0
- package/clis/discord-app/send.js +10 -0
- package/clis/discord-app/servers.js +1 -0
- package/clis/discord-app/status.js +1 -0
- package/clis/discord-app/thread-read.js +1 -0
- package/clis/discord-app/threads.js +1 -0
- package/clis/discord-app/utils.js +226 -0
- package/clis/discord-web/auth.js +10 -0
- package/clis/discord-web/send.js +13 -0
- package/clis/dockerhub/image.js +1 -0
- package/clis/dockerhub/search.js +1 -0
- package/clis/dockerhub/utils.js +1 -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/koubei.js +1 -0
- package/clis/dongchedi/models.js +1 -0
- package/clis/dongchedi/score.js +1 -0
- package/clis/dongchedi/search.js +1 -0
- package/clis/dongchedi/series.js +1 -0
- package/clis/dongchedi/specs.js +1 -0
- package/clis/dongchedi/utils.js +1 -0
- package/clis/douban/article.js +53 -0
- package/clis/douban/auth.js +21 -0
- package/clis/douban/book-hot.js +1 -0
- package/clis/douban/download.js +1 -0
- package/clis/douban/marks.js +59 -0
- package/clis/douban/movie-hot.js +1 -0
- package/clis/douban/photos.js +1 -0
- package/clis/douban/reviews.js +53 -0
- package/clis/douban/search.js +1 -0
- package/clis/douban/subject.js +1 -0
- package/clis/douban/top250.js +50 -0
- package/clis/douban/utils.js +344 -0
- package/clis/doubao/ask.js +1 -0
- package/clis/doubao/auth.js +28 -0
- package/clis/doubao/detail.js +1 -0
- package/clis/doubao/history.js +1 -0
- package/clis/doubao/meeting-summary.js +1 -0
- package/clis/doubao/meeting-transcript.js +1 -0
- package/clis/doubao/new.js +1 -0
- package/clis/doubao/read.js +1 -0
- package/clis/doubao/send.js +1 -0
- package/clis/doubao/status.js +1 -0
- package/clis/doubao/utils.js +704 -0
- package/clis/doubao-app/ask.js +1 -0
- package/clis/doubao-app/dump.js +1 -0
- package/clis/doubao-app/new.js +1 -0
- package/clis/doubao-app/read.js +1 -0
- package/clis/doubao-app/screenshot.js +1 -0
- package/clis/doubao-app/send.js +1 -0
- package/clis/doubao-app/status.js +1 -0
- package/clis/doubao-app/utils.js +64 -0
- package/clis/douyin/_shared/browser-fetch.js +28 -0
- package/clis/douyin/_shared/creation-id.js +1 -0
- package/clis/douyin/_shared/evaluate-result.js +1 -0
- package/clis/douyin/_shared/imagex-upload.js +1 -0
- package/clis/douyin/_shared/public-api.js +1 -0
- package/clis/douyin/_shared/sts2.js +1 -0
- package/clis/douyin/_shared/text-extra.js +1 -0
- package/clis/douyin/_shared/timing.js +1 -0
- package/clis/douyin/_shared/tos-upload.js +5 -0
- package/clis/douyin/_shared/transcode.js +1 -0
- package/clis/douyin/_shared/types.js +1 -0
- package/clis/douyin/_shared/vod-upload.js +5 -0
- package/clis/douyin/activities.js +1 -0
- package/clis/douyin/auth.js +1 -0
- package/clis/douyin/collections.js +1 -0
- package/clis/douyin/delete.js +76 -0
- package/clis/douyin/draft.js +166 -0
- package/clis/douyin/drafts.js +1 -0
- package/clis/douyin/hashtag.js +1 -0
- package/clis/douyin/location.js +1 -0
- package/clis/douyin/profile.js +1 -0
- package/clis/douyin/publish-image.js +64 -0
- package/clis/douyin/publish.js +14 -0
- package/clis/douyin/search.js +51 -0
- package/clis/douyin/stats.js +1 -0
- package/clis/douyin/update.js +1 -0
- package/clis/douyin/user-videos.js +1 -0
- package/clis/douyin/videos.js +1 -0
- package/clis/duckduckgo/search.js +1 -0
- package/clis/duckduckgo/suggest.js +1 -0
- package/clis/eastmoney/_secid.js +1 -0
- package/clis/eastmoney/announcement.js +1 -0
- package/clis/eastmoney/article.js +1 -0
- package/clis/eastmoney/convertible.js +1 -0
- package/clis/eastmoney/etf.js +1 -0
- package/clis/eastmoney/holders.js +1 -0
- package/clis/eastmoney/hot-rank.js +30 -0
- package/clis/eastmoney/index-board.js +1 -0
- package/clis/eastmoney/kline.js +1 -0
- package/clis/eastmoney/kuaixun.js +1 -0
- package/clis/eastmoney/longhu.js +1 -0
- package/clis/eastmoney/money-flow.js +1 -0
- package/clis/eastmoney/northbound.js +1 -0
- package/clis/eastmoney/quote.js +1 -0
- package/clis/eastmoney/rank.js +1 -0
- package/clis/eastmoney/sectors.js +1 -0
- package/clis/eastmoney/whoami.js +1 -0
- package/clis/endoflife/product.js +1 -0
- package/clis/endoflife/utils.js +1 -0
- package/clis/facebook/__fixtures__/notifications-page.html +13 -0
- package/clis/facebook/add-friend.js +24 -0
- package/clis/facebook/auth.js +1 -0
- package/clis/facebook/comment.js +18 -0
- package/clis/facebook/events.js +26 -0
- package/clis/facebook/feed.js +209 -0
- package/clis/facebook/friends.js +24 -0
- package/clis/facebook/groups.js +32 -0
- package/clis/facebook/join-group.js +25 -0
- package/clis/facebook/like.js +29 -0
- package/clis/facebook/marketplace-inbox.js +34 -0
- package/clis/facebook/marketplace-listings.js +33 -0
- package/clis/facebook/memories.js +21 -0
- package/clis/facebook/notifications.js +31 -0
- package/clis/facebook/post.js +88 -0
- package/clis/facebook/profile.js +18 -0
- package/clis/facebook/search.js +22 -0
- package/clis/flathub/app.js +1 -0
- package/clis/flathub/search.js +1 -0
- package/clis/flathub/utils.js +1 -0
- package/clis/flomo/auth.js +22 -0
- package/clis/flomo/memos.js +13 -0
- package/clis/gemini/ask.js +1 -0
- package/clis/gemini/auth.js +14 -0
- package/clis/gemini/deep-research-result.js +4 -0
- package/clis/gemini/deep-research.js +1 -0
- package/clis/gemini/detail.js +1 -0
- package/clis/gemini/history.js +1 -0
- package/clis/gemini/image.js +3 -0
- package/clis/gemini/new.js +1 -0
- package/clis/gemini/read.js +1 -0
- package/clis/gemini/status.js +1 -0
- package/clis/gemini/utils.js +1234 -0
- package/clis/geogebra/add-circle.js +1 -0
- package/clis/geogebra/add-line.js +1 -0
- package/clis/geogebra/add-point.js +1 -0
- package/clis/geogebra/add-polygon.js +1 -0
- package/clis/geogebra/eval.js +1 -0
- package/clis/geogebra/hexagon.js +1 -0
- package/clis/geogebra/info.js +13 -0
- package/clis/geogebra/list.js +1 -0
- package/clis/geogebra/triangle.js +1 -0
- package/clis/geogebra/utils.js +99 -0
- package/clis/ghost/publish.js +1 -0
- package/clis/ghost/shared.js +1 -0
- package/clis/ghost/whoami.js +1 -0
- package/clis/gitee/auth.js +12 -0
- package/clis/gitee/index.js +1 -0
- package/clis/gitee/search.js +1 -0
- package/clis/gitee/trending.js +240 -0
- package/clis/gitee/user.js +71 -0
- package/clis/github/auth.js +7 -0
- package/clis/github-trending/repos.js +1 -0
- package/clis/google/news.js +1 -0
- package/clis/google/search.js +90 -0
- package/clis/google/suggest.js +1 -0
- package/clis/google/trends.js +1 -0
- package/clis/google/utils.js +1 -0
- package/clis/google-scholar/cite.js +20 -0
- package/clis/google-scholar/profile.js +36 -0
- package/clis/google-scholar/search.js +35 -0
- package/clis/goproxy/module.js +1 -0
- package/clis/goproxy/utils.js +1 -0
- package/clis/goproxy/versions.js +1 -0
- package/clis/gov-law/recent.js +1 -0
- package/clis/gov-law/search.js +14 -0
- package/clis/gov-law/shared.js +29 -0
- package/clis/gov-policy/__fixtures__/recent.html +16 -0
- package/clis/gov-policy/__fixtures__/search.html +41 -0
- package/clis/gov-policy/recent.js +8 -0
- package/clis/gov-policy/search.js +8 -0
- package/clis/gov-policy/utils.js +1 -0
- package/clis/grok/ask.js +1 -0
- package/clis/grok/auth.js +17 -0
- package/clis/grok/delete.js +1 -0
- package/clis/grok/detail.js +1 -0
- package/clis/grok/export-all.js +170 -0
- package/clis/grok/export-utils.js +1 -0
- package/clis/grok/export.js +106 -0
- package/clis/grok/history.js +1 -0
- package/clis/grok/image.js +119 -0
- package/clis/grok/image.test.ts +127 -0
- package/clis/grok/new.js +1 -0
- package/clis/grok/pin.js +1 -0
- package/clis/grok/read.js +1 -0
- package/clis/grok/send.js +1 -0
- package/clis/grok/status.js +1 -0
- package/clis/grok/utils.js +337 -0
- package/clis/guazi/__fixtures__/detail.html +7 -0
- package/clis/guazi/__fixtures__/list.html +5 -0
- package/clis/guazi/browse.js +1 -0
- package/clis/guazi/car.js +1 -0
- package/clis/guazi/utils.js +1 -0
- package/clis/hackernews/ask.js +1 -0
- package/clis/hackernews/auth.js +9 -0
- package/clis/hackernews/best.js +1 -0
- package/clis/hackernews/comment.js +61 -0
- package/clis/hackernews/jobs.js +1 -0
- package/clis/hackernews/new.js +1 -0
- package/clis/hackernews/read.js +11 -0
- package/clis/hackernews/search.js +1 -0
- package/clis/hackernews/show.js +1 -0
- package/clis/hackernews/submit.js +65 -0
- package/clis/hackernews/top.js +1 -0
- package/clis/hackernews/user.js +1 -0
- package/clis/hashnode/auth.js +11 -0
- package/clis/hashnode/publish.js +92 -0
- package/clis/hf/auth.js +12 -0
- package/clis/hf/datasets.js +1 -0
- package/clis/hf/models.js +1 -0
- package/clis/hf/paper.js +1 -0
- package/clis/hf/spaces.js +1 -0
- package/clis/hf/top.js +1 -0
- package/clis/homebrew/cask.js +1 -0
- package/clis/homebrew/formula.js +1 -0
- package/clis/homebrew/popular.js +1 -0
- package/clis/homebrew/utils.js +1 -0
- package/clis/huodongxing/events.js +1 -0
- package/clis/hupu/__fixtures__/hot-home.html +64 -0
- package/clis/hupu/auth.js +14 -0
- package/clis/hupu/detail.js +7 -0
- package/clis/hupu/hot.js +14 -0
- package/clis/hupu/like.js +1 -0
- package/clis/hupu/mentions.js +91 -0
- package/clis/hupu/reply.js +1 -0
- package/clis/hupu/search.js +1 -0
- package/clis/hupu/unlike.js +1 -0
- package/clis/hupu/utils.js +243 -0
- package/clis/imdb/person.js +140 -0
- package/clis/imdb/reviews.js +40 -0
- package/clis/imdb/search.js +113 -0
- package/clis/imdb/title.js +1 -0
- package/clis/imdb/top.js +1 -0
- package/clis/imdb/trending.js +1 -0
- package/clis/imdb/utils.js +162 -0
- package/clis/imooc/article.js +59 -0
- package/clis/imooc/login.js +1 -0
- package/clis/imooc/whoami.js +1 -0
- package/clis/indeed/job.js +20 -0
- package/clis/indeed/search.js +37 -0
- package/clis/indeed/utils.js +1 -0
- package/clis/infoq/article.js +19 -0
- package/clis/infoq/login.js +1 -0
- package/clis/infoq/whoami.js +1 -0
- package/clis/instagram/_shared/private-publish.js +75 -0
- package/clis/instagram/_shared/protocol-capture.js +180 -0
- package/clis/instagram/_shared/runtime-info.js +33 -0
- package/clis/instagram/auth.js +22 -0
- package/clis/instagram/collection-create.js +38 -0
- package/clis/instagram/collection-delete.js +72 -0
- package/clis/instagram/comment.js +26 -0
- package/clis/instagram/detail.js +2 -0
- package/clis/instagram/download.js +83 -0
- package/clis/instagram/explore.js +27 -0
- package/clis/instagram/follow.js +24 -0
- package/clis/instagram/followers.js +30 -0
- package/clis/instagram/following.js +74 -0
- package/clis/instagram/like.js +25 -0
- package/clis/instagram/note.js +162 -0
- package/clis/instagram/post.js +718 -0
- package/clis/instagram/profile.js +25 -0
- package/clis/instagram/reel.js +452 -0
- package/clis/instagram/save.js +25 -0
- package/clis/instagram/saved.js +37 -0
- package/clis/instagram/search.js +23 -0
- package/clis/instagram/story.js +21 -0
- package/clis/instagram/unfollow.js +21 -0
- package/clis/instagram/unlike.js +25 -0
- package/clis/instagram/unsave.js +25 -0
- package/clis/instagram/user.js +1 -0
- package/clis/jd/add-cart.js +22 -0
- package/clis/jd/auth.js +12 -0
- package/clis/jd/cart.js +59 -0
- package/clis/jd/detail.js +42 -0
- package/clis/jd/item.js +98 -0
- package/clis/jd/item.test.ts +517 -0
- package/clis/jd/reviews.js +31 -0
- package/clis/jd/search.js +42 -0
- package/clis/jianshu/article.js +1 -0
- package/clis/jianshu/login.js +1 -0
- package/clis/jianshu/notebooks.js +1 -0
- package/clis/jianshu/whoami.js +1 -0
- package/clis/jianyu/auth.js +28 -0
- package/clis/jianyu/detail.js +1 -0
- package/clis/jianyu/search.js +73 -0
- package/clis/jianyu/shared/china-bid-search.js +86 -0
- package/clis/jianyu/shared/procurement-contract.js +1 -0
- package/clis/jianyu/shared/procurement-detail.js +18 -0
- package/clis/jike/auth.js +19 -0
- package/clis/jike/comment.js +82 -0
- package/clis/jike/create.js +83 -0
- package/clis/jike/feed.js +32 -0
- package/clis/jike/like.js +38 -0
- package/clis/jike/notifications.js +115 -0
- package/clis/jike/post.js +33 -0
- package/clis/jike/repost.js +67 -0
- package/clis/jike/search.js +29 -0
- package/clis/jike/topic.js +20 -0
- package/clis/jike/user.js +19 -0
- package/clis/jike/utils.js +15 -0
- package/clis/jimeng/auth.js +13 -0
- package/clis/jimeng/generate.js +60 -0
- package/clis/jimeng/history.js +32 -0
- package/clis/jimeng/new.js +26 -0
- package/clis/jimeng/workspaces.js +22 -0
- package/clis/jira/attachments.js +1 -0
- package/clis/jira/comments.js +1 -0
- package/clis/jira/issue.js +1 -0
- package/clis/jira/links.js +1 -0
- package/clis/jira/search.js +1 -0
- package/clis/jira/shared.js +1 -0
- package/clis/juejin/article.js +5 -0
- package/clis/juejin/categories.js +1 -0
- package/clis/juejin/hot.js +1 -0
- package/clis/juejin/login.js +1 -0
- package/clis/juejin/recommend.js +1 -0
- package/clis/juejin/stats.js +53 -0
- package/clis/juejin/tags.js +1 -0
- package/clis/juejin/utils.js +1 -0
- package/clis/juejin/whoami.js +1 -0
- package/clis/ke/auth.js +14 -0
- package/clis/ke/chengjiao.js +45 -0
- package/clis/ke/ershoufang.js +50 -0
- package/clis/ke/utils.js +21 -0
- package/clis/ke/xiaoqu.js +45 -0
- package/clis/ke/zufang.js +50 -0
- package/clis/kimi/_utils.js +38 -0
- package/clis/kimi/audit-extras.js +64 -0
- package/clis/kimi/auth.js +17 -0
- package/clis/kimi/chat.js +77 -0
- package/clis/kimi/storage.js +14 -0
- package/clis/kimi/ui.js +89 -0
- package/clis/kimi/usage.js +51 -0
- package/clis/kuaishou/auth.js +1 -0
- package/clis/kuaishou/publish.js +53 -0
- package/clis/lesswrong/_helpers.js +9 -0
- package/clis/lesswrong/comments.js +9 -0
- package/clis/lesswrong/curated.js +5 -0
- package/clis/lesswrong/frontpage.js +5 -0
- package/clis/lesswrong/new.js +5 -0
- package/clis/lesswrong/read.js +5 -0
- package/clis/lesswrong/sequences.js +5 -0
- package/clis/lesswrong/shortform.js +5 -0
- package/clis/lesswrong/tag.js +5 -0
- package/clis/lesswrong/tags.js +5 -0
- package/clis/lesswrong/top-month.js +5 -0
- package/clis/lesswrong/top-week.js +5 -0
- package/clis/lesswrong/top-year.js +5 -0
- package/clis/lesswrong/top.js +5 -0
- package/clis/lesswrong/user-posts.js +5 -0
- package/clis/lesswrong/user.js +5 -0
- package/clis/lichess/top.js +1 -0
- package/clis/lichess/user.js +1 -0
- package/clis/lichess/utils.js +1 -0
- package/clis/linkedin/auth.js +27 -0
- package/clis/linkedin/comment.js +1 -0
- package/clis/linkedin/connect.js +244 -0
- package/clis/linkedin/create.js +113 -0
- package/clis/linkedin/follow.js +1 -0
- package/clis/linkedin/inbox.js +1 -0
- package/clis/linkedin/job-detail.js +40 -0
- package/clis/linkedin/jobs-preferences.js +34 -0
- package/clis/linkedin/like.js +1 -0
- package/clis/linkedin/notifications.js +1 -0
- package/clis/linkedin/people-search.js +1 -0
- package/clis/linkedin/post-analytics.js +1 -0
- package/clis/linkedin/post-comments.js +1 -0
- package/clis/linkedin/post-detail.js +1 -0
- package/clis/linkedin/posts-core.js +138 -0
- package/clis/linkedin/posts.js +1 -0
- package/clis/linkedin/profile-analytics.js +1 -0
- package/clis/linkedin/profile-api.js +218 -0
- package/clis/linkedin/profile-experience.js +1 -0
- package/clis/linkedin/profile-projects.js +1 -0
- package/clis/linkedin/profile-read.js +3 -0
- package/clis/linkedin/reply.js +1 -0
- package/clis/linkedin/repost.js +1 -0
- package/clis/linkedin/safe-send.js +155 -0
- package/clis/linkedin/salesnav-inbox.js +21 -0
- package/clis/linkedin/salesnav-message.js +33 -0
- package/clis/linkedin/salesnav-search.js +15 -0
- package/clis/linkedin/salesnav-thread.js +1 -0
- package/clis/linkedin/search-api.js +42 -0
- package/clis/linkedin/search.js +50 -0
- package/clis/linkedin/sent-invitations.js +46 -0
- package/clis/linkedin/services-read.js +57 -0
- package/clis/linkedin/shared.js +10 -0
- package/clis/linkedin/social-api.js +260 -0
- package/clis/linkedin/thread-snapshot.js +81 -0
- package/clis/linkedin/timeline.js +37 -0
- package/clis/linkedin-learning/auth.js +27 -0
- package/clis/linkedin-learning/course.js +17 -0
- package/clis/linkedin-learning/search.js +17 -0
- package/clis/linkedin-learning/trending.js +17 -0
- package/clis/linux-do/auth.js +20 -0
- package/clis/linux-do/categories.js +1 -0
- package/clis/linux-do/feed.js +19 -0
- package/clis/linux-do/search.js +1 -0
- package/clis/linux-do/tags.js +1 -0
- package/clis/linux-do/topic-content.js +28 -0
- package/clis/linux-do/topic.js +1 -0
- package/clis/linux-do/user-posts.js +1 -0
- package/clis/linux-do/user-topics.js +1 -0
- package/clis/lobsters/active.js +1 -0
- package/clis/lobsters/domain.js +1 -0
- package/clis/lobsters/hot.js +1 -0
- package/clis/lobsters/newest.js +1 -0
- package/clis/lobsters/read.js +11 -0
- package/clis/lobsters/tag.js +1 -0
- package/clis/maimai/auth.js +19 -0
- package/clis/maimai/search-talents.js +37 -0
- package/clis/manus/_utils.js +28 -0
- package/clis/manus/auth.js +20 -0
- package/clis/manus/connectors.js +4 -0
- package/clis/manus/credits.js +4 -0
- package/clis/manus/list.js +7 -0
- package/clis/manus/read.js +7 -0
- package/clis/manus/skills.js +4 -0
- package/clis/manus/status.js +8 -0
- package/clis/mastodon/post.js +1 -0
- package/clis/mastodon/shared.js +48 -0
- package/clis/mastodon/whoami.js +1 -0
- package/clis/maven/artifact.js +1 -0
- package/clis/maven/search.js +1 -0
- package/clis/maven/utils.js +1 -0
- package/clis/mdn/search.js +1 -0
- package/clis/medium/article.js +12 -0
- package/clis/medium/feed.js +1 -0
- package/clis/medium/login.js +1 -0
- package/clis/medium/search.js +1 -0
- package/clis/medium/stats.js +56 -0
- package/clis/medium/tag.js +1 -0
- package/clis/medium/user.js +1 -0
- package/clis/medium/utils.js +62 -0
- package/clis/medium/whoami.js +1 -0
- package/clis/mubu/doc.js +1 -0
- package/clis/mubu/docs.js +1 -0
- package/clis/mubu/notes.js +1 -0
- package/clis/mubu/recent.js +1 -0
- package/clis/mubu/search.js +1 -0
- package/clis/mubu/utils.js +31 -0
- package/clis/note/auth.js +12 -0
- package/clis/note/note-utils.js +2 -0
- package/clis/note/publish.js +17 -0
- package/clis/notebooklm/add-source.js +46 -0
- package/clis/notebooklm/auth.js +21 -0
- package/clis/notebooklm/create.js +1 -0
- package/clis/notebooklm/current.js +1 -0
- package/clis/notebooklm/generate-audio.js +1 -0
- package/clis/notebooklm/generate-slides.js +1 -0
- package/clis/notebooklm/get.js +1 -0
- package/clis/notebooklm/history.js +1 -0
- package/clis/notebooklm/list.js +1 -0
- package/clis/notebooklm/note-list.js +1 -0
- package/clis/notebooklm/notes-get.js +1 -0
- package/clis/notebooklm/open.js +1 -0
- package/clis/notebooklm/rpc.js +36 -0
- package/clis/notebooklm/shared.js +1 -0
- package/clis/notebooklm/source-fulltext.js +1 -0
- package/clis/notebooklm/source-get.js +1 -0
- package/clis/notebooklm/source-guide.js +1 -0
- package/clis/notebooklm/source-list.js +1 -0
- package/clis/notebooklm/status.js +1 -0
- package/clis/notebooklm/summary.js +1 -0
- package/clis/notebooklm/utils.js +172 -0
- package/clis/notebooklm/write-note.js +1 -0
- package/clis/nowcoder/auth.js +24 -0
- package/clis/nowcoder/comment.js +1 -0
- package/clis/nowcoder/comments.js +1 -0
- package/clis/nowcoder/companies.js +1 -0
- package/clis/nowcoder/creators.js +1 -0
- package/clis/nowcoder/delete.js +1 -0
- package/clis/nowcoder/detail.js +46 -0
- package/clis/nowcoder/dm-list.js +1 -0
- package/clis/nowcoder/dm-read.js +1 -0
- package/clis/nowcoder/dm-send.js +1 -0
- package/clis/nowcoder/drafts.js +1 -0
- package/clis/nowcoder/experience.js +20 -0
- package/clis/nowcoder/hot.js +1 -0
- package/clis/nowcoder/inbox.js +1 -0
- package/clis/nowcoder/jobs.js +1 -0
- package/clis/nowcoder/like.js +1 -0
- package/clis/nowcoder/my.js +1 -0
- package/clis/nowcoder/notifications.js +16 -0
- package/clis/nowcoder/papers.js +22 -0
- package/clis/nowcoder/post.js +1 -0
- package/clis/nowcoder/practice.js +21 -0
- package/clis/nowcoder/recommend.js +1 -0
- package/clis/nowcoder/referral.js +21 -0
- package/clis/nowcoder/salary.js +22 -0
- package/clis/nowcoder/search.js +31 -0
- package/clis/nowcoder/suggest.js +17 -0
- package/clis/nowcoder/topics.js +1 -0
- package/clis/nowcoder/trending.js +1 -0
- package/clis/nowcoder/utils.js +68 -0
- package/clis/npm/downloads.js +1 -0
- package/clis/npm/package.js +1 -0
- package/clis/npm/search.js +1 -0
- package/clis/npm/utils.js +1 -0
- package/clis/nuget/package.js +1 -0
- package/clis/nuget/search.js +1 -0
- package/clis/nuget/utils.js +1 -0
- package/clis/nvd/cve.js +1 -0
- package/clis/oeis/search.js +1 -0
- package/clis/oeis/sequence.js +1 -0
- package/clis/oeis/utils.js +1 -0
- package/clis/ones/common.js +23 -0
- package/clis/ones/enrich-tasks.js +1 -0
- package/clis/ones/login.js +2 -0
- package/clis/ones/logout.js +1 -0
- package/clis/ones/me.js +1 -0
- package/clis/ones/my-tasks.js +1 -0
- package/clis/ones/resolve-labels.js +1 -0
- package/clis/ones/task-helpers.js +1 -0
- package/clis/ones/task.js +1 -0
- package/clis/ones/tasks.js +1 -0
- package/clis/ones/token-info.js +1 -0
- package/clis/ones/worklog.js +14 -0
- package/clis/openalex/search.js +1 -0
- package/clis/openalex/utils.js +1 -0
- package/clis/openalex/work.js +1 -0
- package/clis/openfda/drug-label.js +1 -0
- package/clis/openfda/food-recall.js +1 -0
- package/clis/openfda/utils.js +1 -0
- package/clis/openreview/author.js +1 -0
- package/clis/openreview/paper.js +1 -0
- package/clis/openreview/reviews.js +4 -0
- package/clis/openreview/search.js +1 -0
- package/clis/openreview/utils.js +1 -0
- package/clis/openreview/venue.js +1 -0
- package/clis/oschina/article.js +1 -0
- package/clis/oschina/catalogs.js +1 -0
- package/clis/oschina/login.js +1 -0
- package/clis/oschina/stats.js +54 -0
- package/clis/oschina/whoami.js +1 -0
- package/clis/osv/query.js +1 -0
- package/clis/osv/utils.js +1 -0
- package/clis/osv/vulnerability.js +1 -0
- package/clis/packagist/package.js +1 -0
- package/clis/packagist/search.js +1 -0
- package/clis/packagist/utils.js +1 -0
- package/clis/paperreview/feedback.js +1 -0
- package/clis/paperreview/review.js +1 -0
- package/clis/paperreview/submit.js +1 -0
- package/clis/paperreview/utils.js +1 -0
- package/clis/pinterest/api.js +1 -0
- package/clis/pinterest/auth.js +1 -0
- package/clis/pinterest/boards.js +1 -0
- package/clis/pinterest/client.js +20 -0
- package/clis/pinterest/publish.js +13 -0
- package/clis/pixiv/auth.js +17 -0
- package/clis/pixiv/detail.js +1 -0
- package/clis/pixiv/download.js +1 -0
- package/clis/pixiv/illusts.js +1 -0
- package/clis/pixiv/ranking.js +26 -0
- package/clis/pixiv/search.js +1 -0
- package/clis/pixiv/user.js +1 -0
- package/clis/pixiv/utils.js +18 -0
- package/clis/powerchina/auth.js +17 -0
- package/clis/powerchina/search.js +1 -0
- package/clis/producthunt/browse.js +54 -0
- package/clis/producthunt/hot.js +64 -0
- package/clis/producthunt/posts.js +1 -0
- package/clis/producthunt/today.js +1 -0
- package/clis/producthunt/utils.js +1 -0
- package/clis/pubmed/article.js +1 -0
- package/clis/pubmed/author.js +1 -0
- package/clis/pubmed/citations.js +1 -0
- package/clis/pubmed/clinical-trial.js +1 -0
- package/clis/pubmed/journal.js +1 -0
- package/clis/pubmed/mesh.js +1 -0
- package/clis/pubmed/related.js +1 -0
- package/clis/pubmed/review.js +1 -0
- package/clis/pubmed/search.js +1 -0
- package/clis/pubmed/utils.js +1 -0
- package/clis/pypi/downloads.js +1 -0
- package/clis/pypi/package.js +1 -0
- package/clis/pypi/utils.js +1 -0
- package/clis/qiita/auth.js +1 -0
- package/clis/qiita/gql.js +32 -0
- package/clis/qiita/publish.js +7 -0
- package/clis/qiita/stats.js +37 -0
- package/clis/qoder/_utils.js +113 -0
- package/clis/qoder/composer.js +1 -0
- package/clis/qoder/history.js +25 -0
- package/clis/qoder/quest.js +1 -0
- package/clis/qoder/read.js +1 -0
- package/clis/qoder/status.js +1 -0
- package/clis/qoder/ui.js +59 -0
- package/clis/quark/auth.js +16 -0
- package/clis/quark/ls.js +1 -0
- package/clis/quark/mkdir.js +1 -0
- package/clis/quark/mv.js +1 -0
- package/clis/quark/rename.js +1 -0
- package/clis/quark/rm.js +1 -0
- package/clis/quark/save.js +1 -0
- package/clis/quark/share-tree.js +1 -0
- package/clis/quark/utils.js +13 -0
- package/clis/quora/create-answer.js +22 -0
- package/clis/quora/create-question.js +24 -0
- package/clis/quora/shared.js +43 -0
- package/clis/quora/whoami.js +1 -0
- package/clis/qwen/ask.js +1 -0
- package/clis/qwen/auth.js +17 -0
- package/clis/qwen/detail.js +1 -0
- package/clis/qwen/history.js +1 -0
- package/clis/qwen/image.js +31 -0
- package/clis/qwen/new.js +1 -0
- package/clis/qwen/read.js +1 -0
- package/clis/qwen/send.js +1 -0
- package/clis/qwen/status.js +1 -0
- package/clis/qwen/utils.js +185 -0
- package/clis/reddit/auth.js +17 -0
- package/clis/reddit/comment.js +36 -0
- package/clis/reddit/frontpage.js +40 -0
- package/clis/reddit/home.js +32 -0
- package/clis/reddit/hot.js +46 -0
- package/clis/reddit/popular.js +46 -0
- package/clis/reddit/read.js +398 -0
- package/clis/reddit/reply.js +56 -0
- package/clis/reddit/save.js +30 -0
- package/clis/reddit/saved.js +24 -0
- package/clis/reddit/search.js +51 -0
- package/clis/reddit/submit.js +42 -0
- package/clis/reddit/subreddit-info.js +29 -0
- package/clis/reddit/subreddit.js +52 -0
- package/clis/reddit/subscribe.js +29 -0
- package/clis/reddit/subscribed.js +68 -0
- package/clis/reddit/upvote.js +43 -0
- package/clis/reddit/upvoted.js +24 -0
- package/clis/reddit/user-comments.js +20 -0
- package/clis/reddit/user-posts.js +17 -0
- package/clis/reddit/user.js +20 -0
- package/clis/reddit/whoami.js +19 -0
- package/clis/rednote/auth.js +19 -0
- package/clis/rednote/comments.js +1 -0
- package/clis/rednote/download.js +1 -0
- package/clis/rednote/feed.js +1 -0
- package/clis/rednote/note.js +1 -0
- package/clis/rednote/notifications.js +67 -0
- package/clis/rednote/search.js +32 -0
- package/clis/rednote/user.js +1 -0
- package/clis/rest-countries/country.js +1 -0
- package/clis/rest-countries/region.js +1 -0
- package/clis/rest-countries/utils.js +1 -0
- package/clis/reuters/article-detail.js +1 -0
- package/clis/reuters/auth.js +39 -0
- package/clis/reuters/search.js +1 -0
- package/clis/reuters/utils.js +50 -0
- package/clis/rfc/rfc.js +1 -0
- package/clis/rfc/utils.js +1 -0
- package/clis/rubygems/gem.js +1 -0
- package/clis/rubygems/search.js +1 -0
- package/clis/rubygems/utils.js +1 -0
- package/clis/segmentfault/_signed-request.js +43 -0
- package/clis/segmentfault/article.js +3 -0
- package/clis/segmentfault/channels.js +1 -0
- package/clis/segmentfault/login.js +1 -0
- package/clis/segmentfault/stats.js +82 -0
- package/clis/segmentfault/tags.js +1 -0
- package/clis/segmentfault/whoami.js +1 -0
- package/clis/semanticscholar/citations.js +1 -0
- package/clis/semanticscholar/paper.js +1 -0
- package/clis/semanticscholar/recommendations.js +1 -0
- package/clis/semanticscholar/search.js +1 -0
- package/clis/semanticscholar/utils.js +1 -0
- package/clis/sinablog/article.js +1 -0
- package/clis/sinablog/hot.js +1 -0
- package/clis/sinablog/search.js +1 -0
- package/clis/sinablog/user.js +1 -0
- package/clis/sinablog/utils.js +153 -0
- package/clis/sinafinance/news.js +1 -0
- package/clis/sinafinance/rolling-news.js +20 -0
- package/clis/sinafinance/stock-rank.js +41 -0
- package/clis/sinafinance/stock.js +1 -0
- package/clis/slock/attachment-download.js +1 -0
- package/clis/slock/attachment-upload.js +34 -0
- package/clis/slock/attachment-url.js +1 -0
- package/clis/slock/auth-verify.js +1 -0
- package/clis/slock/bookmark-add.js +11 -0
- package/clis/slock/bookmark-list.js +10 -0
- package/clis/slock/bookmark-remove.js +7 -0
- package/clis/slock/channel-action.js +1 -0
- package/clis/slock/channel-archive.js +1 -0
- package/clis/slock/channel-create.js +1 -0
- package/clis/slock/channel-files.js +1 -0
- package/clis/slock/channel-info.js +1 -0
- package/clis/slock/channel-join.js +1 -0
- package/clis/slock/channel-leave.js +1 -0
- package/clis/slock/channel-list.js +1 -0
- package/clis/slock/channel-mark.js +1 -0
- package/clis/slock/channel-members.js +1 -0
- package/clis/slock/channel-unarchive.js +1 -0
- package/clis/slock/dm-list.js +1 -0
- package/clis/slock/errors.js +1 -0
- package/clis/slock/in-page.js +113 -0
- package/clis/slock/inbox-done.js +9 -0
- package/clis/slock/inbox-read-all.js +1 -0
- package/clis/slock/inbox.js +1 -0
- package/clis/slock/login.js +1 -0
- package/clis/slock/message-read.js +61 -0
- package/clis/slock/message-search.js +24 -0
- package/clis/slock/message-send.js +55 -0
- package/clis/slock/reaction-add.js +1 -0
- package/clis/slock/reaction-remove.js +1 -0
- package/clis/slock/resolve.js +1 -0
- package/clis/slock/server-list.js +9 -0
- package/clis/slock/server-use.js +18 -0
- package/clis/slock/shared.js +1 -0
- package/clis/slock/task-claim.js +14 -0
- package/clis/slock/task-convert.js +35 -0
- package/clis/slock/task-create.js +24 -0
- package/clis/slock/task-delete.js +9 -0
- package/clis/slock/task-get.js +11 -0
- package/clis/slock/task-list-server.js +12 -0
- package/clis/slock/task-list.js +14 -0
- package/clis/slock/task-status.js +19 -0
- package/clis/slock/task-unclaim.js +13 -0
- package/clis/slock/thread-done.js +1 -0
- package/clis/slock/thread-follow.js +1 -0
- package/clis/slock/thread-list.js +1 -0
- package/clis/slock/thread-state.js +1 -0
- package/clis/slock/thread-undone.js +1 -0
- package/clis/slock/thread-unfollow.js +1 -0
- package/clis/slock/unread-summary.js +18 -0
- package/clis/slock/whoami.js +1 -0
- package/clis/smzdm/search.js +71 -0
- package/clis/sohu/article.js +1 -0
- package/clis/sohu/attributes.js +1 -0
- package/clis/sohu/categories.js +1 -0
- package/clis/sohu/channels.js +1 -0
- package/clis/sohu/columns.js +1 -0
- package/clis/sohu/login.js +1 -0
- package/clis/sohu/mpbp.js +1 -0
- package/clis/sohu/stats.js +95 -0
- package/clis/sohu/topics.js +1 -0
- package/clis/sohu/whoami.js +1 -0
- package/clis/spotify/spotify.js +1 -0
- package/clis/spotify/utils.js +8 -0
- package/clis/stackoverflow/bounties.js +1 -0
- package/clis/stackoverflow/hot.js +1 -0
- package/clis/stackoverflow/read.js +13 -0
- package/clis/stackoverflow/related.js +1 -0
- package/clis/stackoverflow/search.js +1 -0
- package/clis/stackoverflow/tag.js +1 -0
- package/clis/stackoverflow/unanswered.js +1 -0
- package/clis/stackoverflow/user.js +1 -0
- package/clis/stackoverflow/utils.js +1 -0
- package/clis/steam/app.js +1 -0
- package/clis/steam/search.js +1 -0
- package/clis/steam/top-sellers.js +1 -0
- package/clis/steam/utils.js +1 -0
- package/clis/substack/auth.js +11 -0
- package/clis/substack/feed.js +1 -0
- package/clis/substack/post-utils.js +2 -0
- package/clis/substack/publication.js +1 -0
- package/clis/substack/publish.js +10 -0
- package/clis/substack/search.js +1 -0
- package/clis/substack/utils.js +108 -0
- package/clis/suno/auth.js +21 -0
- package/clis/suno/download.js +17 -0
- package/clis/suno/generate.js +4 -0
- package/clis/suno/list.js +14 -0
- package/clis/suno/status.js +1 -0
- package/clis/suno/utils.js +102 -0
- package/clis/taobao/add-cart.js +93 -0
- package/clis/taobao/auth.js +8 -0
- package/clis/taobao/cart.js +68 -0
- package/clis/taobao/detail.js +48 -0
- package/clis/taobao/reviews.js +52 -0
- package/clis/taobao/search.js +64 -0
- package/clis/tdx/hot-rank.js +25 -0
- package/clis/telegram/send.js +18 -0
- package/clis/telegram/shared.js +21 -0
- package/clis/telegram/whoami.js +1 -0
- package/clis/test-utils.js +1 -0
- package/clis/threads/post.js +152 -0
- package/clis/threads/shared.js +27 -0
- package/clis/threads/whoami.js +1 -0
- package/clis/ths/hot-rank.js +27 -0
- package/clis/tieba/hot.js +16 -0
- package/clis/tieba/posts.js +1 -0
- package/clis/tieba/read.js +84 -0
- package/clis/tieba/search.js +54 -0
- package/clis/tieba/utils.js +1 -0
- package/clis/tiktok/auth.js +30 -0
- package/clis/tiktok/comment.js +69 -0
- package/clis/tiktok/creator-videos.js +45 -0
- package/clis/tiktok/explore.js +76 -0
- package/clis/tiktok/follow.js +49 -0
- package/clis/tiktok/following.js +103 -0
- package/clis/tiktok/friends.js +79 -0
- package/clis/tiktok/like.js +19 -0
- package/clis/tiktok/live.js +79 -0
- package/clis/tiktok/notifications.js +77 -0
- package/clis/tiktok/profile.js +26 -0
- package/clis/tiktok/publish.js +82 -0
- package/clis/tiktok/save.js +15 -0
- package/clis/tiktok/search.js +24 -0
- package/clis/tiktok/unfollow.js +59 -0
- package/clis/tiktok/unlike.js +19 -0
- package/clis/tiktok/unsave.js +17 -0
- package/clis/tiktok/user.js +143 -0
- package/clis/tiktok/utils.js +272 -0
- package/clis/toutiao/article.js +1 -0
- package/clis/toutiao/articles.js +6 -0
- package/clis/toutiao/auth.js +50 -0
- package/clis/toutiao/hot.js +1 -0
- package/clis/toutiao/utils.js +2 -0
- package/clis/trae-cn/activity.js +1 -0
- package/clis/trae-cn/approve.js +1 -0
- package/clis/trae-cn/ask.js +1 -0
- package/clis/trae-cn/dump.js +1 -0
- package/clis/trae-cn/export.js +3 -0
- package/clis/trae-cn/model.js +1 -0
- package/clis/trae-cn/new.js +1 -0
- package/clis/trae-cn/read.js +1 -0
- package/clis/trae-cn/screenshot.js +1 -0
- package/clis/trae-cn/select-model.js +1 -0
- package/clis/trae-cn/send.js +1 -0
- package/clis/trae-cn/setup.js +1 -0
- package/clis/trae-cn/status.js +1 -0
- package/clis/trae-cn/targets.js +1 -0
- package/clis/trae-cn/utils.js +456 -0
- package/clis/trae-cn/watch.js +3 -0
- package/clis/trae-solo/_actions.js +41 -0
- package/clis/trae-solo/_fs.js +6 -0
- package/clis/trae-solo/_state.js +2 -0
- package/clis/trae-solo/automation.js +43 -0
- package/clis/trae-solo/history.js +15 -0
- package/clis/trae-solo/mode.js +31 -0
- package/clis/trae-solo/model.js +50 -0
- package/clis/trae-solo/renderer-storage.js +11 -0
- package/clis/trae-solo/settings.js +1 -0
- package/clis/trae-solo/skill-fs.js +1 -0
- package/clis/trae-solo/skill.js +81 -0
- package/clis/trae-solo/state-fs.js +2 -0
- package/clis/trae-solo/status.js +1 -0
- package/clis/trae-solo/task-fs.js +5 -0
- package/clis/trae-solo/user-rules.js +1 -0
- package/clis/trae-solo/workspaces-fs.js +1 -0
- package/clis/tumblr/auth.js +24 -0
- package/clis/tumblr/publish.js +14 -0
- package/clis/tvmaze/search.js +1 -0
- package/clis/tvmaze/show.js +1 -0
- package/clis/tvmaze/utils.js +1 -0
- package/clis/twitter/accept.js +116 -0
- package/clis/twitter/article.js +116 -0
- package/clis/twitter/auth.js +4 -0
- package/clis/twitter/block.js +62 -0
- package/clis/twitter/bookmark-folder.js +4 -0
- package/clis/twitter/bookmark-folders.js +4 -0
- package/clis/twitter/bookmark.js +44 -0
- package/clis/twitter/bookmarks.js +27 -0
- package/clis/twitter/delete.js +36 -0
- package/clis/twitter/device-follow.js +13 -0
- package/clis/twitter/dm-list.js +1 -0
- package/clis/twitter/dm-read.js +1 -0
- package/clis/twitter/dm-send.js +13 -0
- package/clis/twitter/dm-shared.js +6 -0
- package/clis/twitter/download.js +38 -0
- package/clis/twitter/follow-batch.js +43 -0
- package/clis/twitter/follow.js +39 -0
- package/clis/twitter/followers.js +59 -0
- package/clis/twitter/following.js +4 -0
- package/clis/twitter/hide-reply.js +57 -0
- package/clis/twitter/like.js +48 -0
- package/clis/twitter/likes.js +14 -0
- package/clis/twitter/list-add-batch.js +1 -0
- package/clis/twitter/list-add-core.js +35 -0
- package/clis/twitter/list-add.js +1 -0
- package/clis/twitter/list-batch-utils.js +1 -0
- package/clis/twitter/list-create.js +12 -0
- package/clis/twitter/list-delete.js +36 -0
- package/clis/twitter/list-remove-batch.js +1 -0
- package/clis/twitter/list-remove-core.js +127 -0
- package/clis/twitter/list-remove.js +1 -0
- package/clis/twitter/list-tweets.js +27 -0
- package/clis/twitter/lists.js +27 -0
- package/clis/twitter/notifications.js +4 -0
- package/clis/twitter/post.js +158 -0
- package/clis/twitter/profile.js +66 -0
- package/clis/twitter/quote.js +123 -0
- package/clis/twitter/reply-dm.js +112 -0
- package/clis/twitter/reply.js +97 -0
- package/clis/twitter/retweet.js +62 -0
- package/clis/twitter/schedule.js +96 -0
- package/clis/twitter/scheduled-delete.js +60 -0
- package/clis/twitter/scheduled-list.js +15 -0
- package/clis/twitter/scheduled-utils.js +18 -0
- package/clis/twitter/search.js +12 -0
- package/clis/twitter/shared.js +76 -0
- package/clis/twitter/thread.js +4 -0
- package/clis/twitter/timeline.js +4 -0
- package/clis/twitter/trending.js +18 -0
- package/clis/twitter/tweets.js +12 -0
- package/clis/twitter/unblock.js +45 -0
- package/clis/twitter/unbookmark.js +41 -0
- package/clis/twitter/unfollow.js +45 -0
- package/clis/twitter/unlike.js +48 -0
- package/clis/twitter/unretweet.js +62 -0
- package/clis/twitter/utils.js +55 -0
- package/clis/uisdc/news.js +25 -0
- package/clis/uiverse/_shared.js +257 -0
- package/clis/uiverse/code.js +1 -0
- package/clis/uiverse/preview.js +1 -0
- package/clis/upwork/auth.js +19 -0
- package/clis/upwork/detail.js +22 -0
- package/clis/upwork/feed.js +21 -0
- package/clis/upwork/search.js +21 -0
- package/clis/upwork/utils.js +1 -0
- package/clis/v2ex/auth.js +10 -0
- package/clis/v2ex/daily.js +41 -0
- package/clis/v2ex/hot.js +1 -0
- package/clis/v2ex/latest.js +1 -0
- package/clis/v2ex/me.js +58 -0
- package/clis/v2ex/member.js +1 -0
- package/clis/v2ex/node.js +1 -0
- package/clis/v2ex/nodes.js +1 -0
- package/clis/v2ex/notifications.js +40 -0
- package/clis/v2ex/replies.js +1 -0
- package/clis/v2ex/topic.js +1 -0
- package/clis/v2ex/user.js +1 -0
- package/clis/vk/post.js +1 -0
- package/clis/vk/shared.js +8 -0
- package/clis/vk/whoami.js +1 -0
- package/clis/wanfang/search.js +42 -0
- package/clis/web/read.js +260 -0
- package/clis/wechat-channels/auth.js +31 -0
- package/clis/wechat-channels/publish.js +298 -0
- package/clis/weibo/article.js +1 -0
- package/clis/weibo/auth.js +17 -0
- package/clis/weibo/comments.js +28 -0
- package/clis/weibo/delete.js +84 -0
- package/clis/weibo/favorites.js +27 -0
- package/clis/weibo/feed.js +33 -0
- package/clis/weibo/hot.js +17 -0
- package/clis/weibo/me.js +51 -0
- package/clis/weibo/post.js +46 -0
- package/clis/weibo/publish.js +98 -0
- package/clis/weibo/search.js +47 -0
- package/clis/weibo/user-posts.js +92 -0
- package/clis/weibo/user.js +37 -0
- package/clis/weibo/utils.js +16 -0
- package/clis/weixin/article.js +1 -0
- package/clis/weixin/create-draft.js +152 -0
- package/clis/weixin/download.js +100 -0
- package/clis/weixin/drafts.js +27 -0
- package/clis/weixin/login.js +1 -0
- package/clis/weixin/search.js +44 -0
- package/clis/weixin/stats.js +43 -0
- package/clis/weixin/whoami.js +1 -0
- package/clis/weread/ai-outline.js +2 -0
- package/clis/weread/auth.js +24 -0
- package/clis/weread/book-search.js +2 -0
- package/clis/weread/book.js +3 -0
- package/clis/weread/highlights.js +1 -0
- package/clis/weread/notebooks.js +1 -0
- package/clis/weread/notes.js +1 -0
- package/clis/weread/ranking.js +1 -0
- package/clis/weread/search.js +1 -0
- package/clis/weread/shelf.js +1 -0
- package/clis/weread/utils.js +67 -0
- package/clis/weread-official/book.js +1 -0
- package/clis/weread-official/discover.js +1 -0
- package/clis/weread-official/list-apis.js +1 -0
- package/clis/weread-official/notes.js +1 -0
- package/clis/weread-official/readdata.js +1 -0
- package/clis/weread-official/review.js +1 -0
- package/clis/weread-official/search.js +1 -0
- package/clis/weread-official/shelf.js +1 -0
- package/clis/weread-official/utils.js +1 -0
- package/clis/wikidata/entity.js +1 -0
- package/clis/wikidata/search.js +1 -0
- package/clis/wikidata/utils.js +1 -0
- package/clis/wikipedia/page.js +3 -0
- package/clis/wikipedia/random.js +1 -0
- package/clis/wikipedia/search.js +1 -0
- package/clis/wikipedia/summary.js +1 -0
- package/clis/wikipedia/trending.js +1 -0
- package/clis/wikipedia/utils.js +1 -0
- package/clis/wordpress/login.js +1 -0
- package/clis/wordpress/publish.js +1 -0
- package/clis/wordpress/shared.js +54 -0
- package/clis/wordpress/whoami.js +1 -0
- package/clis/woshipm/article.js +1 -0
- package/clis/woshipm/login.js +1 -0
- package/clis/woshipm/stats.js +52 -0
- package/clis/woshipm/whoami.js +1 -0
- package/clis/wttr/current.js +1 -0
- package/clis/wttr/forecast.js +1 -0
- package/clis/wttr/utils.js +1 -0
- package/clis/xianyu/auth.js +11 -0
- package/clis/xianyu/chat.js +1 -0
- package/clis/xianyu/im.js +240 -0
- package/clis/xianyu/inbox.js +1 -0
- package/clis/xianyu/item.js +97 -0
- package/clis/xianyu/messages.js +1 -0
- package/clis/xianyu/publish.js +245 -0
- package/clis/xianyu/reply.js +1 -0
- package/clis/xianyu/search.js +141 -0
- package/clis/xianyu/utils.js +1 -0
- package/clis/xiaoe/auth.js +10 -0
- package/clis/xiaoe/catalog.js +134 -0
- package/clis/xiaoe/content.js +16 -0
- package/clis/xiaoe/courses.js +43 -0
- package/clis/xiaoe/detail.js +19 -0
- package/clis/xiaoe/play-url.js +97 -0
- package/clis/xiaohongshu/ask.js +130 -0
- package/clis/xiaohongshu/auth.js +13 -0
- package/clis/xiaohongshu/collection-helpers.js +64 -0
- package/clis/xiaohongshu/comments.js +89 -0
- package/clis/xiaohongshu/creator-note-detail.js +80 -0
- package/clis/xiaohongshu/creator-notes-summary.js +1 -0
- package/clis/xiaohongshu/creator-notes.js +107 -0
- package/clis/xiaohongshu/creator-profile.js +13 -0
- package/clis/xiaohongshu/creator-stats.js +13 -0
- package/clis/xiaohongshu/delete-note.js +69 -0
- package/clis/xiaohongshu/download.js +200 -0
- package/clis/xiaohongshu/draft-clear.js +44 -0
- package/clis/xiaohongshu/draft-delete.js +37 -0
- package/clis/xiaohongshu/draft-open.js +1 -0
- package/clis/xiaohongshu/draft-utils.js +36 -0
- package/clis/xiaohongshu/drafts.js +1 -0
- package/clis/xiaohongshu/feed.js +38 -0
- package/clis/xiaohongshu/follow.js +75 -0
- package/clis/xiaohongshu/liked.js +1 -0
- package/clis/xiaohongshu/note-helpers.js +1 -0
- package/clis/xiaohongshu/note.js +32 -0
- package/clis/xiaohongshu/notifications.js +1 -0
- package/clis/xiaohongshu/publish-video.js +87 -0
- package/clis/xiaohongshu/publish.js +637 -0
- package/clis/xiaohongshu/saved.js +1 -0
- package/clis/xiaohongshu/search.js +194 -0
- package/clis/xiaohongshu/unfollow.js +98 -0
- package/clis/xiaohongshu/user-helpers.js +1 -0
- package/clis/xiaohongshu/user.js +30 -0
- package/clis/xiaoyuzhou/auth.js +3 -0
- package/clis/xiaoyuzhou/download.js +1 -0
- package/clis/xiaoyuzhou/episode.js +1 -0
- package/clis/xiaoyuzhou/podcast-episodes.js +1 -0
- package/clis/xiaoyuzhou/podcast.js +1 -0
- package/clis/xiaoyuzhou/transcript.js +1 -0
- package/clis/xiaoyuzhou/utils.js +1 -0
- package/clis/xueqiu/article.js +4 -0
- package/clis/xueqiu/auth.js +27 -0
- package/clis/xueqiu/comments.js +38 -0
- package/clis/xueqiu/danjuan-utils.js +84 -0
- package/clis/xueqiu/earnings-date.js +1 -0
- package/clis/xueqiu/events.js +17 -0
- package/clis/xueqiu/feed.js +1 -0
- package/clis/xueqiu/fund-holdings.js +1 -0
- package/clis/xueqiu/fund-snapshot.js +1 -0
- package/clis/xueqiu/groups.js +1 -0
- package/clis/xueqiu/hashtags.js +26 -0
- package/clis/xueqiu/hot-stock.js +1 -0
- package/clis/xueqiu/hot.js +1 -0
- package/clis/xueqiu/kline.js +1 -0
- package/clis/xueqiu/search.js +1 -0
- package/clis/xueqiu/stock.js +1 -0
- package/clis/xueqiu/stocks.js +13 -0
- package/clis/xueqiu/users.js +12 -0
- package/clis/xueqiu/utils.js +9 -0
- package/clis/xueqiu/watchlist.js +1 -0
- package/clis/yahoo/search.js +21 -0
- package/clis/yahoo-finance/quote.js +50 -0
- package/clis/yollomi/background.js +1 -0
- package/clis/yollomi/edit.js +1 -0
- package/clis/yollomi/face-swap.js +1 -0
- package/clis/yollomi/generate.js +1 -0
- package/clis/yollomi/models.js +1 -0
- package/clis/yollomi/object-remover.js +1 -0
- package/clis/yollomi/remove-bg.js +1 -0
- package/clis/yollomi/restore.js +1 -0
- package/clis/yollomi/try-on.js +1 -0
- package/clis/yollomi/upload.js +17 -0
- package/clis/yollomi/upscale.js +1 -0
- package/clis/yollomi/utils.js +16 -0
- package/clis/yollomi/video.js +1 -0
- package/clis/youdao/note.js +113 -0
- package/clis/youtube/auth.js +20 -0
- package/clis/youtube/channel.js +118 -0
- package/clis/youtube/comments.js +64 -0
- package/clis/youtube/feed.js +89 -0
- package/clis/youtube/history.js +87 -0
- package/clis/youtube/like.js +33 -0
- package/clis/youtube/playlist.js +47 -0
- package/clis/youtube/publish.js +56 -0
- package/clis/youtube/search.js +39 -0
- package/clis/youtube/subscribe.js +42 -0
- package/clis/youtube/subscriptions.js +26 -0
- package/clis/youtube/transcript-group.js +2 -0
- package/clis/youtube/transcript.js +417 -0
- package/clis/youtube/unlike.js +33 -0
- package/clis/youtube/unsubscribe.js +42 -0
- package/clis/youtube/utils.js +34 -0
- package/clis/youtube/video.js +96 -0
- package/clis/youtube/watch-later.js +41 -0
- package/clis/yuanbao/ask.js +145 -0
- package/clis/yuanbao/auth.js +23 -0
- package/clis/yuanbao/detail.js +1 -0
- package/clis/yuanbao/history.js +1 -0
- package/clis/yuanbao/new.js +16 -0
- package/clis/yuanbao/read.js +1 -0
- package/clis/yuanbao/send.js +1 -0
- package/clis/yuanbao/shared.js +127 -0
- package/clis/yuanbao/status.js +1 -0
- package/clis/yuque/article.js +1 -0
- package/clis/yuque/whoami.js +1 -0
- package/clis/zhihu/answer-comments.js +11 -0
- package/clis/zhihu/answer-detail.js +11 -0
- package/clis/zhihu/answer.js +15 -0
- package/clis/zhihu/article-transform.js +1 -0
- package/clis/zhihu/article.js +7 -0
- package/clis/zhihu/auth.js +11 -0
- package/clis/zhihu/collection.js +7 -0
- package/clis/zhihu/collections.js +7 -0
- package/clis/zhihu/comment.js +17 -0
- package/clis/zhihu/download.js +39 -0
- package/clis/zhihu/favorite.js +39 -0
- package/clis/zhihu/follow.js +19 -0
- package/clis/zhihu/followers.js +1 -0
- package/clis/zhihu/following.js +1 -0
- package/clis/zhihu/hot.js +21 -0
- package/clis/zhihu/like.js +16 -0
- package/clis/zhihu/paginate.js +11 -0
- package/clis/zhihu/pin.js +24 -0
- package/clis/zhihu/pins.js +1 -0
- package/clis/zhihu/question.js +7 -0
- package/clis/zhihu/recommend.js +7 -0
- package/clis/zhihu/search.js +11 -0
- package/clis/zhihu/stats.js +41 -0
- package/clis/zhihu/target.js +1 -0
- package/clis/zhihu/text.js +6 -0
- package/clis/zhihu/user-answers.js +1 -0
- package/clis/zhihu/user-arg.js +1 -0
- package/clis/zhihu/user-articles.js +1 -0
- package/clis/zhihu/user.js +11 -0
- package/clis/zhihu/write-shared.js +71 -0
- package/clis/zlibrary/info.js +1 -0
- package/clis/zlibrary/search.js +1 -0
- package/clis/zlibrary/utils.js +48 -0
- package/clis/zsxq/auth.js +33 -0
- package/clis/zsxq/dynamics.js +1 -0
- package/clis/zsxq/groups.js +1 -0
- package/clis/zsxq/search.js +1 -0
- package/clis/zsxq/topic.js +1 -0
- package/clis/zsxq/topics.js +1 -0
- package/clis/zsxq/utils.js +72 -0
- package/dist/src/adapter-shadow.d.ts +11 -0
- package/dist/src/adapter-shadow.js +2 -0
- package/dist/src/adapter-shadow.test.d.ts +1 -0
- package/dist/src/adapter-source.d.ts +11 -0
- package/dist/src/adapter-source.js +1 -0
- package/dist/src/adapter-source.test.d.ts +1 -0
- package/dist/src/browser/analyze.d.ts +118 -0
- package/dist/src/browser/analyze.js +1 -0
- package/dist/src/browser/analyze.test.d.ts +1 -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.js +2 -0
- package/dist/src/browser/article-extract.test.d.ts +1 -0
- package/dist/src/browser/ax-snapshot.d.ts +37 -0
- package/dist/src/browser/ax-snapshot.js +2 -0
- package/dist/src/browser/ax-snapshot.test.d.ts +1 -0
- package/dist/src/browser/base-page.d.ts +151 -0
- package/dist/src/browser/base-page.js +225 -0
- package/dist/src/browser/base-page.test.d.ts +1 -0
- package/dist/src/browser/bridge-readiness.d.ts +14 -0
- package/dist/src/browser/bridge-readiness.js +1 -0
- package/dist/src/browser/bridge-readiness.test.d.ts +1 -0
- package/dist/src/browser/bridge.d.ts +26 -0
- package/dist/src/browser/bridge.js +1 -0
- package/dist/src/browser/cdp-click-fixture.test.d.ts +1 -0
- package/dist/src/browser/cdp.d.ts +51 -0
- package/dist/src/browser/cdp.js +1 -0
- package/dist/src/browser/cdp.test.d.ts +1 -0
- package/dist/src/browser/compound.d.ts +59 -0
- package/dist/src/browser/compound.js +82 -0
- package/dist/src/browser/compound.test.d.ts +1 -0
- package/dist/src/browser/config.d.ts +2 -0
- package/dist/src/browser/config.js +1 -0
- package/dist/src/browser/daemon-client.d.ts +79 -0
- package/dist/src/browser/daemon-client.js +1 -0
- package/dist/src/browser/daemon-client.test.d.ts +1 -0
- package/dist/src/browser/daemon-lifecycle.d.ts +37 -0
- package/dist/src/browser/daemon-lifecycle.js +12 -0
- package/dist/src/browser/daemon-transport.d.ts +55 -0
- package/dist/src/browser/daemon-transport.js +1 -0
- package/dist/src/browser/daemon-version.d.ts +4 -0
- package/dist/src/browser/daemon-version.js +2 -0
- package/dist/src/browser/dom-helpers.d.ts +41 -0
- package/dist/src/browser/dom-helpers.js +166 -0
- package/dist/src/browser/dom-helpers.test.d.ts +1 -0
- package/dist/src/browser/dom-snapshot.d.ts +93 -0
- package/dist/src/browser/dom-snapshot.js +809 -0
- package/dist/src/browser/dom-snapshot.test.d.ts +11 -0
- package/dist/src/browser/errors.d.ts +38 -0
- package/dist/src/browser/errors.js +5 -0
- package/dist/src/browser/errors.test.d.ts +1 -0
- package/dist/src/browser/extract.d.ts +69 -0
- package/dist/src/browser/extract.js +42 -0
- package/dist/src/browser/extract.test.d.ts +1 -0
- package/dist/src/browser/find.d.ts +84 -0
- package/dist/src/browser/find.js +328 -0
- package/dist/src/browser/find.test.d.ts +1 -0
- package/dist/src/browser/fingerprint.d.ts +44 -0
- package/dist/src/browser/fingerprint.js +82 -0
- package/dist/src/browser/html-tree.d.ts +75 -0
- package/dist/src/browser/html-tree.js +61 -0
- package/dist/src/browser/html-tree.test.d.ts +1 -0
- package/dist/src/browser/index.d.ts +14 -0
- package/dist/src/browser/index.js +1 -0
- package/dist/src/browser/managed-chrome.d.ts +89 -0
- package/dist/src/browser/managed-chrome.js +1 -0
- package/dist/src/browser/network-cache.d.ts +49 -0
- package/dist/src/browser/network-cache.js +1 -0
- package/dist/src/browser/network-cache.test.d.ts +1 -0
- package/dist/src/browser/network-key.d.ts +22 -0
- package/dist/src/browser/network-key.js +1 -0
- package/dist/src/browser/network-key.test.d.ts +1 -0
- package/dist/src/browser/page.d.ts +83 -0
- package/dist/src/browser/page.js +15 -0
- package/dist/src/browser/page.test.d.ts +1 -0
- package/dist/src/browser/profile.d.ts +96 -0
- package/dist/src/browser/profile.js +2 -0
- package/dist/src/browser/proxy-test.d.ts +28 -0
- package/dist/src/browser/proxy-test.js +12 -0
- package/dist/src/browser/shape-filter.d.ts +52 -0
- package/dist/src/browser/shape-filter.js +1 -0
- package/dist/src/browser/shape-filter.test.d.ts +1 -0
- package/dist/src/browser/shape.d.ts +23 -0
- package/dist/src/browser/shape.js +1 -0
- package/dist/src/browser/shape.test.d.ts +1 -0
- package/dist/src/browser/stealth.d.ts +18 -0
- package/dist/src/browser/stealth.js +391 -0
- package/dist/src/browser/stealth.test.d.ts +1 -0
- package/dist/src/browser/tabs.d.ts +13 -0
- package/dist/src/browser/tabs.js +2 -0
- package/dist/src/browser/target-errors.d.ts +39 -0
- package/dist/src/browser/target-errors.js +1 -0
- package/dist/src/browser/target-errors.test.d.ts +1 -0
- package/dist/src/browser/target-resolver.d.ts +158 -0
- package/dist/src/browser/target-resolver.js +423 -0
- package/dist/src/browser/target-resolver.test.d.ts +1 -0
- package/dist/src/browser/trace.d.ts +21 -0
- package/dist/src/browser/trace.js +2 -0
- package/dist/src/browser/utils.d.ts +20 -0
- package/dist/src/browser/utils.js +1 -0
- package/dist/src/browser/utils.test.d.ts +1 -0
- package/dist/src/browser/verify-fixture.d.ts +65 -0
- package/dist/src/browser/verify-fixture.js +2 -0
- package/dist/src/browser/verify-fixture.test.d.ts +1 -0
- package/dist/src/browser/visual-refs.d.ts +11 -0
- package/dist/src/browser/visual-refs.js +94 -0
- package/dist/src/browser-session-lock.d.ts +13 -0
- package/dist/src/browser-session-lock.js +1 -0
- package/dist/src/browser-session-lock.test.d.ts +1 -0
- package/dist/src/browser.test.d.ts +1 -0
- package/dist/src/build-manifest.d.ts +103 -0
- package/dist/src/build-manifest.js +16 -0
- package/dist/src/build-manifest.test.d.ts +1 -0
- package/dist/src/capabilityRouting.d.ts +19 -0
- package/dist/src/capabilityRouting.js +1 -0
- package/dist/src/capabilityRouting.test.d.ts +1 -0
- package/dist/src/cli-argv-preprocess.d.ts +63 -0
- package/dist/src/cli-argv-preprocess.js +1 -0
- package/dist/src/cli-argv-preprocess.test.d.ts +1 -0
- package/dist/src/cli.d.ts +79 -0
- package/dist/src/cli.js +132 -0
- package/dist/src/cli.test.d.ts +1 -0
- package/dist/src/commanderAdapter.d.ts +21 -0
- package/dist/src/commanderAdapter.js +3 -0
- package/dist/src/commanderAdapter.test.d.ts +1 -0
- package/dist/src/commands/auth.d.ts +40 -0
- package/dist/src/commands/auth.js +2 -0
- package/dist/src/commands/auth.test.d.ts +1 -0
- package/dist/src/commands/daemon.d.ts +25 -0
- package/dist/src/commands/daemon.js +1 -0
- package/dist/src/commands/daemon.test.d.ts +1 -0
- package/dist/src/completion-fast.d.ts +22 -0
- package/dist/src/completion-fast.js +1 -0
- package/dist/src/completion-shared.d.ts +13 -0
- package/dist/src/completion-shared.js +30 -0
- package/dist/src/completion.d.ts +21 -0
- package/dist/src/completion.js +1 -0
- package/dist/src/completion.test.d.ts +1 -0
- package/dist/src/constants.d.ts +22 -0
- package/dist/src/constants.js +1 -0
- package/dist/src/convention-audit.d.ts +50 -0
- package/dist/src/convention-audit.js +2 -0
- package/dist/src/convention-audit.test.d.ts +1 -0
- package/dist/src/daemon-utils.d.ts +18 -0
- package/dist/src/daemon-utils.js +1 -0
- package/dist/src/daemon.d.ts +22 -0
- package/dist/src/daemon.js +1 -0
- package/dist/src/daemon.test.d.ts +1 -0
- package/dist/src/discovery.d.ts +43 -0
- package/dist/src/discovery.js +2 -0
- package/dist/src/doctor.d.ts +38 -0
- package/dist/src/doctor.js +13 -0
- package/dist/src/doctor.test.d.ts +1 -0
- package/dist/src/download/article-download.d.ts +72 -0
- package/dist/src/download/article-download.js +21 -0
- package/dist/src/download/article-download.test.d.ts +1 -0
- package/dist/src/download/index.d.ts +71 -0
- package/dist/src/download/index.js +7 -0
- package/dist/src/download/index.test.d.ts +1 -0
- package/dist/src/download/media-download.d.ts +49 -0
- package/dist/src/download/media-download.js +1 -0
- package/dist/src/download/media-download.test.d.ts +1 -0
- package/dist/src/download/progress.d.ts +36 -0
- package/dist/src/download/progress.js +5 -0
- package/dist/src/download/progress.test.d.ts +1 -0
- package/dist/src/electron-apps.d.ts +31 -0
- package/dist/src/electron-apps.js +1 -0
- package/dist/src/electron-apps.test.d.ts +1 -0
- package/dist/src/engine.test.d.ts +1 -0
- package/dist/src/errors.d.ts +117 -0
- package/dist/src/errors.js +2 -0
- package/dist/src/errors.test.d.ts +1 -0
- package/dist/src/execution.d.ts +24 -0
- package/dist/src/execution.js +2 -0
- package/dist/src/execution.test.d.ts +1 -0
- package/dist/src/extension-manifest-regression.test.d.ts +1 -0
- package/dist/src/external-clis.yaml +109 -0
- package/dist/src/external.d.ts +49 -0
- package/dist/src/external.js +1 -0
- package/dist/src/external.test.d.ts +1 -0
- package/dist/src/help.d.ts +88 -0
- package/dist/src/help.js +8 -0
- package/dist/src/help.test.d.ts +1 -0
- package/dist/src/hooks.d.ts +46 -0
- package/dist/src/hooks.js +1 -0
- package/dist/src/hooks.test.d.ts +4 -0
- package/dist/src/interceptor.d.ts +44 -0
- package/dist/src/interceptor.js +123 -0
- package/dist/src/interceptor.test.d.ts +4 -0
- package/dist/src/launcher.d.ts +41 -0
- package/dist/src/launcher.js +7 -0
- package/dist/src/launcher.test.d.ts +1 -0
- package/dist/src/logger.d.ts +26 -0
- package/dist/src/logger.js +9 -0
- package/dist/src/main.d.ts +5 -0
- package/dist/src/main.js +10 -0
- package/dist/src/manifest-types.d.ts +43 -0
- package/dist/src/manifest-types.js +1 -0
- package/dist/src/node-network.d.ts +10 -0
- package/dist/src/node-network.js +1 -0
- package/dist/src/node-network.test.d.ts +1 -0
- package/dist/src/observation/artifact.d.ts +16 -0
- package/dist/src/observation/artifact.js +8 -0
- package/dist/src/observation/artifact.test.d.ts +1 -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 +1 -0
- package/dist/src/observation/manager.d.ts +9 -0
- package/dist/src/observation/manager.js +1 -0
- package/dist/src/observation/manager.test.d.ts +1 -0
- package/dist/src/observation/redaction.d.ts +11 -0
- package/dist/src/observation/redaction.js +2 -0
- package/dist/src/observation/redaction.test.d.ts +1 -0
- package/dist/src/observation/retention.d.ts +32 -0
- package/dist/src/observation/retention.js +1 -0
- package/dist/src/observation/retention.test.d.ts +1 -0
- package/dist/src/observation/ring-buffer.d.ts +22 -0
- package/dist/src/observation/ring-buffer.js +1 -0
- package/dist/src/observation/ring-buffer.test.d.ts +1 -0
- package/dist/src/observation/session.d.ts +25 -0
- package/dist/src/observation/session.js +1 -0
- package/dist/src/output.d.ts +14 -0
- package/dist/src/output.js +2 -0
- package/dist/src/output.test.d.ts +1 -0
- package/dist/src/package-exports.test.d.ts +1 -0
- package/dist/src/package-paths.d.ts +8 -0
- package/dist/src/package-paths.js +1 -0
- package/dist/src/pipeline/executor.d.ts +11 -0
- package/dist/src/pipeline/executor.js +1 -0
- package/dist/src/pipeline/executor.test.d.ts +4 -0
- package/dist/src/pipeline/index.d.ts +5 -0
- package/dist/src/pipeline/index.js +1 -0
- package/dist/src/pipeline/registry.d.ts +28 -0
- package/dist/src/pipeline/registry.js +1 -0
- package/dist/src/pipeline/steps/browser.d.ts +13 -0
- package/dist/src/pipeline/steps/browser.js +1 -0
- package/dist/src/pipeline/steps/download.d.ts +18 -0
- package/dist/src/pipeline/steps/download.js +1 -0
- package/dist/src/pipeline/steps/download.test.d.ts +1 -0
- package/dist/src/pipeline/steps/fetch.d.ts +5 -0
- package/dist/src/pipeline/steps/fetch.js +31 -0
- package/dist/src/pipeline/steps/fetch.test.d.ts +1 -0
- package/dist/src/pipeline/steps/intercept.d.ts +5 -0
- package/dist/src/pipeline/steps/intercept.js +1 -0
- package/dist/src/pipeline/steps/tap.d.ts +12 -0
- package/dist/src/pipeline/steps/tap.js +53 -0
- package/dist/src/pipeline/steps/transform.d.ts +9 -0
- package/dist/src/pipeline/steps/transform.js +1 -0
- package/dist/src/pipeline/template.d.ts +17 -0
- package/dist/src/pipeline/template.js +1 -0
- package/dist/src/pipeline/template.test.d.ts +4 -0
- package/dist/src/pipeline/transform.test.d.ts +4 -0
- package/dist/src/plugin-manifest.d.ts +70 -0
- package/dist/src/plugin-manifest.js +1 -0
- package/dist/src/plugin-manifest.test.d.ts +4 -0
- package/dist/src/plugin-scaffold.d.ts +28 -0
- package/dist/src/plugin-scaffold.js +75 -0
- package/dist/src/plugin-scaffold.test.d.ts +4 -0
- package/dist/src/plugin.d.ts +145 -0
- package/dist/src/plugin.js +20 -0
- package/dist/src/plugin.test.d.ts +4 -0
- package/dist/src/rate-limit.d.ts +15 -0
- package/dist/src/rate-limit.js +2 -0
- package/dist/src/rate-limit.test.d.ts +1 -0
- package/dist/src/registry-api.d.ts +13 -0
- package/dist/src/registry-api.js +1 -0
- package/dist/src/registry.d.ts +130 -0
- package/dist/src/registry.js +1 -0
- package/dist/src/registry.test.d.ts +4 -0
- package/dist/src/runtime-detect.d.ts +31 -0
- package/dist/src/runtime-detect.js +1 -0
- package/dist/src/runtime-detect.test.d.ts +1 -0
- package/dist/src/runtime.d.ts +57 -0
- package/dist/src/runtime.js +1 -0
- package/dist/src/scripts/framework.d.ts +7 -0
- package/dist/src/scripts/framework.js +1 -0
- package/dist/src/scripts/interact.d.ts +4 -0
- package/dist/src/scripts/interact.js +1 -0
- package/dist/src/scripts/store.d.ts +13 -0
- package/dist/src/scripts/store.js +1 -0
- package/dist/src/serialization.d.ts +42 -0
- package/dist/src/serialization.js +4 -0
- package/dist/src/serialization.test.d.ts +1 -0
- package/dist/src/skills.d.ts +14 -0
- package/dist/src/skills.js +6 -0
- package/dist/src/skills.test.d.ts +1 -0
- package/dist/src/snapshotFormatter.d.ts +11 -0
- package/dist/src/snapshotFormatter.js +3 -0
- package/dist/src/snapshotFormatter.test.d.ts +7 -0
- package/dist/src/tui.d.ts +28 -0
- package/dist/src/tui.js +16 -0
- package/dist/src/tui.test.d.ts +1 -0
- package/dist/src/types.d.ts +236 -0
- package/dist/src/types.js +1 -0
- package/dist/src/utils.d.ts +57 -0
- package/dist/src/utils.js +38 -0
- package/dist/src/utils.test.d.ts +1 -0
- package/dist/src/validate.d.ts +21 -0
- package/dist/src/validate.js +3 -0
- package/dist/src/validate.test.d.ts +9 -0
- package/dist/src/verify.d.ts +27 -0
- package/dist/src/verify.js +2 -0
- package/dist/src/verify.test.d.ts +8 -0
- package/dist/src/version.d.ts +4 -0
- package/dist/src/version.js +1 -0
- package/dist/src/weixin-download.test.d.ts +1 -0
- package/docs/guide/browser-bridge.md +94 -0
- package/docs/guide/electron-app-cli.md +199 -0
- package/docs/guide/exit-codes.md +24 -0
- package/docs/guide/extending-opencli.md +134 -0
- package/docs/guide/getting-started.md +81 -0
- package/docs/guide/installation.md +52 -0
- package/docs/guide/plugins.md +226 -0
- package/docs/guide/remote-orchestration.md +116 -0
- package/docs/guide/troubleshooting.md +69 -0
- package/package.json +116 -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/minify-release.mjs +115 -0
- package/scripts/postinstall.js +174 -0
- package/scripts/silent-column-drop-baseline.json +910 -0
- package/scripts/typed-error-lint-baseline.json +1098 -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 +468 -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 +168 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import{AuthRequiredError as Z,CommandExecutionError as $}from"@jackwener/opencli/errors";import{assertSafeLinkedinUrl as z,normalizeWhitespace as G,unwrapEvaluateResult as B}from"./shared.js";const W="com.linkedin.voyager.dash.deco.identity.profile.FullProfileWithEntities-101",y="com.linkedin.voyager.dash.deco.identity.profile.FullProfilePositionGroup-58",N=/^\/in\/[^/?#]+\/?$/;export function normalizeProfileInputUrl(J,X){const K=z(J||"https://www.linkedin.com/in/me/","profile-url","/in/me/"),Q=new URL(K);if(!N.test(Q.pathname))throw new $(`LinkedIn ${X} requires a /in/<handle>/ profile URL`);return Q.toString()}const T=String.raw`
|
|
2
|
+
const norm = (s) => String(s == null ? '' : s).replace(/[ ]+/g, ' ').replace(/\s+/g, ' ').trim();
|
|
3
|
+
const csrf = ((document.cookie.split('; ').find((c) => c.startsWith('JSESSIONID=')) || '').split('=')[1] || '').replace(/^"|"$/g, '');
|
|
4
|
+
const H = {
|
|
5
|
+
'csrf-token': csrf,
|
|
6
|
+
'accept': 'application/vnd.linkedin.normalized+json+2.1',
|
|
7
|
+
'x-restli-protocol-version': '2.0.0',
|
|
8
|
+
'x-li-lang': 'en_US',
|
|
9
|
+
};
|
|
10
|
+
async function voyagerGet(path) {
|
|
11
|
+
if (!csrf) return { ok: false, auth: true };
|
|
12
|
+
const res = await fetch('/voyager/api' + path, { credentials: 'include', headers: H });
|
|
13
|
+
if (res.status === 401 || res.status === 403) return { ok: false, auth: true, status: res.status };
|
|
14
|
+
if (!res.ok) return { ok: false, status: res.status };
|
|
15
|
+
const json = await res.json();
|
|
16
|
+
return { ok: true, json };
|
|
17
|
+
}
|
|
18
|
+
// normalized+json:included 是实体数组,每个有 entityUrn;引用字段是 urn 字符串(*foo)。
|
|
19
|
+
function indexIncluded(json) {
|
|
20
|
+
const byUrn = {};
|
|
21
|
+
const included = (json && json.included) || [];
|
|
22
|
+
for (const ent of included) { if (ent && ent.entityUrn) byUrn[ent.entityUrn] = ent; }
|
|
23
|
+
return byUrn;
|
|
24
|
+
}
|
|
25
|
+
function typeOf(ent) { return (ent && ent.$type) || ''; }
|
|
26
|
+
// 顺着 CollectionResponse 的 *elements 拿有序 urn 列表(保持资料板块原顺序 = 最新在前)。
|
|
27
|
+
function collElements(byUrn, ref) {
|
|
28
|
+
if (Array.isArray(ref)) return ref;
|
|
29
|
+
const c = ref ? byUrn[ref] : null;
|
|
30
|
+
if (!c) return [];
|
|
31
|
+
return c['*elements'] || c.elements || [];
|
|
32
|
+
}
|
|
33
|
+
function pickType(byUrn, suffix) {
|
|
34
|
+
return Object.values(byUrn).filter((e) => typeOf(e).endsWith(suffix));
|
|
35
|
+
}
|
|
36
|
+
// profile.geoLocation 是内联对象,*geo 指向 Geo 实体(defaultLocalizedName = 展示地名)。
|
|
37
|
+
function resolveGeo(byUrn, profile) {
|
|
38
|
+
const direct = norm(profile.geoLocationName || profile.locationName);
|
|
39
|
+
if (direct) return direct;
|
|
40
|
+
const geoRef = profile.geoLocation && profile.geoLocation['*geo'];
|
|
41
|
+
const geo = geoRef ? byUrn[geoRef] : null;
|
|
42
|
+
return geo ? norm(geo.defaultLocalizedName || geo.defaultLocalizedNameWithoutCountryName) : '';
|
|
43
|
+
}
|
|
44
|
+
// education/position 名字为空时用 *school / *company 引用兜底。
|
|
45
|
+
function refName(byUrn, ref) {
|
|
46
|
+
const ent = ref ? byUrn[ref] : null;
|
|
47
|
+
return ent ? norm(ent.name) : '';
|
|
48
|
+
}
|
|
49
|
+
// LiDate {year, month?, day?} → "YYYY-MM"(无月给空);范围 → "YYYY-MM – Present"。
|
|
50
|
+
function ymd(d) {
|
|
51
|
+
if (!d || d.year == null) return '';
|
|
52
|
+
const m = d.month != null ? String(d.month).padStart(2, '0') : '';
|
|
53
|
+
return m ? d.year + '-' + m : String(d.year);
|
|
54
|
+
}
|
|
55
|
+
function dateRangeParts(range) {
|
|
56
|
+
const r = range || {};
|
|
57
|
+
const start = ymd(r.start || r.startDate);
|
|
58
|
+
const end = ymd(r.end || r.endDate);
|
|
59
|
+
const endLabel = (r.start || r.startDate) && !(r.end || r.endDate) ? 'Present' : end;
|
|
60
|
+
const dateRange = start || endLabel ? norm((start + ' – ' + endLabel).replace(/^ – | – $/g, '').trim()) : '';
|
|
61
|
+
return { startDate: start, endDate: endLabel, dateRange };
|
|
62
|
+
}
|
|
63
|
+
`;function H(J,X){const K=Object.entries(J).map(([Q,Y])=>`const ${Q} = ${JSON.stringify(Y)};`).join(`
|
|
64
|
+
`);return`(async () => {
|
|
65
|
+
${T}
|
|
66
|
+
${K}
|
|
67
|
+
${X}
|
|
68
|
+
})()`}async function j(J,X,K){await J.goto(X);await J.wait(3);const Q=B(await J.evaluate(String.raw`(() => {
|
|
69
|
+
const path = String(location.pathname || '');
|
|
70
|
+
const authWall = /linkedin\.com\/(?:login|checkpoint|authwall|uas)/i.test(location.href)
|
|
71
|
+
|| Boolean(document.querySelector('input[name="session_key"], form.login__form'));
|
|
72
|
+
const m = path.match(/^\/in\/([^/?#]+)\/?$/);
|
|
73
|
+
return { publicId: m ? decodeURIComponent(m[1]) : '', authWall };
|
|
74
|
+
})()`));if(Q?.authWall)throw new Z("linkedin.com",`LinkedIn ${K} requires an active signed-in browser session`);const Y=G(Q?.publicId);if(!Y||Y==="me")throw new $(`LinkedIn ${K} could not resolve the profile handle from ${X}`);return{publicId:Y,profileUrl:`https://www.linkedin.com/in/${Y}/`}}export async function fetchFullProfile(J,X,K){const{publicId:Q,profileUrl:Y}=await j(J,X,K),V=B(await J.evaluate(H({PUBLIC_ID:Q,DECO:W},String.raw`
|
|
75
|
+
const r = await voyagerGet('/identity/dash/profiles?q=memberIdentity&memberIdentity=' + encodeURIComponent(PUBLIC_ID) + '&decorationId=' + DECO);
|
|
76
|
+
if (!r.ok) return { ok: false, auth: r.auth || false, status: r.status || 0 };
|
|
77
|
+
const byUrn = indexIncluded(r.json);
|
|
78
|
+
const profile = pickType(byUrn, 'identity.profile.Profile')[0] || null;
|
|
79
|
+
if (!profile) return { ok: false, status: 0, empty: true };
|
|
80
|
+
// 有序经历:profile.*profilePositionGroups → 组 → *profilePositionInPositionGroup → 职位。
|
|
81
|
+
const positions = [];
|
|
82
|
+
for (const pgUrn of collElements(byUrn, profile['*profilePositionGroups'])) {
|
|
83
|
+
const pg = byUrn[pgUrn];
|
|
84
|
+
if (!pg) continue;
|
|
85
|
+
const groupCompany = norm(pg.companyName);
|
|
86
|
+
for (const posUrn of collElements(byUrn, pg['*profilePositionInPositionGroup'])) {
|
|
87
|
+
const p = byUrn[posUrn];
|
|
88
|
+
if (!p) continue;
|
|
89
|
+
const dr = dateRangeParts(p.dateRange);
|
|
90
|
+
positions.push({
|
|
91
|
+
title: norm(p.title),
|
|
92
|
+
company: norm(p.companyName || groupCompany),
|
|
93
|
+
location: norm(p.locationName || p.geoLocationName),
|
|
94
|
+
description: norm(p.description),
|
|
95
|
+
dateRange: dr.dateRange, startDate: dr.startDate, endDate: dr.endDate,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// 有序教育。
|
|
100
|
+
const educations = [];
|
|
101
|
+
for (const eduUrn of collElements(byUrn, profile['*profileEducations'])) {
|
|
102
|
+
const e = byUrn[eduUrn];
|
|
103
|
+
if (!e) continue;
|
|
104
|
+
const dr = dateRangeParts(e.dateRange);
|
|
105
|
+
const school = norm(e.schoolName) || refName(byUrn, e['*school']);
|
|
106
|
+
if (!school && !norm(e.degreeName) && !norm(e.fieldOfStudy)) continue;
|
|
107
|
+
educations.push({
|
|
108
|
+
school, degree: norm(e.degreeName), field: norm(e.fieldOfStudy),
|
|
109
|
+
grade: norm(e.grade), activities: norm(e.activities), description: norm(e.description),
|
|
110
|
+
dateRange: dr.dateRange, startDate: dr.startDate, endDate: dr.endDate,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
ok: true,
|
|
115
|
+
profile: {
|
|
116
|
+
firstName: norm(profile.firstName), lastName: norm(profile.lastName),
|
|
117
|
+
headline: norm(profile.headline), summary: norm(profile.summary),
|
|
118
|
+
location: resolveGeo(byUrn, profile), publicIdentifier: norm(profile.publicIdentifier) || PUBLIC_ID,
|
|
119
|
+
profileUrn: profile.entityUrn || '',
|
|
120
|
+
},
|
|
121
|
+
positions, educations,
|
|
122
|
+
};
|
|
123
|
+
`)));if(V?.auth)throw new Z("linkedin.com",`LinkedIn ${K} requires an active signed-in browser session`);if(!V?.ok)throw new $(`LinkedIn ${K}: profile API returned ${V?.empty?"no profile entity":"HTTP "+(V?.status||"?")}`);return{...V,profileUrl:Y,publicId:Q}}export async function fetchExperience(J,X,K){const{publicId:Q,profileUrl:Y}=await j(J,X,K),V=B(await J.evaluate(H({PUBLIC_ID:Q,DECO:W},String.raw`
|
|
124
|
+
const r = await voyagerGet('/identity/dash/profiles?q=memberIdentity&memberIdentity=' + encodeURIComponent(PUBLIC_ID) + '&decorationId=' + DECO);
|
|
125
|
+
if (!r.ok) return { ok: false, auth: r.auth || false, status: r.status || 0 };
|
|
126
|
+
const byUrn = indexIncluded(r.json);
|
|
127
|
+
const profile = pickType(byUrn, 'identity.profile.Profile')[0] || null;
|
|
128
|
+
return { ok: !!profile, profileUrn: profile ? profile.entityUrn : '' };
|
|
129
|
+
`)));if(V?.auth)throw new Z("linkedin.com",`LinkedIn ${K} requires an active signed-in browser session`);if(!V?.ok||!V?.profileUrn)throw new $(`LinkedIn ${K}: could not resolve profile urn (HTTP ${V?.status||"?"})`);const M=B(await J.evaluate(H({PROFILE_URN:V.profileUrn,DECO:y},String.raw`
|
|
130
|
+
const r = await voyagerGet('/identity/dash/profilePositionGroups?q=viewee&profileUrn=' + encodeURIComponent(PROFILE_URN) + '&decorationId=' + DECO);
|
|
131
|
+
if (!r.ok) return { ok: false, auth: r.auth || false, status: r.status || 0 };
|
|
132
|
+
const byUrn = indexIncluded(r.json);
|
|
133
|
+
// data 本身是 positionGroups 的 CollectionResponse,*elements 有序。
|
|
134
|
+
const data = (r.json && r.json.data) || {};
|
|
135
|
+
const groupUrns = collElements(byUrn, data['*elements'] || data.elements);
|
|
136
|
+
const rows = [];
|
|
137
|
+
for (const pgUrn of groupUrns) {
|
|
138
|
+
const pg = byUrn[pgUrn];
|
|
139
|
+
if (!pg) continue;
|
|
140
|
+
const groupCompany = norm(pg.companyName);
|
|
141
|
+
for (const posUrn of collElements(byUrn, pg['*profilePositionInPositionGroup'])) {
|
|
142
|
+
const p = byUrn[posUrn];
|
|
143
|
+
if (!p) continue;
|
|
144
|
+
const dr = dateRangeParts(p.dateRange);
|
|
145
|
+
rows.push({
|
|
146
|
+
title: norm(p.title),
|
|
147
|
+
company: norm(p.companyName || groupCompany),
|
|
148
|
+
location: norm(p.locationName || p.geoLocationName),
|
|
149
|
+
description: norm(p.description),
|
|
150
|
+
dateRange: dr.dateRange, startDate: dr.startDate, endDate: dr.endDate,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return { ok: true, rows };
|
|
155
|
+
`)));if(M?.auth)throw new Z("linkedin.com",`LinkedIn ${K} requires an active signed-in browser session`);if(!M?.ok)throw new $(`LinkedIn ${K}: positionGroups API returned HTTP ${M?.status||"?"}`);return{rows:Array.isArray(M.rows)?M.rows:[],profileUrl:Y,publicId:Q}}export async function fetchProjects(J,X,K){const{profileUrl:Q}=await j(J,X,K),Y=B(await J.evaluate(H({DECO:W},String.raw`
|
|
156
|
+
const path = String(location.pathname || '').match(/^\/in\/([^/?#]+)/);
|
|
157
|
+
const pid = path ? decodeURIComponent(path[1]) : '';
|
|
158
|
+
const r = await voyagerGet('/identity/dash/profiles?q=memberIdentity&memberIdentity=' + encodeURIComponent(pid) + '&decorationId=' + DECO);
|
|
159
|
+
if (!r.ok) return { ok: false, auth: r.auth || false, status: r.status || 0 };
|
|
160
|
+
const byUrn = indexIncluded(r.json);
|
|
161
|
+
const profile = pickType(byUrn, 'identity.profile.Profile')[0] || null;
|
|
162
|
+
return { ok: !!profile, profileUrn: profile ? profile.entityUrn : '' };
|
|
163
|
+
`)));if(Y?.auth)throw new Z("linkedin.com",`LinkedIn ${K} requires an active signed-in browser session`);if(!Y?.ok||!Y?.profileUrn)throw new $(`LinkedIn ${K}: could not resolve profile urn (HTTP ${Y?.status||"?"})`);const V=B(await J.evaluate(H({PROFILE_URN:Y.profileUrn},String.raw`
|
|
164
|
+
const r = await voyagerGet('/identity/dash/profileProjects?q=viewee&profileUrn=' + encodeURIComponent(PROFILE_URN) + '&count=50');
|
|
165
|
+
if (!r.ok) return { ok: false, auth: r.auth || false, status: r.status || 0 };
|
|
166
|
+
const byUrn = indexIncluded(r.json);
|
|
167
|
+
const projects = pickType(byUrn, 'identity.profile.Project');
|
|
168
|
+
const data = (r.json && r.json.data) || {};
|
|
169
|
+
const ordered = collElements(byUrn, data['*elements'] || data.elements);
|
|
170
|
+
const list = ordered.length ? ordered.map((u) => byUrn[u]).filter(Boolean) : projects;
|
|
171
|
+
const rows = list.map((p) => {
|
|
172
|
+
const dr = dateRangeParts(p.dateRange || p.timePeriod);
|
|
173
|
+
return {
|
|
174
|
+
title: norm(p.title), description: norm(p.description),
|
|
175
|
+
dateRange: dr.dateRange, startDate: dr.startDate, endDate: dr.endDate,
|
|
176
|
+
};
|
|
177
|
+
});
|
|
178
|
+
return { ok: true, rows };
|
|
179
|
+
`)));if(V?.auth)throw new Z("linkedin.com",`LinkedIn ${K} requires an active signed-in browser session`);if(!V?.ok)throw new $(`LinkedIn ${K}: profileProjects API returned HTTP ${V?.status||"?"}`);return{rows:Array.isArray(V.rows)?V.rows:[],profileUrl:Q}}export async function fetchSelfAnalytics(J,X){await J.goto("https://www.linkedin.com/feed/");await J.wait(2);if(B(await J.evaluate(String.raw`(() => /linkedin\.com\/(?:login|checkpoint|authwall|uas)/i.test(location.href) || Boolean(document.querySelector('input[name="session_key"]')))()`)))throw new Z("linkedin.com",`LinkedIn ${X} requires an active signed-in browser session`);const Q=B(await J.evaluate(H({DECO:W},String.raw`
|
|
180
|
+
const result = { profile_views: '', search_appearances: '', followers: '', connections: '' };
|
|
181
|
+
// 资料浏览量 / 搜索出现次数
|
|
182
|
+
const wvmp = await voyagerGet('/identity/wvmpCards');
|
|
183
|
+
if (wvmp.auth) return { ok: false, auth: true };
|
|
184
|
+
if (wvmp.ok) {
|
|
185
|
+
const byUrn = indexIncluded(wvmp.json);
|
|
186
|
+
for (const card of pickType(byUrn, 'wvmpOverview.WvmpViewersCard').concat(Object.values(byUrn))) {
|
|
187
|
+
const raw = card && card.value;
|
|
188
|
+
const val = typeof raw === 'string' ? (() => { try { return JSON.parse(raw); } catch (e) { return null; } })() : raw;
|
|
189
|
+
const insights = val && val.insightCards;
|
|
190
|
+
if (!Array.isArray(insights)) continue;
|
|
191
|
+
for (const ic of insights) {
|
|
192
|
+
const v = ic && ic.value;
|
|
193
|
+
if (v && v.numViews != null && result.profile_views === '') result.profile_views = String(v.numViews);
|
|
194
|
+
if (v && v.numSearchAppearances != null && result.search_appearances === '') result.search_appearances = String(v.numSearchAppearances);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// 人脉数
|
|
199
|
+
const cs = await voyagerGet('/relationships/connectionsSummary');
|
|
200
|
+
if (cs.ok) {
|
|
201
|
+
const n = cs.json && cs.json.data && cs.json.data.numConnections;
|
|
202
|
+
if (n != null) result.connections = String(n);
|
|
203
|
+
}
|
|
204
|
+
// 粉丝数:本人 FullProfile 的 followingState.followerCount
|
|
205
|
+
const meRes = await voyagerGet('/me');
|
|
206
|
+
const publicId = meRes.ok && meRes.json && meRes.json.included
|
|
207
|
+
? (meRes.json.included.find((e) => typeOf(e).endsWith('MiniProfile')) || {}).publicIdentifier
|
|
208
|
+
: '';
|
|
209
|
+
if (publicId) {
|
|
210
|
+
const pr = await voyagerGet('/identity/dash/profiles?q=memberIdentity&memberIdentity=' + encodeURIComponent(publicId) + '&decorationId=' + DECO);
|
|
211
|
+
if (pr.ok) {
|
|
212
|
+
const byUrn = indexIncluded(pr.json);
|
|
213
|
+
const fs = pickType(byUrn, 'FollowingState')[0];
|
|
214
|
+
if (fs && fs.followerCount != null) result.followers = String(fs.followerCount);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return { ok: true, result };
|
|
218
|
+
`)));if(Q?.auth)throw new Z("linkedin.com",`LinkedIn ${X} requires an active signed-in browser session`);if(!Q?.ok)throw new $(`LinkedIn ${X}: analytics API unavailable`);return Q.result}export const __test__={normalizeProfileInputUrl,DECO_FULL_PROFILE:W,DECO_POSITION_GROUPS:y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as Q,Strategy as T}from"@jackwener/opencli/registry";import{CommandExecutionError as V,EmptyResultError as X}from"@jackwener/opencli/errors";import{normalizeWhitespace as A}from"./shared.js";import{fetchExperience as Y,normalizeProfileInputUrl as Z}from"./profile-api.js";function L(q,F,G,H){const B=A(q.title);return{rank:F+1,total_count:G,title:B,employment_type:"",company:A(q.company),date_range:A(q.dateRange),start_date:A(q.startDate),end_date:A(q.endDate),location:A(q.location),location_type:"",description:A(q.description),skills:"",media:"",urls:"",skill_url:"",media_url:"",profile_url:H,raw_text:[B,A(q.company),A(q.dateRange),A(q.location),A(q.description)].filter(Boolean).join(" | ")}}Q({site:"linkedin",name:"profile-experience",access:"read",description:"Read LinkedIn profile experience entries via the Voyager API: titles, companies, dates, locations, and descriptions",domain:"www.linkedin.com",strategy:T.COOKIE,browser:!0,args:[{name:"profile-url",type:"string",required:!1,help:"LinkedIn /in/<handle>/ profile URL. Defaults to /in/me/."}],columns:["rank","total_count","title","employment_type","company","date_range","start_date","end_date","location","location_type","description","skills","media","urls","skill_url","media_url","profile_url","raw_text"],func:async(q,F)=>{if(!q)throw new V("Browser session required for linkedin profile-experience");const G=Z(F["profile-url"],"profile-experience"),{rows:H,profileUrl:B}=await Y(q,G,"profile-experience"),J=H.filter((K)=>A(K.title));if(J.length===0)throw new X("linkedin profile-experience","No LinkedIn profile experience entries were returned by the Voyager API.");return J.map((K,N)=>L(K,N,J.length,B))}});export const __test__={buildRow:L};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as M,Strategy as N}from"@jackwener/opencli/registry";import{CommandExecutionError as O,EmptyResultError as Q}from"@jackwener/opencli/errors";import{normalizeWhitespace as A}from"./shared.js";import{fetchProjects as T,normalizeProfileInputUrl as V}from"./profile-api.js";function J(q,D,F){const B=A(q.title);return{rank:D+1,title:B,date_range:A(q.dateRange),associated_with:"",description:A(q.description),skills:"",media:"",urls:"",profile_url:F,raw_text:[B,A(q.dateRange),A(q.description)].filter(Boolean).join(" | ")}}M({site:"linkedin",name:"profile-projects",access:"read",description:"Read LinkedIn profile projects via the Voyager API: titles, dates, and descriptions",domain:"www.linkedin.com",strategy:N.COOKIE,browser:!0,args:[{name:"profile-url",type:"string",required:!1,help:"LinkedIn /in/<handle>/ profile URL. Defaults to /in/me/."}],columns:["rank","title","date_range","associated_with","description","skills","media","urls","profile_url","raw_text"],func:async(q,D)=>{if(!q)throw new O("Browser session required for linkedin profile-projects");const F=V(D["profile-url"],"profile-projects"),{rows:B,profileUrl:K}=await T(q,F,"profile-projects"),H=B.filter((G)=>A(G.title));if(H.length===0)throw new Q("linkedin profile-projects","No LinkedIn profile projects were returned by the Voyager API.");return H.map((G,L)=>J(G,L,K))}});export const __test__={buildRow:J};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{cli as $,Strategy as v}from"@jackwener/opencli/registry";import{CommandExecutionError as N}from"@jackwener/opencli/errors";import{compactRepeatedText as Q,normalizeWhitespace as A}from"./shared.js";import{fetchFullProfile as D,normalizeProfileInputUrl as F}from"./profile-api.js";function V(q){const B=[A(q.title),A(q.company)].filter(Boolean).join(" — "),G=[A(q.location),A(q.dateRange)].filter(Boolean).join(" · ");return[B,G].filter(Boolean).join(" (")+(G?")":"")}function X(q){const B=A(q.school),H=[[A(q.degree),A(q.field)].filter(Boolean).join(", "),A(q.dateRange)].filter(Boolean).join(" · ");return[B,H].filter(Boolean).join(" (")+(H?")":"")}$({site:"linkedin",name:"profile-read",access:"read",description:"Read LinkedIn profile sections via the Voyager API: name, headline, location, About, experience, and education",domain:"www.linkedin.com",strategy:v.COOKIE,browser:!0,args:[{name:"profile-url",type:"string",required:!1,help:"LinkedIn /in/<handle>/ profile URL. Defaults to /in/me/."}],columns:["profile_url","name","headline","location","about","about_character_count","about_skills","experience","education","services","featured"],func:async(q,B)=>{if(!q)throw new N("Browser session required for linkedin profile-read");const G=F(B["profile-url"],"profile-read"),H=await D(q,G,"profile-read"),{profile:J,positions:Y,educations:Z}=H,K=Q([J.firstName,J.lastName].filter(Boolean).join(" "));if(!K)throw new N("LinkedIn profile-read could not find a profile name");const L=A(J.summary);return[{profile_url:H.profileUrl,name:K,headline:Q(J.headline),location:A(J.location),about:L,about_character_count:`${L.length}/2,600`,about_skills:"",experience:Y.map(V).filter(Boolean).join(`
|
|
2
|
+
`),education:Z.map(X).filter(Boolean).join(`
|
|
3
|
+
`),services:"",featured:""}]}});export const __test__={fmtPosition:V,fmtEducation:X};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as b,Strategy as q}from"@jackwener/opencli/registry";import{ArgumentError as W,AuthRequiredError as v,CommandExecutionError as Y}from"@jackwener/opencli/errors";import{assertLinkedInAuthenticated as z,LINKEDIN_DOMAIN as Z,unwrapEvaluateResult as K}from"./shared.js";import{buildCommentScript as k,NORM_COMMENT_DECORATION as w,normalizeCommentUrn as y}from"./social-api.js";const Q=1250;b({site:"linkedin",name:"reply",access:"write",description:"Reply to a comment on a LinkedIn post via the Voyager API. Dry-run by default; pass --send true to actually publish. The comment urn comes from `linkedin post-comments`.",domain:Z,strategy:q.COOKIE,browser:!0,args:[{name:"comment",type:"string",required:!0,positional:!0,help:"The comment to reply to: a comment_urn from `linkedin post-comments` (urn:li:comment:(activity:…,…) or urn:li:fsd_comment:(…))."},{name:"text",type:"string",required:!0,help:`Reply body (max ${Q} chars).`},{name:"send",type:"bool",required:!1,default:!1,help:"Actually post the reply. Default false = dry-run (validates the session only; nothing is posted)."}],columns:["status","parent_comment_urn","reply_urn","text_chars"],func:async(F,G)=>{if(!F)throw new Y("Browser session required for linkedin reply");const J=y(G?.comment),B=String(G?.text??"").replace(/ /g," ").trim();if(!B)throw new W("--text is required");if(B.length>Q)throw new W(`--text must be ${Q} characters or fewer (got ${B.length})`);const $=G?.send===!0||G?.send==="true",P=J.match(/urn:li:comment:\((activity|ugcPost):(\d+),/),V=P?`urn:li:${P[1]}:${P[2]}`:"";await F.goto(V?`https://www.linkedin.com/feed/update/${V}/`:"https://www.linkedin.com/feed/");await F.wait(2);if(!$){await z(F,"LinkedIn reply");return[{status:"dry_run",parent_comment_urn:J,reply_urn:"(not posted — pass --send true to publish)",text_chars:B.length}]}const f=K(await F.evaluate(k({threadUrn:J,text:B,decorationId:w})));if(!f?.ok){if(f?.stage==="auth"||f?.httpStatus===401||f?.httpStatus===403)throw new v(Z,`LinkedIn reply requires an active signed-in LinkedIn browser session (${f?.error||"auth"}).`);throw new Y(`LinkedIn reply failed: stage=${f?.stage||"unknown"} http=${f?.httpStatus||"?"} ${f?.error||""}`.trim())}return[{status:"replied",parent_comment_urn:J,reply_urn:f.commentUrn||"",text_chars:B.length}]}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as $,Strategy as b}from"@jackwener/opencli/registry";import{ArgumentError as z,AuthRequiredError as P,CommandExecutionError as W}from"@jackwener/opencli/errors";import{assertLinkedInAuthenticated as Q,LINKEDIN_DOMAIN as Y,unwrapEvaluateResult as q}from"./shared.js";import{buildRepostScript as x,normalizeThreadUrn as K,REPOST_CREATE_QID as k}from"./social-api.js";const J=3000;$({site:"linkedin",name:"repost",access:"write",description:"Repost (reshare) a LinkedIn post to your own feed via the Voyager API. Plain repost by default; pass --text to quote-repost with your commentary. Dry-run unless --send true.",domain:Y,strategy:b.COOKIE,browser:!0,args:[{name:"post",type:"string",required:!0,positional:!0,help:"Post to repost: a LinkedIn post URL (…/feed/update/… or …/posts/…) or a raw urn:li:activity:… / urn:li:ugcPost:… urn."},{name:"text",type:"string",required:!1,help:`Optional commentary to quote-repost with (max ${J} chars). Omit for a plain repost.`},{name:"send",type:"bool",required:!1,default:!1,help:"Actually repost. Default false = dry-run (validates the session only; nothing is posted)."}],columns:["status","shared_urn","repost_urn","quote"],func:async(B,F)=>{if(!B)throw new W("Browser session required for linkedin repost");const V=K(F?.post),G=String(F?.text??"").replace(/ /g," ").trim();if(G.length>J)throw new z(`--text must be ${J} characters or fewer (got ${G.length})`);const Z=F?.send===!0||F?.send==="true";await B.goto("https://www.linkedin.com/feed/");await B.wait(2);if(!Z){await Q(B,"LinkedIn repost");return[{status:"dry_run",shared_urn:V,repost_urn:"(not posted — pass --send true to repost)",quote:G?"yes":""}]}const f=q(await B.evaluate(x({activityUrn:V,commentary:G,repostQid:k})));if(!f?.ok){if(f?.stage==="auth"||f?.httpStatus===401||f?.httpStatus===403)throw new P(Y,`LinkedIn repost requires an active signed-in LinkedIn browser session (${f?.error||"auth"}).`);throw new W(`LinkedIn repost failed: stage=${f?.stage||"unknown"} http=${f?.httpStatus||"?"} ${f?.error||""}`.trim())}return[{status:"reposted",shared_urn:f.shared_urn||"",repost_urn:f.repost_urn||"",quote:f.quote?"yes":""}]}});
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import{cli as U,Strategy as v}from"@jackwener/opencli/registry";import{ArgumentError as q,AuthRequiredError as f,CommandExecutionError as X}from"@jackwener/opencli/errors";import{createHash as N}from"node:crypto";const P="www.linkedin.com";function O(j){return String(j??"").replace(/[\u00a0\u202f]/g," ").replace(/\s+/g," ").trim()}function Y(j){if(j&&typeof j==="object"&&"data"in j&&"session"in j)return j.data;return j}function _(j){return O(j).replace(/\s*[•·]\s*(?:1st|2nd|3rd\+?|degree connection).*$/i,"").replace(/\s+LinkedIn.*$/i,"").toLowerCase()}function T(j){const G=String(j||"").toLowerCase();return G==="linkedin.com"||G.endsWith(".linkedin.com")}function B(j){const G=O(j);if(!G)return"";try{const D=new URL(G);if(D.protocol!=="https:"||D.username||D.password||D.port||!T(D.hostname))return"";const J=D.pathname.match(/^\/messaging\/thread\/([^/]+)\/?$/i);if(!J||!J[1])return"";D.hostname="www.linkedin.com";D.hash="";D.search="";if(!D.pathname.endsWith("/"))D.pathname+="/";return D.toString()}catch{return""}}function w(j){return N("sha256").update(O(j)).digest("hex")}function z(j,G){const D=O(j).toLowerCase(),J=O(G).toLowerCase();return!J||D.includes(J)}function C(j){return/\r|\n/.test(String(j??""))}function y(j,G){const D=_(G),J=(Array.isArray(j)?j:[]).map(O).filter(Boolean);return J.find((V)=>_(V)===D)||J[0]||""}function A(j,G){const D=O(G.expectedName),J=y(j?.headerNames,D),V=B(G.threadUrl),K=B(j?.url||""),Z=String(j?.bodyText||"");if(j?.authRequired)return{ok:!1,blockReason:"auth_required",expectedValue:D,actualValue:J,observedUrl:K};if(j?.searchFailure||/we didn't find anything|no results found|no results for/i.test(Z))return{ok:!1,blockReason:"search_failure_visible",expectedValue:D,actualValue:J,observedUrl:K};if(V&&K&&V!==K)return{ok:!1,blockReason:"thread_url_mismatch",expectedValue:V,actualValue:K,observedUrl:K};if(!J||_(J)!==_(D))return{ok:!1,blockReason:"recipient_header_mismatch",expectedValue:D,actualValue:J,observedUrl:K};if(!j?.composerFound)return{ok:!1,blockReason:"composer_not_found",expectedValue:D,actualValue:J,observedUrl:K};const Q=O(G.expectedLastHash);if(Q&&Q!==j?.latestMessageHash)return{ok:!1,blockReason:"latest_message_mismatch",expectedValue:Q,actualValue:j?.latestMessageHash||"",observedUrl:K};const W=O(G.expectedLastText);if(W&&!z(Z,W))return{ok:!1,blockReason:"latest_message_mismatch",expectedValue:W,actualValue:"",observedUrl:K};return{ok:!0,blockReason:"verified",expectedValue:D,actualValue:J,observedUrl:K}}function S(j,G,D=G){const J=O(j[G]);if(!J)throw new q(`${D} is required`);return J}function L(j,G,D=G){const J=String(j[G]??"");if(!O(J))throw new q(`${D} is required`);return J}function b(j,G){const D=B(j);if(!D)throw new q(`${G} must be an exact https://www.linkedin.com/messaging/thread/<id>/ URL`);return D}function h(){return String.raw`(() => {
|
|
2
|
+
const marker = '__OPENCLI_LINKEDIN_PROBE__';
|
|
3
|
+
void marker;
|
|
4
|
+
const clean = (s) => String(s || '').replace(/[\u00a0\u202f]/g, ' ').replace(/\s+/g, ' ').trim();
|
|
5
|
+
const text = document.body ? (document.body.innerText || '') : '';
|
|
6
|
+
const lower = text.toLowerCase();
|
|
7
|
+
const authRequired = /\b(sign in|log in|join linkedin)\b/i.test(text)
|
|
8
|
+
|| /linkedin\.com\/(login|checkpoint|authwall)/i.test(location.href)
|
|
9
|
+
|| /captcha|verification required/i.test(text);
|
|
10
|
+
const searchFailure = /we didn't find anything|no results found|no results for/i.test(text);
|
|
11
|
+
|
|
12
|
+
const headerCandidates = [];
|
|
13
|
+
const selectors = [
|
|
14
|
+
'.msg-thread__link-to-profile',
|
|
15
|
+
'.msg-thread__link-to-profile span[aria-hidden="true"]',
|
|
16
|
+
'.msg-entity-lockup__entity-title',
|
|
17
|
+
'.msg-conversation-card__participant-names',
|
|
18
|
+
'main h1',
|
|
19
|
+
'main h2',
|
|
20
|
+
'[data-anonymize="person-name"]',
|
|
21
|
+
'a[href*="/in/"] span[aria-hidden="true"]',
|
|
22
|
+
'a[href*="/in/"]'
|
|
23
|
+
];
|
|
24
|
+
for (const selector of selectors) {
|
|
25
|
+
for (const el of Array.from(document.querySelectorAll(selector)).slice(0, 8)) {
|
|
26
|
+
const value = clean(el.innerText || el.textContent || el.getAttribute('aria-label'));
|
|
27
|
+
if (value && value.length <= 120 && !/^(message|messaging|send|profile|view profile)$/i.test(value)) {
|
|
28
|
+
headerCandidates.push(value);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const composer = Array.from(document.querySelectorAll('[contenteditable="true"][role="textbox"], div.msg-form__contenteditable[contenteditable="true"], [aria-label*="Write a message" i]'))
|
|
34
|
+
.find((el) => !el.closest('[aria-hidden="true"]') && el.offsetParent !== null);
|
|
35
|
+
|
|
36
|
+
const messageText = Array.from(document.querySelectorAll('.msg-s-message-list__event, .msg-s-event-listitem, [data-event-urn], .msg-s-message-group__meta, .msg-s-message-list-content'))
|
|
37
|
+
.map((el) => clean(el.innerText || el.textContent))
|
|
38
|
+
.filter(Boolean)
|
|
39
|
+
.join('\n');
|
|
40
|
+
const sourceText = messageText || text;
|
|
41
|
+
const sourceLines = sourceText.split(/\n+/).map(clean).filter(Boolean);
|
|
42
|
+
const lastMeaningfulLine = [...sourceLines].reverse().find((line) => !/^(send|reply|write a message|press enter to send)$/i.test(line)) || '';
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
url: location.href,
|
|
46
|
+
title: document.title || '',
|
|
47
|
+
headerNames: Array.from(new Set(headerCandidates)).slice(0, 10),
|
|
48
|
+
bodyText: text,
|
|
49
|
+
composerFound: Boolean(composer),
|
|
50
|
+
composerText: composer ? clean(composer.innerText || composer.textContent) : '',
|
|
51
|
+
authRequired,
|
|
52
|
+
searchFailure,
|
|
53
|
+
latestMessageText: lastMeaningfulLine,
|
|
54
|
+
latestMessageHash: '',
|
|
55
|
+
};
|
|
56
|
+
})()`}function x(){return String.raw`(() => {
|
|
57
|
+
const marker = '__OPENCLI_LINKEDIN_FOCUS_COMPOSER__';
|
|
58
|
+
void marker;
|
|
59
|
+
const clean = (s) => String(s || '').replace(/[\u00a0\u202f]/g, ' ').replace(/\s+/g, ' ').trim();
|
|
60
|
+
const composer = Array.from(document.querySelectorAll('[contenteditable="true"][role="textbox"], div.msg-form__contenteditable[contenteditable="true"], [aria-label*="Write a message" i]'))
|
|
61
|
+
.find((el) => !el.closest('[aria-hidden="true"]') && el.offsetParent !== null);
|
|
62
|
+
if (!composer) return { ok: false, error: 'composer_not_found', composerText: '' };
|
|
63
|
+
composer.focus();
|
|
64
|
+
composer.innerHTML = '';
|
|
65
|
+
composer.dispatchEvent(new InputEvent('input', { bubbles: true, inputType: 'deleteContentBackward', data: null }));
|
|
66
|
+
return { ok: true, composerText: clean(composer.innerText || composer.textContent) };
|
|
67
|
+
})()`}function i(){return String.raw`(() => {
|
|
68
|
+
const marker = '__OPENCLI_LINKEDIN_READ_COMPOSER__';
|
|
69
|
+
void marker;
|
|
70
|
+
const clean = (s) => String(s || '').replace(/[\u00a0\u202f]/g, ' ').replace(/\s+/g, ' ').trim();
|
|
71
|
+
const composer = Array.from(document.querySelectorAll('[contenteditable="true"][role="textbox"], div.msg-form__contenteditable[contenteditable="true"], [aria-label*="Write a message" i]'))
|
|
72
|
+
.find((el) => !el.closest('[aria-hidden="true"]') && el.offsetParent !== null);
|
|
73
|
+
return { ok: Boolean(composer), composerText: composer ? clean(composer.innerText || composer.textContent) : '' };
|
|
74
|
+
})()`}function k(j){return`(() => {
|
|
75
|
+
const marker = '__OPENCLI_LINKEDIN_FILL_COMPOSER_MULTILINE__';
|
|
76
|
+
void marker;
|
|
77
|
+
const message = ${JSON.stringify(String(j??""))};
|
|
78
|
+
const normalize = (s) => String(s || '').replace(/[\\u00a0\\u202f]/g, ' ').replace(/\\s+/g, ' ').trim();
|
|
79
|
+
const composer = Array.from(document.querySelectorAll('[contenteditable="true"][role="textbox"], div.msg-form__contenteditable[contenteditable="true"], [aria-label*="Write a message" i]'))
|
|
80
|
+
.find((el) => !el.closest('[aria-hidden="true"]') && el.offsetParent !== null);
|
|
81
|
+
if (!composer) return { ok: false, error: 'composer_not_found', composerText: '', method: '' };
|
|
82
|
+
|
|
83
|
+
const setDomMultiline = () => {
|
|
84
|
+
composer.innerHTML = '';
|
|
85
|
+
const normalized = message.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');
|
|
86
|
+
const lines = normalized.split('\\n');
|
|
87
|
+
lines.forEach((line, index) => {
|
|
88
|
+
if (index > 0) composer.appendChild(document.createElement('br'));
|
|
89
|
+
if (line) composer.appendChild(document.createTextNode(line));
|
|
90
|
+
});
|
|
91
|
+
composer.dispatchEvent(new InputEvent('beforeinput', {
|
|
92
|
+
bubbles: true,
|
|
93
|
+
cancelable: true,
|
|
94
|
+
inputType: 'insertFromPaste',
|
|
95
|
+
data: message,
|
|
96
|
+
}));
|
|
97
|
+
composer.dispatchEvent(new InputEvent('input', {
|
|
98
|
+
bubbles: true,
|
|
99
|
+
inputType: 'insertFromPaste',
|
|
100
|
+
data: message,
|
|
101
|
+
}));
|
|
102
|
+
return { method: 'dom_multiline' };
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
composer.focus();
|
|
106
|
+
composer.innerHTML = '';
|
|
107
|
+
composer.dispatchEvent(new InputEvent('input', { bubbles: true, inputType: 'deleteContentBackward', data: null }));
|
|
108
|
+
|
|
109
|
+
let method = 'dom_multiline';
|
|
110
|
+
try {
|
|
111
|
+
if (typeof DataTransfer !== 'undefined' && typeof ClipboardEvent !== 'undefined') {
|
|
112
|
+
const data = new DataTransfer();
|
|
113
|
+
data.setData('text/plain', message);
|
|
114
|
+
const paste = new ClipboardEvent('paste', {
|
|
115
|
+
clipboardData: data,
|
|
116
|
+
bubbles: true,
|
|
117
|
+
cancelable: true,
|
|
118
|
+
});
|
|
119
|
+
composer.dispatchEvent(paste);
|
|
120
|
+
method = 'paste_event';
|
|
121
|
+
}
|
|
122
|
+
} catch {
|
|
123
|
+
method = 'dom_multiline';
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (normalize(composer.innerText || composer.textContent) !== normalize(message)) {
|
|
127
|
+
method = setDomMultiline().method;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const brCount = composer.querySelectorAll('br').length;
|
|
131
|
+
const childBlockCount = Array.from(composer.children).filter((el) => {
|
|
132
|
+
const tag = String(el.tagName || '').toLowerCase();
|
|
133
|
+
return tag === 'br' || tag === 'div' || tag === 'p';
|
|
134
|
+
}).length;
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
ok: normalize(composer.innerText || composer.textContent) === normalize(message),
|
|
138
|
+
composerText: composer.innerText || composer.textContent || '',
|
|
139
|
+
method,
|
|
140
|
+
renderedBreaks: brCount + childBlockCount,
|
|
141
|
+
};
|
|
142
|
+
})()`}function n(){return String.raw`(() => {
|
|
143
|
+
const marker = '__OPENCLI_LINKEDIN_CLICK_SEND__';
|
|
144
|
+
void marker;
|
|
145
|
+
const buttons = Array.from(document.querySelectorAll('button'));
|
|
146
|
+
const send = buttons.find((button) => {
|
|
147
|
+
const text = (button.innerText || button.textContent || button.getAttribute('aria-label') || '').trim().toLowerCase();
|
|
148
|
+
return text === 'send' || text === 'send message';
|
|
149
|
+
});
|
|
150
|
+
if (!send) return { ok: false, error: 'send_button_not_found', sent: false };
|
|
151
|
+
if (send.disabled || send.getAttribute('aria-disabled') === 'true') return { ok: false, error: 'send_button_disabled', sent: false };
|
|
152
|
+
send.click();
|
|
153
|
+
return { ok: true, sent: true };
|
|
154
|
+
})()`}async function F(j){const G=Y(await j.evaluate(h())),D=O(G?.latestMessageText||"");return{...G||{},latestMessageText:D,latestMessageHash:D?w(D):""}}async function m(j,G){if(!C(G)){await j.insertText(G);return{method:"insert_text",renderedBreaks:0}}const D=Y(await j.evaluate(k(G)));if(D?.ok)return{method:D.method||"dom_multiline",renderedBreaks:Number(D.renderedBreaks||0)};await j.insertText(G);return{method:"insert_text_fallback",renderedBreaks:0}}U({site:"linkedin",name:"safe-send",access:"write",description:"Fail-closed LinkedIn message sender that verifies exact thread, recipient, and latest message before filling/sending",domain:P,strategy:v.UI,browser:!0,args:[{name:"thread-url",required:!0,help:"Exact LinkedIn messaging thread URL to open and verify"},{name:"expected-name",required:!0,help:"Expected visible recipient name in the active thread header"},{name:"message",required:!0,help:"Message body to send or dry-run"},{name:"expected-last-text",help:"Substring expected in the currently visible latest conversation context"},{name:"expected-last-hash",help:"SHA-256 hash of expected latest visible message text"},{name:"send",type:"bool",default:!1,help:"Actually click Send. Default is dry-run verification only."},{name:"screenshot",type:"bool",default:!1,help:"Capture a screenshot during verification"}],columns:["status","recipient","reason","thread_url","message_chars","screenshot"],func:async(j,G)=>{if(!j)throw new X("Browser session required for linkedin safe-send");const D=b(S(G,"thread-url","--thread-url"),"--thread-url"),J=S(G,"expected-name","--expected-name"),V=L(G,"message","--message");await j.goto("https://www.linkedin.com/messaging/");await j.wait(4);await j.goto(D);await j.wait(12);let K=await F(j);const Z=O(G["expected-last-text"]);for(let $=0;Z&&$<6&&!z(K.bodyText,Z);$+=1){await j.wait(2);K=await F(j)}const Q=A(K,{expectedName:J,threadUrl:D,expectedLastText:G["expected-last-text"],expectedLastHash:G["expected-last-hash"]});if(Q.blockReason==="auth_required")throw new f(P,"LinkedIn safe-send requires an active signed-in LinkedIn browser session.");if(!Q.ok){const $=[`Expected ${Q.expectedValue}; actual ${Q.actualValue||"not_visible"} at ${Q.observedUrl||"url_not_available"}`,`Observed headers: ${(K.headerNames||[]).join(" | ")||"no_visible_headers"}`,`Title: ${K.title||"title_not_available"}`,`Body: ${O(K.bodyText||"").slice(0,500)}`].join(`
|
|
155
|
+
`);throw new X(`LinkedIn safe-send blocked: ${Q.blockReason}`,$)}let W="";if(G.screenshot&&typeof j.screenshot==="function")W=await j.screenshot({fullPage:!1});if(!G.send)return[{status:"verified_dry_run",recipient:Q.actualValue,reason:Q.blockReason,thread_url:Q.observedUrl,message_chars:V.length,screenshot:W?"captured":""}];const H=Y(await j.evaluate(x()));if(!H?.ok)throw new X(`LinkedIn safe-send blocked: ${H?.error||"composer_focus_failed"}`);await m(j,V);await j.wait(0.6+Math.random()*0.8);const I=Y(await j.evaluate(i()));if(!I?.ok||O(I.composerText)!==O(V))throw new X("LinkedIn safe-send blocked: composer_text_mismatch",`Composer text did not exactly match intended message for ${J}.`);const E=await F(j),R=A(E,{expectedName:J,threadUrl:D,expectedLastText:G["expected-last-text"],expectedLastHash:G["expected-last-hash"]});if(!R.ok)throw new X(`LinkedIn safe-send blocked after fill: ${R.blockReason}`);const M=Y(await j.evaluate(n()));if(!M?.ok||!M.sent)throw new X(`LinkedIn safe-send blocked: ${M?.error||"send_click_failed"}`);await j.wait(0.8+Math.random()*1.2);return[{status:"sent",recipient:Q.actualValue,reason:Q.blockReason,thread_url:Q.observedUrl,message_chars:V.length,screenshot:W?"captured":""}]}});export const __test__={normalizeWhitespace:O,unwrapEvaluateResult:Y,normalizeName:_,canonicalizeLinkedInThreadUrl:B,hashText:w,hasLineBreaks:C,requireRawStringArg:L,buildFillComposerMultilineScript:k,assessThreadSafety:A};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{cli as y,Strategy as M}from"@jackwener/opencli/registry";import{ArgumentError as P,AuthRequiredError as z,CommandExecutionError as V,EmptyResultError as _}from"@jackwener/opencli/errors";const b="www.linkedin.com",L="https://www.linkedin.com/sales/inbox/",THREADS_BASE="https://www.linkedin.com/sales-api/salesApiMessagingThreads",O=20,F=40,W=500,THREAD_DECORATION="(id,restrictions,archived,unreadMessageCount,nextPageStartsAt,totalMessageCount,messages*(id,type,contentFlag,deliveredAt,lastEditedAt,subject,body,footerText,blockCopy,attachments,author,systemMessageContent),participants*~fs_salesProfile(entityUrn,firstName,lastName,fullName,degree,profilePictureDisplayImage,objectUrn,inmailRestriction))";export function normalizeWhitespace(Q){return String(Q??"").replace(/[\u00a0\u202f]/g," ").replace(/\s+/g," ").trim()}export function parseLimit(Q,Y=F){if(Q===void 0||Q===null||Q==="")return Y;const $=Number(Q);if(!Number.isInteger($)||$<1||$>W)throw new P(`--limit must be an integer between 1 and ${W}`);return $}function D(Q){if(Q&&typeof Q==="object"&&"data"in Q&&"session"in Q)return Q.data;return Q}export function encodeRestliDecoration(Q){return encodeURIComponent(Q).replace(/\(/g,"%28").replace(/\)/g,"%29")}function C(Q){return Q?`https://www.linkedin.com/sales/inbox/${encodeURIComponent(Q)}`:""}function j({count:Q=O,pageStartsAt:Y=""}={}){let $=`${THREADS_BASE}?decoration=${encodeRestliDecoration(THREAD_DECORATION)}&count=${Q}&filter=INBOX&q=filter`;if(Y)$+=`&pageStartsAt=${encodeURIComponent(Y)}`;return $}function N(Q){const Y=Q?.participantsResolutionResults||{};return(Array.isArray(Q?.participants)?Q.participants:Object.keys(Y)).map((q)=>Y[q]||{entityUrn:q}).filter(Boolean)}function v(Q){return String(Q?.degree??"").trim()==="0"}function R(Q){const Y=N(Q),$=Y.find((q)=>!v(q))||Y[0];return normalizeWhitespace($?.fullName||[$?.firstName,$?.lastName].filter(Boolean).join(" "))}function f(Q){if(!Q||typeof Q!=="object"||!Array.isArray(Q.elements))throw new V("Sales Navigator messaging threads API returned malformed payload");return Q.elements.map((Y)=>{if(!Y||typeof Y!=="object")throw new V("Sales Navigator messaging threads API returned malformed thread row");const $=Array.isArray(Y?.messages)?Y.messages:[],q=$[0]||{},k=Number(q.deliveredAt||Y?.nextPageStartsAt||0),J=normalizeWhitespace(Y?.id||"");if(!J)throw new V("Sales Navigator messaging thread row missing id");return{thread_id:J,thread_url:C(J),person_name:R(Y),last_message_snippet:normalizeWhitespace(q.body||q.subject||"").slice(0,300),last_activity_time:k?new Date(k).toISOString():"",unread:Number(Y?.unreadMessageCount||0)>0,unread_count:Number(Y?.unreadMessageCount||0),total_message_count:Number(Y?.totalMessageCount||$.length||0),archived:Boolean(Y?.archived),next_page_starts_at:normalizeWhitespace(Y?.nextPageStartsAt||""),participants:N(Y).map((G)=>({name:normalizeWhitespace(G.fullName||[G.firstName,G.lastName].filter(Boolean).join(" ")),entity_urn:normalizeWhitespace(G.entityUrn||""),object_urn:normalizeWhitespace(G.objectUrn||""),degree:normalizeWhitespace(G.degree??"")}))}})}function S(Q,Y){return String.raw`(async () => {
|
|
2
|
+
try {
|
|
3
|
+
const res = await fetch(${JSON.stringify(Q)}, {
|
|
4
|
+
credentials: 'include',
|
|
5
|
+
headers: {
|
|
6
|
+
'csrf-token': ${JSON.stringify(Y)},
|
|
7
|
+
'x-restli-protocol-version': '2.0.0',
|
|
8
|
+
accept: 'application/json',
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
const text = await res.text();
|
|
12
|
+
let json = null;
|
|
13
|
+
try { json = text ? JSON.parse(text) : null; } catch (_) { json = null; }
|
|
14
|
+
if (res.status === 401 || res.status === 403) return { authRequired: true, status: res.status, text };
|
|
15
|
+
if (!res.ok) return { error: 'HTTP ' + res.status, status: res.status, text, json };
|
|
16
|
+
return { status: res.status, json };
|
|
17
|
+
} catch (e) {
|
|
18
|
+
return { error: 'fetch failed: ' + ((e && e.message) || String(e)) };
|
|
19
|
+
}
|
|
20
|
+
})()`}export async function getCsrf(Q){const $=(await Q.getCookies({url:"https://www.linkedin.com"})).find((q)=>q.name==="JSESSIONID")?.value;if(!$)throw new z(b,"LinkedIn JSESSIONID cookie not found. Please sign in to LinkedIn.");return $.replace(/^\"|\"$/g,"")}export async function fetchSalesnavJson(Q,Y,$,q){const k=D(await Q.evaluate(S($,Y)));if(k?.authRequired)throw new z(b,`${q} authentication failed (HTTP ${k.status||"auth_required"}).`);if(k?.error||!k?.json)throw new V(`${q} returned an unexpected response`,`${k?.error||"no_json"}
|
|
21
|
+
${normalizeWhitespace(k?.text||"").slice(0,500)}`);return k.json}export async function fetchInboxRows(Q,{limit:Y=F,maxPages:$=30}={}){const q=await getCsrf(Q),k=[],J=new Set;let G="",X=0,U=!1;while(k.length<Y&&X<$){const K=await fetchSalesnavJson(Q,q,j({count:O,pageStartsAt:G}),"Sales Navigator messaging threads API");X+=1;const Z=f(K);if(Z.length===0)break;for(const H of Z){if(J.has(H.thread_id))continue;J.add(H.thread_id);k.push(H);if(k.length>=Y)break}const B=Z[Z.length-1]?.next_page_starts_at;U=Boolean(B);if(!B)break;if(B===G)throw new V("Sales Navigator messaging threads API returned the same cursor twice");G=B}if(k.length<Y&&U&&X>=$)throw new V(`Sales Navigator messaging threads API reached the ${$}-page safety cap before collecting ${Y} conversations`);return k.slice(0,Y).map((K,Z)=>({...K,rank:Z+1}))}export{THREAD_DECORATION,THREADS_BASE};y({site:"linkedin",name:"salesnav-inbox",access:"read",description:"List LinkedIn Sales Navigator message conversations with API pagination",domain:b,strategy:M.UI,browser:!0,args:[{name:"limit",type:"number",default:F,help:"Maximum conversations to return (1-500)"},{name:"max-pages",type:"number",default:30,help:"Maximum Sales Navigator API pages to fetch"},{name:"unread-only",type:"bool",default:!1,help:"Return only unread conversations"}],columns:["rank","thread_id","thread_url","person_name","last_message_snippet","last_activity_time","unread","unread_count","total_message_count","archived","participants","next_page_starts_at"],func:async(Q,Y)=>{if(!Q)throw new V("Browser session required for linkedin salesnav-inbox");const $=parseLimit(Y.limit),q=parseLimit(Y["max-pages"],30);await Q.goto(L);await Q.wait(4);let k=await fetchInboxRows(Q,{limit:$,maxPages:q});if(Y["unread-only"])k=k.filter((J)=>J.unread);if(k.length===0){if(Y["unread-only"])return[];throw new _("linkedin salesnav-inbox","No Sales Navigator conversations were found.")}return k.slice(0,$).map((J,G)=>({...J,rank:G+1}))}});export const __test__={THREAD_DECORATION,normalizeWhitespace,parseLimit,encodeRestliDecoration,salesnavThreadUrl:C,threadListUrl:j,parseSalesnavThreads:f,fetchInboxRows};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import{cli as E,Strategy as q}from"@jackwener/opencli/registry";import{ArgumentError as l,AuthRequiredError as b,CommandExecutionError as u}from"@jackwener/opencli/errors";const w="www.linkedin.com",J="https://www.linkedin.com/sales/",B="(entityUrn,objectUrn,firstName,lastName,fullName,headline,degree,inmailRestriction,memberBadges,defaultPosition)",k="https://www.linkedin.com/sales-api/salesApiCredits?q=findCreditGrant&creditGrantType=LSS_INMAIL",D="https://www.linkedin.com/sales-api/salesApiMessageActions?action=createMessage";function c(e){return String(e??"").replace(/[\u00a0\u202f]/g," ").replace(/\s+/g," ").trim()}function R(e,t,n=t){const r=c(e[t]);if(!r)throw new l(`${n} is required`);return r}function f(e){if(e&&typeof e==="object"&&"data"in e&&"session"in e)return e.data;return e}function G(e){const t=String(e||"").toLowerCase();return t==="linkedin.com"||t.endsWith(".linkedin.com")}function g(e){const t=c(e),n=t.match(/^urn:li:fs_salesProfile:\(([^,()]+),([^,()]+),([^,()]+)\)$/);if(!n)return null;if(!m(n[1],n[2],n[3]))return null;return{profileId:n[1],authType:n[2],authToken:n[3],entityUrn:t}}function m(e,t,n){return[e,t,n].every((r)=>{const i=c(r).toLowerCase();return i&&i!=="undefined"&&i!=="null"&&i!=="not_available"})}function N({profileId:e,authType:t,authToken:n}){return`https://www.linkedin.com/sales/lead/${encodeURIComponent(e)},${encodeURIComponent(t)},${encodeURIComponent(n)}`}function v(e){const t=c(e),n=g(t);if(n)return n;try{const r=new URL(t);if(r.protocol!=="https:"||r.username||r.password||r.port||!G(r.hostname))return null;const i=r.pathname.match(/^\/sales\/lead\/([^,/]+),([^,/]+),([^/]+)\/?$/i);if(i){const a=decodeURIComponent(i[1]),s=decodeURIComponent(i[2]),d=decodeURIComponent(i[3]);if(!m(a,s,d))return null;return{profileId:a,authType:s,authToken:d,entityUrn:`urn:li:fs_salesProfile:(${a},${s},${d})`}}const o=r.pathname.match(/^\/in\/([^/]+)\/?$/i);if(o)return{profileId:decodeURIComponent(o[1]),authType:"",authToken:"",entityUrn:""}}catch{return null}return null}function F(e){return encodeURIComponent(e).replace(/\(/g,"%28").replace(/\)/g,"%29")}function U(e){if(!e?.profileId||!e?.authType||!e?.authToken)return"";return`https://www.linkedin.com/sales-api/salesApiProfiles/${`(profileId:${e.profileId},authType:${e.authType},authToken:${e.authToken})`}?decoration=${F(B)}`}function H(){const e=new Uint8Array(8);if(globalThis.crypto?.getRandomValues)globalThis.crypto.getRandomValues(e);else for(let t=0;t<e.length;t+=1)e[t]=Math.floor(Math.random()*256);return Array.from(e,(t)=>t.toString(16).padStart(2,"0")).join("")}function T({recipientUrn:e,subject:t,body:n,trackingId:r=H(),copyToCrm:i=!1}){const o=c(e);if(!g(o))throw new l("--recipient must resolve to a Sales Navigator lead urn");const a=c(t),s=String(n??"").trim();if(!a)throw new l("--subject is required");if(!s)throw new l("--body is required");if(a.length>200)throw new l("--subject must be 200 characters or fewer");if(s.length>1900)throw new l("--body must be 1900 characters or fewer");return{createMessageRequest:{recipients:[o],subject:a,body:s,copyToCrm:Boolean(i),trackingId:r}}}function _(e){const n=(Array.isArray(e?.elements)?e.elements:[]).find((o)=>o?.type==="LSS_INMAIL"&&Number.isInteger(o.value));if(n)return n.value;const r=[],i=(o)=>{if(o===null||o===void 0)return;if(typeof o==="number"&&Number.isFinite(o))r.push(o);if(Array.isArray(o))o.forEach(i);else if(typeof o==="object"){for(const[a,s]of Object.entries(o))if(/remaining|available|balance|value/i.test(a)&&typeof s==="number")r.unshift(s);else if(!/^count$|^start$|^id$/i.test(a))i(s)}};i(e);return r.find((o)=>Number.isInteger(o)&&o>=0)??null}function p(e,t,n={}){return String.raw`(async () => {
|
|
2
|
+
const headers = {
|
|
3
|
+
'csrf-token': ${JSON.stringify(t)},
|
|
4
|
+
'x-restli-protocol-version': '2.0.0',
|
|
5
|
+
accept: ${JSON.stringify(n.accept||"application/json")},
|
|
6
|
+
...((${JSON.stringify(Boolean(n.body))}) ? { 'content-type': 'application/json' } : {}),
|
|
7
|
+
};
|
|
8
|
+
try {
|
|
9
|
+
const res = await fetch(${JSON.stringify(e)}, {
|
|
10
|
+
credentials: 'include',
|
|
11
|
+
method: ${JSON.stringify(n.method||"GET")},
|
|
12
|
+
headers,
|
|
13
|
+
body: ${n.body?JSON.stringify(JSON.stringify(n.body)):"undefined"},
|
|
14
|
+
});
|
|
15
|
+
const text = await res.text();
|
|
16
|
+
let json = null;
|
|
17
|
+
try { json = text ? JSON.parse(text) : null; } catch (_) { json = null; }
|
|
18
|
+
if (res.status === 401 || res.status === 403) return ['auth', res.status, json, text];
|
|
19
|
+
if (!res.ok) return ['error', res.status, json, text, 'HTTP ' + res.status];
|
|
20
|
+
return ['ok', res.status, json, text];
|
|
21
|
+
} catch (e) {
|
|
22
|
+
return ['error', 0, null, '', 'fetch failed: ' + ((e && e.message) || String(e))];
|
|
23
|
+
}
|
|
24
|
+
})()`}function h(e,t,{requireJson:n=!0}={}){if(Array.isArray(e)){const[r,i,o,a,s]=e;e={authRequired:r==="auth",error:r==="error"?s||`HTTP ${i}`:"",status:i,json:o,text:a}}if(e?.authRequired)throw new b(w,`${t} auth failed.`);if(e?.error)throw new u(`${t} failed`,e.error);if(!e||typeof e!=="object"||Array.isArray(e))throw new u(`${t} returned malformed response`);if(n&&(!e.json||typeof e.json!=="object"||Array.isArray(e.json)))throw new u(`${t} returned malformed response`,"missing_json");return e}function A(e,t){const n=c(e),r=c(t).split(" ")[0];return n.includes("You sent a Sales Navigator message")&&(!r||n.includes(r))}async function z(e){const n=(await e.getCookies({url:"https://www.linkedin.com"})).find((r)=>r.name==="JSESSIONID")?.value;if(!n)throw new b(w,"LinkedIn JSESSIONID cookie not found. Please sign in to LinkedIn.");return n.replace(/^\"|\"$/g,"")}async function V(e,t,n){if(!t)throw new l("--recipient must be a Sales Navigator lead URL, Sales Navigator profile URL, LinkedIn /in/ URL, or urn:li:fs_salesProfile:(...)");if(t.entityUrn&&t.authType&&t.authToken)return t;await e.goto(`https://www.linkedin.com/sales/lead/${encodeURIComponent(t.profileId)}`);await e.wait(6);const r=f(await e.evaluate(String.raw`(() => {
|
|
25
|
+
const href = location.href;
|
|
26
|
+
const text = document.body ? document.body.innerText : '';
|
|
27
|
+
const resourceUrns = Array.from(performance.getEntriesByType('resource'))
|
|
28
|
+
.map((entry) => entry.name)
|
|
29
|
+
.filter((name) => name.includes('/sales-api/salesApiProfiles/'))
|
|
30
|
+
.slice(-20);
|
|
31
|
+
return { href, text: text.slice(0, 1000), resourceUrns };
|
|
32
|
+
})()`)),i=String(r?.href||"").match(/\/sales\/lead\/([^,/]+),([^,/]+),([^/?#]+)/i);if(i&&m(i[1],i[2],i[3]))return{profileId:decodeURIComponent(i[1]),authType:decodeURIComponent(i[2]),authToken:decodeURIComponent(i[3]),entityUrn:`urn:li:fs_salesProfile:(${decodeURIComponent(i[1])},${decodeURIComponent(i[2])},${decodeURIComponent(i[3])})`};for(const o of r?.resourceUrns||[]){const a=String(o).match(/profileId:([^,)]+),authType:([^,)]+),authToken:([^,)]+)\)/);if(a&&a[1]===t.profileId)return{profileId:a[1],authType:a[2],authToken:a[3],entityUrn:`urn:li:fs_salesProfile:(${a[1]},${a[2]},${a[3]})`}}throw new u("Could not resolve Sales Navigator auth token for recipient",`Observed URL: ${r?.href||"url_not_available"}
|
|
33
|
+
Body: ${c(r?.text||"").slice(0,500)}`)}function $(e){const t=e?.data||e||{},n=t.defaultPosition||(Array.isArray(t.positions)?t.positions.find((r)=>r.current)||t.positions[0]:{})||{};return{recipient:c(t.fullName||[t.firstName,t.lastName].filter(Boolean).join(" ")),title:c(n.title||t.headline||""),company:c(n.companyName||n.company?.name||""),degree:c(t.degree||""),inmail_restriction:c(t.inmailRestriction||""),open_link:Boolean(t.memberBadges?.openLink)}}function j(e){const t=$(e);if(!t.recipient)throw new u("Sales Navigator profile lookup returned malformed profile data","missing_recipient_name");return t}E({site:"linkedin",name:"salesnav-message",access:"write",description:"Send or dry-run a LinkedIn Sales Navigator InMail to a lead using the Sales Navigator messaging API",domain:w,strategy:q.UI,browser:!0,args:[{name:"recipient",type:"string",required:!0,positional:!0,help:"Sales Navigator lead URL, LinkedIn /in/ URL from salesnav-search, or urn:li:fs_salesProfile:(...)"},{name:"subject",type:"string",required:!0,help:"InMail subject"},{name:"body",type:"string",required:!0,help:"InMail body"},{name:"send",type:"bool",default:!1,help:"Actually send the InMail. Default is dry-run validation only."},{name:"copy-to-crm",type:"bool",default:!1,help:"Set Sales Navigator copyToCrm on the message request"}],columns:["status","recipient","title","company","credits_remaining","credits_before","credits_after","sent_in_salesnav","message_chars","subject_chars","recipient_urn","degree","inmail_restriction","open_link"],func:async(e,t)=>{if(!e)throw new u("Browser session required for linkedin salesnav-message");const n=R(t,"recipient","--recipient"),r=R(t,"subject","--subject"),i=String(t.body??"").trim();if(!i)throw new l("--body is required");await e.goto(J);await e.wait(4);const o=await z(e),a=await V(e,v(n),o);let s={recipient:"",title:"",company:"",degree:"",inmail_restriction:"",open_link:!1};const d=U(a);if(d){const O=h(f(await e.evaluate(p(d,o))),"LinkedIn Sales Navigator profile API");s=j(O.json)}if(s.inmail_restriction&&s.inmail_restriction!=="NO_RESTRICTION")throw new u("Sales Navigator InMail blocked by recipient restriction",s.inmail_restriction);const C=h(f(await e.evaluate(p(k,o))),"LinkedIn Sales Navigator credits API"),y=_(C?.json),L=T({recipientUrn:a.entityUrn,subject:r,body:i,copyToCrm:t["copy-to-crm"]});if(!t.send)return[{status:"validated_dry_run",recipient:s.recipient,title:s.title,company:s.company,credits_remaining:y,credits_before:y,credits_after:"",sent_in_salesnav:!1,message_chars:i.length,subject_chars:r.length,recipient_urn:a.entityUrn,degree:s.degree,inmail_restriction:s.inmail_restriction,open_link:s.open_link}];const P=h(f(await e.evaluate(p(D,o,{method:"POST",accept:"application/vnd.linkedin.normalized+json+2.1",body:L}))),"LinkedIn Sales Navigator message API",{requireJson:!1});await e.wait(3);const M=h(f(await e.evaluate(p(k,o))),"LinkedIn Sales Navigator credits API after send"),I=_(M?.json);await e.goto(N(a));await e.wait(6);const x=f(await e.evaluate('document.body ? document.body.innerText : ""')),S=A(x,s.recipient);if(!S)throw new u("Sales Navigator post-send verification failed","Sent activity was not found on the Sales Navigator lead page.");return[{status:"sent",recipient:s.recipient,title:s.title,company:s.company,credits_remaining:I,credits_before:y,credits_after:I,sent_in_salesnav:S,message_chars:i.length,subject_chars:r.length,recipient_urn:a.entityUrn,degree:s.degree,inmail_restriction:s.inmail_restriction,open_link:s.open_link}]}});export const __test__={normalizeWhitespace:c,parseSalesProfileUrn:g,isResolvedSalesProfileParts:m,parseRecipient:v,salesLeadUrlFromParts:N,profileApiUrl:U,buildCreateMessagePayload:T,extractRemainingCredits:_,profileSummary:$,requireProfileSummary:j,salesPageShowsSentMessage:A};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{cli as _,Strategy as k}from"@jackwener/opencli/registry";import{ArgumentError as O,AuthRequiredError as f,CommandExecutionError as T,EmptyResultError as I}from"@jackwener/opencli/errors";const H="www.linkedin.com",j="https://www.linkedin.com/sales/",v="https://www.linkedin.com/sales-api/salesApiLeadSearch",S="com.linkedin.sales.deco.desktop.searchv2.LeadSearchResult-14",z=25;function Y(J){return String(J??"").replace(/[ ]/g," ").replace(/\s+/g," ").trim()}function L(J,Q,V=Q){const $=Y(J[Q]);if(!$)throw new O(`${V} is required`);return $}function W(J){if(J===void 0||J===null||J==="")return 25;const Q=Number(J);if(!Number.isInteger(Q)||Q<1||Q>500)throw new O("--limit must be an integer between 1 and 500");return Q}function A(J){if(J&&typeof J==="object"&&"data"in J&&"session"in J)return J.data;return J}function x(J,Q){const V="(spellCorrectionEnabled:true,recentSearchParam:(doLogHistory:true),keywords:"+encodeURIComponent(J)+")";return v+"?q=searchQuery&query="+V+"&start="+Q+"&count="+z+"&decorationId="+S}function U(J,Q){return String.raw`(async () => {
|
|
2
|
+
const headers = {
|
|
3
|
+
'csrf-token': ${JSON.stringify(Q)},
|
|
4
|
+
'x-restli-protocol-version': '2.0.0',
|
|
5
|
+
accept: 'application/json',
|
|
6
|
+
};
|
|
7
|
+
try {
|
|
8
|
+
const res = await fetch(${JSON.stringify(J)}, { credentials: 'include', headers });
|
|
9
|
+
if (res.status === 401 || res.status === 403) return { authRequired: true, status: res.status };
|
|
10
|
+
if (!res.ok) return { error: 'HTTP ' + res.status };
|
|
11
|
+
return { json: await res.json() };
|
|
12
|
+
} catch (e) {
|
|
13
|
+
return { error: 'fetch failed: ' + ((e && e.message) || String(e)) };
|
|
14
|
+
}
|
|
15
|
+
})()`}function K(J){const Q=String(J||"").match(/fs_salesProfile:\(([^,)]+)/);return Q&&Q[1]?"https://www.linkedin.com/in/"+Q[1]:""}function D(J){const Q=String(J||"").match(/^urn:li:fs_salesProfile:\(([^,()]+),([^,()]+),([^,()]+)\)$/);if(!Q)return"";return`https://www.linkedin.com/sales/lead/${encodeURIComponent(Q[1])},${encodeURIComponent(Q[2])},${encodeURIComponent(Q[3])}`}function C(J){if(!J||typeof J!=="object"||!Array.isArray(J.elements))throw new T("Sales Navigator lead search API returned malformed payload");const Q=[];for(const V of J.elements){if(!V||typeof V!=="object")throw new T("Sales Navigator lead search API returned malformed lead row");const $=Array.isArray(V.currentPositions)?V.currentPositions:[],M=Array.isArray(V.pastPositions)?V.pastPositions:[],b=$[0]||M[0]||{},G=Y(V.fullName||[V.firstName,V.lastName].filter(Boolean).join(" "));if(!G)throw new T("Sales Navigator lead row missing name");const X=Y(V.entityUrn||"");if(!K(X))throw new T("Sales Navigator lead row missing profile identity");Q.push({name:G,title:Y(b.title||""),company:Y(b.companyName||""),location:Y(V.geoRegion||""),degree:Y(V.degree||""),profile_url:K(X),lead_url:D(X),recipient_urn:X})}return Q}function N(J){if(J?.authRequired)throw new f(H,"LinkedIn Sales Navigator API auth failed (HTTP "+(J.status||"")+"). Confirm the account has Sales Navigator access.");if(J?.error)throw new T("Sales Navigator lead search API returned an unexpected response",J.error);if(!J||!J.json)throw new T("Sales Navigator lead search API returned an unexpected response","no_json");return J.json}_({site:"linkedin",name:"salesnav-search",access:"read",description:"Search LinkedIn Sales Navigator for people leads by keyword",domain:H,strategy:k.UI,browser:!0,args:[{name:"keywords",type:"string",required:!0,positional:!0,help:'People search keywords, e.g. "quality manager food manufacturing"'},{name:"limit",type:"number",default:25,help:"Maximum leads to return (1-500, fetched 25 per request)"}],columns:["rank","name","title","company","location","degree","profile_url","lead_url","recipient_urn"],func:async(J,Q)=>{if(!J)throw new T("Browser session required for linkedin salesnav-search");const V=L(Q,"keywords","--keywords"),$=W(Q.limit);await J.goto(j);await J.wait(6);const b=(await J.getCookies({url:"https://www.linkedin.com"})).find((B)=>B.name==="JSESSIONID")?.value;if(!b)throw new f(H,"LinkedIn JSESSIONID cookie not found. Please sign in to LinkedIn.");const G=b.replace(/^\"|\"$/g,""),X=[],F=new Set;for(let B=0;X.length<$&&B<2000;B+=z){const P=A(await J.evaluate(U(x(V,B),G))),R=N(P),q=C(R);if(q.length===0)break;for(const Z of q){const w=Z.profile_url||Z.name.toLowerCase();if(F.has(w))continue;F.add(w);X.push(Z)}await J.wait(1)}if(X.length===0)throw new I("linkedin salesnav-search","No Sales Navigator leads were found.");return X.slice(0,$).map((B,P)=>({rank:P+1,...B}))}});export const __test__={normalizeWhitespace:Y,parseLimit:W,leadSearchUrl:x,profileUrlFromEntityUrn:K,leadUrlFromEntityUrn:D,parseLeads:C,requireLeadSearchResult:N};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as R,Strategy as M}from"@jackwener/opencli/registry";import{ArgumentError as H,CommandExecutionError as O,EmptyResultError as y}from"@jackwener/opencli/errors";import{THREAD_DECORATION as W,THREADS_BASE as f,encodeRestliDecoration as S,fetchInboxRows as v,fetchSalesnavJson as T,getCsrf as x,normalizeWhitespace as X,parseLimit as b}from"./salesnav-inbox.js";const A="www.linkedin.com",w="https://www.linkedin.com/sales/inbox/",k=200,P=20;function I(Q){const Y=String(Q||"").toLowerCase();return Y==="linkedin.com"||Y.endsWith(".linkedin.com")}function C(Q){const Y=X(Q),J=Y.match(/^urn:li:fs_salesProfile:\(([^,()]+),([^,()]+),([^,()]+)\)$/);if(!J)return"";if([J[1],J[2],J[3]].map(($)=>X($).toLowerCase()).some(($)=>!$||$==="undefined"||$==="null"||$==="not_available"))return"";return Y}function q(Q){const Y=X(Q);if(!Y)return["empty",""];if(/^2-[A-Za-z0-9+/=_-]+$/.test(Y))return["thread_id",Y];if(/^urn:li:fs_salesProfile:\(/.test(Y)){const J=C(Y);if(!J)throw new H("Sales Navigator recipient urn must be urn:li:fs_salesProfile:(profileId,authType,authToken)");return["recipient_urn",J]}try{const J=new URL(Y);if(J.protocol!=="https:"||J.username||J.password||J.port||!I(J.hostname))return["name",Y.toLowerCase()];const K=J.pathname.match(/^\/sales\/inbox\/([^/]+)\/?$/i);if(K)return["thread_id",decodeURIComponent(K[1])];const $=J.pathname.match(/^\/sales\/lead\/([^,/]+),([^,/]+),([^/]+)\/?$/i);if($){const V=`urn:li:fs_salesProfile:(${decodeURIComponent($[1])},${decodeURIComponent($[2])},${decodeURIComponent($[3])})`;if(!C(V))throw new H("Sales Navigator lead URL must contain resolved profileId, authType, and authToken");return["recipient_urn",V]}}catch(J){if(J instanceof H)throw J}return["name",Y.toLowerCase()]}function D(Q){return Q?`https://www.linkedin.com/sales/inbox/${encodeURIComponent(Q)}`:""}function L(Q,Y){return`${f}/${encodeURIComponent(Q)}?decoration=${S(W)}&count=1&messageCount=${Y}`}function E(Q){return X(Q?.fullName||[Q?.firstName,Q?.lastName].filter(Boolean).join(" "))}function U(Q){const Y=Q?.participantsResolutionResults||{},J=Array.isArray(Q?.participants)?Q.participants:Object.keys(Y),K=new Map;for(const $ of J){const V=Y[$]||{entityUrn:$};K.set($,V)}return K}function _(Q){if(!Q||typeof Q!=="object")throw new O("Sales Navigator messaging thread API returned malformed payload");const Y=X(Q?.id||"");if(!Y)throw new O("Sales Navigator messaging thread API returned a thread without id");if(!Array.isArray(Q?.messages))throw new O("Sales Navigator messaging thread API returned malformed messages");const J=U(Q),$=Q.messages.map((V)=>{if(!V||typeof V!=="object")throw new O("Sales Navigator messaging thread API returned malformed message row");const B=Number(V?.deliveredAt||0),Z=J.get(V?.author);return{message_id:X(V?.id||""),thread_id:Y,sender:E(Z)||X(V?.author||""),sender_urn:X(V?.author||""),text:X(V?.body||V?.systemMessageContent||""),subject:X(V?.subject||""),timestamp:B?new Date(B).toISOString():"",delivered_at:B||"",type:X(V?.type||"")}}).filter((V)=>V.text||V.subject||V.message_id);$.sort((V,B)=>Number(V.delivered_at||0)-Number(B.delivered_at||0));return $.map((V,B)=>({index:B,...V}))}function z(Q,Y){if(!Q||!Y)return!1;const[J,K]=Y;if(J==="thread_id")return Q.thread_id===K;if(J==="recipient_urn")return(Q.participants||[]).some(($)=>X($.entity_urn)===K);if(J==="name"){const $=X(K).toLowerCase();if(!$)return!1;if(X(Q.person_name).toLowerCase()===$)return!0;return(Q.participants||[]).some((V)=>X(V.name).toLowerCase()===$)}return!1}async function c(Q,Y,{maxPages:J=30}={}){const K=q(Y);if(K[0]==="empty")throw new H("thread or recipient is required");if(K[0]==="thread_id")return K[1];const V=(await v(Q,{limit:500,maxPages:J})).find((B)=>z(B,K));if(!V)throw new y("linkedin salesnav-thread",`No Sales Navigator thread matched ${Y}`);return V.thread_id}async function u(Q,Y,J,K=k){let $=P;if(K<$)$=K;let V=null;for(let F=0;F<30;F+=1){V=await T(Q,Y,L(J,$),"Sales Navigator messaging thread API");const j=Number(V?.totalMessageCount||0),N=Array.isArray(V?.messages)?V.messages.length:0;if(N>=K||j&&N>=j||$>=K)break;let G=$+P;if(j&&j>G)G=j;if(G>K)G=K;$=G}const B=Number(V?.totalMessageCount||0),Z=Array.isArray(V?.messages)?V.messages.length:0;if(B&&Z<B&&Z<K)throw new O(`Sales Navigator messaging thread API returned partial history (${Z}/${B})`);return V}R({site:"linkedin",name:"salesnav-thread",access:"read",description:"Return full Sales Navigator message history for a thread id, Sales Navigator inbox URL, lead URL, recipient urn, or exact recipient name",domain:A,strategy:M.UI,browser:!0,args:[{name:"thread-or-recipient",type:"string",required:!0,positional:!0,help:"Sales Navigator inbox URL/thread id, Sales Navigator lead URL, recipient urn, or exact participant name"},{name:"limit",type:"number",default:k,help:"Maximum messages to return (1-500)"},{name:"max-pages",type:"number",default:30,help:"Maximum inbox pages to scan when resolving a recipient"}],columns:["index","thread_id","thread_url","sender","text","timestamp","subject","message_id","sender_urn","delivered_at","type","total_message_count"],func:async(Q,Y)=>{if(!Q)throw new O("Browser session required for linkedin salesnav-thread");const J=X(Y["thread-or-recipient"]);if(!J)throw new H("thread-or-recipient is required");const K=b(Y.limit,k),$=b(Y["max-pages"],30);await Q.goto(w);await Q.wait(4);const V=await c(Q,J,{maxPages:$}),B=await x(Q),Z=await u(Q,B,V,K),F=_(Z).slice(0,K);if(F.length===0)throw new y("linkedin salesnav-thread",`No messages found for ${V}`);return F.map((j)=>({...j,thread_url:D(V),total_message_count:Number(Z?.totalMessageCount||F.length)}))}});export const __test__={parseThreadInput:q,threadApiUrl:L,participantIndex:U,parseSalesnavThreadMessages:_,threadMatchesInput:z,salesnavThreadUrl:D};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import{AuthRequiredError as X,CommandExecutionError as Z}from"@jackwener/opencli/errors";import{unwrapEvaluateResult as $}from"./shared.js";export const SEARCH_CLUSTERS_QUERY_ID="voyagerSearchDashClusters.ef3d0937fb65bd7812e32e5a85028e79";function P({keywords:z,filters:F,start:K,count:N}){const O=z?`keywords:${encodeURIComponent(z)},`:"",J=`List(${F.join(",")})`;return`(start:${K},count:${N},origin:GLOBAL_SEARCH_HEADER,query:(${O}flagshipSearchIntent:SEARCH_SRP,queryParameters:${J},includeFiltersInResponse:false))`}function x(z,F){return`(async () => {
|
|
2
|
+
const norm = (s) => String(s == null ? '' : s).replace(/[ ]+/g, ' ').replace(/\\s+/g, ' ').trim();
|
|
3
|
+
const csrf = ((document.cookie.split('; ').find((c) => c.startsWith('JSESSIONID=')) || '').split('=')[1] || '').replace(/^"|"$/g, '');
|
|
4
|
+
if (!csrf) return { ok: false, auth: true };
|
|
5
|
+
const url = '/voyager/api/graphql?queryId=' + ${JSON.stringify(F)} + '&variables=' + ${JSON.stringify(z)};
|
|
6
|
+
const res = await fetch(url, { credentials: 'include', headers: {
|
|
7
|
+
'csrf-token': csrf,
|
|
8
|
+
'accept': 'application/vnd.linkedin.normalized+json+2.1',
|
|
9
|
+
'x-restli-protocol-version': '2.0.0',
|
|
10
|
+
'x-li-lang': 'en_US',
|
|
11
|
+
} });
|
|
12
|
+
if (res.status === 401 || res.status === 403) return { ok: false, auth: true, status: res.status };
|
|
13
|
+
if (!res.ok) return { ok: false, status: res.status };
|
|
14
|
+
const json = await res.json();
|
|
15
|
+
const byUrn = {};
|
|
16
|
+
for (const ent of (json.included || [])) { if (ent && ent.entityUrn) byUrn[ent.entityUrn] = ent; }
|
|
17
|
+
const clusters = json && json.data && json.data.data && json.data.data.searchDashClustersByAll;
|
|
18
|
+
if (!clusters) return { ok: true, rows: [], total: 0 };
|
|
19
|
+
const rows = [];
|
|
20
|
+
for (const el of (clusters.elements || [])) {
|
|
21
|
+
if (!String(el.$type || '').endsWith('SearchClusterViewModel')) continue;
|
|
22
|
+
for (const it of (el.items || [])) {
|
|
23
|
+
if (!String(it.$type || '').endsWith('SearchItem')) continue;
|
|
24
|
+
const item = it.item || {};
|
|
25
|
+
let entity = item.entityResult;
|
|
26
|
+
if (!entity && item['*entityResult']) entity = byUrn[item['*entityResult']];
|
|
27
|
+
if (!entity || !String(entity.$type || '').endsWith('EntityResultViewModel')) continue;
|
|
28
|
+
const nav = norm(entity.navigationUrl).split('?')[0];
|
|
29
|
+
rows.push({
|
|
30
|
+
name: norm(entity.title && entity.title.text),
|
|
31
|
+
headline: norm(entity.primarySubtitle && entity.primarySubtitle.text),
|
|
32
|
+
location: norm(entity.secondarySubtitle && entity.secondarySubtitle.text),
|
|
33
|
+
summary: norm(entity.summary && entity.summary.text),
|
|
34
|
+
nav,
|
|
35
|
+
entityUrn: norm(entity.entityUrn),
|
|
36
|
+
distance: norm(entity.entityCustomTrackingInfo && entity.entityCustomTrackingInfo.memberDistance),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const paging = clusters.paging || {};
|
|
41
|
+
return { ok: true, rows, total: paging.total || 0 };
|
|
42
|
+
})()`}export async function fetchSearchClusters(z,{keywords:F="",filters:K=[],start:N=0,count:O=10},J){const W=P({keywords:F,filters:K,start:N,count:O}),B=$(await z.evaluate(x(W,SEARCH_CLUSTERS_QUERY_ID)));if(B?.auth)throw new X("linkedin.com",`LinkedIn ${J} requires an active signed-in browser session`);if(!B?.ok)throw new Z(`LinkedIn ${J}: search API returned HTTP ${B?.status||"?"}`);return{rows:Array.isArray(B.rows)?B.rows:[],total:Number(B.total)||0}}export const __test__={buildVariables:P,SEARCH_CLUSTERS_QUERY_ID};
|