@jackwener/opencli 1.6.8 → 1.6.10
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/README.md +117 -59
- package/README.zh-CN.md +123 -79
- package/dist/clis/_shared/common.d.ts +3 -0
- package/dist/clis/_shared/common.js +22 -0
- package/dist/clis/bilibili/hot.d.ts +1 -0
- package/dist/clis/bilibili/hot.js +35 -0
- package/dist/clis/bluesky/feeds.d.ts +1 -0
- package/dist/clis/bluesky/feeds.js +27 -0
- package/dist/clis/bluesky/followers.d.ts +1 -0
- package/dist/clis/bluesky/followers.js +27 -0
- package/dist/clis/bluesky/following.d.ts +1 -0
- package/dist/clis/bluesky/following.js +27 -0
- package/dist/clis/bluesky/profile.d.ts +1 -0
- package/dist/clis/bluesky/profile.js +29 -0
- package/dist/clis/bluesky/search.d.ts +1 -0
- package/dist/clis/bluesky/search.js +28 -0
- package/dist/clis/bluesky/starter-packs.d.ts +1 -0
- package/dist/clis/bluesky/starter-packs.js +28 -0
- package/dist/clis/bluesky/thread.d.ts +1 -0
- package/dist/clis/bluesky/thread.js +30 -0
- package/dist/clis/bluesky/trending.d.ts +1 -0
- package/dist/clis/bluesky/trending.js +19 -0
- package/dist/clis/bluesky/user.d.ts +1 -0
- package/dist/clis/bluesky/user.js +33 -0
- package/dist/clis/cnki/search.d.ts +1 -0
- package/dist/clis/cnki/search.js +60 -0
- package/dist/clis/cnki/search.test.d.ts +1 -0
- package/dist/clis/cnki/search.test.js +18 -0
- package/dist/clis/devto/tag.d.ts +1 -0
- package/dist/clis/devto/tag.js +32 -0
- package/dist/clis/devto/top.d.ts +1 -0
- package/dist/clis/devto/top.js +26 -0
- package/dist/clis/devto/user.d.ts +1 -0
- package/dist/clis/devto/user.js +31 -0
- package/dist/clis/dictionary/examples.d.ts +1 -0
- package/dist/clis/dictionary/examples.js +27 -0
- package/dist/clis/dictionary/search.d.ts +1 -0
- package/dist/clis/dictionary/search.js +29 -0
- package/dist/clis/dictionary/synonyms.d.ts +1 -0
- package/dist/clis/dictionary/synonyms.js +27 -0
- package/dist/clis/douban/subject.d.ts +1 -0
- package/dist/clis/douban/subject.js +118 -0
- package/dist/clis/douban/top250.d.ts +1 -0
- package/dist/clis/douban/top250.js +67 -0
- package/dist/clis/facebook/add-friend.d.ts +1 -0
- package/dist/clis/facebook/add-friend.js +43 -0
- package/dist/clis/facebook/events.d.ts +1 -0
- package/dist/clis/facebook/events.js +40 -0
- package/dist/clis/facebook/feed.d.ts +1 -0
- package/dist/clis/facebook/feed.js +59 -0
- package/dist/clis/facebook/friends.d.ts +1 -0
- package/dist/clis/facebook/friends.js +38 -0
- package/dist/clis/facebook/groups.d.ts +1 -0
- package/dist/clis/facebook/groups.js +46 -0
- package/dist/clis/facebook/join-group.d.ts +1 -0
- package/dist/clis/facebook/join-group.js +44 -0
- package/dist/clis/facebook/memories.d.ts +1 -0
- package/dist/clis/facebook/memories.js +35 -0
- package/dist/clis/facebook/notifications.d.ts +1 -0
- package/dist/clis/facebook/notifications.js +36 -0
- package/dist/clis/facebook/profile.d.ts +1 -0
- package/dist/clis/facebook/profile.js +37 -0
- package/dist/clis/facebook/search.d.ts +1 -0
- package/dist/clis/facebook/search.js +38 -0
- package/dist/clis/facebook/search.test.d.ts +1 -1
- package/dist/clis/facebook/search.test.js +6 -9
- package/dist/clis/gitee/index.d.ts +3 -0
- package/dist/clis/gitee/index.js +3 -0
- package/dist/clis/gitee/search.d.ts +1 -0
- package/dist/clis/gitee/search.js +136 -0
- package/dist/clis/gitee/trending.d.ts +1 -0
- package/dist/clis/gitee/trending.js +567 -0
- package/dist/clis/gitee/user.d.ts +1 -0
- package/dist/clis/gitee/user.js +199 -0
- package/dist/clis/gitee/user.test.d.ts +1 -0
- package/dist/clis/gitee/user.test.js +63 -0
- package/dist/clis/hackernews/ask.d.ts +1 -0
- package/dist/clis/hackernews/ask.js +29 -0
- package/dist/clis/hackernews/best.d.ts +1 -0
- package/dist/clis/hackernews/best.js +29 -0
- package/dist/clis/hackernews/jobs.d.ts +1 -0
- package/dist/clis/hackernews/jobs.js +27 -0
- package/dist/clis/hackernews/new.d.ts +1 -0
- package/dist/clis/hackernews/new.js +29 -0
- package/dist/clis/hackernews/search.d.ts +1 -0
- package/dist/clis/hackernews/search.js +36 -0
- package/dist/clis/hackernews/show.d.ts +1 -0
- package/dist/clis/hackernews/show.js +29 -0
- package/dist/clis/hackernews/top.d.ts +1 -0
- package/dist/clis/hackernews/top.js +29 -0
- package/dist/clis/hackernews/user.d.ts +1 -0
- package/dist/clis/hackernews/user.js +22 -0
- package/dist/clis/hupu/hot.d.ts +1 -0
- package/dist/clis/hupu/hot.js +40 -0
- package/dist/clis/instagram/comment.d.ts +1 -0
- package/dist/clis/instagram/comment.js +47 -0
- package/dist/clis/instagram/explore.d.ts +1 -0
- package/dist/clis/instagram/explore.js +41 -0
- package/dist/clis/instagram/follow.d.ts +1 -0
- package/dist/clis/instagram/follow.js +43 -0
- package/dist/clis/instagram/followers.d.ts +1 -0
- package/dist/clis/instagram/followers.js +45 -0
- package/dist/clis/instagram/following.d.ts +1 -0
- package/dist/clis/instagram/following.js +45 -0
- package/dist/clis/instagram/like.d.ts +1 -0
- package/dist/clis/instagram/like.js +45 -0
- package/dist/clis/instagram/profile.d.ts +1 -0
- package/dist/clis/instagram/profile.js +39 -0
- package/dist/clis/instagram/save.d.ts +1 -0
- package/dist/clis/instagram/save.js +45 -0
- package/dist/clis/instagram/saved.d.ts +1 -0
- package/dist/clis/instagram/saved.js +38 -0
- package/dist/clis/instagram/search.d.ts +1 -0
- package/dist/clis/instagram/search.js +38 -0
- package/dist/clis/instagram/unfollow.d.ts +1 -0
- package/dist/clis/instagram/unfollow.js +40 -0
- package/dist/clis/instagram/unlike.d.ts +1 -0
- package/dist/clis/instagram/unlike.js +45 -0
- package/dist/clis/instagram/unsave.d.ts +1 -0
- package/dist/clis/instagram/unsave.js +45 -0
- package/dist/clis/instagram/user.d.ts +1 -0
- package/dist/clis/instagram/user.js +48 -0
- package/dist/clis/jd/add-cart.d.ts +1 -0
- package/dist/clis/jd/add-cart.js +71 -0
- package/dist/clis/jd/cart.d.ts +1 -0
- package/dist/clis/jd/cart.js +79 -0
- package/dist/clis/jd/commands.test.d.ts +5 -0
- package/dist/clis/jd/commands.test.js +64 -0
- package/dist/clis/jd/detail.d.ts +1 -0
- package/dist/clis/jd/detail.js +62 -0
- package/dist/clis/jd/reviews.d.ts +1 -0
- package/dist/clis/jd/reviews.js +54 -0
- package/dist/clis/jd/search.d.ts +1 -0
- package/dist/clis/jd/search.js +65 -0
- package/dist/clis/jianyu/search.d.ts +14 -0
- package/dist/clis/jianyu/search.js +135 -0
- package/dist/clis/jianyu/search.test.d.ts +1 -0
- package/dist/clis/jianyu/search.test.js +23 -0
- package/dist/clis/jike/post.d.ts +1 -0
- package/dist/clis/jike/post.js +61 -0
- package/dist/clis/jike/topic.d.ts +1 -0
- package/dist/clis/jike/topic.js +51 -0
- package/dist/clis/jike/user.d.ts +1 -0
- package/dist/clis/jike/user.js +50 -0
- package/dist/clis/jimeng/generate.d.ts +1 -0
- package/dist/clis/jimeng/generate.js +83 -0
- package/dist/clis/jimeng/history.d.ts +1 -0
- package/dist/clis/jimeng/history.js +47 -0
- package/dist/clis/jimeng/new.d.ts +1 -0
- package/dist/clis/jimeng/new.js +43 -0
- package/dist/clis/jimeng/workspaces.d.ts +1 -0
- package/dist/clis/jimeng/workspaces.js +41 -0
- package/dist/clis/linux-do/categories.d.ts +1 -0
- package/dist/clis/linux-do/categories.js +65 -0
- package/dist/clis/linux-do/search.d.ts +1 -0
- package/dist/clis/linux-do/search.js +41 -0
- package/dist/clis/linux-do/tags.d.ts +1 -0
- package/dist/clis/linux-do/tags.js +39 -0
- package/dist/clis/linux-do/topic-content.test.js +5 -5
- package/dist/clis/linux-do/topic.d.ts +1 -0
- package/dist/clis/linux-do/topic.js +56 -0
- package/dist/clis/linux-do/user-posts.d.ts +1 -0
- package/dist/clis/linux-do/user-posts.js +61 -0
- package/dist/clis/linux-do/user-topics.d.ts +1 -0
- package/dist/clis/linux-do/user-topics.js +48 -0
- package/dist/clis/lobsters/active.d.ts +1 -0
- package/dist/clis/lobsters/active.js +26 -0
- package/dist/clis/lobsters/hot.d.ts +1 -0
- package/dist/clis/lobsters/hot.js +26 -0
- package/dist/clis/lobsters/newest.d.ts +1 -0
- package/dist/clis/lobsters/newest.js +26 -0
- package/dist/clis/lobsters/tag.d.ts +1 -0
- package/dist/clis/lobsters/tag.js +32 -0
- package/dist/clis/pixiv/detail.d.ts +1 -0
- package/dist/clis/pixiv/detail.js +58 -0
- package/dist/clis/pixiv/ranking.d.ts +1 -0
- package/dist/clis/pixiv/ranking.js +59 -0
- package/dist/clis/pixiv/user.d.ts +1 -0
- package/dist/clis/pixiv/user.js +52 -0
- package/dist/clis/quark/ls.d.ts +1 -0
- package/dist/clis/quark/ls.js +63 -0
- package/dist/clis/quark/mkdir.d.ts +1 -0
- package/dist/clis/quark/mkdir.js +36 -0
- package/dist/clis/quark/mv.d.ts +1 -0
- package/dist/clis/quark/mv.js +53 -0
- package/dist/clis/quark/rename.d.ts +1 -0
- package/dist/clis/quark/rename.js +26 -0
- package/dist/clis/quark/rm.d.ts +1 -0
- package/dist/clis/quark/rm.js +24 -0
- package/dist/clis/quark/save.d.ts +1 -0
- package/dist/clis/quark/save.js +80 -0
- package/dist/clis/quark/share-tree.d.ts +1 -0
- package/dist/clis/quark/share-tree.js +45 -0
- package/dist/clis/quark/utils.d.ts +50 -0
- package/dist/clis/quark/utils.js +146 -0
- package/dist/clis/quark/utils.test.d.ts +1 -0
- package/dist/clis/quark/utils.test.js +58 -0
- package/dist/clis/reddit/frontpage.d.ts +1 -0
- package/dist/clis/reddit/frontpage.js +31 -0
- package/dist/clis/reddit/hot.d.ts +1 -0
- package/dist/clis/reddit/hot.js +45 -0
- package/dist/clis/reddit/popular.d.ts +1 -0
- package/dist/clis/reddit/popular.js +41 -0
- package/dist/clis/reddit/search.d.ts +1 -0
- package/dist/clis/reddit/search.js +65 -0
- package/dist/clis/reddit/subreddit.d.ts +1 -0
- package/dist/clis/reddit/subreddit.js +52 -0
- package/dist/clis/reddit/user-comments.d.ts +1 -0
- package/dist/clis/reddit/user-comments.js +44 -0
- package/dist/clis/reddit/user-posts.d.ts +1 -0
- package/dist/clis/reddit/user-posts.js +42 -0
- package/dist/clis/reddit/user.d.ts +1 -0
- package/dist/clis/reddit/user.js +37 -0
- package/dist/clis/stackoverflow/bounties.d.ts +1 -0
- package/dist/clis/stackoverflow/bounties.js +27 -0
- package/dist/clis/stackoverflow/hot.d.ts +1 -0
- package/dist/clis/stackoverflow/hot.js +24 -0
- package/dist/clis/stackoverflow/search.d.ts +1 -0
- package/dist/clis/stackoverflow/search.js +27 -0
- package/dist/clis/stackoverflow/unanswered.d.ts +1 -0
- package/dist/clis/stackoverflow/unanswered.js +26 -0
- package/dist/clis/steam/top-sellers.d.ts +1 -0
- package/dist/clis/steam/top-sellers.js +25 -0
- package/dist/clis/taobao/add-cart.d.ts +1 -0
- package/dist/clis/taobao/add-cart.js +149 -0
- package/dist/clis/taobao/cart.d.ts +1 -0
- package/dist/clis/taobao/cart.js +95 -0
- package/dist/clis/taobao/commands.test.d.ts +5 -0
- package/dist/clis/taobao/commands.test.js +64 -0
- package/dist/clis/taobao/detail.d.ts +1 -0
- package/dist/clis/taobao/detail.js +70 -0
- package/dist/clis/taobao/reviews.d.ts +1 -0
- package/dist/clis/taobao/reviews.js +76 -0
- package/dist/clis/taobao/search.d.ts +1 -0
- package/dist/clis/taobao/search.js +96 -0
- package/dist/clis/tiktok/comment.d.ts +1 -0
- package/dist/clis/tiktok/comment.js +57 -0
- package/dist/clis/tiktok/explore.d.ts +1 -0
- package/dist/clis/tiktok/explore.js +35 -0
- package/dist/clis/tiktok/follow.d.ts +1 -0
- package/dist/clis/tiktok/follow.js +39 -0
- package/dist/clis/tiktok/following.d.ts +1 -0
- package/dist/clis/tiktok/following.js +42 -0
- package/dist/clis/tiktok/friends.d.ts +1 -0
- package/dist/clis/tiktok/friends.js +43 -0
- package/dist/clis/tiktok/like.d.ts +1 -0
- package/dist/clis/tiktok/like.js +33 -0
- package/dist/clis/tiktok/live.d.ts +1 -0
- package/dist/clis/tiktok/live.js +47 -0
- package/dist/clis/tiktok/notifications.d.ts +1 -0
- package/dist/clis/tiktok/notifications.js +49 -0
- package/dist/clis/tiktok/profile.d.ts +1 -0
- package/dist/clis/tiktok/profile.js +54 -0
- package/dist/clis/tiktok/save.d.ts +1 -0
- package/dist/clis/tiktok/save.js +29 -0
- package/dist/clis/tiktok/search.d.ts +1 -0
- package/dist/clis/tiktok/search.js +39 -0
- package/dist/clis/tiktok/unfollow.d.ts +1 -0
- package/dist/clis/tiktok/unfollow.js +44 -0
- package/dist/clis/tiktok/unlike.d.ts +1 -0
- package/dist/clis/tiktok/unlike.js +33 -0
- package/dist/clis/tiktok/unsave.d.ts +1 -0
- package/dist/clis/tiktok/unsave.js +31 -0
- package/dist/clis/tiktok/user.d.ts +1 -0
- package/dist/clis/tiktok/user.js +41 -0
- package/dist/clis/twitter/reply.js +3 -8
- package/dist/clis/twitter/reply.test.js +5 -5
- package/dist/clis/v2ex/hot.d.ts +1 -0
- package/dist/clis/v2ex/hot.js +25 -0
- package/dist/clis/v2ex/latest.d.ts +1 -0
- package/dist/clis/v2ex/latest.js +25 -0
- package/dist/clis/v2ex/member.d.ts +1 -0
- package/dist/clis/v2ex/member.js +27 -0
- package/dist/clis/v2ex/node.d.ts +1 -0
- package/dist/clis/v2ex/node.js +38 -0
- package/dist/clis/v2ex/nodes.d.ts +1 -0
- package/dist/clis/v2ex/nodes.js +25 -0
- package/dist/clis/v2ex/replies.d.ts +1 -0
- package/dist/clis/v2ex/replies.js +26 -0
- package/dist/clis/v2ex/topic.d.ts +1 -0
- package/dist/clis/v2ex/topic.js +30 -0
- package/dist/clis/v2ex/user.d.ts +1 -0
- package/dist/clis/v2ex/user.js +33 -0
- package/dist/clis/xiaoe/catalog.d.ts +1 -0
- package/dist/clis/xiaoe/catalog.js +125 -0
- package/dist/clis/xiaoe/content.d.ts +1 -0
- package/dist/clis/xiaoe/content.js +39 -0
- package/dist/clis/xiaoe/courses.d.ts +1 -0
- package/dist/clis/xiaoe/courses.js +69 -0
- package/dist/clis/xiaoe/detail.d.ts +1 -0
- package/dist/clis/xiaoe/detail.js +35 -0
- package/dist/clis/xiaoe/play-url.d.ts +1 -0
- package/dist/clis/xiaoe/play-url.js +120 -0
- package/dist/clis/xiaohongshu/feed.d.ts +1 -0
- package/dist/clis/xiaohongshu/feed.js +32 -0
- package/dist/clis/xiaohongshu/note.js +8 -3
- package/dist/clis/xiaohongshu/note.test.js +11 -0
- package/dist/clis/xiaohongshu/notifications.d.ts +1 -0
- package/dist/clis/xiaohongshu/notifications.js +38 -0
- package/dist/clis/xueqiu/earnings-date.d.ts +1 -0
- package/dist/clis/xueqiu/earnings-date.js +61 -0
- package/dist/clis/xueqiu/feed.d.ts +1 -0
- package/dist/clis/xueqiu/feed.js +48 -0
- package/dist/clis/xueqiu/groups.d.ts +1 -0
- package/dist/clis/xueqiu/groups.js +25 -0
- package/dist/clis/xueqiu/hot-stock.d.ts +1 -0
- package/dist/clis/xueqiu/hot-stock.js +44 -0
- package/dist/clis/xueqiu/hot.d.ts +1 -0
- package/dist/clis/xueqiu/hot.js +44 -0
- package/dist/clis/xueqiu/kline.d.ts +1 -0
- package/dist/clis/xueqiu/kline.js +64 -0
- package/dist/clis/xueqiu/search.d.ts +1 -0
- package/dist/clis/xueqiu/search.js +49 -0
- package/dist/clis/xueqiu/stock.d.ts +1 -0
- package/dist/clis/xueqiu/stock.js +72 -0
- package/dist/clis/xueqiu/watchlist.d.ts +1 -0
- package/dist/clis/xueqiu/watchlist.js +45 -0
- package/dist/clis/zhihu/answer.d.ts +1 -0
- package/dist/clis/zhihu/answer.js +194 -0
- package/dist/clis/zhihu/answer.test.d.ts +1 -0
- package/dist/clis/zhihu/answer.test.js +81 -0
- package/dist/clis/zhihu/comment.d.ts +1 -0
- package/dist/clis/zhihu/comment.js +335 -0
- package/dist/clis/zhihu/comment.test.d.ts +1 -0
- package/dist/clis/zhihu/comment.test.js +54 -0
- package/dist/clis/zhihu/favorite.d.ts +1 -0
- package/dist/clis/zhihu/favorite.js +224 -0
- package/dist/clis/zhihu/favorite.test.d.ts +1 -0
- package/dist/clis/zhihu/favorite.test.js +196 -0
- package/dist/clis/zhihu/follow.d.ts +1 -0
- package/dist/clis/zhihu/follow.js +80 -0
- package/dist/clis/zhihu/follow.test.d.ts +1 -0
- package/dist/clis/zhihu/follow.test.js +45 -0
- package/dist/clis/zhihu/hot.d.ts +1 -0
- package/dist/clis/zhihu/hot.js +43 -0
- package/dist/clis/zhihu/like.d.ts +1 -0
- package/dist/clis/zhihu/like.js +91 -0
- package/dist/clis/zhihu/like.test.d.ts +1 -0
- package/dist/clis/zhihu/like.test.js +64 -0
- package/dist/clis/zhihu/search.d.ts +1 -0
- package/dist/clis/zhihu/search.js +52 -0
- package/dist/clis/zhihu/target.d.ts +24 -0
- package/dist/clis/zhihu/target.js +91 -0
- package/dist/clis/zhihu/target.test.d.ts +1 -0
- package/dist/clis/zhihu/target.test.js +77 -0
- package/dist/clis/zhihu/write-shared.d.ts +32 -0
- package/dist/clis/zhihu/write-shared.js +221 -0
- package/dist/clis/zhihu/write-shared.test.d.ts +1 -0
- package/dist/clis/zhihu/write-shared.test.js +175 -0
- package/dist/src/browser/bridge.d.ts +2 -0
- package/dist/src/browser/bridge.js +30 -24
- package/dist/src/browser/daemon-client.d.ts +30 -10
- package/dist/src/browser/daemon-client.js +42 -27
- package/dist/src/browser/daemon-client.test.js +32 -25
- package/dist/src/browser/dom-helpers.test.js +3 -2
- package/dist/src/browser/errors.d.ts +26 -1
- package/dist/src/browser/errors.js +40 -7
- package/dist/src/browser/errors.test.d.ts +1 -0
- package/dist/src/browser/errors.test.js +51 -0
- package/dist/src/browser/index.d.ts +2 -1
- package/dist/src/browser/index.js +1 -1
- package/dist/src/browser/page.d.ts +9 -8
- package/dist/src/browser/page.js +33 -31
- package/dist/src/browser.test.js +27 -8
- package/dist/src/build-manifest.d.ts +5 -11
- package/dist/src/build-manifest.js +6 -75
- package/dist/src/build-manifest.test.js +1 -39
- package/dist/src/cascade.js +3 -2
- package/dist/src/cli.d.ts +3 -3
- package/dist/src/cli.js +73 -65
- package/dist/src/cli.test.js +20 -15
- package/dist/src/clis/binance/asks.d.ts +1 -0
- package/dist/src/clis/binance/asks.js +20 -0
- package/dist/src/clis/binance/commands.test.d.ts +3 -0
- package/dist/src/clis/binance/commands.test.js +58 -0
- package/dist/src/clis/binance/depth.d.ts +1 -0
- package/dist/src/clis/binance/depth.js +20 -0
- package/dist/src/clis/binance/gainers.d.ts +1 -0
- package/dist/src/clis/binance/gainers.js +21 -0
- package/dist/src/clis/binance/klines.d.ts +1 -0
- package/dist/src/clis/binance/klines.js +20 -0
- package/dist/src/clis/binance/losers.d.ts +1 -0
- package/dist/src/clis/binance/losers.js +21 -0
- package/dist/src/clis/binance/pairs.d.ts +1 -0
- package/dist/src/clis/binance/pairs.js +20 -0
- package/dist/src/clis/binance/price.d.ts +1 -0
- package/dist/src/clis/binance/price.js +17 -0
- package/dist/src/clis/binance/prices.d.ts +1 -0
- package/dist/src/clis/binance/prices.js +18 -0
- package/dist/src/clis/binance/ticker.d.ts +1 -0
- package/dist/src/clis/binance/ticker.js +20 -0
- package/dist/src/clis/binance/top.d.ts +1 -0
- package/dist/src/clis/binance/top.js +20 -0
- package/dist/src/clis/binance/trades.d.ts +1 -0
- package/dist/src/clis/binance/trades.js +19 -0
- package/dist/src/commanderAdapter.js +19 -6
- package/dist/src/completion-fast.d.ts +25 -0
- package/dist/src/completion-fast.js +140 -0
- package/dist/src/completion.d.ts +1 -0
- package/dist/src/completion.js +1 -0
- package/dist/src/diagnostic.d.ts +1 -0
- package/dist/src/diagnostic.js +64 -2
- package/dist/src/diagnostic.test.js +93 -3
- package/dist/src/discovery.d.ts +3 -3
- package/dist/src/discovery.js +34 -97
- package/dist/src/doctor.d.ts +2 -0
- package/dist/src/doctor.js +59 -31
- package/dist/src/doctor.test.js +89 -16
- package/dist/src/download/index.d.ts +1 -1
- package/dist/src/engine.test.js +4 -19
- package/dist/src/execution.js +1 -13
- package/dist/src/explore.js +1 -1
- package/dist/src/generate-verified.d.ts +105 -0
- package/dist/src/generate-verified.js +696 -0
- package/dist/src/generate-verified.test.d.ts +1 -0
- package/dist/src/generate-verified.test.js +925 -0
- package/dist/src/generate.d.ts +11 -6
- package/dist/src/generate.js +4 -7
- package/dist/src/main.js +65 -12
- package/dist/src/pipeline/steps/download.d.ts +1 -17
- package/dist/src/pipeline/steps/download.js +20 -31
- package/dist/src/pipeline/steps/intercept.d.ts +1 -1
- package/dist/src/pipeline/steps/intercept.js +1 -1
- package/dist/src/pipeline/steps/tap.d.ts +1 -1
- package/dist/src/pipeline/steps/tap.js +1 -1
- package/dist/src/plugin-scaffold.d.ts +2 -2
- package/dist/src/plugin-scaffold.js +24 -21
- package/dist/src/plugin-scaffold.test.js +1 -1
- package/dist/src/plugin.d.ts +3 -2
- package/dist/src/plugin.js +29 -14
- package/dist/src/plugin.test.js +47 -32
- package/dist/src/record.js +26 -25
- package/dist/src/runtime-detect.js +3 -7
- package/dist/src/scripts/framework.d.ts +3 -0
- package/dist/src/scripts/framework.js +8 -4
- package/dist/src/scripts/store.d.ts +5 -1
- package/dist/src/scripts/store.js +5 -1
- package/dist/src/skill-generate.d.ts +30 -0
- package/dist/src/skill-generate.js +75 -0
- package/dist/src/skill-generate.test.d.ts +1 -0
- package/dist/src/skill-generate.test.js +173 -0
- package/dist/src/synthesize.d.ts +1 -1
- package/dist/src/synthesize.js +7 -8
- package/dist/src/types.d.ts +3 -1
- package/package.json +5 -5
- package/dist/clis/bilibili/hot.yaml +0 -38
- package/dist/clis/bluesky/feeds.yaml +0 -29
- package/dist/clis/bluesky/followers.yaml +0 -33
- package/dist/clis/bluesky/following.yaml +0 -33
- package/dist/clis/bluesky/profile.yaml +0 -27
- package/dist/clis/bluesky/search.yaml +0 -34
- package/dist/clis/bluesky/starter-packs.yaml +0 -34
- package/dist/clis/bluesky/thread.yaml +0 -32
- package/dist/clis/bluesky/trending.yaml +0 -27
- package/dist/clis/bluesky/user.yaml +0 -34
- package/dist/clis/devto/tag.yaml +0 -34
- package/dist/clis/devto/top.yaml +0 -29
- package/dist/clis/devto/user.yaml +0 -33
- package/dist/clis/dictionary/examples.yaml +0 -25
- package/dist/clis/dictionary/search.yaml +0 -27
- package/dist/clis/dictionary/synonyms.yaml +0 -25
- package/dist/clis/douban/subject.yaml +0 -107
- package/dist/clis/douban/top250.yaml +0 -70
- package/dist/clis/facebook/add-friend.yaml +0 -43
- package/dist/clis/facebook/events.yaml +0 -44
- package/dist/clis/facebook/feed.yaml +0 -63
- package/dist/clis/facebook/friends.yaml +0 -42
- package/dist/clis/facebook/groups.yaml +0 -50
- package/dist/clis/facebook/join-group.yaml +0 -44
- package/dist/clis/facebook/memories.yaml +0 -39
- package/dist/clis/facebook/notifications.yaml +0 -40
- package/dist/clis/facebook/profile.yaml +0 -37
- package/dist/clis/facebook/search.yaml +0 -47
- package/dist/clis/hackernews/ask.yaml +0 -38
- package/dist/clis/hackernews/best.yaml +0 -38
- package/dist/clis/hackernews/jobs.yaml +0 -36
- package/dist/clis/hackernews/new.yaml +0 -38
- package/dist/clis/hackernews/search.yaml +0 -44
- package/dist/clis/hackernews/show.yaml +0 -38
- package/dist/clis/hackernews/top.yaml +0 -38
- package/dist/clis/hackernews/user.yaml +0 -25
- package/dist/clis/hupu/hot.yaml +0 -43
- package/dist/clis/instagram/comment.yaml +0 -52
- package/dist/clis/instagram/explore.yaml +0 -43
- package/dist/clis/instagram/follow.yaml +0 -41
- package/dist/clis/instagram/followers.yaml +0 -51
- package/dist/clis/instagram/following.yaml +0 -51
- package/dist/clis/instagram/like.yaml +0 -46
- package/dist/clis/instagram/profile.yaml +0 -42
- package/dist/clis/instagram/save.yaml +0 -46
- package/dist/clis/instagram/saved.yaml +0 -40
- package/dist/clis/instagram/search.yaml +0 -44
- package/dist/clis/instagram/unfollow.yaml +0 -38
- package/dist/clis/instagram/unlike.yaml +0 -46
- package/dist/clis/instagram/unsave.yaml +0 -46
- package/dist/clis/instagram/user.yaml +0 -54
- package/dist/clis/jike/post.yaml +0 -59
- package/dist/clis/jike/topic.yaml +0 -53
- package/dist/clis/jike/user.yaml +0 -52
- package/dist/clis/jimeng/generate.yaml +0 -85
- package/dist/clis/jimeng/history.yaml +0 -46
- package/dist/clis/linux-do/categories.yaml +0 -70
- package/dist/clis/linux-do/search.yaml +0 -48
- package/dist/clis/linux-do/tags.yaml +0 -41
- package/dist/clis/linux-do/topic.yaml +0 -62
- package/dist/clis/linux-do/user-posts.yaml +0 -67
- package/dist/clis/linux-do/user-topics.yaml +0 -54
- package/dist/clis/lobsters/active.yaml +0 -29
- package/dist/clis/lobsters/hot.yaml +0 -29
- package/dist/clis/lobsters/newest.yaml +0 -29
- package/dist/clis/lobsters/tag.yaml +0 -34
- package/dist/clis/pixiv/detail.yaml +0 -49
- package/dist/clis/pixiv/ranking.yaml +0 -53
- package/dist/clis/pixiv/user.yaml +0 -46
- package/dist/clis/reddit/frontpage.yaml +0 -30
- package/dist/clis/reddit/hot.yaml +0 -47
- package/dist/clis/reddit/popular.yaml +0 -40
- package/dist/clis/reddit/search.yaml +0 -61
- package/dist/clis/reddit/subreddit.yaml +0 -50
- package/dist/clis/reddit/user-comments.yaml +0 -46
- package/dist/clis/reddit/user-posts.yaml +0 -44
- package/dist/clis/reddit/user.yaml +0 -40
- package/dist/clis/stackoverflow/bounties.yaml +0 -29
- package/dist/clis/stackoverflow/hot.yaml +0 -28
- package/dist/clis/stackoverflow/search.yaml +0 -33
- package/dist/clis/stackoverflow/unanswered.yaml +0 -28
- package/dist/clis/steam/top-sellers.yaml +0 -29
- package/dist/clis/tiktok/comment.yaml +0 -66
- package/dist/clis/tiktok/explore.yaml +0 -39
- package/dist/clis/tiktok/follow.yaml +0 -39
- package/dist/clis/tiktok/following.yaml +0 -46
- package/dist/clis/tiktok/friends.yaml +0 -47
- package/dist/clis/tiktok/like.yaml +0 -38
- package/dist/clis/tiktok/live.yaml +0 -51
- package/dist/clis/tiktok/notifications.yaml +0 -52
- package/dist/clis/tiktok/profile.yaml +0 -45
- package/dist/clis/tiktok/save.yaml +0 -34
- package/dist/clis/tiktok/search.yaml +0 -47
- package/dist/clis/tiktok/unfollow.yaml +0 -44
- package/dist/clis/tiktok/unlike.yaml +0 -38
- package/dist/clis/tiktok/unsave.yaml +0 -36
- package/dist/clis/tiktok/user.yaml +0 -44
- package/dist/clis/v2ex/hot.yaml +0 -28
- package/dist/clis/v2ex/latest.yaml +0 -28
- package/dist/clis/v2ex/member.yaml +0 -29
- package/dist/clis/v2ex/node.yaml +0 -34
- package/dist/clis/v2ex/nodes.yaml +0 -31
- package/dist/clis/v2ex/replies.yaml +0 -32
- package/dist/clis/v2ex/topic.yaml +0 -33
- package/dist/clis/v2ex/user.yaml +0 -34
- package/dist/clis/xiaoe/catalog.yaml +0 -129
- package/dist/clis/xiaoe/content.yaml +0 -43
- package/dist/clis/xiaoe/courses.yaml +0 -73
- package/dist/clis/xiaoe/detail.yaml +0 -39
- package/dist/clis/xiaoe/play-url.yaml +0 -124
- package/dist/clis/xiaohongshu/feed.yaml +0 -31
- package/dist/clis/xiaohongshu/notifications.yaml +0 -37
- package/dist/clis/xueqiu/earnings-date.yaml +0 -69
- package/dist/clis/xueqiu/feed.yaml +0 -53
- package/dist/clis/xueqiu/groups.yaml +0 -23
- package/dist/clis/xueqiu/hot-stock.yaml +0 -49
- package/dist/clis/xueqiu/hot.yaml +0 -46
- package/dist/clis/xueqiu/kline.yaml +0 -65
- package/dist/clis/xueqiu/search.yaml +0 -55
- package/dist/clis/xueqiu/stock.yaml +0 -69
- package/dist/clis/xueqiu/watchlist.yaml +0 -46
- package/dist/clis/zhihu/hot.yaml +0 -46
- package/dist/clis/zhihu/search.yaml +0 -59
- package/dist/src/browser/discover.d.ts +0 -15
- package/dist/src/browser/discover.js +0 -19
- package/dist/src/yaml-schema.d.ts +0 -29
- package/dist/src/yaml-schema.js +0 -22
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'linux-do',
|
|
4
|
+
name: 'user-topics',
|
|
5
|
+
description: 'linux.do 用户创建的话题',
|
|
6
|
+
domain: 'linux.do',
|
|
7
|
+
strategy: Strategy.COOKIE,
|
|
8
|
+
browser: true,
|
|
9
|
+
args: [
|
|
10
|
+
{ name: 'username', required: true, positional: true, help: 'Username' },
|
|
11
|
+
{ name: 'limit', type: 'int', default: 20, help: 'Number of topics' },
|
|
12
|
+
],
|
|
13
|
+
columns: ['rank', 'title', 'replies', 'created_at', 'likes', 'views', 'url'],
|
|
14
|
+
pipeline: [
|
|
15
|
+
{ navigate: 'https://linux.do' },
|
|
16
|
+
{ evaluate: `(async () => {
|
|
17
|
+
const username = \${{ args.username | json }};
|
|
18
|
+
const toLocalTime = (utcStr) => {
|
|
19
|
+
if (!utcStr) return '';
|
|
20
|
+
const date = new Date(utcStr);
|
|
21
|
+
return Number.isNaN(date.getTime()) ? utcStr : date.toLocaleString();
|
|
22
|
+
};
|
|
23
|
+
const res = await fetch('/topics/created-by/' + encodeURIComponent(username) + '.json', { credentials: 'include' });
|
|
24
|
+
if (!res.ok) throw new Error('HTTP ' + res.status + ' - 请先登录 linux.do');
|
|
25
|
+
let data;
|
|
26
|
+
try { data = await res.json(); } catch { throw new Error('响应不是有效 JSON - 请先登录 linux.do'); }
|
|
27
|
+
const topics = data?.topic_list?.topics || [];
|
|
28
|
+
return topics.slice(0, \${{ args.limit }}).map(t => ({
|
|
29
|
+
title: t.fancy_title || t.title || '',
|
|
30
|
+
replies: t.posts_count || 0,
|
|
31
|
+
created_at: toLocalTime(t.created_at),
|
|
32
|
+
likes: t.like_count || 0,
|
|
33
|
+
views: t.views || 0,
|
|
34
|
+
url: 'https://linux.do/t/topic/' + t.id,
|
|
35
|
+
}));
|
|
36
|
+
})()
|
|
37
|
+
` },
|
|
38
|
+
{ map: {
|
|
39
|
+
rank: '${{ index + 1 }}',
|
|
40
|
+
title: '${{ item.title }}',
|
|
41
|
+
replies: '${{ item.replies }}',
|
|
42
|
+
created_at: '${{ item.created_at }}',
|
|
43
|
+
likes: '${{ item.likes }}',
|
|
44
|
+
views: '${{ item.views }}',
|
|
45
|
+
url: '${{ item.url }}',
|
|
46
|
+
} },
|
|
47
|
+
],
|
|
48
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'lobsters',
|
|
4
|
+
name: 'active',
|
|
5
|
+
description: 'Lobste.rs most active discussions',
|
|
6
|
+
domain: 'lobste.rs',
|
|
7
|
+
strategy: Strategy.PUBLIC,
|
|
8
|
+
browser: false,
|
|
9
|
+
args: [
|
|
10
|
+
{ name: 'limit', type: 'int', default: 20, help: 'Number of stories' },
|
|
11
|
+
],
|
|
12
|
+
columns: ['rank', 'title', 'score', 'author', 'comments', 'tags'],
|
|
13
|
+
pipeline: [
|
|
14
|
+
{ fetch: { url: 'https://lobste.rs/active.json' } },
|
|
15
|
+
{ map: {
|
|
16
|
+
rank: '${{ index + 1 }}',
|
|
17
|
+
title: '${{ item.title }}',
|
|
18
|
+
score: '${{ item.score }}',
|
|
19
|
+
author: '${{ item.submitter_user }}',
|
|
20
|
+
comments: '${{ item.comment_count }}',
|
|
21
|
+
tags: `\${{ item.tags | join(', ') }}`,
|
|
22
|
+
url: '${{ item.comments_url }}',
|
|
23
|
+
} },
|
|
24
|
+
{ limit: '${{ args.limit }}' },
|
|
25
|
+
],
|
|
26
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'lobsters',
|
|
4
|
+
name: 'hot',
|
|
5
|
+
description: 'Lobste.rs hottest stories',
|
|
6
|
+
domain: 'lobste.rs',
|
|
7
|
+
strategy: Strategy.PUBLIC,
|
|
8
|
+
browser: false,
|
|
9
|
+
args: [
|
|
10
|
+
{ name: 'limit', type: 'int', default: 20, help: 'Number of stories' },
|
|
11
|
+
],
|
|
12
|
+
columns: ['rank', 'title', 'score', 'author', 'comments', 'tags'],
|
|
13
|
+
pipeline: [
|
|
14
|
+
{ fetch: { url: 'https://lobste.rs/hottest.json' } },
|
|
15
|
+
{ map: {
|
|
16
|
+
rank: '${{ index + 1 }}',
|
|
17
|
+
title: '${{ item.title }}',
|
|
18
|
+
score: '${{ item.score }}',
|
|
19
|
+
author: '${{ item.submitter_user }}',
|
|
20
|
+
comments: '${{ item.comment_count }}',
|
|
21
|
+
tags: `\${{ item.tags | join(', ') }}`,
|
|
22
|
+
url: '${{ item.comments_url }}',
|
|
23
|
+
} },
|
|
24
|
+
{ limit: '${{ args.limit }}' },
|
|
25
|
+
],
|
|
26
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'lobsters',
|
|
4
|
+
name: 'newest',
|
|
5
|
+
description: 'Lobste.rs newest stories',
|
|
6
|
+
domain: 'lobste.rs',
|
|
7
|
+
strategy: Strategy.PUBLIC,
|
|
8
|
+
browser: false,
|
|
9
|
+
args: [
|
|
10
|
+
{ name: 'limit', type: 'int', default: 20, help: 'Number of stories' },
|
|
11
|
+
],
|
|
12
|
+
columns: ['rank', 'title', 'score', 'author', 'comments', 'tags'],
|
|
13
|
+
pipeline: [
|
|
14
|
+
{ fetch: { url: 'https://lobste.rs/newest.json' } },
|
|
15
|
+
{ map: {
|
|
16
|
+
rank: '${{ index + 1 }}',
|
|
17
|
+
title: '${{ item.title }}',
|
|
18
|
+
score: '${{ item.score }}',
|
|
19
|
+
author: '${{ item.submitter_user }}',
|
|
20
|
+
comments: '${{ item.comment_count }}',
|
|
21
|
+
tags: `\${{ item.tags | join(', ') }}`,
|
|
22
|
+
url: '${{ item.comments_url }}',
|
|
23
|
+
} },
|
|
24
|
+
{ limit: '${{ args.limit }}' },
|
|
25
|
+
],
|
|
26
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'lobsters',
|
|
4
|
+
name: 'tag',
|
|
5
|
+
description: 'Lobste.rs stories by tag',
|
|
6
|
+
domain: 'lobste.rs',
|
|
7
|
+
strategy: Strategy.PUBLIC,
|
|
8
|
+
browser: false,
|
|
9
|
+
args: [
|
|
10
|
+
{
|
|
11
|
+
name: 'tag',
|
|
12
|
+
required: true,
|
|
13
|
+
positional: true,
|
|
14
|
+
help: 'Tag name (e.g. programming, rust, security, ai)',
|
|
15
|
+
},
|
|
16
|
+
{ name: 'limit', type: 'int', default: 20, help: 'Number of stories' },
|
|
17
|
+
],
|
|
18
|
+
columns: ['rank', 'title', 'score', 'author', 'comments', 'tags'],
|
|
19
|
+
pipeline: [
|
|
20
|
+
{ fetch: { url: 'https://lobste.rs/t/${{ args.tag }}.json' } },
|
|
21
|
+
{ map: {
|
|
22
|
+
rank: '${{ index + 1 }}',
|
|
23
|
+
title: '${{ item.title }}',
|
|
24
|
+
score: '${{ item.score }}',
|
|
25
|
+
author: '${{ item.submitter_user }}',
|
|
26
|
+
comments: '${{ item.comment_count }}',
|
|
27
|
+
tags: `\${{ item.tags | join(', ') }}`,
|
|
28
|
+
url: '${{ item.comments_url }}',
|
|
29
|
+
} },
|
|
30
|
+
{ limit: '${{ args.limit }}' },
|
|
31
|
+
],
|
|
32
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'pixiv',
|
|
4
|
+
name: 'detail',
|
|
5
|
+
description: 'View illustration details (tags, stats, URLs)',
|
|
6
|
+
domain: 'www.pixiv.net',
|
|
7
|
+
strategy: Strategy.COOKIE,
|
|
8
|
+
browser: true,
|
|
9
|
+
args: [
|
|
10
|
+
{ name: 'id', required: true, positional: true, help: 'Illustration ID' },
|
|
11
|
+
],
|
|
12
|
+
columns: [
|
|
13
|
+
'illust_id',
|
|
14
|
+
'title',
|
|
15
|
+
'author',
|
|
16
|
+
'type',
|
|
17
|
+
'pages',
|
|
18
|
+
'bookmarks',
|
|
19
|
+
'likes',
|
|
20
|
+
'views',
|
|
21
|
+
'tags',
|
|
22
|
+
'created',
|
|
23
|
+
'url',
|
|
24
|
+
],
|
|
25
|
+
pipeline: [
|
|
26
|
+
{ navigate: 'https://www.pixiv.net' },
|
|
27
|
+
{ evaluate: `(async () => {
|
|
28
|
+
const id = \${{ args.id | json }};
|
|
29
|
+
const res = await fetch(
|
|
30
|
+
'https://www.pixiv.net/ajax/illust/' + id,
|
|
31
|
+
{ credentials: 'include' }
|
|
32
|
+
);
|
|
33
|
+
if (!res.ok) {
|
|
34
|
+
if (res.status === 401 || res.status === 403) throw new Error('Authentication required — please log in to Pixiv in Chrome');
|
|
35
|
+
if (res.status === 404) throw new Error('Illustration not found: ' + id);
|
|
36
|
+
throw new Error('Pixiv request failed (HTTP ' + res.status + ')');
|
|
37
|
+
}
|
|
38
|
+
const data = await res.json();
|
|
39
|
+
const b = data?.body;
|
|
40
|
+
if (!b) throw new Error('Illustration not found');
|
|
41
|
+
return [{
|
|
42
|
+
illust_id: b.illustId,
|
|
43
|
+
title: b.illustTitle,
|
|
44
|
+
author: b.userName,
|
|
45
|
+
user_id: b.userId,
|
|
46
|
+
type: b.illustType === 0 ? 'illust' : b.illustType === 1 ? 'manga' : b.illustType === 2 ? 'ugoira' : String(b.illustType),
|
|
47
|
+
pages: b.pageCount,
|
|
48
|
+
bookmarks: b.bookmarkCount,
|
|
49
|
+
likes: b.likeCount,
|
|
50
|
+
views: b.viewCount,
|
|
51
|
+
tags: (b.tags?.tags || []).map(t => t.tag).join(', '),
|
|
52
|
+
created: b.createDate?.split('T')[0] || '',
|
|
53
|
+
url: 'https://www.pixiv.net/artworks/' + b.illustId
|
|
54
|
+
}];
|
|
55
|
+
})()
|
|
56
|
+
` },
|
|
57
|
+
],
|
|
58
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'pixiv',
|
|
4
|
+
name: 'ranking',
|
|
5
|
+
description: 'Pixiv illustration rankings (daily/weekly/monthly)',
|
|
6
|
+
domain: 'www.pixiv.net',
|
|
7
|
+
strategy: Strategy.COOKIE,
|
|
8
|
+
browser: true,
|
|
9
|
+
args: [
|
|
10
|
+
{
|
|
11
|
+
name: 'mode',
|
|
12
|
+
default: 'daily',
|
|
13
|
+
help: 'Ranking mode',
|
|
14
|
+
choices: [
|
|
15
|
+
'daily',
|
|
16
|
+
'weekly',
|
|
17
|
+
'monthly',
|
|
18
|
+
'rookie',
|
|
19
|
+
'original',
|
|
20
|
+
'male',
|
|
21
|
+
'female',
|
|
22
|
+
'daily_r18',
|
|
23
|
+
'weekly_r18',
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
{ name: 'page', type: 'int', default: 1, help: 'Page number' },
|
|
27
|
+
{ name: 'limit', type: 'int', default: 20, help: 'Number of results' },
|
|
28
|
+
],
|
|
29
|
+
columns: ['rank', 'title', 'author', 'illust_id', 'pages', 'bookmarks'],
|
|
30
|
+
pipeline: [
|
|
31
|
+
{ navigate: 'https://www.pixiv.net' },
|
|
32
|
+
{ evaluate: `(async () => {
|
|
33
|
+
const mode = \${{ args.mode | json }};
|
|
34
|
+
const page = \${{ args.page | json }};
|
|
35
|
+
const limit = \${{ args.limit | json }};
|
|
36
|
+
const res = await fetch(
|
|
37
|
+
'https://www.pixiv.net/ranking.php?mode=' + mode + '&p=' + page + '&format=json',
|
|
38
|
+
{ credentials: 'include' }
|
|
39
|
+
);
|
|
40
|
+
if (!res.ok) {
|
|
41
|
+
if (res.status === 401 || res.status === 403) throw new Error('Authentication required — please log in to Pixiv in Chrome');
|
|
42
|
+
throw new Error('Pixiv request failed (HTTP ' + res.status + ')');
|
|
43
|
+
}
|
|
44
|
+
const data = await res.json();
|
|
45
|
+
const items = (data?.contents || []).slice(0, limit);
|
|
46
|
+
return items.map((item, i) => ({
|
|
47
|
+
rank: item.rank,
|
|
48
|
+
title: item.title,
|
|
49
|
+
author: item.user_name,
|
|
50
|
+
user_id: item.user_id,
|
|
51
|
+
illust_id: item.illust_id,
|
|
52
|
+
pages: item.illust_page_count,
|
|
53
|
+
bookmarks: item.illust_bookmark_count,
|
|
54
|
+
url: 'https://www.pixiv.net/artworks/' + item.illust_id
|
|
55
|
+
}));
|
|
56
|
+
})()
|
|
57
|
+
` },
|
|
58
|
+
],
|
|
59
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'pixiv',
|
|
4
|
+
name: 'user',
|
|
5
|
+
description: 'View Pixiv artist profile',
|
|
6
|
+
domain: 'www.pixiv.net',
|
|
7
|
+
strategy: Strategy.COOKIE,
|
|
8
|
+
browser: true,
|
|
9
|
+
args: [
|
|
10
|
+
{ name: 'uid', required: true, positional: true, help: 'Pixiv user ID' },
|
|
11
|
+
],
|
|
12
|
+
columns: [
|
|
13
|
+
'user_id',
|
|
14
|
+
'name',
|
|
15
|
+
'premium',
|
|
16
|
+
'following',
|
|
17
|
+
'illusts',
|
|
18
|
+
'manga',
|
|
19
|
+
'novels',
|
|
20
|
+
'comment',
|
|
21
|
+
],
|
|
22
|
+
pipeline: [
|
|
23
|
+
{ navigate: 'https://www.pixiv.net' },
|
|
24
|
+
{ evaluate: `(async () => {
|
|
25
|
+
const uid = \${{ args.uid | json }};
|
|
26
|
+
const res = await fetch(
|
|
27
|
+
'https://www.pixiv.net/ajax/user/' + uid + '?full=1',
|
|
28
|
+
{ credentials: 'include' }
|
|
29
|
+
);
|
|
30
|
+
if (!res.ok) {
|
|
31
|
+
if (res.status === 401 || res.status === 403) throw new Error('Authentication required — please log in to Pixiv in Chrome');
|
|
32
|
+
if (res.status === 404) throw new Error('User not found: ' + uid);
|
|
33
|
+
throw new Error('Pixiv request failed (HTTP ' + res.status + ')');
|
|
34
|
+
}
|
|
35
|
+
const data = await res.json();
|
|
36
|
+
const b = data?.body;
|
|
37
|
+
if (!b) throw new Error('User not found');
|
|
38
|
+
return [{
|
|
39
|
+
user_id: uid,
|
|
40
|
+
name: b.name,
|
|
41
|
+
premium: b.premium ? 'Yes' : 'No',
|
|
42
|
+
following: b.following,
|
|
43
|
+
illusts: typeof b.illusts === 'object' ? Object.keys(b.illusts).length : (b.illusts || 0),
|
|
44
|
+
manga: typeof b.manga === 'object' ? Object.keys(b.manga).length : (b.manga || 0),
|
|
45
|
+
novels: typeof b.novels === 'object' ? Object.keys(b.novels).length : (b.novels || 0),
|
|
46
|
+
comment: (b.comment || '').slice(0, 80),
|
|
47
|
+
url: 'https://www.pixiv.net/users/' + uid
|
|
48
|
+
}];
|
|
49
|
+
})()
|
|
50
|
+
` },
|
|
51
|
+
],
|
|
52
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
+
import { findFolder, formatSize, listMyDrive, } from './utils.js';
|
|
3
|
+
async function buildTree(page, pdirFid, parentPath, depth, maxDepth, dirsOnly) {
|
|
4
|
+
if (depth > maxDepth)
|
|
5
|
+
return [];
|
|
6
|
+
const files = await listMyDrive(page, pdirFid);
|
|
7
|
+
const nodes = [];
|
|
8
|
+
for (const file of files) {
|
|
9
|
+
if (dirsOnly && !file.dir)
|
|
10
|
+
continue;
|
|
11
|
+
const path = parentPath ? `${parentPath}/${file.file_name}` : file.file_name;
|
|
12
|
+
const node = {
|
|
13
|
+
name: file.file_name,
|
|
14
|
+
fid: file.fid,
|
|
15
|
+
is_dir: file.dir,
|
|
16
|
+
size: formatSize(file.size),
|
|
17
|
+
path,
|
|
18
|
+
};
|
|
19
|
+
if (file.dir && depth < maxDepth) {
|
|
20
|
+
node.children = await buildTree(page, file.fid, path, depth + 1, maxDepth, dirsOnly);
|
|
21
|
+
}
|
|
22
|
+
nodes.push(node);
|
|
23
|
+
}
|
|
24
|
+
return nodes;
|
|
25
|
+
}
|
|
26
|
+
function flattenTree(nodes, level = 0) {
|
|
27
|
+
const result = [];
|
|
28
|
+
const indent = ' '.repeat(level);
|
|
29
|
+
for (const node of nodes) {
|
|
30
|
+
result.push({
|
|
31
|
+
name: `${indent}${node.name}`,
|
|
32
|
+
fid: node.fid,
|
|
33
|
+
is_dir: node.is_dir,
|
|
34
|
+
size: node.size,
|
|
35
|
+
path: node.path,
|
|
36
|
+
});
|
|
37
|
+
if (node.children) {
|
|
38
|
+
result.push(...flattenTree(node.children, level + 1));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
cli({
|
|
44
|
+
site: 'quark',
|
|
45
|
+
name: 'ls',
|
|
46
|
+
description: 'List files in your Quark Drive',
|
|
47
|
+
domain: 'pan.quark.cn',
|
|
48
|
+
strategy: Strategy.COOKIE,
|
|
49
|
+
args: [
|
|
50
|
+
{ name: 'path', positional: true, default: '', help: 'Folder path to list (empty for root)' },
|
|
51
|
+
{ name: 'depth', type: 'int', default: 0, help: 'Max depth to traverse' },
|
|
52
|
+
{ name: 'dirs-only', type: 'boolean', default: false, help: 'Show directories only' },
|
|
53
|
+
],
|
|
54
|
+
columns: ['name', 'is_dir', 'size', 'fid', 'path'],
|
|
55
|
+
func: async (page, kwargs) => {
|
|
56
|
+
const path = kwargs.path ?? '';
|
|
57
|
+
const depth = Math.max(0, kwargs.depth ?? 0);
|
|
58
|
+
const dirsOnly = kwargs['dirs-only'] ?? false;
|
|
59
|
+
const rootFid = path ? await findFolder(page, path) : '0';
|
|
60
|
+
const tree = await buildTree(page, rootFid, path, 0, depth, dirsOnly);
|
|
61
|
+
return flattenTree(tree);
|
|
62
|
+
},
|
|
63
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ArgumentError } from '@jackwener/opencli/errors';
|
|
2
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
3
|
+
import { DRIVE_API, apiPost, findFolder } from './utils.js';
|
|
4
|
+
cli({
|
|
5
|
+
site: 'quark',
|
|
6
|
+
name: 'mkdir',
|
|
7
|
+
description: 'Create a folder in your Quark Drive',
|
|
8
|
+
domain: 'pan.quark.cn',
|
|
9
|
+
strategy: Strategy.COOKIE,
|
|
10
|
+
defaultFormat: 'json',
|
|
11
|
+
args: [
|
|
12
|
+
{ name: 'name', required: true, positional: true, help: 'Folder name' },
|
|
13
|
+
{ name: 'parent', help: 'Parent folder path (resolved by name)' },
|
|
14
|
+
{ name: 'parent-fid', help: 'Parent folder fid (use directly)' },
|
|
15
|
+
],
|
|
16
|
+
func: async (page, kwargs) => {
|
|
17
|
+
const name = kwargs.name;
|
|
18
|
+
if (!name.trim())
|
|
19
|
+
throw new ArgumentError('Folder name cannot be empty');
|
|
20
|
+
if (kwargs.parent && kwargs['parent-fid']) {
|
|
21
|
+
throw new ArgumentError('Cannot use both --parent and --parent-fid');
|
|
22
|
+
}
|
|
23
|
+
const parentFid = kwargs['parent-fid']
|
|
24
|
+
? kwargs['parent-fid']
|
|
25
|
+
: kwargs.parent
|
|
26
|
+
? await findFolder(page, kwargs.parent)
|
|
27
|
+
: '0';
|
|
28
|
+
const data = await apiPost(page, `${DRIVE_API}?pr=ucpro&fr=pc`, {
|
|
29
|
+
pdir_fid: parentFid,
|
|
30
|
+
file_name: name,
|
|
31
|
+
dir_path: '',
|
|
32
|
+
dir_init_lock: false,
|
|
33
|
+
});
|
|
34
|
+
return { status: 'ok', fid: data.fid, name };
|
|
35
|
+
},
|
|
36
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ArgumentError, CommandExecutionError } from '@jackwener/opencli/errors';
|
|
2
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
3
|
+
import { DRIVE_API, apiPost, findFolder, pollTask } from './utils.js';
|
|
4
|
+
cli({
|
|
5
|
+
site: 'quark',
|
|
6
|
+
name: 'mv',
|
|
7
|
+
description: 'Move files to a folder in your Quark Drive',
|
|
8
|
+
domain: 'pan.quark.cn',
|
|
9
|
+
strategy: Strategy.COOKIE,
|
|
10
|
+
defaultFormat: 'json',
|
|
11
|
+
timeoutSeconds: 120,
|
|
12
|
+
args: [
|
|
13
|
+
{ name: 'fids', required: true, positional: true, help: 'File IDs to move (comma-separated)' },
|
|
14
|
+
{ name: 'to', default: '', help: 'Destination folder path (required unless --to-fid is set)' },
|
|
15
|
+
{ name: 'to-fid', default: '', help: 'Destination folder ID (overrides --to)' },
|
|
16
|
+
],
|
|
17
|
+
func: async (page, kwargs) => {
|
|
18
|
+
const to = kwargs.to;
|
|
19
|
+
const toFid = kwargs['to-fid'];
|
|
20
|
+
const fids = kwargs.fids;
|
|
21
|
+
const fidList = [...new Set(fids.split(',').map(id => id.trim()).filter(Boolean))];
|
|
22
|
+
if (fidList.length === 0)
|
|
23
|
+
throw new ArgumentError('No fids provided');
|
|
24
|
+
if (!to && !toFid)
|
|
25
|
+
throw new ArgumentError('Either --to or --to-fid is required');
|
|
26
|
+
if (to && toFid)
|
|
27
|
+
throw new ArgumentError('Cannot use both --to and --to-fid');
|
|
28
|
+
const targetFid = toFid || await findFolder(page, to);
|
|
29
|
+
const data = await apiPost(page, `${DRIVE_API}/move?pr=ucpro&fr=pc`, {
|
|
30
|
+
filelist: fidList,
|
|
31
|
+
to_pdir_fid: targetFid,
|
|
32
|
+
});
|
|
33
|
+
const result = {
|
|
34
|
+
status: 'pending',
|
|
35
|
+
count: fidList.length,
|
|
36
|
+
destination: to || toFid,
|
|
37
|
+
task_id: data.task_id,
|
|
38
|
+
completed: false,
|
|
39
|
+
};
|
|
40
|
+
if (data.task_id) {
|
|
41
|
+
const completed = await pollTask(page, data.task_id);
|
|
42
|
+
result.completed = completed;
|
|
43
|
+
result.status = completed ? 'ok' : 'error';
|
|
44
|
+
if (!completed)
|
|
45
|
+
throw new CommandExecutionError('quark: Move task timed out');
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
result.status = 'ok';
|
|
49
|
+
result.completed = true;
|
|
50
|
+
}
|
|
51
|
+
return result;
|
|
52
|
+
},
|
|
53
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ArgumentError } from '@jackwener/opencli/errors';
|
|
2
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
3
|
+
import { DRIVE_API, apiPost } from './utils.js';
|
|
4
|
+
cli({
|
|
5
|
+
site: 'quark',
|
|
6
|
+
name: 'rename',
|
|
7
|
+
description: 'Rename a file in your Quark Drive',
|
|
8
|
+
domain: 'pan.quark.cn',
|
|
9
|
+
strategy: Strategy.COOKIE,
|
|
10
|
+
defaultFormat: 'json',
|
|
11
|
+
args: [
|
|
12
|
+
{ name: 'fid', required: true, positional: true, help: 'File ID to rename' },
|
|
13
|
+
{ name: 'name', required: true, help: 'New file name' },
|
|
14
|
+
],
|
|
15
|
+
func: async (page, kwargs) => {
|
|
16
|
+
const fid = kwargs.fid;
|
|
17
|
+
const name = kwargs.name;
|
|
18
|
+
if (!name.trim())
|
|
19
|
+
throw new ArgumentError('New name cannot be empty');
|
|
20
|
+
await apiPost(page, `${DRIVE_API}/rename?pr=ucpro&fr=pc`, {
|
|
21
|
+
fid,
|
|
22
|
+
file_name: name,
|
|
23
|
+
});
|
|
24
|
+
return { status: 'ok', fid, new_name: name };
|
|
25
|
+
},
|
|
26
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ArgumentError } from '@jackwener/opencli/errors';
|
|
2
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
3
|
+
import { DRIVE_API, apiPost } from './utils.js';
|
|
4
|
+
cli({
|
|
5
|
+
site: 'quark',
|
|
6
|
+
name: 'rm',
|
|
7
|
+
description: 'Delete files from your Quark Drive',
|
|
8
|
+
domain: 'pan.quark.cn',
|
|
9
|
+
strategy: Strategy.COOKIE,
|
|
10
|
+
defaultFormat: 'json',
|
|
11
|
+
args: [
|
|
12
|
+
{ name: 'fids', required: true, positional: true, help: 'File IDs to delete (comma-separated)' },
|
|
13
|
+
],
|
|
14
|
+
func: async (page, kwargs) => {
|
|
15
|
+
const fids = kwargs.fids;
|
|
16
|
+
const fidList = [...new Set(fids.split(',').map(id => id.trim()).filter(Boolean))];
|
|
17
|
+
if (fidList.length === 0)
|
|
18
|
+
throw new ArgumentError('No fids provided');
|
|
19
|
+
await apiPost(page, `${DRIVE_API}/delete?pr=ucpro&fr=pc`, {
|
|
20
|
+
filelist: fidList,
|
|
21
|
+
});
|
|
22
|
+
return { status: 'ok', count: fidList.length, deleted_fids: fidList };
|
|
23
|
+
},
|
|
24
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ArgumentError, CommandExecutionError } from '@jackwener/opencli/errors';
|
|
2
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
3
|
+
import { SHARE_API, extractPwdId, apiPost, getToken, pollTask, findFolder, } from './utils.js';
|
|
4
|
+
async function saveShare(page, pwdId, stoken, fidList, targetFid, saveAll) {
|
|
5
|
+
const data = await apiPost(page, `${SHARE_API}/save?pr=ucpro&fr=pc`, {
|
|
6
|
+
pwd_id: pwdId,
|
|
7
|
+
stoken,
|
|
8
|
+
pdir_fid: '0',
|
|
9
|
+
to_pdir_fid: targetFid,
|
|
10
|
+
fid_list: fidList,
|
|
11
|
+
pdir_save_all: saveAll,
|
|
12
|
+
scene: 'link',
|
|
13
|
+
});
|
|
14
|
+
return data.task_id;
|
|
15
|
+
}
|
|
16
|
+
cli({
|
|
17
|
+
site: 'quark',
|
|
18
|
+
name: 'save',
|
|
19
|
+
description: 'Save shared files to your Quark Drive',
|
|
20
|
+
domain: 'pan.quark.cn',
|
|
21
|
+
strategy: Strategy.COOKIE,
|
|
22
|
+
defaultFormat: 'json',
|
|
23
|
+
timeoutSeconds: 120,
|
|
24
|
+
args: [
|
|
25
|
+
{ name: 'url', required: true, positional: true, help: 'Quark share URL or pwd_id' },
|
|
26
|
+
{ name: 'to', default: '', help: 'Destination folder path' },
|
|
27
|
+
{ name: 'to-fid', default: '', help: 'Destination folder ID (overrides --to)' },
|
|
28
|
+
{ name: 'fids', default: '', help: 'File IDs to save (comma-separated, from share-tree). Omit to save all.' },
|
|
29
|
+
{ name: 'stoken', default: '', help: 'Share token (from share-tree output, required with --fids)' },
|
|
30
|
+
{ name: 'passcode', default: '', help: 'Share passcode (if required)' },
|
|
31
|
+
],
|
|
32
|
+
func: async (page, kwargs) => {
|
|
33
|
+
const url = kwargs.url;
|
|
34
|
+
const to = kwargs.to;
|
|
35
|
+
const toFid = kwargs['to-fid'];
|
|
36
|
+
const fids = kwargs.fids;
|
|
37
|
+
const stokenArg = kwargs.stoken;
|
|
38
|
+
const passcode = kwargs.passcode;
|
|
39
|
+
if (!to && !toFid)
|
|
40
|
+
throw new ArgumentError('Either --to or --to-fid is required');
|
|
41
|
+
if (to && toFid)
|
|
42
|
+
throw new ArgumentError('Cannot use both --to and --to-fid');
|
|
43
|
+
const pwdId = extractPwdId(url);
|
|
44
|
+
const saveAll = !fids;
|
|
45
|
+
let stoken;
|
|
46
|
+
let fidList;
|
|
47
|
+
if (saveAll) {
|
|
48
|
+
stoken = stokenArg || await getToken(page, pwdId, passcode);
|
|
49
|
+
fidList = [];
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
if (!stokenArg)
|
|
53
|
+
throw new ArgumentError('--stoken is required when using --fids');
|
|
54
|
+
stoken = stokenArg;
|
|
55
|
+
fidList = [...new Set(fids.split(',').map(id => id.trim()).filter(Boolean))];
|
|
56
|
+
}
|
|
57
|
+
const targetFid = toFid || await findFolder(page, to);
|
|
58
|
+
const taskId = await saveShare(page, pwdId, stoken, fidList, targetFid, saveAll);
|
|
59
|
+
const result = {
|
|
60
|
+
success: false,
|
|
61
|
+
task_id: taskId,
|
|
62
|
+
saved_to: to || toFid,
|
|
63
|
+
target_fid: targetFid,
|
|
64
|
+
...(saveAll ? {} : { fids: fidList }),
|
|
65
|
+
};
|
|
66
|
+
if (taskId) {
|
|
67
|
+
const completed = await pollTask(page, taskId, (task) => {
|
|
68
|
+
result.save_count = task.save_as?.save_as_sum_num;
|
|
69
|
+
});
|
|
70
|
+
result.completed = completed;
|
|
71
|
+
result.success = completed;
|
|
72
|
+
if (!completed)
|
|
73
|
+
throw new CommandExecutionError('quark: Save task timed out');
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
result.success = true;
|
|
77
|
+
}
|
|
78
|
+
return result;
|
|
79
|
+
},
|
|
80
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|