@sovovs/bycli 1.8.0 → 2.1.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/cli-manifest.json +0 -61
- package/clis/twitter/search.js +3 -3
- package/dist/src/adapter-shadow.js +2 -2
- package/dist/src/browser/analyze.d.ts +10 -99
- package/dist/src/browser/analyze.js +10 -226
- package/dist/src/browser/cdp.js +67 -7
- package/dist/src/browser/daemon-client.d.ts +2 -0
- package/dist/src/browser/daemon-client.js +1 -1
- package/dist/src/browser/extension-capabilities.d.ts +13 -0
- package/dist/src/browser/extension-capabilities.js +22 -0
- package/dist/src/browser/extension-capabilities.test.d.ts +1 -0
- package/dist/src/browser/extension-version-metadata.test.d.ts +1 -0
- package/dist/src/browser/navigation-guard.d.ts +78 -0
- package/dist/src/browser/navigation-guard.js +142 -0
- package/dist/src/browser/navigation-guard.test.d.ts +1 -0
- package/dist/src/browser/page.d.ts +1 -0
- package/dist/src/browser/page.js +20 -1
- package/dist/src/browser/url-policy.d.ts +89 -0
- package/dist/src/browser/url-policy.js +311 -0
- package/dist/src/browser/url-policy.test.d.ts +1 -0
- package/dist/src/browser/verify-fixture.js +2 -2
- package/dist/src/build-manifest.js +4 -2
- package/dist/src/capabilityRouting.d.ts +3 -2
- package/dist/src/capabilityRouting.js +10 -2
- package/dist/src/cli.js +11 -14
- package/dist/src/commanderAdapter.js +5 -5
- package/dist/src/config-paths.d.ts +19 -0
- package/dist/src/config-paths.js +31 -0
- package/dist/src/daemon.js +256 -0
- package/dist/src/discovery.d.ts +10 -3
- package/dist/src/discovery.js +20 -10
- package/dist/src/discovery.test.d.ts +1 -0
- package/dist/src/execution.d.ts +5 -0
- package/dist/src/execution.js +272 -48
- package/dist/src/help.js +8 -8
- package/dist/src/main.js +18 -2
- package/dist/src/manifest-schema.d.ts +9 -0
- package/dist/src/manifest-schema.js +162 -0
- package/dist/src/manifest-schema.test.d.ts +1 -0
- package/dist/src/manifest-types.d.ts +1 -1
- package/dist/src/observation/redaction.js +10 -4
- package/dist/src/plugin.js +11 -8
- package/dist/src/recorder/highlevel/analyze.d.ts +29 -0
- package/dist/src/recorder/highlevel/analyze.js +91 -0
- package/dist/src/recorder/highlevel/init.d.ts +125 -0
- package/dist/src/recorder/highlevel/init.js +279 -0
- package/dist/src/recorder/highlevel/init.test.d.ts +1 -0
- package/dist/src/recorder/highlevel/verify.d.ts +73 -0
- package/dist/src/recorder/highlevel/verify.js +74 -0
- package/dist/src/recorder/http/analyze-runner.d.ts +28 -0
- package/dist/src/recorder/http/analyze-runner.js +78 -0
- package/dist/src/recorder/http/analyze-runner.test.d.ts +1 -0
- package/dist/src/recorder/http/handlers.d.ts +51 -0
- package/dist/src/recorder/http/handlers.js +219 -0
- package/dist/src/recorder/http/wrapper-config.d.ts +20 -0
- package/dist/src/recorder/http/wrapper-config.js +82 -0
- package/dist/src/recorder/http/wrapper-envelope.d.ts +31 -0
- package/dist/src/recorder/http/wrapper-envelope.js +51 -0
- package/dist/src/recorder/http/wrapper-gates.d.ts +16 -0
- package/dist/src/recorder/http/wrapper-gates.js +28 -0
- package/dist/src/recorder/http/wrapper-metrics.d.ts +1 -0
- package/dist/src/recorder/http/wrapper-metrics.js +5 -0
- package/dist/src/recorder/http/wrapper-registry.d.ts +50 -0
- package/dist/src/recorder/http/wrapper-registry.js +98 -0
- package/dist/src/recorder/http/wrapper-server.d.ts +59 -0
- package/dist/src/recorder/http/wrapper-server.js +240 -0
- package/dist/src/recorder/http/wrapper.test.d.ts +1 -0
- package/dist/src/recorder/observability/logger.d.ts +5 -0
- package/dist/src/recorder/observability/logger.js +13 -0
- package/dist/src/recorder/runner/config.d.ts +34 -0
- package/dist/src/recorder/runner/config.js +84 -0
- package/dist/src/recorder/runner/config.test.d.ts +1 -0
- package/dist/src/recorder/runner/reap.d.ts +79 -0
- package/dist/src/recorder/runner/reap.js +230 -0
- package/dist/src/recorder/runner/reap.test.d.ts +1 -0
- package/dist/src/recorder/runner/runner-port.d.ts +95 -0
- package/dist/src/recorder/runner/runner-port.js +518 -0
- package/dist/src/recorder/runner/runner-port.test.d.ts +1 -0
- package/dist/src/recorder/runner/session-keys.d.ts +28 -0
- package/dist/src/recorder/runner/session-keys.js +72 -0
- package/dist/src/recorder/runner/session-keys.test.d.ts +1 -0
- package/dist/src/recorder/runner/verify-runner-main.d.ts +96 -0
- package/dist/src/recorder/runner/verify-runner-main.js +292 -0
- package/dist/src/recorder/runner/verify-runner-main.test.d.ts +1 -0
- package/dist/src/registry-api.d.ts +1 -1
- package/dist/src/registry-api.types.test.d.ts +1 -0
- package/dist/src/registry-transaction.d.ts +42 -0
- package/dist/src/registry-transaction.js +194 -0
- package/dist/src/registry-transaction.test.d.ts +1 -0
- package/dist/src/registry.d.ts +58 -16
- package/dist/src/registry.js +131 -15
- package/dist/src/serialization.d.ts +1 -1
- package/dist/src/serialization.js +3 -3
- package/dist/src/types.d.ts +2 -0
- package/package.json +8 -5
- package/scripts/m1-daemon-navigate-drive.mjs +138 -0
- package/scripts/m1-extension-spike.mjs +237 -0
- package/scripts/m1-live-spike.mjs +156 -0
- package/scripts/m6b-connect-back-spike.sh +31 -0
- package/clis/12306/utils.test.js +0 -331
- package/clis/1688/assets.test.js +0 -39
- package/clis/1688/download.test.js +0 -31
- package/clis/1688/item.test.js +0 -67
- package/clis/1688/search.test.js +0 -75
- package/clis/1688/shared.test.js +0 -57
- package/clis/1688/store.test.js +0 -62
- package/clis/36kr/article.test.js +0 -46
- package/clis/36kr/hot.test.js +0 -15
- package/clis/36kr/news.test.js +0 -85
- package/clis/51job/utils.test.js +0 -69
- package/clis/_atlassian/shared.test.js +0 -170
- package/clis/aibase/news.test.js +0 -59
- package/clis/amazon/bestsellers.test.js +0 -29
- package/clis/amazon/discussion.test.js +0 -124
- package/clis/amazon/offer.test.js +0 -29
- package/clis/amazon/product.test.js +0 -24
- package/clis/amazon/rankings.test.js +0 -41
- package/clis/amazon/search.test.js +0 -22
- package/clis/amazon/shared.test.js +0 -44
- package/clis/apple-podcasts/commands.test.js +0 -119
- package/clis/apple-podcasts/utils.test.js +0 -57
- package/clis/arxiv/arxiv.test.js +0 -112
- package/clis/baidu-scholar/search.test.js +0 -23
- package/clis/barchart/greeks.test.js +0 -138
- package/clis/bilibili/comment.test.js +0 -153
- package/clis/bilibili/comments.test.js +0 -142
- package/clis/bilibili/dynamic.test.js +0 -68
- package/clis/bilibili/hot.test.js +0 -17
- package/clis/bilibili/subtitle.test.js +0 -196
- package/clis/bilibili/summary.test.js +0 -210
- package/clis/bilibili/utils.test.js +0 -61
- package/clis/bilibili/video.test.js +0 -132
- package/clis/binance/commands.test.js +0 -70
- package/clis/bloomberg/utils.test.js +0 -129
- package/clis/booking/booking.test.js +0 -356
- package/clis/boss/chatlist.test.js +0 -211
- package/clis/boss/chatmsg.test.js +0 -230
- package/clis/boss/search.test.js +0 -78
- package/clis/boss/utils.test.js +0 -34
- package/clis/brave/search.test.js +0 -76
- package/clis/chaoxing/utils.test.js +0 -45
- package/clis/chatgpt/commands.test.js +0 -45
- package/clis/chatgpt/envelope.test.js +0 -108
- package/clis/chatgpt/image.test.js +0 -188
- package/clis/chatgpt/utils.test.js +0 -330
- package/clis/chatgpt-app/ax.test.js +0 -35
- package/clis/chatwise/composer.test.js +0 -186
- package/clis/chess/analyze.test.js +0 -79
- package/clis/chess/game.test.js +0 -178
- package/clis/chess/games.test.js +0 -164
- package/clis/chess/stats.test.js +0 -79
- package/clis/chess/utils.test.js +0 -230
- package/clis/claude/ask.test.js +0 -338
- package/clis/claude/commands.test.js +0 -118
- package/clis/claude/utils.test.js +0 -148
- package/clis/cnki/search.test.js +0 -18
- package/clis/codex/sidebar.test.js +0 -329
- package/clis/coingecko/coingecko.test.js +0 -109
- package/clis/confluence/commands.test.js +0 -195
- package/clis/coupang/coupang.test.js +0 -159
- package/clis/coupang/utils.test.js +0 -62
- package/clis/ctrip/ctrip.test.js +0 -719
- package/clis/dblp/dblp.test.js +0 -397
- package/clis/deepseek/ask.test.js +0 -312
- package/clis/deepseek/detail.test.js +0 -81
- package/clis/deepseek/send.test.js +0 -107
- package/clis/deepseek/utils.test.js +0 -370
- package/clis/defillama/defillama.test.js +0 -99
- package/clis/devto/devto.test.js +0 -236
- package/clis/dianping/dianping.test.js +0 -578
- package/clis/douban/download.test.js +0 -170
- package/clis/douban/movie-hot.test.js +0 -14
- package/clis/douban/search.test.js +0 -11
- package/clis/douban/subject.test.js +0 -11
- package/clis/douban/utils.test.js +0 -438
- package/clis/doubao/detail.test.js +0 -42
- package/clis/doubao/history.test.js +0 -37
- package/clis/doubao/utils.test.js +0 -344
- package/clis/douyin/_shared/browser-fetch.test.js +0 -64
- package/clis/douyin/_shared/creation-id.test.js +0 -22
- package/clis/douyin/_shared/imagex-upload.test.js +0 -87
- package/clis/douyin/_shared/sts2.test.js +0 -27
- package/clis/douyin/_shared/text-extra.test.js +0 -37
- package/clis/douyin/_shared/timing.test.js +0 -28
- package/clis/douyin/_shared/tos-upload-short-read.test.js +0 -83
- package/clis/douyin/_shared/tos-upload.test.js +0 -229
- package/clis/douyin/_shared/transcode.test.js +0 -91
- package/clis/douyin/_shared/vod-upload.test.js +0 -38
- package/clis/douyin/activities.test.js +0 -55
- package/clis/douyin/collections.test.js +0 -45
- package/clis/douyin/delete.test.js +0 -100
- package/clis/douyin/draft.test.js +0 -335
- package/clis/douyin/drafts.test.js +0 -11
- package/clis/douyin/hashtag.test.js +0 -171
- package/clis/douyin/location.test.js +0 -23
- package/clis/douyin/profile.test.js +0 -46
- package/clis/douyin/publish-upload-id.test.js +0 -170
- package/clis/douyin/publish.test.js +0 -38
- package/clis/douyin/stats.test.js +0 -22
- package/clis/douyin/update.test.js +0 -11
- package/clis/douyin/user-videos.test.js +0 -151
- package/clis/douyin/videos.test.js +0 -54
- package/clis/duckduckgo/search.test.js +0 -128
- package/clis/duckduckgo/suggest.test.js +0 -66
- package/clis/eastmoney/hot-rank.test.js +0 -59
- package/clis/endoflife/endoflife.test.js +0 -51
- package/clis/facebook/feed.test.js +0 -169
- package/clis/facebook/marketplace.test.js +0 -91
- package/clis/facebook/notifications.test.js +0 -458
- package/clis/facebook/search.test.js +0 -55
- package/clis/flathub/flathub.test.js +0 -90
- package/clis/flomo/memos.test.js +0 -144
- package/clis/gemini/ask.test.js +0 -100
- package/clis/gemini/deep-research-result.test.js +0 -155
- package/clis/gemini/deep-research.test.js +0 -181
- package/clis/gemini/reply-state.test.js +0 -671
- package/clis/gemini/utils.test.js +0 -198
- package/clis/geogebra/geogebra.test.js +0 -175
- package/clis/gitee/search.test.js +0 -65
- package/clis/gitee/user.test.js +0 -63
- package/clis/google/utils.test.js +0 -75
- package/clis/google-scholar/cite.test.js +0 -47
- package/clis/google-scholar/profile.test.js +0 -49
- package/clis/google-scholar/search.test.js +0 -71
- package/clis/goproxy/goproxy.test.js +0 -103
- package/clis/gov-law/commands.test.js +0 -39
- package/clis/gov-policy/gov-policy.test.js +0 -224
- package/clis/grok/ask.test.js +0 -29
- package/clis/grok/utils.test.js +0 -103
- package/clis/hackernews/hackernews.test.js +0 -132
- package/clis/hf/hf.test.js +0 -16
- package/clis/hupu/hot.test.js +0 -224
- package/clis/imdb/utils.test.js +0 -88
- package/clis/indeed/indeed.test.js +0 -375
- package/clis/instagram/_shared/private-publish.test.js +0 -705
- package/clis/instagram/_shared/protocol-capture.test.js +0 -114
- package/clis/instagram/download.test.js +0 -118
- package/clis/instagram/note.test.js +0 -53
- package/clis/instagram/post.test.js +0 -1647
- package/clis/instagram/reel.test.js +0 -167
- package/clis/instagram/story.test.js +0 -134
- package/clis/jd/commands.test.js +0 -41
- package/clis/jd/item.test.js +0 -354
- package/clis/jianyu/search.test.js +0 -153
- package/clis/jianyu/shared/procurement-contract.test.js +0 -72
- package/clis/jianyu/shared/procurement-detail.test.js +0 -84
- package/clis/jike/read.test.js +0 -86
- package/clis/jira/commands.test.js +0 -287
- package/clis/juejin/search.js +0 -123
- package/clis/juejin/search.test.js +0 -98
- package/clis/lesswrong/frontpage.test.js +0 -37
- package/clis/lichess/lichess.test.js +0 -85
- package/clis/linkedin/connect.test.js +0 -213
- package/clis/linkedin/inbox.test.js +0 -152
- package/clis/linkedin/job-detail.test.js +0 -38
- package/clis/linkedin/jobs-preferences.test.js +0 -43
- package/clis/linkedin/people-search.test.js +0 -216
- package/clis/linkedin/post-analytics.test.js +0 -40
- package/clis/linkedin/posts.test.js +0 -40
- package/clis/linkedin/profile-analytics.test.js +0 -67
- package/clis/linkedin/profile-experience.test.js +0 -152
- package/clis/linkedin/profile-projects.test.js +0 -111
- package/clis/linkedin/profile-read.test.js +0 -77
- package/clis/linkedin/safe-send.test.js +0 -204
- package/clis/linkedin/salesnav-inbox.test.js +0 -113
- package/clis/linkedin/salesnav-message.test.js +0 -172
- package/clis/linkedin/salesnav-search.test.js +0 -76
- package/clis/linkedin/salesnav-thread.test.js +0 -79
- package/clis/linkedin/search.test.js +0 -222
- package/clis/linkedin/sent-invitations.test.js +0 -62
- package/clis/linkedin/services-read.test.js +0 -105
- package/clis/linkedin/thread-snapshot.test.js +0 -89
- package/clis/linkedin/timeline.test.js +0 -81
- package/clis/linkedin-learning/course.test.js +0 -114
- package/clis/linkedin-learning/search.test.js +0 -144
- package/clis/linkedin-learning/trending.test.js +0 -123
- package/clis/linux-do/feed.test.js +0 -153
- package/clis/linux-do/topic-content.test.js +0 -59
- package/clis/lobsters/lobsters.test.js +0 -169
- package/clis/notebooklm/add-source.test.js +0 -97
- package/clis/notebooklm/compat.test.js +0 -16
- package/clis/notebooklm/create.test.js +0 -58
- package/clis/notebooklm/generate-audio.test.js +0 -63
- package/clis/notebooklm/generate-slides.test.js +0 -75
- package/clis/notebooklm/history.test.js +0 -58
- package/clis/notebooklm/note-list.test.js +0 -56
- package/clis/notebooklm/notes-get.test.js +0 -72
- package/clis/notebooklm/open.test.js +0 -63
- package/clis/notebooklm/rpc.test.js +0 -131
- package/clis/notebooklm/source-fulltext.test.js +0 -106
- package/clis/notebooklm/source-get.test.js +0 -84
- package/clis/notebooklm/source-guide.test.js +0 -104
- package/clis/notebooklm/summary.test.js +0 -78
- package/clis/notebooklm/utils.test.js +0 -449
- package/clis/notebooklm/write-note.test.js +0 -70
- package/clis/nuget/nuget.test.js +0 -111
- package/clis/oeis/oeis.test.js +0 -88
- package/clis/ones/task-helpers.test.js +0 -12
- package/clis/ones/worklog.test.js +0 -20
- package/clis/openfda/openfda.test.js +0 -114
- package/clis/openreview/openreview.test.js +0 -427
- package/clis/osv/osv.test.js +0 -97
- package/clis/paperreview/commands.test.js +0 -243
- package/clis/paperreview/utils.test.js +0 -49
- package/clis/pixiv/download.test.js +0 -87
- package/clis/pixiv/illusts.test.js +0 -99
- package/clis/pixiv/search.test.js +0 -83
- package/clis/powerchina/search.test.js +0 -93
- package/clis/producthunt/utils.test.js +0 -64
- package/clis/pubmed/pubmed.test.js +0 -276
- package/clis/quark/utils.test.js +0 -58
- package/clis/qwen/utils.test.js +0 -45
- package/clis/reddit/extract-media.test.js +0 -149
- package/clis/reddit/frontpage.test.js +0 -34
- package/clis/reddit/home.test.js +0 -170
- package/clis/reddit/hot.test.js +0 -32
- package/clis/reddit/popular.test.js +0 -26
- package/clis/reddit/read.test.js +0 -335
- package/clis/reddit/reply.test.js +0 -89
- package/clis/reddit/search.test.js +0 -26
- package/clis/reddit/subreddit-info.test.js +0 -163
- package/clis/reddit/subreddit.test.js +0 -31
- package/clis/reddit/subscribed.test.js +0 -168
- package/clis/reddit/whoami.test.js +0 -105
- package/clis/rednote/navigation.test.js +0 -26
- package/clis/rednote/rednote.test.js +0 -222
- package/clis/rest-countries/rest-countries.test.js +0 -83
- package/clis/reuters/reuters.test.js +0 -299
- package/clis/rfc/rfc.test.js +0 -74
- package/clis/sinafinance/stock.test.js +0 -59
- package/clis/spotify/utils.test.js +0 -67
- package/clis/stackoverflow/stackoverflow.test.js +0 -404
- package/clis/steam/steam.test.js +0 -46
- package/clis/substack/utils.test.js +0 -44
- package/clis/suno/commands.test.js +0 -188
- package/clis/suno/download.test.js +0 -151
- package/clis/suno/generate.test.js +0 -252
- package/clis/suno/utils.test.js +0 -329
- package/clis/taobao/commands.test.js +0 -41
- package/clis/tdx/hot-rank.test.js +0 -59
- package/clis/ths/hot-rank.test.js +0 -64
- package/clis/tieba/commands.test.js +0 -79
- package/clis/tieba/utils.test.js +0 -290
- package/clis/tiktok/creator-videos.test.js +0 -113
- package/clis/tiktok/refactor.test.js +0 -389
- package/clis/tiktok/write-refactor.test.js +0 -370
- package/clis/toutiao/toutiao.test.js +0 -378
- package/clis/tvmaze/tvmaze.test.js +0 -93
- package/clis/twitter/bookmark-folder.test.js +0 -395
- package/clis/twitter/bookmark-folders.test.js +0 -152
- package/clis/twitter/bookmark.test.js +0 -74
- package/clis/twitter/bookmarks.test.js +0 -205
- package/clis/twitter/delete.test.js +0 -85
- package/clis/twitter/device-follow.test.js +0 -287
- package/clis/twitter/download.test.js +0 -457
- package/clis/twitter/followers.test.js +0 -62
- package/clis/twitter/following.test.js +0 -338
- package/clis/twitter/hide-reply.test.js +0 -76
- package/clis/twitter/like.test.js +0 -73
- package/clis/twitter/likes.test.js +0 -220
- package/clis/twitter/list-add.test.js +0 -133
- package/clis/twitter/list-create.test.js +0 -169
- package/clis/twitter/list-remove.test.js +0 -110
- package/clis/twitter/list-tweets.test.js +0 -196
- package/clis/twitter/lists.test.js +0 -253
- package/clis/twitter/post.test.js +0 -258
- package/clis/twitter/profile.test.js +0 -39
- package/clis/twitter/quote.test.js +0 -194
- package/clis/twitter/reply.test.js +0 -237
- package/clis/twitter/retweet.test.js +0 -73
- package/clis/twitter/search.test.js +0 -349
- package/clis/twitter/shared.test.js +0 -794
- package/clis/twitter/thread.test.js +0 -58
- package/clis/twitter/timeline.test.js +0 -104
- package/clis/twitter/trending.test.js +0 -15
- package/clis/twitter/tweets.test.js +0 -362
- package/clis/twitter/unbookmark.test.js +0 -73
- package/clis/twitter/unlike.test.js +0 -75
- package/clis/twitter/unretweet.test.js +0 -73
- package/clis/twitter/utils.test.js +0 -169
- package/clis/uisdc/news.test.js +0 -66
- package/clis/uiverse/_shared.test.js +0 -62
- package/clis/uiverse/navigation.test.js +0 -12
- package/clis/upwork/upwork.test.js +0 -566
- package/clis/wanfang/search.test.js +0 -23
- package/clis/web/read.test.js +0 -392
- package/clis/weibo/delete.test.js +0 -94
- package/clis/weibo/envelope.test.js +0 -85
- package/clis/weibo/favorites.test.js +0 -114
- package/clis/weibo/publish.test.js +0 -192
- package/clis/weibo/user-posts.test.js +0 -92
- package/clis/weibo/utils.test.js +0 -36
- package/clis/weixin/drafts.test.js +0 -69
- package/clis/weixin/search.test.js +0 -227
- package/clis/weread/ai-outline.test.js +0 -83
- package/clis/weread/book-search.test.js +0 -242
- package/clis/weread/commands.test.js +0 -398
- package/clis/weread/private-api-regression.test.js +0 -369
- package/clis/weread/search-regression.test.js +0 -494
- package/clis/weread/utils.test.js +0 -128
- package/clis/weread-official/commands.test.js +0 -385
- package/clis/weread-official/utils.test.js +0 -242
- package/clis/wikidata/wikidata.test.js +0 -83
- package/clis/wikipedia/trending.test.js +0 -57
- package/clis/wttr/wttr.test.js +0 -84
- package/clis/xianyu/chat.test.js +0 -84
- package/clis/xianyu/im.test.js +0 -253
- package/clis/xianyu/item.test.js +0 -56
- package/clis/xianyu/publish.test.js +0 -220
- package/clis/xianyu/search.test.js +0 -17
- package/clis/xiaoe/xiaoe.test.js +0 -486
- package/clis/xiaohongshu/comments.test.js +0 -258
- package/clis/xiaohongshu/creator-note-detail.test.js +0 -451
- package/clis/xiaohongshu/creator-notes-summary.test.js +0 -94
- package/clis/xiaohongshu/creator-notes.test.js +0 -281
- package/clis/xiaohongshu/creator-stats.test.js +0 -24
- package/clis/xiaohongshu/delete-note.test.js +0 -172
- package/clis/xiaohongshu/download.test.js +0 -316
- package/clis/xiaohongshu/navigation.test.js +0 -34
- package/clis/xiaohongshu/note.test.js +0 -249
- package/clis/xiaohongshu/publish.test.js +0 -608
- package/clis/xiaohongshu/search.test.js +0 -325
- package/clis/xiaohongshu/user-helpers.test.js +0 -160
- package/clis/xiaoyuzhou/auth.test.js +0 -124
- package/clis/xiaoyuzhou/download.test.js +0 -135
- package/clis/xiaoyuzhou/podcast-episodes.test.js +0 -78
- package/clis/xiaoyuzhou/transcript.test.js +0 -195
- package/clis/xiaoyuzhou/utils.test.js +0 -39
- package/clis/xueqiu/comments.test.js +0 -696
- package/clis/xueqiu/danjuan-utils.test.js +0 -41
- package/clis/xueqiu/utils.test.js +0 -26
- package/clis/yahoo/search.test.js +0 -94
- package/clis/youdao/note.test.js +0 -99
- package/clis/youtube/channel.test.js +0 -59
- package/clis/youtube/feed.test.js +0 -131
- package/clis/youtube/transcript-group.test.js +0 -99
- package/clis/youtube/transcript.test.js +0 -296
- package/clis/youtube/utils.test.js +0 -84
- package/clis/yuanbao/ask.test.js +0 -124
- package/clis/yuanbao/new.test.js +0 -30
- package/clis/yuanbao/shared.test.js +0 -80
- package/clis/zhihu/answer-comments.test.js +0 -287
- package/clis/zhihu/answer-detail.test.js +0 -338
- package/clis/zhihu/answer.test.js +0 -54
- package/clis/zhihu/collection.test.js +0 -337
- package/clis/zhihu/collections.test.js +0 -182
- package/clis/zhihu/comment.test.js +0 -50
- package/clis/zhihu/download.test.js +0 -12
- package/clis/zhihu/favorite.test.js +0 -59
- package/clis/zhihu/follow.test.js +0 -42
- package/clis/zhihu/like.test.js +0 -41
- package/clis/zhihu/question.test.js +0 -251
- package/clis/zhihu/recommend.test.js +0 -143
- package/clis/zhihu/search.test.js +0 -198
- package/clis/zhihu/target.test.js +0 -77
- package/clis/zhihu/text.test.js +0 -24
- package/clis/zhihu/write-shared.test.js +0 -176
- package/clis/zlibrary/commands.test.js +0 -65
- package/clis/zsxq/search.test.js +0 -24
- package/clis/zsxq/topic.test.js +0 -30
- package/clis/zsxq/topics.test.js +0 -24
- package/clis/zsxq/utils.test.js +0 -31
- package/dist/src/adapter-shadow.test.js +0 -49
- package/dist/src/adapter-source.test.js +0 -29
- package/dist/src/browser/analyze.test.js +0 -166
- package/dist/src/browser/article-extract.e2e.test.js +0 -105
- package/dist/src/browser/article-extract.test.js +0 -94
- package/dist/src/browser/ax-snapshot.test.js +0 -91
- package/dist/src/browser/base-page.test.js +0 -758
- package/dist/src/browser/cdp-click-fixture.test.js +0 -87
- package/dist/src/browser/cdp.test.js +0 -79
- package/dist/src/browser/compound.test.js +0 -175
- package/dist/src/browser/daemon-client.test.js +0 -199
- package/dist/src/browser/dom-helpers.test.js +0 -106
- package/dist/src/browser/dom-snapshot.test.js +0 -313
- package/dist/src/browser/errors.test.js +0 -60
- package/dist/src/browser/extract.test.js +0 -129
- package/dist/src/browser/find.test.js +0 -180
- package/dist/src/browser/html-tree.test.js +0 -181
- package/dist/src/browser/network-cache.test.js +0 -58
- package/dist/src/browser/network-key.test.js +0 -49
- package/dist/src/browser/page.test.js +0 -378
- package/dist/src/browser/shape-filter.test.js +0 -101
- package/dist/src/browser/shape.test.js +0 -82
- package/dist/src/browser/stealth.test.js +0 -134
- package/dist/src/browser/target-errors.test.js +0 -94
- package/dist/src/browser/target-resolver.test.js +0 -118
- package/dist/src/browser/utils.test.js +0 -29
- package/dist/src/browser/verify-fixture.test.js +0 -219
- package/dist/src/browser.test.js +0 -232
- package/dist/src/build-manifest.test.js +0 -341
- package/dist/src/capabilityRouting.test.js +0 -63
- package/dist/src/cli-argv-preprocess.test.js +0 -209
- package/dist/src/cli.test.js +0 -2803
- package/dist/src/commanderAdapter.test.js +0 -352
- package/dist/src/commands/daemon.test.js +0 -219
- package/dist/src/completion.test.js +0 -24
- package/dist/src/convention-audit.test.js +0 -247
- package/dist/src/daemon.test.js +0 -60
- package/dist/src/doctor.test.js +0 -263
- package/dist/src/download/article-download.test.js +0 -235
- package/dist/src/download/index.test.js +0 -140
- package/dist/src/download/media-download.test.js +0 -112
- package/dist/src/download/progress.test.js +0 -36
- package/dist/src/electron-apps.test.js +0 -49
- package/dist/src/engine.test.js +0 -312
- package/dist/src/errors.test.js +0 -109
- package/dist/src/execution.test.js +0 -623
- package/dist/src/extension-manifest-regression.test.js +0 -12
- package/dist/src/external.test.js +0 -146
- package/dist/src/help.test.js +0 -58
- package/dist/src/hooks.test.js +0 -92
- package/dist/src/interceptor.test.js +0 -81
- package/dist/src/launcher.test.js +0 -138
- package/dist/src/node-network.test.js +0 -55
- package/dist/src/observation/artifact.test.js +0 -121
- package/dist/src/observation/manager.test.js +0 -13
- package/dist/src/observation/redaction.test.js +0 -32
- package/dist/src/observation/retention.test.js +0 -118
- package/dist/src/observation/ring-buffer.test.js +0 -22
- package/dist/src/output.test.js +0 -53
- package/dist/src/package-exports.test.js +0 -112
- package/dist/src/pipeline/executor.test.js +0 -182
- package/dist/src/pipeline/steps/download.test.js +0 -102
- package/dist/src/pipeline/steps/fetch.test.js +0 -117
- package/dist/src/pipeline/template.test.js +0 -175
- package/dist/src/pipeline/transform.test.js +0 -133
- package/dist/src/plugin-manifest.test.js +0 -179
- package/dist/src/plugin-scaffold.test.js +0 -83
- package/dist/src/plugin.test.js +0 -1324
- package/dist/src/registry.test.js +0 -209
- package/dist/src/runtime-detect.test.js +0 -39
- package/dist/src/serialization.test.js +0 -78
- package/dist/src/snapshotFormatter.test.js +0 -521
- package/dist/src/tui.test.js +0 -19
- package/dist/src/update-check.test.js +0 -116
- package/dist/src/utils.test.js +0 -155
- package/dist/src/validate.test.js +0 -90
- package/dist/src/weixin-download.test.js +0 -45
|
@@ -1,566 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import {
|
|
3
|
-
ArgumentError,
|
|
4
|
-
AuthRequiredError,
|
|
5
|
-
CommandExecutionError,
|
|
6
|
-
EmptyResultError,
|
|
7
|
-
} from '@sovovs/bycli/errors';
|
|
8
|
-
import { getRegistry } from '@sovovs/bycli/registry';
|
|
9
|
-
import {
|
|
10
|
-
UPWORK_ORIGIN,
|
|
11
|
-
LIST_COLUMNS,
|
|
12
|
-
DETAIL_COLUMNS,
|
|
13
|
-
requireQuery,
|
|
14
|
-
requirePositiveInt,
|
|
15
|
-
requireBoundedInt,
|
|
16
|
-
requireCiphertext,
|
|
17
|
-
requireFeedTab,
|
|
18
|
-
requireSort,
|
|
19
|
-
buildSearchUrl,
|
|
20
|
-
buildFeedUrl,
|
|
21
|
-
feedStateKey,
|
|
22
|
-
buildJobUrl,
|
|
23
|
-
stripHighlight,
|
|
24
|
-
decodeExperienceLevel,
|
|
25
|
-
decodeWorkload,
|
|
26
|
-
decodeProposalsTier,
|
|
27
|
-
formatBudget,
|
|
28
|
-
formatBudgetFromDetail,
|
|
29
|
-
jobType,
|
|
30
|
-
formatSkills,
|
|
31
|
-
jobToListRow,
|
|
32
|
-
} from './utils.js';
|
|
33
|
-
import './search.js';
|
|
34
|
-
import './feed.js';
|
|
35
|
-
import './detail.js';
|
|
36
|
-
|
|
37
|
-
function createPageMock(evaluateResult) {
|
|
38
|
-
const evaluate = typeof evaluateResult === 'function'
|
|
39
|
-
? vi.fn(evaluateResult)
|
|
40
|
-
: vi.fn().mockResolvedValue(evaluateResult);
|
|
41
|
-
return {
|
|
42
|
-
goto: vi.fn().mockResolvedValue(undefined),
|
|
43
|
-
wait: vi.fn().mockResolvedValue(undefined),
|
|
44
|
-
evaluate,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
describe('upwork adapter — registration', () => {
|
|
49
|
-
it('registers search/feed/detail with the expected shape', () => {
|
|
50
|
-
const search = getRegistry().get('upwork/search');
|
|
51
|
-
const feed = getRegistry().get('upwork/feed');
|
|
52
|
-
const detail = getRegistry().get('upwork/detail');
|
|
53
|
-
|
|
54
|
-
expect(search).toBeDefined();
|
|
55
|
-
expect(search.browser).toBe(true);
|
|
56
|
-
expect(search.strategy).toBe('cookie');
|
|
57
|
-
expect(search.navigateBefore).toBe(false);
|
|
58
|
-
expect(search.columns).toEqual(LIST_COLUMNS);
|
|
59
|
-
|
|
60
|
-
expect(feed).toBeDefined();
|
|
61
|
-
expect(feed.browser).toBe(true);
|
|
62
|
-
expect(feed.strategy).toBe('cookie');
|
|
63
|
-
expect(feed.columns).toEqual(LIST_COLUMNS);
|
|
64
|
-
expect(feed.aliases).toContain('best-matches');
|
|
65
|
-
|
|
66
|
-
expect(detail).toBeDefined();
|
|
67
|
-
expect(detail.browser).toBe(true);
|
|
68
|
-
expect(detail.strategy).toBe('cookie');
|
|
69
|
-
expect(detail.columns).toEqual(DETAIL_COLUMNS);
|
|
70
|
-
expect(detail.aliases).toContain('job');
|
|
71
|
-
expect(detail.aliases).toContain('view');
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('shares list columns between search and feed but not detail', () => {
|
|
75
|
-
expect(LIST_COLUMNS).toContain('rank');
|
|
76
|
-
expect(LIST_COLUMNS).toContain('proposalsTier');
|
|
77
|
-
expect(DETAIL_COLUMNS).toContain('description');
|
|
78
|
-
expect(DETAIL_COLUMNS).not.toContain('rank');
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
describe('upwork adapter — argument validators', () => {
|
|
83
|
-
it('requireQuery trims and rejects empty', () => {
|
|
84
|
-
expect(requireQuery(' python ')).toBe('python');
|
|
85
|
-
expect(() => requireQuery('')).toThrow(ArgumentError);
|
|
86
|
-
expect(() => requireQuery(' ')).toThrow(ArgumentError);
|
|
87
|
-
expect(() => requireQuery(null)).toThrow(ArgumentError);
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('requirePositiveInt rejects zero / negative / floats', () => {
|
|
91
|
-
expect(requirePositiveInt(1, 1, 'page')).toBe(1);
|
|
92
|
-
expect(requirePositiveInt('5', 1, 'page')).toBe(5);
|
|
93
|
-
expect(() => requirePositiveInt(0, 1, 'page')).toThrow(/positive integer/);
|
|
94
|
-
expect(() => requirePositiveInt(-1, 1, 'page')).toThrow(/positive integer/);
|
|
95
|
-
expect(() => requirePositiveInt(1.5, 1, 'page')).toThrow(/positive integer/);
|
|
96
|
-
expect(() => requirePositiveInt('abc', 1, 'page')).toThrow(/positive integer/);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('requireBoundedInt enforces both bounds (no silent clamp)', () => {
|
|
100
|
-
expect(requireBoundedInt(20, 20, 1, 50, 'limit')).toBe(20);
|
|
101
|
-
expect(requireBoundedInt('50', 20, 1, 50, 'limit')).toBe(50);
|
|
102
|
-
expect(() => requireBoundedInt(0, 20, 1, 50, 'limit')).toThrow(/positive integer/);
|
|
103
|
-
expect(() => requireBoundedInt(100, 20, 1, 50, 'limit')).toThrow(/<= 50/);
|
|
104
|
-
expect(() => requireBoundedInt(0, 20, 10, 50, 'per_page')).toThrow(/positive integer/);
|
|
105
|
-
expect(() => requireBoundedInt(5, 20, 10, 50, 'per_page')).toThrow(/>= 10/);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('requireCiphertext accepts ~01/~02 forms and rejects garbage', () => {
|
|
109
|
-
expect(requireCiphertext('~022054964136512093518')).toBe('~022054964136512093518');
|
|
110
|
-
expect(requireCiphertext('~012055605504980235850')).toBe('~012055605504980235850');
|
|
111
|
-
expect(requireCiphertext('https://www.upwork.com/jobs/~022054964136512093518')).toBe('~022054964136512093518');
|
|
112
|
-
expect(requireCiphertext(' ~022054964136512093518 ')).toBe('~022054964136512093518');
|
|
113
|
-
expect(() => requireCiphertext('')).toThrow(ArgumentError);
|
|
114
|
-
expect(() => requireCiphertext('~03abc')).toThrow(/valid ciphertext/);
|
|
115
|
-
expect(() => requireCiphertext('not-a-job-id')).toThrow(ArgumentError);
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
it('requireFeedTab validates the small enum', () => {
|
|
119
|
-
expect(requireFeedTab('best-matches')).toBe('best-matches');
|
|
120
|
-
expect(requireFeedTab('MOST-RECENT')).toBe('most-recent');
|
|
121
|
-
expect(requireFeedTab(undefined)).toBe('best-matches');
|
|
122
|
-
expect(() => requireFeedTab('saved')).toThrow(/best-matches/);
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it('requireSort validates the small enum', () => {
|
|
126
|
-
expect(requireSort('recency')).toBe('recency');
|
|
127
|
-
expect(requireSort('RELEVANCE')).toBe('relevance');
|
|
128
|
-
expect(requireSort(undefined)).toBe('recency');
|
|
129
|
-
expect(() => requireSort('best')).toThrow(/recency/);
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
describe('upwork adapter — URL builders', () => {
|
|
134
|
-
it('buildSearchUrl emits a canonical, round-trippable URL', () => {
|
|
135
|
-
expect(buildSearchUrl({ query: 'python', sort: 'recency', page: 1, perPage: 10 }))
|
|
136
|
-
.toBe(`${UPWORK_ORIGIN}/nx/search/jobs/?q=python`);
|
|
137
|
-
expect(buildSearchUrl({ query: 'python developer', location: 'United States', sort: 'relevance', page: 2, perPage: 25 }))
|
|
138
|
-
.toBe(`${UPWORK_ORIGIN}/nx/search/jobs/?q=python+developer&location=United+States&sort=relevance&per_page=25&page=2`);
|
|
139
|
-
expect(buildSearchUrl({ query: 'react', category: 'web-development', sort: 'recency', page: 1, perPage: 10 }))
|
|
140
|
-
.toBe(`${UPWORK_ORIGIN}/nx/search/jobs/?q=react&category2_uid=web-development`);
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
it('buildFeedUrl returns the right path per tab', () => {
|
|
144
|
-
expect(buildFeedUrl('best-matches')).toBe(`${UPWORK_ORIGIN}/nx/find-work/best-matches`);
|
|
145
|
-
expect(buildFeedUrl('most-recent')).toBe(`${UPWORK_ORIGIN}/nx/find-work/most-recent`);
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
it('feedStateKey maps tab → Nuxt state slot', () => {
|
|
149
|
-
expect(feedStateKey('best-matches')).toBe('feedBestMatch');
|
|
150
|
-
expect(feedStateKey('most-recent')).toBe('feedMostRecent');
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
it('buildJobUrl prepends the origin', () => {
|
|
154
|
-
expect(buildJobUrl('~022054964136512093518')).toBe(`${UPWORK_ORIGIN}/jobs/~022054964136512093518`);
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
describe('upwork adapter — text + field normalizers', () => {
|
|
159
|
-
it('stripHighlight removes Upwork query-highlight markup and collapses whitespace', () => {
|
|
160
|
-
expect(stripHighlight('Software <span class="highlight">Developer</span> (Client-Facing)'))
|
|
161
|
-
.toBe('Software Developer (Client-Facing)');
|
|
162
|
-
expect(stripHighlight(' multi\n\nline ')).toBe('multi line');
|
|
163
|
-
expect(stripHighlight(null)).toBe('');
|
|
164
|
-
expect(stripHighlight(undefined)).toBe('');
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
it('decodeExperienceLevel handles i18n keys, rendered labels, and numeric tiers', () => {
|
|
168
|
-
expect(decodeExperienceLevel('jsn_Entry_205')).toBe('entry');
|
|
169
|
-
expect(decodeExperienceLevel('jsn_Intermediate_206')).toBe('intermediate');
|
|
170
|
-
expect(decodeExperienceLevel('jsn_Expert_207')).toBe('expert');
|
|
171
|
-
expect(decodeExperienceLevel('Entry level')).toBe('entry');
|
|
172
|
-
expect(decodeExperienceLevel('Intermediate')).toBe('intermediate');
|
|
173
|
-
expect(decodeExperienceLevel('Expert')).toBe('expert');
|
|
174
|
-
expect(decodeExperienceLevel(1)).toBe('entry');
|
|
175
|
-
expect(decodeExperienceLevel(2)).toBe('intermediate');
|
|
176
|
-
expect(decodeExperienceLevel(3)).toBe('expert');
|
|
177
|
-
expect(decodeExperienceLevel(null)).toBe('');
|
|
178
|
-
expect(decodeExperienceLevel('')).toBe('');
|
|
179
|
-
expect(decodeExperienceLevel('Mystery_999')).toBe('');
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
it('decodeWorkload extracts engagement suffix and normalizes', () => {
|
|
183
|
-
expect(decodeWorkload('usnuxt_Engagement_421.fullTime')).toBe('full-time');
|
|
184
|
-
expect(decodeWorkload('usnuxt_Engagement_421.partTime')).toBe('part-time');
|
|
185
|
-
expect(decodeWorkload('More than 30 hrs/week')).toBe('More than 30 hrs/week');
|
|
186
|
-
expect(decodeWorkload(null)).toBe('');
|
|
187
|
-
expect(decodeWorkload('')).toBe('');
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
it('decodeProposalsTier maps both i18n-keyed and rendered buckets', () => {
|
|
191
|
-
expect(decodeProposalsTier('usnuxt_JobProposalTier_418.lessThan5')).toBe('<5');
|
|
192
|
-
expect(decodeProposalsTier('usnuxt_JobProposalTier_418.5to10')).toBe('5-10');
|
|
193
|
-
expect(decodeProposalsTier('usnuxt_JobProposalTier_418.10to15')).toBe('10-15');
|
|
194
|
-
expect(decodeProposalsTier('usnuxt_JobProposalTier_418.20to50')).toBe('20-50');
|
|
195
|
-
expect(decodeProposalsTier('usnuxt_JobProposalTier_418.50Plus')).toBe('50+');
|
|
196
|
-
expect(decodeProposalsTier('15 to 20')).toBe('15-20');
|
|
197
|
-
expect(decodeProposalsTier('5 to 10')).toBe('5-10');
|
|
198
|
-
expect(decodeProposalsTier(null)).toBe('');
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
it('formatBudget handles hourly ranges, single bounds, fixed, and missing', () => {
|
|
202
|
-
expect(formatBudget({ type: 2, hourlyBudget: { min: 40, max: 70 } })).toBe('$40-$70/hr');
|
|
203
|
-
expect(formatBudget({ type: 2, hourlyBudget: { min: 30, max: 30 } })).toBe('$30/hr');
|
|
204
|
-
expect(formatBudget({ type: 2, hourlyBudget: { min: 0, max: 50 } })).toBe('$50/hr');
|
|
205
|
-
expect(formatBudget({ type: 2, hourlyBudget: { min: 25, max: 0 } })).toBe('$25/hr');
|
|
206
|
-
expect(formatBudget({ type: 2, hourlyBudget: { min: 0, max: 0 } })).toBe('');
|
|
207
|
-
expect(formatBudget({ type: 1, amount: { amount: 200 } })).toBe('$200');
|
|
208
|
-
expect(formatBudget({ type: 1, amount: { amount: 0 } })).toBe('');
|
|
209
|
-
expect(formatBudget({ type: null })).toBe('');
|
|
210
|
-
expect(formatBudget(null)).toBe('');
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
it('formatBudgetFromDetail reads extendedBudgetInfo and budget.amount', () => {
|
|
214
|
-
expect(formatBudgetFromDetail({ type: 2, extendedBudgetInfo: { hourlyBudgetMin: 40, hourlyBudgetMax: 70 } })).toBe('$40-$70/hr');
|
|
215
|
-
expect(formatBudgetFromDetail({ type: 1, budget: { amount: 500 } })).toBe('$500');
|
|
216
|
-
expect(formatBudgetFromDetail({ type: 2, extendedBudgetInfo: { hourlyBudgetMin: 0, hourlyBudgetMax: 0 } })).toBe('');
|
|
217
|
-
expect(formatBudgetFromDetail({ type: 1, budget: { amount: 0 } })).toBe('');
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
it('jobType returns stable labels', () => {
|
|
221
|
-
expect(jobType(1)).toBe('fixed');
|
|
222
|
-
expect(jobType(2)).toBe('hourly');
|
|
223
|
-
expect(jobType(0)).toBe('');
|
|
224
|
-
expect(jobType(null)).toBe('');
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
it('formatSkills dedupes across attrs / skills / ontologySkills', () => {
|
|
228
|
-
expect(formatSkills({ attrs: [{ prettyName: 'Python' }, { prettyName: 'JavaScript' }, { prettyName: 'Python' }] }))
|
|
229
|
-
.toBe('Python, JavaScript');
|
|
230
|
-
expect(formatSkills({ skills: [{ prefLabel: 'Android' }, { prefLabel: 'QA Testing' }] }))
|
|
231
|
-
.toBe('Android, QA Testing');
|
|
232
|
-
expect(formatSkills({ ontologySkills: [{ name: 'React' }] })).toBe('React');
|
|
233
|
-
expect(formatSkills({})).toBe('');
|
|
234
|
-
expect(formatSkills(null)).toBe('');
|
|
235
|
-
});
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
describe('upwork adapter — jobToListRow', () => {
|
|
239
|
-
it('produces a row matching LIST_COLUMNS keys and order', () => {
|
|
240
|
-
const job = {
|
|
241
|
-
ciphertext: '~022054964136512093518',
|
|
242
|
-
title: 'Software <span class="highlight">Developer</span>',
|
|
243
|
-
type: 2,
|
|
244
|
-
hourlyBudget: { min: 40, max: 70 },
|
|
245
|
-
tierText: 'jsn_Intermediate_206',
|
|
246
|
-
proposalsTier: 'usnuxt_JobProposalTier_418.50Plus',
|
|
247
|
-
attrs: [{ prettyName: 'Python' }, { prettyName: 'SQL' }],
|
|
248
|
-
client: { location: { country: 'United States' }, totalFeedback: 4.87 },
|
|
249
|
-
publishedOn: '2026-05-14T16:37:43.507Z',
|
|
250
|
-
};
|
|
251
|
-
const row = jobToListRow(job, 3);
|
|
252
|
-
expect(Object.keys(row)).toEqual(LIST_COLUMNS);
|
|
253
|
-
expect(row).toEqual({
|
|
254
|
-
rank: 3,
|
|
255
|
-
id: '~022054964136512093518',
|
|
256
|
-
title: 'Software Developer',
|
|
257
|
-
type: 'hourly',
|
|
258
|
-
budget: '$40-$70/hr',
|
|
259
|
-
experienceLevel: 'intermediate',
|
|
260
|
-
proposalsTier: '50+',
|
|
261
|
-
skills: 'Python, SQL',
|
|
262
|
-
clientCountry: 'United States',
|
|
263
|
-
clientRating: 4.87,
|
|
264
|
-
publishedOn: '2026-05-14T16:37:43.507Z',
|
|
265
|
-
url: 'https://www.upwork.com/jobs/~022054964136512093518',
|
|
266
|
-
});
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
it('drops zero / NaN client rating to null, never silently labels 0 as a real score', () => {
|
|
270
|
-
const job = { ciphertext: '~022054964136512093518', client: { totalFeedback: 0 } };
|
|
271
|
-
expect(jobToListRow(job, 1).clientRating).toBeNull();
|
|
272
|
-
const job2 = { ciphertext: '~022054964136512093518', client: { totalFeedback: null } };
|
|
273
|
-
expect(jobToListRow(job2, 1).clientRating).toBeNull();
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
it('falls back to createdOn when publishedOn is missing', () => {
|
|
277
|
-
const job = {
|
|
278
|
-
ciphertext: '~022054964136512093518',
|
|
279
|
-
type: 2,
|
|
280
|
-
hourlyBudget: { min: 0, max: 0 },
|
|
281
|
-
createdOn: '2026-01-01T00:00:00.000Z',
|
|
282
|
-
};
|
|
283
|
-
expect(jobToListRow(job, 1).publishedOn).toBe('2026-01-01T00:00:00.000Z');
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
it('returns null instead of non-round-trippable rows when ciphertext is missing or malformed', () => {
|
|
287
|
-
expect(jobToListRow({ ciphertext: '', title: 'missing id' }, 1)).toBeNull();
|
|
288
|
-
expect(jobToListRow({ ciphertext: '12345', title: 'bad id' }, 1)).toBeNull();
|
|
289
|
-
expect(jobToListRow({ title: 'no id' }, 1)).toBeNull();
|
|
290
|
-
});
|
|
291
|
-
});
|
|
292
|
-
|
|
293
|
-
describe('upwork search — func behavior', () => {
|
|
294
|
-
const cmd = () => getRegistry().get('upwork/search');
|
|
295
|
-
|
|
296
|
-
it('returns rows on a populated state', async () => {
|
|
297
|
-
const page = createPageMock({
|
|
298
|
-
ready: true,
|
|
299
|
-
onLogin: false,
|
|
300
|
-
challenge: false,
|
|
301
|
-
jobsPresent: true,
|
|
302
|
-
jobs: [
|
|
303
|
-
{ ciphertext: '~022054964136512093518', title: 'A', type: 2, hourlyBudget: { min: 10, max: 20 }, attrs: [], client: {} },
|
|
304
|
-
{ ciphertext: '~022055605504980235850', title: 'B', type: 1, amount: { amount: 100 }, attrs: [], client: {} },
|
|
305
|
-
],
|
|
306
|
-
paging: { total: 2, offset: 0, count: 2 },
|
|
307
|
-
});
|
|
308
|
-
const rows = await cmd().func(page, { query: 'python', page: 1, per_page: 10 });
|
|
309
|
-
expect(rows).toHaveLength(2);
|
|
310
|
-
expect(rows[0].rank).toBe(1);
|
|
311
|
-
expect(rows[0].type).toBe('hourly');
|
|
312
|
-
expect(rows[1].rank).toBe(2);
|
|
313
|
-
expect(rows[1].type).toBe('fixed');
|
|
314
|
-
expect(page.goto).toHaveBeenCalledWith(expect.stringContaining('/nx/search/jobs/?q=python'));
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
it('uses pageNum/perPage to compute the starting rank', async () => {
|
|
318
|
-
const page = createPageMock({
|
|
319
|
-
ready: true, onLogin: false, challenge: false,
|
|
320
|
-
jobsPresent: true,
|
|
321
|
-
jobs: [{ ciphertext: '~022054964136512093518', title: 'A', type: 2, attrs: [], client: {} }],
|
|
322
|
-
});
|
|
323
|
-
const rows = await cmd().func(page, { query: 'python', page: 3, per_page: 10 });
|
|
324
|
-
expect(rows[0].rank).toBe(21);
|
|
325
|
-
});
|
|
326
|
-
|
|
327
|
-
it('throws AuthRequiredError when redirected to login', async () => {
|
|
328
|
-
const page = createPageMock({ ready: false, onLogin: true, challenge: false, jobs: [] });
|
|
329
|
-
await expect(cmd().func(page, { query: 'python' })).rejects.toBeInstanceOf(AuthRequiredError);
|
|
330
|
-
});
|
|
331
|
-
|
|
332
|
-
it('throws CommandExecutionError on Cloudflare challenge', async () => {
|
|
333
|
-
const page = createPageMock({ ready: false, onLogin: false, challenge: true, jobs: [] });
|
|
334
|
-
await expect(cmd().func(page, { query: 'python' })).rejects.toBeInstanceOf(CommandExecutionError);
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
it('throws CommandExecutionError when state never hydrates', async () => {
|
|
338
|
-
const page = createPageMock({ ready: false, onLogin: false, challenge: false, jobs: [] });
|
|
339
|
-
await expect(cmd().func(page, { query: 'python' })).rejects.toThrow(/was not present/);
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
it('throws EmptyResultError when the search returns zero jobs', async () => {
|
|
343
|
-
const page = createPageMock({ ready: true, onLogin: false, challenge: false, jobsPresent: true, jobs: [], paging: { total: 0 } });
|
|
344
|
-
await expect(cmd().func(page, { query: 'asdfqwerzxcv' })).rejects.toBeInstanceOf(EmptyResultError);
|
|
345
|
-
});
|
|
346
|
-
|
|
347
|
-
it('unwraps Browser Bridge envelopes at the evaluate boundary', async () => {
|
|
348
|
-
const page = createPageMock({
|
|
349
|
-
session: 'site:upwork',
|
|
350
|
-
data: {
|
|
351
|
-
ready: true,
|
|
352
|
-
onLogin: false,
|
|
353
|
-
challenge: false,
|
|
354
|
-
jobsPresent: true,
|
|
355
|
-
jobs: [{ ciphertext: '~022054964136512093518', title: 'A', type: 2, attrs: [], client: {} }],
|
|
356
|
-
},
|
|
357
|
-
});
|
|
358
|
-
const rows = await cmd().func(page, { query: 'python' });
|
|
359
|
-
expect(rows).toHaveLength(1);
|
|
360
|
-
expect(rows[0].id).toBe('~022054964136512093518');
|
|
361
|
-
});
|
|
362
|
-
|
|
363
|
-
it('treats missing or malformed jobs state as parser drift, not legal empty', async () => {
|
|
364
|
-
await expect(cmd().func(createPageMock({ ready: true, onLogin: false, challenge: false }), { query: 'python' }))
|
|
365
|
-
.rejects.toBeInstanceOf(CommandExecutionError);
|
|
366
|
-
await expect(cmd().func(createPageMock({ ready: true, onLogin: false, challenge: false, jobsPresent: true, jobs: {} }), { query: 'python' }))
|
|
367
|
-
.rejects.toBeInstanceOf(CommandExecutionError);
|
|
368
|
-
});
|
|
369
|
-
|
|
370
|
-
it('fails closed when any search result lacks a round-trippable job id', async () => {
|
|
371
|
-
const page = createPageMock({
|
|
372
|
-
ready: true,
|
|
373
|
-
onLogin: false,
|
|
374
|
-
challenge: false,
|
|
375
|
-
jobsPresent: true,
|
|
376
|
-
jobs: [{ ciphertext: '~022054964136512093518', title: 'A' }, { ciphertext: '12345', title: 'B' }],
|
|
377
|
-
});
|
|
378
|
-
await expect(cmd().func(page, { query: 'python' })).rejects.toBeInstanceOf(CommandExecutionError);
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
it('rejects empty query before opening the page', async () => {
|
|
382
|
-
const page = createPageMock({ ready: true, jobs: [] });
|
|
383
|
-
await expect(cmd().func(page, { query: '' })).rejects.toBeInstanceOf(ArgumentError);
|
|
384
|
-
expect(page.goto).not.toHaveBeenCalled();
|
|
385
|
-
});
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
describe('upwork feed — func behavior', () => {
|
|
389
|
-
const cmd = () => getRegistry().get('upwork/feed');
|
|
390
|
-
|
|
391
|
-
it('hits the best-matches URL by default', async () => {
|
|
392
|
-
const page = createPageMock({
|
|
393
|
-
ready: true, onLogin: false, challenge: false,
|
|
394
|
-
jobsPresent: true,
|
|
395
|
-
jobs: [{ ciphertext: '~022054964136512093518', title: 'A', type: 2, attrs: [], client: {} }],
|
|
396
|
-
});
|
|
397
|
-
const rows = await cmd().func(page, { tab: 'best-matches', limit: 5 });
|
|
398
|
-
expect(rows).toHaveLength(1);
|
|
399
|
-
expect(page.goto).toHaveBeenCalledWith('https://www.upwork.com/nx/find-work/best-matches');
|
|
400
|
-
});
|
|
401
|
-
|
|
402
|
-
it('switches URL for the most-recent tab', async () => {
|
|
403
|
-
const page = createPageMock({
|
|
404
|
-
ready: true, onLogin: false, challenge: false,
|
|
405
|
-
jobsPresent: true,
|
|
406
|
-
jobs: [{ ciphertext: '~022054964136512093518', title: 'A', type: 1, amount: { amount: 50 }, attrs: [], client: {} }],
|
|
407
|
-
});
|
|
408
|
-
await cmd().func(page, { tab: 'most-recent', limit: 5 });
|
|
409
|
-
expect(page.goto).toHaveBeenCalledWith('https://www.upwork.com/nx/find-work/most-recent');
|
|
410
|
-
});
|
|
411
|
-
|
|
412
|
-
it('throws AuthRequiredError when redirected to login', async () => {
|
|
413
|
-
const page = createPageMock({ ready: false, onLogin: true, challenge: false, jobs: [] });
|
|
414
|
-
await expect(cmd().func(page, { tab: 'best-matches' })).rejects.toBeInstanceOf(AuthRequiredError);
|
|
415
|
-
});
|
|
416
|
-
|
|
417
|
-
it('throws EmptyResultError for an empty feed without sentinel rows', async () => {
|
|
418
|
-
const page = createPageMock({ ready: true, onLogin: false, challenge: false, jobsPresent: true, jobs: [] });
|
|
419
|
-
await expect(cmd().func(page, { tab: 'best-matches' })).rejects.toBeInstanceOf(EmptyResultError);
|
|
420
|
-
});
|
|
421
|
-
|
|
422
|
-
it('unwraps Browser Bridge envelopes and rejects malformed feed jobs state', async () => {
|
|
423
|
-
const rows = await cmd().func(createPageMock({
|
|
424
|
-
session: 'site:upwork',
|
|
425
|
-
data: {
|
|
426
|
-
ready: true,
|
|
427
|
-
onLogin: false,
|
|
428
|
-
challenge: false,
|
|
429
|
-
jobsPresent: true,
|
|
430
|
-
jobs: [{ ciphertext: '~022054964136512093518', title: 'A', type: 2, attrs: [], client: {} }],
|
|
431
|
-
},
|
|
432
|
-
}), { tab: 'best-matches' });
|
|
433
|
-
expect(rows[0].id).toBe('~022054964136512093518');
|
|
434
|
-
|
|
435
|
-
await expect(cmd().func(createPageMock({ ready: true, onLogin: false, challenge: false, jobsPresent: true, jobs: null }), { tab: 'best-matches' }))
|
|
436
|
-
.rejects.toBeInstanceOf(CommandExecutionError);
|
|
437
|
-
});
|
|
438
|
-
|
|
439
|
-
it('fails closed when any feed result lacks a round-trippable job id', async () => {
|
|
440
|
-
const page = createPageMock({
|
|
441
|
-
ready: true,
|
|
442
|
-
onLogin: false,
|
|
443
|
-
challenge: false,
|
|
444
|
-
jobsPresent: true,
|
|
445
|
-
jobs: [{ ciphertext: '~022054964136512093518', title: 'A' }, { ciphertext: '', title: 'B' }],
|
|
446
|
-
});
|
|
447
|
-
await expect(cmd().func(page, { tab: 'best-matches' })).rejects.toBeInstanceOf(CommandExecutionError);
|
|
448
|
-
});
|
|
449
|
-
});
|
|
450
|
-
|
|
451
|
-
describe('upwork detail — func behavior', () => {
|
|
452
|
-
const cmd = () => getRegistry().get('upwork/detail');
|
|
453
|
-
|
|
454
|
-
it('returns one row from a populated jobDetails store', async () => {
|
|
455
|
-
const page = createPageMock({
|
|
456
|
-
ready: true, onLogin: false, challenge: false,
|
|
457
|
-
job: {
|
|
458
|
-
uid: '2054964136512093518',
|
|
459
|
-
ciphertext: '~022054964136512093518',
|
|
460
|
-
title: 'Software Developer',
|
|
461
|
-
type: 2,
|
|
462
|
-
extendedBudgetInfo: { hourlyBudgetMin: 40, hourlyBudgetMax: 70 },
|
|
463
|
-
contractorTier: 2,
|
|
464
|
-
workload: 'More than 30 hrs/week',
|
|
465
|
-
category: { name: 'Web Development', urlSlug: 'web-development' },
|
|
466
|
-
attrs: [{ prettyName: 'Python' }],
|
|
467
|
-
description: 'We are looking for...',
|
|
468
|
-
publishTime: '2026-05-14T16:37:43.507Z',
|
|
469
|
-
clientActivity: { totalApplicants: 50, totalHired: 0 },
|
|
470
|
-
},
|
|
471
|
-
buyer: {
|
|
472
|
-
stats: { score: 4.8, totalJobsWithHires: 5, totalCharges: { amount: 188.28 } },
|
|
473
|
-
location: { country: 'United States' },
|
|
474
|
-
},
|
|
475
|
-
});
|
|
476
|
-
const rows = await cmd().func(page, { id: '~022054964136512093518' });
|
|
477
|
-
expect(rows).toHaveLength(1);
|
|
478
|
-
const row = rows[0];
|
|
479
|
-
expect(Object.keys(row)).toEqual(DETAIL_COLUMNS);
|
|
480
|
-
expect(row.id).toBe('~022054964136512093518');
|
|
481
|
-
expect(row.type).toBe('hourly');
|
|
482
|
-
expect(row.budget).toBe('$40-$70/hr');
|
|
483
|
-
expect(row.experienceLevel).toBe('intermediate');
|
|
484
|
-
expect(row.workload).toBe('More than 30 hrs/week');
|
|
485
|
-
expect(row.category).toBe('Web Development');
|
|
486
|
-
expect(row.skills).toBe('Python');
|
|
487
|
-
expect(row.clientCountry).toBe('United States');
|
|
488
|
-
expect(row.clientSpent).toBe(188.28);
|
|
489
|
-
expect(row.clientHires).toBe(5);
|
|
490
|
-
expect(row.clientRating).toBe(4.8);
|
|
491
|
-
expect(row.proposalsCount).toBe(50);
|
|
492
|
-
expect(row.url).toBe('https://www.upwork.com/jobs/~022054964136512093518');
|
|
493
|
-
});
|
|
494
|
-
|
|
495
|
-
it('accepts a full /jobs/ URL as the positional id', async () => {
|
|
496
|
-
const page = createPageMock({
|
|
497
|
-
ready: true, onLogin: false, challenge: false,
|
|
498
|
-
job: { ciphertext: '~022054964136512093518', title: 'X', type: 1, budget: { amount: 100 } },
|
|
499
|
-
buyer: {},
|
|
500
|
-
});
|
|
501
|
-
const rows = await cmd().func(page, { id: 'https://www.upwork.com/jobs/~022054964136512093518' });
|
|
502
|
-
expect(rows[0].id).toBe('~022054964136512093518');
|
|
503
|
-
expect(rows[0].budget).toBe('$100');
|
|
504
|
-
});
|
|
505
|
-
|
|
506
|
-
it('drops zero client score to null', async () => {
|
|
507
|
-
const page = createPageMock({
|
|
508
|
-
ready: true, onLogin: false, challenge: false,
|
|
509
|
-
job: { ciphertext: '~022054964136512093518', title: 'X', type: 2 },
|
|
510
|
-
buyer: { stats: { score: 0, totalJobsWithHires: 0 } },
|
|
511
|
-
});
|
|
512
|
-
const rows = await cmd().func(page, { id: '~022054964136512093518' });
|
|
513
|
-
expect(rows[0].clientRating).toBeNull();
|
|
514
|
-
expect(rows[0].clientHires).toBe(0);
|
|
515
|
-
});
|
|
516
|
-
|
|
517
|
-
it('throws AuthRequiredError when redirected to login', async () => {
|
|
518
|
-
const page = createPageMock({ ready: false, onLogin: true, challenge: false, job: null });
|
|
519
|
-
await expect(cmd().func(page, { id: '~022054964136512093518' })).rejects.toBeInstanceOf(AuthRequiredError);
|
|
520
|
-
});
|
|
521
|
-
|
|
522
|
-
it('throws CommandExecutionError on Cloudflare challenge', async () => {
|
|
523
|
-
const page = createPageMock({ ready: false, onLogin: false, challenge: true, job: null });
|
|
524
|
-
await expect(cmd().func(page, { id: '~022054964136512093518' })).rejects.toBeInstanceOf(CommandExecutionError);
|
|
525
|
-
});
|
|
526
|
-
|
|
527
|
-
it('throws EmptyResultError when the store has no job', async () => {
|
|
528
|
-
const page = createPageMock({ ready: false, onLogin: false, challenge: false, job: null });
|
|
529
|
-
await expect(cmd().func(page, { id: '~022054964136512093518' })).rejects.toBeInstanceOf(EmptyResultError);
|
|
530
|
-
});
|
|
531
|
-
|
|
532
|
-
it('unwraps Browser Bridge envelopes and treats wrong-shape job as parser drift', async () => {
|
|
533
|
-
const rows = await cmd().func(createPageMock({
|
|
534
|
-
session: 'site:upwork',
|
|
535
|
-
data: {
|
|
536
|
-
ready: true,
|
|
537
|
-
onLogin: false,
|
|
538
|
-
challenge: false,
|
|
539
|
-
job: { ciphertext: '~022054964136512093518', title: 'X', type: 1, budget: { amount: 100 } },
|
|
540
|
-
buyer: {},
|
|
541
|
-
},
|
|
542
|
-
}), { id: '~022054964136512093518' });
|
|
543
|
-
expect(rows[0].id).toBe('~022054964136512093518');
|
|
544
|
-
|
|
545
|
-
await expect(cmd().func(createPageMock({ ready: true, onLogin: false, challenge: false, job: [] }), { id: '~022054964136512093518' }))
|
|
546
|
-
.rejects.toBeInstanceOf(CommandExecutionError);
|
|
547
|
-
});
|
|
548
|
-
|
|
549
|
-
it('fails closed when the detail store belongs to a different ciphertext', async () => {
|
|
550
|
-
const page = createPageMock({
|
|
551
|
-
ready: true,
|
|
552
|
-
onLogin: false,
|
|
553
|
-
challenge: false,
|
|
554
|
-
job: { ciphertext: '~022055605504980235850', title: 'Wrong job' },
|
|
555
|
-
buyer: {},
|
|
556
|
-
});
|
|
557
|
-
await expect(cmd().func(page, { id: '~022054964136512093518' }))
|
|
558
|
-
.rejects.toBeInstanceOf(CommandExecutionError);
|
|
559
|
-
});
|
|
560
|
-
|
|
561
|
-
it('rejects malformed ciphertext before opening the page', async () => {
|
|
562
|
-
const page = createPageMock({ ready: true, job: null });
|
|
563
|
-
await expect(cmd().func(page, { id: 'not-an-id' })).rejects.toBeInstanceOf(ArgumentError);
|
|
564
|
-
expect(page.goto).not.toHaveBeenCalled();
|
|
565
|
-
});
|
|
566
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import { getRegistry } from '@sovovs/bycli/registry';
|
|
3
|
-
import './search.js';
|
|
4
|
-
|
|
5
|
-
describe('wanfang search command', () => {
|
|
6
|
-
const command = getRegistry().get('wanfang/search');
|
|
7
|
-
|
|
8
|
-
it('registers as a public browser command', () => {
|
|
9
|
-
expect(command).toBeDefined();
|
|
10
|
-
expect(command.site).toBe('wanfang');
|
|
11
|
-
expect(command.strategy).toBe('public');
|
|
12
|
-
expect(command.browser).toBe(true);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('rejects empty queries before browser navigation', async () => {
|
|
16
|
-
const page = { goto: vi.fn() };
|
|
17
|
-
await expect(command.func(page, { query: ' ' })).rejects.toMatchObject({
|
|
18
|
-
name: 'ArgumentError',
|
|
19
|
-
code: 'ARGUMENT',
|
|
20
|
-
});
|
|
21
|
-
expect(page.goto).not.toHaveBeenCalled();
|
|
22
|
-
});
|
|
23
|
-
});
|