koishi-plugin-kkk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +57 -0
- package/LICENSE +674 -0
- package/README.md +98 -0
- package/assets/web/assets/CronEditor-CYgFpX-g.js +1 -0
- package/assets/web/assets/DesktopLayout-iI43ij11.js +1 -0
- package/assets/web/assets/MobileLayout-CziU8MCR.js +1 -0
- package/assets/web/assets/ThemeSwitch-DFohhwd9.js +1 -0
- package/assets/web/assets/index-BRROK0vh.js +47 -0
- package/assets/web/assets/index-Dj-StEiS.css +2 -0
- package/assets/web/assets/separator-CxcFlCzz.js +1 -0
- package/assets/web/favicon.svg +1 -0
- package/assets/web/icons.svg +24 -0
- package/assets/web/index.html +15 -0
- package/assets/webui.html +115 -0
- package/client/index.ts +63 -0
- package/config/default_config/app.yaml +64 -0
- package/config/default_config/bilibili.yaml +116 -0
- package/config/default_config/config.json +157 -0
- package/config/default_config/cookies.yaml +11 -0
- package/config/default_config/douyin.yaml +99 -0
- package/config/default_config/kuaishou.yaml +8 -0
- package/config/default_config/pushlist.yaml +37 -0
- package/config/default_config/request.yaml +22 -0
- package/config/default_config/upload.yaml +50 -0
- package/config/default_config/xiaohongshu.yaml +23 -0
- package/dist/index.js +1 -0
- package/lib/compat/axios.js +23 -0
- package/lib/compat/cron.js +77 -0
- package/lib/compat/esm.js +15 -0
- package/lib/compat/express.js +23 -0
- package/lib/compat/heroui.js +12 -0
- package/lib/compat/lodash.js +33 -0
- package/lib/compat/logger.js +118 -0
- package/lib/compat/node-karin.js +1053 -0
- package/lib/compat/phosphor-icons.js +27 -0
- package/lib/compat/qqcard.js +256 -0
- package/lib/compat/root.js +44 -0
- package/lib/compat/runtime.js +87 -0
- package/lib/compat/segment.js +167 -0
- package/lib/compat/sqlite3.js +117 -0
- package/lib/compat/start.js +7 -0
- package/lib/compat/syncConfig.js +65 -0
- package/lib/compat/template-react.js +30 -0
- package/lib/compat/text.js +65 -0
- package/lib/compat/yaml.js +13 -0
- package/lib/configBridge.js +91 -0
- package/lib/index.js +775 -0
- package/lib/karin/app.js +34 -0
- package/lib/karin/apps/__ready.js +9 -0
- package/lib/karin/apps/admin.js +136 -0
- package/lib/karin/apps/help.js +233 -0
- package/lib/karin/apps/push.js +291 -0
- package/lib/karin/apps/qrlogin.js +176 -0
- package/lib/karin/apps/statistics.js +209 -0
- package/lib/karin/apps/testPush.js +247 -0
- package/lib/karin/apps/tools.js +473 -0
- package/lib/karin/apps/update.js +252 -0
- package/lib/karin/index.js +37 -0
- package/lib/karin/module/db/bilibili.js +831 -0
- package/lib/karin/module/db/douyin.js +918 -0
- package/lib/karin/module/db/index.js +165 -0
- package/lib/karin/module/db/migration.js +199 -0
- package/lib/karin/module/db/statistics.js +559 -0
- package/lib/karin/module/index.js +94 -0
- package/lib/karin/module/server/constants/routes.js +48 -0
- package/lib/karin/module/server/controllers/bots.js +230 -0
- package/lib/karin/module/server/controllers/config.js +75 -0
- package/lib/karin/module/server/controllers/video.js +208 -0
- package/lib/karin/module/server/index.js +26 -0
- package/lib/karin/module/server/middlewares/auth.js +133 -0
- package/lib/karin/module/server/routes/amagi.js +57 -0
- package/lib/karin/module/server/routes/api.js +40 -0
- package/lib/karin/module/server/routes/index.js +97 -0
- package/lib/karin/module/server/routes/ssr.js +16 -0
- package/lib/karin/module/server/routes/static.js +43 -0
- package/lib/karin/module/utils/Base.js +403 -0
- package/lib/karin/module/utils/CardParser.js +487 -0
- package/lib/karin/module/utils/Common.js +418 -0
- package/lib/karin/module/utils/Config.js +434 -0
- package/lib/karin/module/utils/EmojiReaction.js +242 -0
- package/lib/karin/module/utils/ErrorHandler/handler.js +114 -0
- package/lib/karin/module/utils/ErrorHandler/index.js +55 -0
- package/lib/karin/module/utils/ErrorHandler/render.js +182 -0
- package/lib/karin/module/utils/ErrorHandler/sender.js +206 -0
- package/lib/karin/module/utils/ErrorHandler/strategy.js +41 -0
- package/lib/karin/module/utils/ErrorHandler/types.js +2 -0
- package/lib/karin/module/utils/ErrorHandler/utils.js +108 -0
- package/lib/karin/module/utils/FFmpeg.js +298 -0
- package/lib/karin/module/utils/ImageHelper.js +91 -0
- package/lib/karin/module/utils/ImageSlice.js +429 -0
- package/lib/karin/module/utils/MotionPhoto.js +250 -0
- package/lib/karin/module/utils/Network/Downloader.js +413 -0
- package/lib/karin/module/utils/Network/ImageDownloader.js +250 -0
- package/lib/karin/module/utils/Network/Network.js +332 -0
- package/lib/karin/module/utils/Network/ThrottleStream.js +71 -0
- package/lib/karin/module/utils/Network/constants.js +129 -0
- package/lib/karin/module/utils/Network/helpers.js +174 -0
- package/lib/karin/module/utils/Network/index.js +34 -0
- package/lib/karin/module/utils/Network/types.js +12 -0
- package/lib/karin/module/utils/Networks.js +17 -0
- package/lib/karin/module/utils/ParseLock.js +34 -0
- package/lib/karin/module/utils/ParseOverride.js +88 -0
- package/lib/karin/module/utils/QqCardResolve.js +114 -0
- package/lib/karin/module/utils/QqPanel.js +879 -0
- package/lib/karin/module/utils/Render/coverTheme.js +256 -0
- package/lib/karin/module/utils/Render/index.js +582 -0
- package/lib/karin/module/utils/amagiClient.js +338 -0
- package/lib/karin/module/utils/avatar.js +201 -0
- package/lib/karin/module/utils/bot.js +141 -0
- package/lib/karin/module/utils/build-metadata.js +50 -0
- package/lib/karin/module/utils/changelog.js +166 -0
- package/lib/karin/module/utils/index.js +26 -0
- package/lib/karin/module/utils/loginSession.js +259 -0
- package/lib/karin/module/utils/parseTip.js +93 -0
- package/lib/karin/module/utils/runtime-report.js +140 -0
- package/lib/karin/module/utils/semver.js +72 -0
- package/lib/karin/module/utils/statisticsAggregate.js +415 -0
- package/lib/karin/platform/bilibili/bilibili.js +1805 -0
- package/lib/karin/platform/bilibili/comments.js +294 -0
- package/lib/karin/platform/bilibili/danmaku.js +555 -0
- package/lib/karin/platform/bilibili/dynamic-text.js +827 -0
- package/lib/karin/platform/bilibili/genParams.js +37 -0
- package/lib/karin/platform/bilibili/getID.js +159 -0
- package/lib/karin/platform/bilibili/index.js +24 -0
- package/lib/karin/platform/bilibili/live-status.js +40 -0
- package/lib/karin/platform/bilibili/login.js +132 -0
- package/lib/karin/platform/bilibili/push.js +1397 -0
- package/lib/karin/platform/bilibili/riskControl.js +133 -0
- package/lib/karin/platform/bilibili/search.js +299 -0
- package/lib/karin/platform/common/danmaku-types.js +12 -0
- package/lib/karin/platform/douyin/comments.js +310 -0
- package/lib/karin/platform/douyin/danmaku.js +893 -0
- package/lib/karin/platform/douyin/douyin.js +1145 -0
- package/lib/karin/platform/douyin/getID.js +94 -0
- package/lib/karin/platform/douyin/index.js +24 -0
- package/lib/karin/platform/douyin/login.js +230 -0
- package/lib/karin/platform/douyin/push/favorite.js +75 -0
- package/lib/karin/platform/douyin/push/index.js +21 -0
- package/lib/karin/platform/douyin/push/live.js +69 -0
- package/lib/karin/platform/douyin/push/post.js +60 -0
- package/lib/karin/platform/douyin/push/recommend.js +74 -0
- package/lib/karin/platform/douyin/push/render.js +621 -0
- package/lib/karin/platform/douyin/push/types.js +2 -0
- package/lib/karin/platform/douyin/push.js +1128 -0
- package/lib/karin/platform/douyin/types.js +13 -0
- package/lib/karin/platform/douyin/videoQuality.js +222 -0
- package/lib/karin/platform/douyin/workType.js +182 -0
- package/lib/karin/platform/index.js +20 -0
- package/lib/karin/platform/kuaishou/comments.js +91 -0
- package/lib/karin/platform/kuaishou/getID.js +43 -0
- package/lib/karin/platform/kuaishou/getdata.js +41 -0
- package/lib/karin/platform/kuaishou/index.js +20 -0
- package/lib/karin/platform/kuaishou/kuaishou.js +122 -0
- package/lib/karin/platform/xiaohongshu/comments.js +162 -0
- package/lib/karin/platform/xiaohongshu/getID.js +129 -0
- package/lib/karin/platform/xiaohongshu/index.js +18 -0
- package/lib/karin/platform/xiaohongshu/xiaohongshu.js +643 -0
- package/lib/karin/root.js +73 -0
- package/lib/karin/setup.js +99 -0
- package/lib/karin/types/config/amagi.js +2 -0
- package/lib/karin/types/config/app.js +2 -0
- package/lib/karin/types/config/bilibili.js +2 -0
- package/lib/karin/types/config/cookies.js +2 -0
- package/lib/karin/types/config/douyin.js +2 -0
- package/lib/karin/types/config/index.js +2 -0
- package/lib/karin/types/config/kuaishou.js +2 -0
- package/lib/karin/types/config/pushlist.js +2 -0
- package/lib/karin/types/config/request.js +2 -0
- package/lib/karin/types/config/upload.js +2 -0
- package/lib/karin/types/config/xiaohongshu.js +2 -0
- package/lib/karin/types/datatypes.js +2 -0
- package/lib/karin/types/index.js +18 -0
- package/lib/karin/types/netrorks/NetworksConfigType.js +2 -0
- package/lib/karin/types/netrorks/index.js +17 -0
- package/lib/karin/web.config.js +49 -0
- package/lib/ktr/registry.js +82 -0
- package/lib/ktr/template/_preview/components/PreviewInfoCard.js +10 -0
- package/lib/ktr/template/_preview/components/PreviewLayout.js +10 -0
- package/lib/ktr/template/_preview/components/PreviewVideoCard.js +8 -0
- package/lib/ktr/template/_preview/render.js +142 -0
- package/lib/ktr/template/_preview/types.js +2 -0
- package/lib/ktr/template/_preview/utils/status.js +31 -0
- package/lib/ktr/template/_preview/utils/time.js +12 -0
- package/lib/ktr/template/bilibili/bangumi/components/bangumi.js +127 -0
- package/lib/ktr/template/bilibili/bangumi/components/types.js +2 -0
- package/lib/ktr/template/bilibili/bangumi/index.js +12 -0
- package/lib/ktr/template/bilibili/comment/components/Comment.js +193 -0
- package/lib/ktr/template/bilibili/comment/components/types.js +2 -0
- package/lib/ktr/template/bilibili/comment/index.js +10 -0
- package/lib/ktr/template/bilibili/components/Icons.js +66 -0
- package/lib/ktr/template/bilibili/components/shared.js +93 -0
- package/lib/ktr/template/bilibili/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/components/DYNAMIC_TYPE_ARTICLE.js +66 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/components/DYNAMIC_TYPE_AV.js +87 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/components/DYNAMIC_TYPE_DRAW.js +93 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/components/DYNAMIC_TYPE_FORWARD.js +132 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/components/DYNAMIC_TYPE_LIVE_RCMD.js +84 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/components/DYNAMIC_TYPE_WORD.js +38 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/components/AdditionalCard.js +59 -0
- package/lib/ktr/template/bilibili/dynamic/components/CommonComponents.js +30 -0
- package/lib/ktr/template/bilibili/dynamic/types.js +2 -0
- package/lib/ktr/template/bilibili/qrcodeImg/components/qrcodeImg.js +48 -0
- package/lib/ktr/template/bilibili/qrcodeImg/components/types.js +3 -0
- package/lib/ktr/template/bilibili/qrcodeImg/index.js +10 -0
- package/lib/ktr/template/bilibili/userlist/components/UserList.js +53 -0
- package/lib/ktr/template/bilibili/userlist/components/types.js +3 -0
- package/lib/ktr/template/bilibili/userlist/index.js +13 -0
- package/lib/ktr/template/bilibili/videoInfo/components/types.js +2 -0
- package/lib/ktr/template/bilibili/videoInfo/components/videoInfo.js +62 -0
- package/lib/ktr/template/bilibili/videoInfo/index.js +10 -0
- package/lib/ktr/template/components/AmbientCover.js +36 -0
- package/lib/ktr/template/components/DefaultLayout.js +33 -0
- package/lib/ktr/template/components/GlowImage.js +276 -0
- package/lib/ktr/template/components/QRCodeWithAvatar.js +34 -0
- package/lib/ktr/template/components/RolldownLogo.js +6 -0
- package/lib/ktr/template/components/ViteLogo.js +6 -0
- package/lib/ktr/template/components/iconRegistry.js +173 -0
- package/lib/ktr/template/douyin/article-work/components/ArticleWork.js +99 -0
- package/lib/ktr/template/douyin/article-work/components/types.js +3 -0
- package/lib/ktr/template/douyin/article-work/index.js +10 -0
- package/lib/ktr/template/douyin/comment/components/Comment.js +189 -0
- package/lib/ktr/template/douyin/comment/components/types.js +2 -0
- package/lib/ktr/template/douyin/comment/index.js +10 -0
- package/lib/ktr/template/douyin/components/Icons.js +29 -0
- package/lib/ktr/template/douyin/components/types.js +3 -0
- package/lib/ktr/template/douyin/dynamic/components/Dynamic.js +90 -0
- package/lib/ktr/template/douyin/dynamic/components/types.js +3 -0
- package/lib/ktr/template/douyin/dynamic/index.js +10 -0
- package/lib/ktr/template/douyin/favorite-list/components/FavoriteList.js +30 -0
- package/lib/ktr/template/douyin/favorite-list/components/types.js +3 -0
- package/lib/ktr/template/douyin/favorite-list/index.js +10 -0
- package/lib/ktr/template/douyin/image-work/components/ImageWork.js +136 -0
- package/lib/ktr/template/douyin/image-work/components/types.js +2 -0
- package/lib/ktr/template/douyin/image-work/index.js +10 -0
- package/lib/ktr/template/douyin/live/components/Live.js +51 -0
- package/lib/ktr/template/douyin/live/components/types.js +3 -0
- package/lib/ktr/template/douyin/live/index.js +10 -0
- package/lib/ktr/template/douyin/musicinfo/components/MusicInfo.js +60 -0
- package/lib/ktr/template/douyin/musicinfo/components/types.js +3 -0
- package/lib/ktr/template/douyin/musicinfo/index.js +10 -0
- package/lib/ktr/template/douyin/qrcodeImg/components/qrcodeImg.js +39 -0
- package/lib/ktr/template/douyin/qrcodeImg/components/types.js +3 -0
- package/lib/ktr/template/douyin/qrcodeImg/index.js +9 -0
- package/lib/ktr/template/douyin/recommend-list/components/RecommendList.js +30 -0
- package/lib/ktr/template/douyin/recommend-list/components/types.js +3 -0
- package/lib/ktr/template/douyin/recommend-list/index.js +10 -0
- package/lib/ktr/template/douyin/user_profile/components/UserVideoList.js +54 -0
- package/lib/ktr/template/douyin/user_profile/components/types.js +3 -0
- package/lib/ktr/template/douyin/user_profile/index.js +9 -0
- package/lib/ktr/template/douyin/userlist/components/UserList.js +50 -0
- package/lib/ktr/template/douyin/userlist/components/types.js +3 -0
- package/lib/ktr/template/douyin/userlist/index.js +13 -0
- package/lib/ktr/template/douyin/video-work/components/VideoWork.js +127 -0
- package/lib/ktr/template/douyin/video-work/components/types.js +2 -0
- package/lib/ktr/template/douyin/video-work/index.js +10 -0
- package/lib/ktr/template/kuaishou/comment/components/Comment.js +88 -0
- package/lib/ktr/template/kuaishou/comment/components/types.js +2 -0
- package/lib/ktr/template/kuaishou/comment/index.js +10 -0
- package/lib/ktr/template/other/changelog/components/changelog.js +117 -0
- package/lib/ktr/template/other/changelog/components/types.js +3 -0
- package/lib/ktr/template/other/changelog/index.js +9 -0
- package/lib/ktr/template/other/handlerError/components/errorTitles.js +227 -0
- package/lib/ktr/template/other/handlerError/components/handlerError.js +392 -0
- package/lib/ktr/template/other/handlerError/components/stackHighlight.js +109 -0
- package/lib/ktr/template/other/handlerError/components/types.js +2 -0
- package/lib/ktr/template/other/handlerError/index.js +9 -0
- package/lib/ktr/template/other/help/components/Help.js +79 -0
- package/lib/ktr/template/other/help/components/types.js +3 -0
- package/lib/ktr/template/other/help/index.js +12 -0
- package/lib/ktr/template/other/live-photo-tip/components/LivePhotoTip.js +80 -0
- package/lib/ktr/template/other/live-photo-tip/components/types.js +3 -0
- package/lib/ktr/template/other/live-photo-tip/index.js +9 -0
- package/lib/ktr/template/other/qrlogin/components/qrlogin.js +58 -0
- package/lib/ktr/template/other/qrlogin/components/types.js +3 -0
- package/lib/ktr/template/other/qrlogin/index.js +9 -0
- package/lib/ktr/template/other/runtime/components/runtime.js +101 -0
- package/lib/ktr/template/other/runtime/components/types.js +3 -0
- package/lib/ktr/template/other/runtime/index.js +9 -0
- package/lib/ktr/template/other/version_warning/components/VersionWarning.js +38 -0
- package/lib/ktr/template/other/version_warning/components/types.js +3 -0
- package/lib/ktr/template/other/version_warning/index.js +9 -0
- package/lib/ktr/template/statistics/components/BoxplotGuide.js +17 -0
- package/lib/ktr/template/statistics/components/ChartCard.js +15 -0
- package/lib/ktr/template/statistics/components/KpiCard.js +14 -0
- package/lib/ktr/template/statistics/components/PlatformTable.js +20 -0
- package/lib/ktr/template/statistics/components/RankList.js +61 -0
- package/lib/ktr/template/statistics/components/SSRChart.js +22 -0
- package/lib/ktr/template/statistics/components/chartPresets.js +630 -0
- package/lib/ktr/template/statistics/components/chartTheme.js +226 -0
- package/lib/ktr/template/statistics/components/format.js +38 -0
- package/lib/ktr/template/statistics/components/types.js +9 -0
- package/lib/ktr/template/statistics/global/components/GlobalStatistics.js +246 -0
- package/lib/ktr/template/statistics/global/components/types.js +3 -0
- package/lib/ktr/template/statistics/global/index.js +9 -0
- package/lib/ktr/template/statistics/group/components/GroupStatistics.js +181 -0
- package/lib/ktr/template/statistics/group/components/types.js +3 -0
- package/lib/ktr/template/statistics/group/index.js +9 -0
- package/lib/ktr/template/types/ctx.js +2 -0
- package/lib/ktr/template/xiaohongshu/comment/components/Comment.js +99 -0
- package/lib/ktr/template/xiaohongshu/comment/components/types.js +3 -0
- package/lib/ktr/template/xiaohongshu/comment/index.js +9 -0
- package/lib/ktr/template/xiaohongshu/noteInfo/components/noteInfo.js +93 -0
- package/lib/ktr/template/xiaohongshu/noteInfo/components/types.js +2 -0
- package/lib/ktr/template/xiaohongshu/noteInfo/index.js +9 -0
- package/lib/ktr/utils/QRCodeAvatar.js +99 -0
- package/lib/ktr/utils/QRcode.js +56 -0
- package/lib/ktr/utils/avatarProxy.js +45 -0
- package/lib/ktr/utils/cn.js +11 -0
- package/lib/ktr/utils/theme.js +12 -0
- package/lib/qqFields.json +75 -0
- package/lib/qqOptions.js +44 -0
- package/lib/richtext/index.js +25 -0
- package/lib/richtext/parse/index.js +232 -0
- package/lib/richtext/react/cn.js +11 -0
- package/lib/richtext/react/index.js +221 -0
- package/lib/richtext/types.js +2 -0
- package/lib/schema.js +352 -0
- package/lib/webui.js +341 -0
- package/package.json +88 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_BV.svg +1 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_GOODS.svg +1 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_LOTTERY.svg +1 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_VIEW_PICTURE.svg +1 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_VOTE.svg +1 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_WEB.svg +1 -0
- package/resources/image/bilibili/bilibili-dark.png +0 -0
- package/resources/image/bilibili/bilibili-light.png +0 -0
- package/resources/image/bilibili/bilibili.png +0 -0
- package/resources/image/bilibili/id-dark.svg +1 -0
- package/resources/image/bilibili/id-light.svg +1 -0
- package/resources/image/bilibili/level/lv0.svg +1 -0
- package/resources/image/bilibili/level/lv1.svg +1 -0
- package/resources/image/bilibili/level/lv2.svg +1 -0
- package/resources/image/bilibili/level/lv3.svg +1 -0
- package/resources/image/bilibili/level/lv4.svg +1 -0
- package/resources/image/bilibili/level/lv5.svg +1 -0
- package/resources/image/bilibili/level/lv6.svg +1 -0
- package/resources/image/bilibili/level/lv7.svg +1 -0
- package/resources/image/bilibili/like-dark.svg +6 -0
- package/resources/image/bilibili/like-light.svg +6 -0
- package/resources/image/bilibili/play.svg +28 -0
- package/resources/image/bilibili/res-local1.png +0 -0
- package/resources/image/bilibili/up_pb.svg +1 -0
- package/resources/image/bilibili//347/233/264/346/222/255/344/270/255.png +0 -0
- package/resources/image/douyin/douyin.png +0 -0
- package/resources/image/douyin/dylogo-dark.svg +23 -0
- package/resources/image/douyin/dylogo-light.svg +38 -0
- package/resources/image/douyin/search-dark.svg +1 -0
- package/resources/image/douyin/search-light.svg +3 -0
- package/resources/image/douyin//346/212/226/351/237/263-/347/233/264/346/222/255/344/270/255.png +0 -0
- package/resources/image/frame-logo.png +0 -0
- package/resources/image/kuaishou/logo.png +0 -0
- package/resources/image/other/handlerError/Milky.png +0 -0
- package/resources/image/other/handlerError/chronocat.svg +43 -0
- package/resources/image/other/handlerError/conwechat.webp +0 -0
- package/resources/image/other/handlerError/gocq-http.webp +0 -0
- package/resources/image/other/handlerError/lagrange.webp +0 -0
- package/resources/image/other/handlerError/llonebot.webp +0 -0
- package/resources/image/other/handlerError/napcat.webp +0 -0
- package/resources/image/other/handlerError/onebot.png +0 -0
- package/resources/image/other/handlerError/satori.png +0 -0
- package/resources/image/xiaohongshu/logo.png +0 -0
- package/resources/template/style.css +23708 -0
- package/resources/vite.svg +130 -0
- package/scripts/build.mjs +129 -0
- package/scripts/check-schema.cjs +55 -0
- package/scripts/deploy.mjs +78 -0
- package/scripts/make-demo-placeholders.mjs +112 -0
- package/scripts/patch-deps.mjs +46 -0
- package/scripts/patch-webui.mjs +112 -0
- package/scripts/smoke-commands.cjs +39 -0
- package/scripts/smoke-config.cjs +122 -0
- package/scripts/smoke-douyin.cjs +170 -0
- package/scripts/smoke-koishi-commands.cjs +210 -0
- package/scripts/smoke-login.cjs +110 -0
- package/scripts/smoke-parse.cjs +54 -0
- package/scripts/smoke-push-mock.cjs +114 -0
- package/scripts/smoke-push.cjs +104 -0
- package/scripts/smoke-qq.cjs +147 -0
- package/scripts/smoke-qqcard.cjs +108 -0
- package/scripts/smoke-qqpanel.cjs +205 -0
- package/scripts/smoke-render.cjs +106 -0
- package/scripts/smoke-server.cjs +94 -0
- package/src/compat/axios.ts +5 -0
- package/src/compat/cron.ts +86 -0
- package/src/compat/esm.ts +13 -0
- package/src/compat/express.ts +5 -0
- package/src/compat/heroui.tsx +53 -0
- package/src/compat/lodash.ts +32 -0
- package/src/compat/logger.ts +121 -0
- package/src/compat/node-karin.ts +1064 -0
- package/src/compat/phosphor-icons.tsx +25 -0
- package/src/compat/qqcard.ts +251 -0
- package/src/compat/root.ts +44 -0
- package/src/compat/runtime.ts +120 -0
- package/src/compat/segment.ts +161 -0
- package/src/compat/sqlite3.ts +123 -0
- package/src/compat/start.ts +3 -0
- package/src/compat/syncConfig.ts +64 -0
- package/src/compat/template-react.ts +54 -0
- package/src/compat/text.ts +58 -0
- package/src/compat/yaml.ts +6 -0
- package/src/configBridge.ts +94 -0
- package/src/index.ts +769 -0
- package/src/karin/app.ts +1 -0
- package/src/karin/apps/__ready.ts +14 -0
- package/src/karin/apps/admin.ts +127 -0
- package/src/karin/apps/help.ts +228 -0
- package/src/karin/apps/push.ts +327 -0
- package/src/karin/apps/qrlogin.ts +160 -0
- package/src/karin/apps/statistics.ts +203 -0
- package/src/karin/apps/testPush.ts +226 -0
- package/src/karin/apps/tools.ts +510 -0
- package/src/karin/apps/update.ts +239 -0
- package/src/karin/index.ts +9 -0
- package/src/karin/module/db/bilibili.ts +1089 -0
- package/src/karin/module/db/douyin.ts +1218 -0
- package/src/karin/module/db/index.ts +159 -0
- package/src/karin/module/db/migration.ts +249 -0
- package/src/karin/module/db/statistics.ts +817 -0
- package/src/karin/module/index.ts +37 -0
- package/src/karin/module/server/constants/routes.ts +53 -0
- package/src/karin/module/server/controllers/bots.ts +289 -0
- package/src/karin/module/server/controllers/config.ts +85 -0
- package/src/karin/module/server/controllers/video.ts +212 -0
- package/src/karin/module/server/index.ts +11 -0
- package/src/karin/module/server/middlewares/auth.ts +147 -0
- package/src/karin/module/server/routes/amagi.ts +57 -0
- package/src/karin/module/server/routes/api.ts +42 -0
- package/src/karin/module/server/routes/index.ts +68 -0
- package/src/karin/module/server/routes/ssr.ts +14 -0
- package/src/karin/module/server/routes/static.ts +43 -0
- package/src/karin/module/utils/Base.ts +497 -0
- package/src/karin/module/utils/CardParser.ts +503 -0
- package/src/karin/module/utils/Common.ts +448 -0
- package/src/karin/module/utils/Config.ts +443 -0
- package/src/karin/module/utils/EmojiReaction.ts +268 -0
- package/src/karin/module/utils/ErrorHandler/handler.ts +124 -0
- package/src/karin/module/utils/ErrorHandler/index.ts +48 -0
- package/src/karin/module/utils/ErrorHandler/render.ts +180 -0
- package/src/karin/module/utils/ErrorHandler/sender.ts +192 -0
- package/src/karin/module/utils/ErrorHandler/strategy.ts +41 -0
- package/src/karin/module/utils/ErrorHandler/types.ts +122 -0
- package/src/karin/module/utils/ErrorHandler/utils.ts +108 -0
- package/src/karin/module/utils/FFmpeg.ts +357 -0
- package/src/karin/module/utils/ImageHelper.ts +90 -0
- package/src/karin/module/utils/ImageSlice.ts +383 -0
- package/src/karin/module/utils/MotionPhoto.ts +297 -0
- package/src/karin/module/utils/Network/Downloader.ts +481 -0
- package/src/karin/module/utils/Network/ImageDownloader.ts +291 -0
- package/src/karin/module/utils/Network/Network.ts +344 -0
- package/src/karin/module/utils/Network/ThrottleStream.ts +76 -0
- package/src/karin/module/utils/Network/constants.ts +135 -0
- package/src/karin/module/utils/Network/helpers.ts +183 -0
- package/src/karin/module/utils/Network/index.ts +28 -0
- package/src/karin/module/utils/Network/types.ts +46 -0
- package/src/karin/module/utils/Networks.ts +20 -0
- package/src/karin/module/utils/ParseLock.ts +33 -0
- package/src/karin/module/utils/ParseOverride.ts +128 -0
- package/src/karin/module/utils/QqCardResolve.ts +116 -0
- package/src/karin/module/utils/QqPanel.ts +880 -0
- package/src/karin/module/utils/Render/coverTheme.ts +294 -0
- package/src/karin/module/utils/Render/index.ts +574 -0
- package/src/karin/module/utils/amagiClient.ts +368 -0
- package/src/karin/module/utils/avatar.ts +220 -0
- package/src/karin/module/utils/bot.ts +115 -0
- package/src/karin/module/utils/build-metadata.ts +60 -0
- package/src/karin/module/utils/changelog.ts +175 -0
- package/src/karin/module/utils/index.ts +10 -0
- package/src/karin/module/utils/loginSession.ts +291 -0
- package/src/karin/module/utils/parseTip.ts +59 -0
- package/src/karin/module/utils/runtime-report.ts +142 -0
- package/src/karin/module/utils/semver.ts +60 -0
- package/src/karin/module/utils/statisticsAggregate.ts +507 -0
- package/src/karin/platform/bilibili/bilibili.ts +2004 -0
- package/src/karin/platform/bilibili/comments.ts +397 -0
- package/src/karin/platform/bilibili/danmaku.ts +653 -0
- package/src/karin/platform/bilibili/dynamic-text.ts +926 -0
- package/src/karin/platform/bilibili/genParams.ts +30 -0
- package/src/karin/platform/bilibili/getID.ts +163 -0
- package/src/karin/platform/bilibili/index.ts +8 -0
- package/src/karin/platform/bilibili/live-status.ts +36 -0
- package/src/karin/platform/bilibili/login.ts +130 -0
- package/src/karin/platform/bilibili/push.ts +1615 -0
- package/src/karin/platform/bilibili/riskControl.ts +114 -0
- package/src/karin/platform/bilibili/search.ts +305 -0
- package/src/karin/platform/common/danmaku-types.ts +18 -0
- package/src/karin/platform/douyin/comments.ts +404 -0
- package/src/karin/platform/douyin/danmaku.ts +1187 -0
- package/src/karin/platform/douyin/douyin.ts +1244 -0
- package/src/karin/platform/douyin/getID.ts +101 -0
- package/src/karin/platform/douyin/index.ts +8 -0
- package/src/karin/platform/douyin/login.ts +251 -0
- package/src/karin/platform/douyin/push/favorite.ts +97 -0
- package/src/karin/platform/douyin/push/index.ts +5 -0
- package/src/karin/platform/douyin/push/live.ts +86 -0
- package/src/karin/platform/douyin/push/post.ts +75 -0
- package/src/karin/platform/douyin/push/recommend.ts +96 -0
- package/src/karin/platform/douyin/push/render.ts +768 -0
- package/src/karin/platform/douyin/push/types.ts +41 -0
- package/src/karin/platform/douyin/push.ts +1241 -0
- package/src/karin/platform/douyin/types.ts +151 -0
- package/src/karin/platform/douyin/videoQuality.ts +234 -0
- package/src/karin/platform/douyin/workType.ts +238 -0
- package/src/karin/platform/index.ts +4 -0
- package/src/karin/platform/kuaishou/comments.ts +114 -0
- package/src/karin/platform/kuaishou/getID.ts +48 -0
- package/src/karin/platform/kuaishou/getdata.ts +78 -0
- package/src/karin/platform/kuaishou/index.ts +4 -0
- package/src/karin/platform/kuaishou/kuaishou.ts +130 -0
- package/src/karin/platform/xiaohongshu/comments.ts +227 -0
- package/src/karin/platform/xiaohongshu/getID.ts +127 -0
- package/src/karin/platform/xiaohongshu/index.ts +2 -0
- package/src/karin/platform/xiaohongshu/xiaohongshu.ts +733 -0
- package/src/karin/root.ts +78 -0
- package/src/karin/setup.ts +77 -0
- package/src/karin/types/config/amagi.ts +46 -0
- package/src/karin/types/config/app.ts +129 -0
- package/src/karin/types/config/bilibili.ts +121 -0
- package/src/karin/types/config/cookies.ts +11 -0
- package/src/karin/types/config/douyin.ts +93 -0
- package/src/karin/types/config/index.ts +41 -0
- package/src/karin/types/config/kuaishou.ts +10 -0
- package/src/karin/types/config/pushlist.ts +55 -0
- package/src/karin/types/config/request.ts +27 -0
- package/src/karin/types/config/upload.ts +49 -0
- package/src/karin/types/config/xiaohongshu.ts +24 -0
- package/src/karin/types/datatypes.ts +42 -0
- package/src/karin/types/index.ts +4 -0
- package/src/karin/types/netrorks/NetworksConfigType.ts +61 -0
- package/src/karin/types/netrorks/index.ts +1 -0
- package/src/karin/web.config.ts +48 -0
- package/src/ktr/registry.ts +55 -0
- package/src/ktr/template/_preview/components/PreviewInfoCard.tsx +33 -0
- package/src/ktr/template/_preview/components/PreviewLayout.tsx +65 -0
- package/src/ktr/template/_preview/components/PreviewVideoCard.tsx +22 -0
- package/src/ktr/template/_preview/render.ts +158 -0
- package/src/ktr/template/_preview/types.ts +15 -0
- package/src/ktr/template/_preview/utils/status.ts +29 -0
- package/src/ktr/template/_preview/utils/time.ts +8 -0
- package/src/ktr/template/bilibili/bangumi/components/bangumi.tsx +462 -0
- package/src/ktr/template/bilibili/bangumi/components/types.ts +36 -0
- package/src/ktr/template/bilibili/bangumi/index.tsx +9 -0
- package/src/ktr/template/bilibili/comment/components/Comment.tsx +657 -0
- package/src/ktr/template/bilibili/comment/components/types.ts +26 -0
- package/src/ktr/template/bilibili/comment/index.tsx +11 -0
- package/src/ktr/template/bilibili/components/Icons.tsx +209 -0
- package/src/ktr/template/bilibili/components/shared.tsx +162 -0
- package/src/ktr/template/bilibili/components/types.ts +388 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/components/DYNAMIC_TYPE_ARTICLE.tsx +251 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/components/types.ts +67 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/index.tsx +12 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/components/DYNAMIC_TYPE_AV.tsx +238 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/components/types.ts +39 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/index.tsx +12 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/components/DYNAMIC_TYPE_DRAW.tsx +205 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/components/types.ts +20 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/index.tsx +11 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/components/DYNAMIC_TYPE_FORWARD.tsx +348 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/components/types.ts +16 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/index.tsx +12 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/components/DYNAMIC_TYPE_LIVE_RCMD.tsx +264 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/components/types.ts +32 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/index.tsx +12 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/components/DYNAMIC_TYPE_WORD.tsx +68 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/components/types.ts +14 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/index.tsx +12 -0
- package/src/ktr/template/bilibili/dynamic/components/AdditionalCard.tsx +165 -0
- package/src/ktr/template/bilibili/dynamic/components/CommonComponents.tsx +142 -0
- package/src/ktr/template/bilibili/dynamic/types.ts +382 -0
- package/src/ktr/template/bilibili/qrcodeImg/components/qrcodeImg.tsx +179 -0
- package/src/ktr/template/bilibili/qrcodeImg/components/types.ts +9 -0
- package/src/ktr/template/bilibili/qrcodeImg/index.tsx +12 -0
- package/src/ktr/template/bilibili/userlist/components/UserList.tsx +246 -0
- package/src/ktr/template/bilibili/userlist/components/types.ts +35 -0
- package/src/ktr/template/bilibili/userlist/index.tsx +11 -0
- package/src/ktr/template/bilibili/videoInfo/components/types.ts +28 -0
- package/src/ktr/template/bilibili/videoInfo/components/videoInfo.tsx +217 -0
- package/src/ktr/template/bilibili/videoInfo/index.tsx +12 -0
- package/src/ktr/template/components/AmbientCover.tsx +50 -0
- package/src/ktr/template/components/DefaultLayout.tsx +166 -0
- package/src/ktr/template/components/GlowImage.tsx +572 -0
- package/src/ktr/template/components/QRCodeWithAvatar.tsx +52 -0
- package/src/ktr/template/components/RolldownLogo.tsx +110 -0
- package/src/ktr/template/components/ViteLogo.tsx +134 -0
- package/src/ktr/template/components/iconRegistry.ts +294 -0
- package/src/ktr/template/douyin/article-work/components/ArticleWork.tsx +301 -0
- package/src/ktr/template/douyin/article-work/components/types.ts +53 -0
- package/src/ktr/template/douyin/article-work/index.tsx +12 -0
- package/src/ktr/template/douyin/comment/components/Comment.tsx +612 -0
- package/src/ktr/template/douyin/comment/components/types.ts +85 -0
- package/src/ktr/template/douyin/comment/index.tsx +11 -0
- package/src/ktr/template/douyin/components/Icons.tsx +75 -0
- package/src/ktr/template/douyin/components/types.ts +83 -0
- package/src/ktr/template/douyin/dynamic/components/Dynamic.tsx +283 -0
- package/src/ktr/template/douyin/dynamic/components/types.ts +46 -0
- package/src/ktr/template/douyin/dynamic/index.tsx +11 -0
- package/src/ktr/template/douyin/favorite-list/components/FavoriteList.tsx +201 -0
- package/src/ktr/template/douyin/favorite-list/components/types.ts +38 -0
- package/src/ktr/template/douyin/favorite-list/index.tsx +12 -0
- package/src/ktr/template/douyin/image-work/components/ImageWork.tsx +437 -0
- package/src/ktr/template/douyin/image-work/components/types.ts +78 -0
- package/src/ktr/template/douyin/image-work/index.tsx +11 -0
- package/src/ktr/template/douyin/live/components/Live.tsx +229 -0
- package/src/ktr/template/douyin/live/components/types.ts +47 -0
- package/src/ktr/template/douyin/live/index.tsx +11 -0
- package/src/ktr/template/douyin/musicinfo/components/MusicInfo.tsx +187 -0
- package/src/ktr/template/douyin/musicinfo/components/types.ts +31 -0
- package/src/ktr/template/douyin/musicinfo/index.tsx +11 -0
- package/src/ktr/template/douyin/qrcodeImg/components/qrcodeImg.tsx +170 -0
- package/src/ktr/template/douyin/qrcodeImg/components/types.ts +9 -0
- package/src/ktr/template/douyin/qrcodeImg/index.tsx +9 -0
- package/src/ktr/template/douyin/recommend-list/components/RecommendList.tsx +201 -0
- package/src/ktr/template/douyin/recommend-list/components/types.ts +37 -0
- package/src/ktr/template/douyin/recommend-list/index.tsx +12 -0
- package/src/ktr/template/douyin/user_profile/components/UserVideoList.tsx +225 -0
- package/src/ktr/template/douyin/user_profile/components/types.ts +71 -0
- package/src/ktr/template/douyin/user_profile/index.tsx +9 -0
- package/src/ktr/template/douyin/userlist/components/UserList.tsx +229 -0
- package/src/ktr/template/douyin/userlist/components/types.ts +35 -0
- package/src/ktr/template/douyin/userlist/index.tsx +11 -0
- package/src/ktr/template/douyin/video-work/components/VideoWork.tsx +398 -0
- package/src/ktr/template/douyin/video-work/components/types.ts +80 -0
- package/src/ktr/template/douyin/video-work/index.tsx +11 -0
- package/src/ktr/template/font.css +6071 -0
- package/src/ktr/template/global.d.ts +69 -0
- package/src/ktr/template/kuaishou/comment/components/Comment.tsx +207 -0
- package/src/ktr/template/kuaishou/comment/components/types.ts +47 -0
- package/src/ktr/template/kuaishou/comment/index.tsx +11 -0
- package/src/ktr/template/other/changelog/components/changelog.tsx +411 -0
- package/src/ktr/template/other/changelog/components/types.ts +21 -0
- package/src/ktr/template/other/changelog/index.tsx +9 -0
- package/src/ktr/template/other/handlerError/components/errorTitles.ts +224 -0
- package/src/ktr/template/other/handlerError/components/handlerError.tsx +1076 -0
- package/src/ktr/template/other/handlerError/components/stackHighlight.ts +127 -0
- package/src/ktr/template/other/handlerError/components/types.ts +124 -0
- package/src/ktr/template/other/handlerError/index.tsx +9 -0
- package/src/ktr/template/other/help/components/Help.tsx +249 -0
- package/src/ktr/template/other/help/components/types.ts +47 -0
- package/src/ktr/template/other/help/index.tsx +9 -0
- package/src/ktr/template/other/live-photo-tip/components/LivePhotoTip.tsx +295 -0
- package/src/ktr/template/other/live-photo-tip/components/types.ts +8 -0
- package/src/ktr/template/other/live-photo-tip/index.tsx +9 -0
- package/src/ktr/template/other/qrlogin/components/qrlogin.tsx +295 -0
- package/src/ktr/template/other/qrlogin/components/types.ts +11 -0
- package/src/ktr/template/other/qrlogin/index.tsx +9 -0
- package/src/ktr/template/other/runtime/components/runtime.tsx +347 -0
- package/src/ktr/template/other/runtime/components/types.ts +75 -0
- package/src/ktr/template/other/runtime/index.tsx +9 -0
- package/src/ktr/template/other/version_warning/components/VersionWarning.tsx +392 -0
- package/src/ktr/template/other/version_warning/components/types.ts +8 -0
- package/src/ktr/template/other/version_warning/index.tsx +9 -0
- package/src/ktr/template/statistics/components/BoxplotGuide.tsx +57 -0
- package/src/ktr/template/statistics/components/ChartCard.tsx +40 -0
- package/src/ktr/template/statistics/components/KpiCard.tsx +39 -0
- package/src/ktr/template/statistics/components/PlatformTable.tsx +83 -0
- package/src/ktr/template/statistics/components/RankList.tsx +127 -0
- package/src/ktr/template/statistics/components/SSRChart.tsx +41 -0
- package/src/ktr/template/statistics/components/chartPresets.ts +700 -0
- package/src/ktr/template/statistics/components/chartTheme.ts +234 -0
- package/src/ktr/template/statistics/components/format.ts +33 -0
- package/src/ktr/template/statistics/components/types.ts +92 -0
- package/src/ktr/template/statistics/global/components/GlobalStatistics.tsx +597 -0
- package/src/ktr/template/statistics/global/components/types.ts +138 -0
- package/src/ktr/template/statistics/global/index.tsx +9 -0
- package/src/ktr/template/statistics/group/components/GroupStatistics.tsx +468 -0
- package/src/ktr/template/statistics/group/components/types.ts +113 -0
- package/src/ktr/template/statistics/group/index.tsx +9 -0
- package/src/ktr/template/style.css +65 -0
- package/src/ktr/template/types/ctx.ts +42 -0
- package/src/ktr/template/xiaohongshu/comment/components/Comment.tsx +264 -0
- package/src/ktr/template/xiaohongshu/comment/components/types.ts +119 -0
- package/src/ktr/template/xiaohongshu/comment/index.tsx +9 -0
- package/src/ktr/template/xiaohongshu/noteInfo/components/noteInfo.tsx +271 -0
- package/src/ktr/template/xiaohongshu/noteInfo/components/types.ts +66 -0
- package/src/ktr/template/xiaohongshu/noteInfo/index.tsx +9 -0
- package/src/ktr/utils/QRCodeAvatar.ts +102 -0
- package/src/ktr/utils/QRcode.ts +65 -0
- package/src/ktr/utils/avatarProxy.ts +42 -0
- package/src/ktr/utils/cn.ts +6 -0
- package/src/ktr/utils/theme.ts +10 -0
- package/src/qqFields.json +75 -0
- package/src/qqOptions.ts +64 -0
- package/src/richtext/index.ts +9 -0
- package/src/richtext/parse/index.ts +271 -0
- package/src/richtext/react/cn.ts +6 -0
- package/src/richtext/react/index.tsx +582 -0
- package/src/richtext/types.ts +320 -0
- package/src/schema.ts +372 -0
- package/src/webui.ts +352 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# 抖音解析开关,单独开关,受「总开关」影响
|
|
2
|
+
switch: true
|
|
3
|
+
|
|
4
|
+
# 解析时发送的内容,可选值:'info'(视频信息)、'comment'(评论图片)、'video'(视频文件)
|
|
5
|
+
sendContent:
|
|
6
|
+
- info
|
|
7
|
+
- comment
|
|
8
|
+
- video
|
|
9
|
+
|
|
10
|
+
# 抖音评论数量,范围 1 ~ x 条
|
|
11
|
+
numcomment: 5
|
|
12
|
+
|
|
13
|
+
# 次级评论请求数量,范围1 ~ x 条,最高尽量 8 条左右,当前逻辑不仅无法判断请求的来的评论的嵌套深度,而且「subCommentDepth」会限制嵌套深度,超过深度的评论会被截断
|
|
14
|
+
subCommentLimit: 5
|
|
15
|
+
|
|
16
|
+
# 次级评论嵌套深度,范围1 ~ 6 层
|
|
17
|
+
subCommentDepth: 3
|
|
18
|
+
|
|
19
|
+
# 评论图是否显示真实评论数量,关闭则显示解析到的评论数量
|
|
20
|
+
realCommentCount: false
|
|
21
|
+
|
|
22
|
+
# 是否收集评论区的图片
|
|
23
|
+
commentImageCollection: true
|
|
24
|
+
|
|
25
|
+
# 合辑 Live 图 BGM 合并模式
|
|
26
|
+
# - 'continuous': 连续模式,BGM 接续播放
|
|
27
|
+
# - 'independent': 独立模式,每张图 BGM 从头开始
|
|
28
|
+
liveImageMergeMode: continuous
|
|
29
|
+
|
|
30
|
+
# 解析时是否直接输出文本,关闭后渲染为图片
|
|
31
|
+
textMode: false
|
|
32
|
+
|
|
33
|
+
# 视频画质偏好设置,'adapt' 为自动根据「maxAutoVideoSize」大小选择,其他为固定画质
|
|
34
|
+
# 可选值:'adapt'、'540p'、'720p'、'1080p'、'2k'、'4k'
|
|
35
|
+
videoQuality: '4k'
|
|
36
|
+
|
|
37
|
+
# 视频体积上限,自动画质模式下可接受的最大视频大小(单位:MB),仅在 「videoQuality」 为 'adapt' 时生效
|
|
38
|
+
maxAutoVideoSize: 50
|
|
39
|
+
|
|
40
|
+
# 谁可以触发扫码登录,all为所有人,admin为管理员,master为主人,group.owner为群主,group.admin为群管理员。修改后需重启
|
|
41
|
+
loginPerm: master
|
|
42
|
+
|
|
43
|
+
# 视频信息返回形式:
|
|
44
|
+
# - 'text'(文本模式)
|
|
45
|
+
# - 'image'(图片模式)
|
|
46
|
+
videoInfoMode: 'image'
|
|
47
|
+
|
|
48
|
+
# 视频信息的内容,可选值:'cover'(封面)、'title'(标题)、'author'(作者)、'stats'(视频统计信息),数组为空则不显示任何内容
|
|
49
|
+
displayContent: ['cover', 'title', 'author', 'stats']
|
|
50
|
+
|
|
51
|
+
# 弹幕烧录(将弹幕硬编码到视频画面中,需要重新编码视频,耗时较长)
|
|
52
|
+
burnDanmaku: false
|
|
53
|
+
|
|
54
|
+
# 弹幕显示区域(限制弹幕范围,避免遮挡视频主体)
|
|
55
|
+
# - 0.25: 1/4 屏,仅顶部区域
|
|
56
|
+
# - 0.5: 半屏,上半部分(推荐)
|
|
57
|
+
# - 0.75: 3/4 屏,大部分区域
|
|
58
|
+
# - 1: 全屏,铺满整个画面
|
|
59
|
+
danmakuArea: 0.5
|
|
60
|
+
|
|
61
|
+
# 弹幕字号
|
|
62
|
+
# - 'small': 小号
|
|
63
|
+
# - 'medium': 中号(推荐)
|
|
64
|
+
# - 'large': 大号
|
|
65
|
+
danmakuFontSize: 'medium'
|
|
66
|
+
|
|
67
|
+
# 弹幕透明度(0-100,0为完全透明,100为完全不透明,推荐70)
|
|
68
|
+
danmakuOpacity: 70
|
|
69
|
+
|
|
70
|
+
# 横屏转竖屏模式(针对横屏视频,抖音大多是竖屏,此选项主要用于横屏视频)
|
|
71
|
+
# - 'off': 关闭,保持原始比例
|
|
72
|
+
# - 'standard': 智能模式,仅对宽高比 ≥1.7 的横屏视频转竖屏
|
|
73
|
+
# - 'force': 强制 9:16,所有视频统一转为竖屏
|
|
74
|
+
verticalMode: 'off'
|
|
75
|
+
|
|
76
|
+
# 视频编码格式
|
|
77
|
+
# - 'h264': 兼容性最好,支持几乎所有设备
|
|
78
|
+
# - 'h265': 压缩率更高,近几年设备支持良好(默认)
|
|
79
|
+
# - 'av1': 最新编码格式,压缩率最高,但编码较慢
|
|
80
|
+
videoCodec: 'h265'
|
|
81
|
+
|
|
82
|
+
# 抖音推送相关配置
|
|
83
|
+
push:
|
|
84
|
+
# 推送开关,开启后需重启;使用「#设置抖音推送 + 抖音号」配置推送列表
|
|
85
|
+
switch: true
|
|
86
|
+
# 谁可以设置推送,all为所有人,admin为管理员,master为主人,group.owner为群主,group.admin为群管理员。修改后需重启
|
|
87
|
+
permission: master
|
|
88
|
+
# 推送定时任务的cron表达式,默认为每十分钟推送一次
|
|
89
|
+
cron: '*/10 * * * *'
|
|
90
|
+
# 推送时是否一同解析该作品
|
|
91
|
+
parsedynamic: false
|
|
92
|
+
# 分享链接二维码的类型,web为跳转到抖音网页,download为视频下载直链
|
|
93
|
+
shareType: 'web'
|
|
94
|
+
# 推送解析时视频画质偏好设置,'adapt' 为自动根据「maxAutoVideoSize」大小选择,其他为固定画质
|
|
95
|
+
# 可选值:'adapt'、'540p'、'720p'、'1080p'、'2k'、'4k'
|
|
96
|
+
pushVideoQuality: '4k'
|
|
97
|
+
|
|
98
|
+
# 推送解析时视频体积上限,自动画质模式下可接受的最大视频大小(单位:MB),仅在 「videoQuality」 为 'adapt' 时生效
|
|
99
|
+
pushMaxAutoVideoSize: 50
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# # 抖音推送列表
|
|
2
|
+
# douyin:
|
|
3
|
+
# -
|
|
4
|
+
# # 抖音用户(可不填,执行推送时会自动填上)
|
|
5
|
+
# sec_uid:
|
|
6
|
+
# # 抖音号(必填)
|
|
7
|
+
# short_id:
|
|
8
|
+
# # 推送群号和机器人账号,多个则使用逗号隔开(必填,例子:[12345678:87654321, 11451419:88888888],群号就是11451419,机器人账号就是88888888)
|
|
9
|
+
# group_id:
|
|
10
|
+
# - 1145141919810:8888888888
|
|
11
|
+
# # 这个博主的名字信息(可不填,执行推送时会自动填上)
|
|
12
|
+
# remark:
|
|
13
|
+
# # 推送类型(可选,默认为 [post])
|
|
14
|
+
# # post: 作品列表
|
|
15
|
+
# # favorite: 喜欢列表
|
|
16
|
+
# # recommend: 推荐列表
|
|
17
|
+
# # live: 直播
|
|
18
|
+
# # 可以同时推送多种类型,例如:[post, favorite, live]
|
|
19
|
+
# pushTypes:
|
|
20
|
+
# - post
|
|
21
|
+
|
|
22
|
+
# # B站推送列表
|
|
23
|
+
# bilibili:
|
|
24
|
+
# -
|
|
25
|
+
# # B站用户(必填)
|
|
26
|
+
# host_mid:
|
|
27
|
+
# # 推送群号和机器人账号,多个则使用逗号隔开(必填,例子:[12345678:87654321, 11451419:88888888],群号就是11451419,机器人账号就是88888888)
|
|
28
|
+
# group_id:
|
|
29
|
+
# - 1145141919810:8888888888
|
|
30
|
+
# # 这个UP主的名字信息(可不填,执行推送时会自动填上)
|
|
31
|
+
# remark:
|
|
32
|
+
|
|
33
|
+
# 抖音推送列表
|
|
34
|
+
douyin: []
|
|
35
|
+
|
|
36
|
+
# B站推送列表
|
|
37
|
+
bilibili: []
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# 请求超时时间,单位:毫秒
|
|
2
|
+
timeout: 30000
|
|
3
|
+
|
|
4
|
+
# 用户代理
|
|
5
|
+
User-Agent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36'
|
|
6
|
+
|
|
7
|
+
# 代理配置
|
|
8
|
+
proxy:
|
|
9
|
+
# 是否启用代理
|
|
10
|
+
switch: false
|
|
11
|
+
# 代理服务器主机地址
|
|
12
|
+
host: ''
|
|
13
|
+
# 代理服务器端口
|
|
14
|
+
port: ''
|
|
15
|
+
# 代理协议类型(http/https)
|
|
16
|
+
protocol: 'http'
|
|
17
|
+
# 代理服务器认证信息
|
|
18
|
+
auth:
|
|
19
|
+
# 用户名
|
|
20
|
+
username: ''
|
|
21
|
+
# 密码
|
|
22
|
+
password: ''
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# 本地视频发送方式,可选值:file / base64
|
|
2
|
+
# file: 使用 file 协议发送本地视频(需 Karin 与协议端在同一系统)
|
|
3
|
+
# base64: 转换为 base64 后发送(传输数据量增大约 30%,不在同一网络环境可能导致额外带宽成本,适合 karin 和协议端不在同一网络环境)
|
|
4
|
+
videoSendMode: file
|
|
5
|
+
|
|
6
|
+
# 视频上传拦截,开启后会根据解析的视频文件大小判断是否需要上传
|
|
7
|
+
usefilelimit: false
|
|
8
|
+
|
|
9
|
+
# 视频拦截阈值(填数字),视频文件大于该数值则不会上传 单位: MB,「视频文件上传限制」开启后才会生效
|
|
10
|
+
filelimit: 20
|
|
11
|
+
|
|
12
|
+
# 压缩视频,开启后会将视频文件压缩后再上传,适合上传大文件
|
|
13
|
+
compress: false
|
|
14
|
+
|
|
15
|
+
# 触发视频压缩的阈值,单位:MB。当文件大小超过该值时,才会压缩视频,「压缩视频」开启后才会生效
|
|
16
|
+
compresstrigger: 80
|
|
17
|
+
|
|
18
|
+
# 压缩后的值,若视频文件大小大于「触发视频压缩的阈值」的值,则会进行压缩至该值(±5%),「压缩视频」开启后才会生效
|
|
19
|
+
compressvalue: 30
|
|
20
|
+
|
|
21
|
+
# 使用文件上传,开启后会将视频文件上传到群文件中,私聊也行
|
|
22
|
+
# 与「videoSendMode: base64」互斥(群文件上传仅支持 file 协议)
|
|
23
|
+
usegroupfile: false
|
|
24
|
+
|
|
25
|
+
# 群文件上传阈值,当文件大小超过该值时将使用群文件上传,单位:MB,「使用群文件上传」开启后才会生效
|
|
26
|
+
groupfilevalue: 100
|
|
27
|
+
|
|
28
|
+
# 网络图片发送方式,可选值:url / file / base64
|
|
29
|
+
# url: 直接传递 HTTP 链接给上游下载(可能因上游网络问题导致下载超时)
|
|
30
|
+
# file: 下载到本地使用 file 协议发送(需 Karin 与协议端在同一系统)
|
|
31
|
+
# base64: 下载后转换为 base64 发送(传输数据量增大约 30%,不在同一网络环境可能导致额外带宽成本)
|
|
32
|
+
imageSendMode: url
|
|
33
|
+
|
|
34
|
+
# 下载限速开关,开启后会限制下载速度,避免触发服务器风控导致连接被重置(ECONNRESET)
|
|
35
|
+
# 如果你的网络带宽很大且下载时经常报错"连接被重置",建议开启此选项
|
|
36
|
+
downloadThrottle: false
|
|
37
|
+
|
|
38
|
+
# 下载速度限制,单位:MB/s,建议设置为 5-20 之间
|
|
39
|
+
# 设置过高可能触发服务器风控,设置过低会影响下载体验
|
|
40
|
+
# 仅在「下载限速开关」开启后生效
|
|
41
|
+
downloadMaxSpeed: 10
|
|
42
|
+
|
|
43
|
+
# 断流自动降速,当检测到连接被重置(ECONNRESET)时自动降低下载速度
|
|
44
|
+
# 每次断流后速度会降低到当前的 60%,直到达到最低速度
|
|
45
|
+
# 仅在「下载限速开关」开启后生效
|
|
46
|
+
downloadAutoReduce: true
|
|
47
|
+
|
|
48
|
+
# 最低下载速度,单位:MB/s,自动降速时不会低于此值
|
|
49
|
+
# 仅在「下载限速开关」和「断流自动降速」都开启后生效
|
|
50
|
+
downloadMinSpeed: 1
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# 小红书解析开关,单独开关,受「总开关」影响
|
|
2
|
+
switch: true
|
|
3
|
+
|
|
4
|
+
# 解析时发送的内容,可选值:'info'(笔记、视频信息)、'comment'(评论图片)、'image'(笔记图片)、'video'(视频文件)
|
|
5
|
+
sendContent:
|
|
6
|
+
- 'info'
|
|
7
|
+
- 'comment'
|
|
8
|
+
- 'image'
|
|
9
|
+
- 'video'
|
|
10
|
+
|
|
11
|
+
# 小红书评论数量(预留)
|
|
12
|
+
numcomment: 10
|
|
13
|
+
|
|
14
|
+
# 视频画质偏好设置,'adapt' 为自动根据「maxAutoVideoSize」大小选择,其他为固定画质
|
|
15
|
+
# - '540p': 540P 标清
|
|
16
|
+
# - '720p': 720P 高清
|
|
17
|
+
# - '1080p': 1080P 超清
|
|
18
|
+
# - '2k': 2K 超高清
|
|
19
|
+
# - '4k': 4K 超高清
|
|
20
|
+
videoQuality: '4k'
|
|
21
|
+
|
|
22
|
+
# 视频体积上限,自动画质模式下可接受的最大视频大小(单位:MB),仅在 「videoQuality」 为 'adapt' 时生效
|
|
23
|
+
maxAutoVideoSize: 50
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as l,ref as u,onMounted as d,onUnmounted as p,h as f}from"vue";const h="kkk-console",r=64,k=28;function v(s){s.page({name:"kkk 配置",path:"/kkk-config",desc:"解析 / 面板 / 画质 / 图片切片等设置,改完直接生效",authority:4,icon:"activity:plugin",component:l({setup(){const n=u({}),t=()=>{const o=document.querySelector("nav.layout-activity"),i=document.querySelector("footer.layout-status"),c=o&&Math.round(o.getBoundingClientRect().right)||r,a=(i?Math.round(i.getBoundingClientRect().height):k)+8;n.value={position:"fixed",left:c+"px",top:"0px",width:"calc(100vw - "+c+"px)",height:"calc(100vh - "+a+"px)",border:"0",display:"block",background:"#fff",zIndex:"1"}};let e=null;return d(()=>{t(),e=setInterval(t,1e3),window.addEventListener("resize",t)}),p(()=>{e&&clearInterval(e),window.removeEventListener("resize",t)}),()=>f("iframe",{src:"/kkk",style:n.value})}})})}export{v as apply,h as name};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
/** `node-karin/axios` 的兼容实现:直接复用 axios */
|
|
21
|
+
const axios_1 = __importDefault(require("axios"));
|
|
22
|
+
__exportStar(require("axios"), exports);
|
|
23
|
+
exports.default = axios_1.default;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cronMatcher = cronMatcher;
|
|
4
|
+
exports.startScheduler = startScheduler;
|
|
5
|
+
function parseField(field, min, max) {
|
|
6
|
+
if (field === '*' || field === '?')
|
|
7
|
+
return () => true;
|
|
8
|
+
const matchers = [];
|
|
9
|
+
for (const part of field.split(',')) {
|
|
10
|
+
const stepMatch = part.match(/^(\*|\d+(?:-\d+)?)\/(\d+)$/);
|
|
11
|
+
if (stepMatch) {
|
|
12
|
+
const step = Number(stepMatch[2]);
|
|
13
|
+
const [start, end] = stepMatch[1] === '*' ? [min, max] : stepMatch[1].split('-').map(Number);
|
|
14
|
+
matchers.push((value) => value >= start && value <= (end ?? start) && (value - start) % step === 0);
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
const rangeMatch = part.match(/^(\d+)-(\d+)$/);
|
|
18
|
+
if (rangeMatch) {
|
|
19
|
+
const start = Number(rangeMatch[1]);
|
|
20
|
+
const end = Number(rangeMatch[2]);
|
|
21
|
+
matchers.push((value) => value >= start && value <= end);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
const num = Number(part);
|
|
25
|
+
if (!Number.isNaN(num))
|
|
26
|
+
matchers.push((value) => value === num);
|
|
27
|
+
}
|
|
28
|
+
if (!matchers.length)
|
|
29
|
+
return () => true;
|
|
30
|
+
return (value) => matchers.some((matcher) => matcher(value));
|
|
31
|
+
}
|
|
32
|
+
function cronMatcher(expression) {
|
|
33
|
+
const fields = expression.trim().split(/\s+/);
|
|
34
|
+
if (fields.length < 5)
|
|
35
|
+
return () => false;
|
|
36
|
+
const [minute, hour, day, month, week] = fields;
|
|
37
|
+
const matchMinute = parseField(minute, 0, 59);
|
|
38
|
+
const matchHour = parseField(hour, 0, 23);
|
|
39
|
+
const matchDay = parseField(day, 1, 31);
|
|
40
|
+
const matchMonth = parseField(month, 1, 12);
|
|
41
|
+
const matchWeek = parseField(week, 0, 6);
|
|
42
|
+
return (date) => matchMinute(date.getMinutes())
|
|
43
|
+
&& matchHour(date.getHours())
|
|
44
|
+
&& matchDay(date.getDate())
|
|
45
|
+
&& matchMonth(date.getMonth() + 1)
|
|
46
|
+
&& matchWeek(date.getDay());
|
|
47
|
+
}
|
|
48
|
+
function startScheduler(ctx, logger, tasks) {
|
|
49
|
+
if (!tasks.length)
|
|
50
|
+
return;
|
|
51
|
+
const entries = tasks.map((task) => ({ task, match: cronMatcher(task.cron), running: false, lastKey: '' }));
|
|
52
|
+
for (const entry of entries) {
|
|
53
|
+
logger.info('注册定时任务 %s(%s)', entry.task.name, entry.task.cron);
|
|
54
|
+
}
|
|
55
|
+
const tick = async () => {
|
|
56
|
+
const now = new Date();
|
|
57
|
+
const key = now.toISOString().slice(0, 16);
|
|
58
|
+
for (const entry of entries) {
|
|
59
|
+
if (entry.lastKey === key)
|
|
60
|
+
continue;
|
|
61
|
+
if (!entry.match(now))
|
|
62
|
+
continue;
|
|
63
|
+
entry.lastKey = key;
|
|
64
|
+
if (entry.running) {
|
|
65
|
+
logger.warn('任务 %s 上一轮尚未结束,跳过本次触发', entry.task.name);
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
entry.running = true;
|
|
69
|
+
Promise.resolve()
|
|
70
|
+
.then(() => entry.task.handler())
|
|
71
|
+
.catch((error) => logger.error('任务 %s 执行失败: %s', entry.task.name, error?.stack ?? error))
|
|
72
|
+
.finally(() => { entry.running = false; });
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
ctx.setInterval(tick, 30 * 1000);
|
|
76
|
+
void tick();
|
|
77
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.importEsm = importEsm;
|
|
4
|
+
/**
|
|
5
|
+
* 真实动态 import 的逃生舱。
|
|
6
|
+
*
|
|
7
|
+
* tsc 在 `module: commonjs` 下会把 `await import('x')` 降级成 `Promise.resolve().then(() => require('x'))`,
|
|
8
|
+
* 于是 ESM-only 的依赖(例如 `@ikenxuan/qrcode` 的 exports 没有 require 条件)依旧加载不了。
|
|
9
|
+
* 这里用 `new Function` 包一层,绕开编译期改写,运行时由 Node 走真正的 ESM 加载。
|
|
10
|
+
*/
|
|
11
|
+
function importEsm(specifier) {
|
|
12
|
+
const importer = new Function('specifier', 'return import(specifier)');
|
|
13
|
+
return importer(specifier);
|
|
14
|
+
}
|
|
15
|
+
exports.default = importEsm;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
/** `node-karin/express` 的兼容实现:复用 express */
|
|
21
|
+
const express_1 = __importDefault(require("express"));
|
|
22
|
+
__exportStar(require("express"), exports);
|
|
23
|
+
exports.default = express_1.default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Button = exports.Chip = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const join = (...parts) => parts.filter(Boolean).join(' ');
|
|
6
|
+
/** 对应 HeroUI 的 Chip(标签/徽章) */
|
|
7
|
+
const Chip = ({ size = 'md', color, variant, className, style, children, ...rest }) => ((0, jsx_runtime_1.jsx)("span", { className: join('inline-flex items-center justify-center rounded-full leading-none', className), style: style, "data-color": color, "data-variant": variant, "data-size": size, ...rest, children: children }));
|
|
8
|
+
exports.Chip = Chip;
|
|
9
|
+
/** 对应 HeroUI 的 Button(静态海报里就是一块按钮样式的容器) */
|
|
10
|
+
const Button = ({ size = 'md', color, variant, className, style, children, ...rest }) => ((0, jsx_runtime_1.jsx)("span", { className: join('inline-flex items-center justify-center gap-2 rounded-xl font-medium', className), style: style, "data-color": color, "data-variant": variant, "data-size": size, ...rest, children: children }));
|
|
11
|
+
exports.Button = Button;
|
|
12
|
+
exports.default = { Chip: exports.Chip, Button: exports.Button };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* \`node-karin/lodash\` 的兼容实现。
|
|
4
|
+
*
|
|
5
|
+
* 上游只有一个模板用到它,且只用了 \`camelCase\` / \`upperFirst\` 两个纯函数,
|
|
6
|
+
* 因此这里不引入 lodash 全量依赖,直接实现同语义的小函数(并保留 lodash 的默认导出形态)。
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.camelCase = camelCase;
|
|
10
|
+
exports.upperFirst = upperFirst;
|
|
11
|
+
/** lodash 的 camelCase:\`'QQ Bot' -> 'qqBot'\` */
|
|
12
|
+
function camelCase(input) {
|
|
13
|
+
const words = String(input ?? '')
|
|
14
|
+
.replace(/['\u2019]/g, '')
|
|
15
|
+
.replace(/([a-z\d])([A-Z])/g, '$1 $2')
|
|
16
|
+
.replace(/[^a-zA-Z0-9]+/g, ' ')
|
|
17
|
+
.trim()
|
|
18
|
+
.split(/\s+/)
|
|
19
|
+
.filter(Boolean);
|
|
20
|
+
return words
|
|
21
|
+
.map((word, index) => {
|
|
22
|
+
const lower = word.toLowerCase();
|
|
23
|
+
return index === 0 ? lower : lower.charAt(0).toUpperCase() + lower.slice(1);
|
|
24
|
+
})
|
|
25
|
+
.join('');
|
|
26
|
+
}
|
|
27
|
+
/** lodash 的 upperFirst:只把首字母大写 */
|
|
28
|
+
function upperFirst(input) {
|
|
29
|
+
const text = String(input ?? '');
|
|
30
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
31
|
+
}
|
|
32
|
+
const lodash = { camelCase, upperFirst };
|
|
33
|
+
exports.default = lodash;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logger = void 0;
|
|
4
|
+
exports.setLogger = setLogger;
|
|
5
|
+
/** karin `logger` 的 Koishi 兼容实现:保留 mark/彩色包装等调用习惯 */
|
|
6
|
+
const node_util_1 = require("node:util");
|
|
7
|
+
const runtime_1 = require("./runtime");
|
|
8
|
+
let koishiLogger = null;
|
|
9
|
+
function setLogger(logger) {
|
|
10
|
+
koishiLogger = logger;
|
|
11
|
+
}
|
|
12
|
+
function getLogger() {
|
|
13
|
+
if (koishiLogger)
|
|
14
|
+
return koishiLogger;
|
|
15
|
+
const runtime = (0, runtime_1.tryGetRuntime)();
|
|
16
|
+
if (!runtime)
|
|
17
|
+
return null;
|
|
18
|
+
koishiLogger = runtime.ctx.logger('kkk');
|
|
19
|
+
return koishiLogger;
|
|
20
|
+
}
|
|
21
|
+
const safeFormat = (args) => {
|
|
22
|
+
try {
|
|
23
|
+
return (0, node_util_1.format)(...args);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return args.map((item) => (typeof item === 'string' ? item : String(item))).join(' ');
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const wrap = (code) => (input) => `\u001b[${code}m${input}\u001b[0m`;
|
|
30
|
+
const chalkFn = new Proxy(function () { }, {
|
|
31
|
+
get(_target, prop) {
|
|
32
|
+
if (prop === 'rgb')
|
|
33
|
+
return (r, g, b) => (input) => `\u001b[38;2;${r};${g};${b}m${input}\u001b[0m`;
|
|
34
|
+
if (prop === 'hex')
|
|
35
|
+
return (_hex) => (input) => String(input);
|
|
36
|
+
if (prop === 'bold')
|
|
37
|
+
return wrap(1);
|
|
38
|
+
return wrap(36);
|
|
39
|
+
},
|
|
40
|
+
apply(_target, _this, args) {
|
|
41
|
+
return String(args[0] ?? '');
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
/** karin 的 logger.runContext 会捕获一段代码里产生的日志,错误处理海报要读这段日志 */
|
|
45
|
+
const captureStack = [];
|
|
46
|
+
/** Karin 的日志级别是 4 字母缩写,错误诊断海报按这个格式解析 */
|
|
47
|
+
const KARIN_LEVEL = {
|
|
48
|
+
debug: 'DEBU',
|
|
49
|
+
trace: 'TRAC',
|
|
50
|
+
info: 'INFO',
|
|
51
|
+
mark: 'MARK',
|
|
52
|
+
warn: 'WARN',
|
|
53
|
+
error: 'ERRO',
|
|
54
|
+
fatal: 'FATA'
|
|
55
|
+
};
|
|
56
|
+
const stamp = () => {
|
|
57
|
+
const now = new Date();
|
|
58
|
+
const pad = (value, size = 2) => String(value).padStart(size, '0');
|
|
59
|
+
return pad(now.getHours()) + ':' + pad(now.getMinutes()) + ':' + pad(now.getSeconds()) + '.' + pad(now.getMilliseconds(), 3);
|
|
60
|
+
};
|
|
61
|
+
const emit = (level, args) => {
|
|
62
|
+
const logger = getLogger();
|
|
63
|
+
const message = safeFormat(args);
|
|
64
|
+
const capture = captureStack[captureStack.length - 1];
|
|
65
|
+
if (capture)
|
|
66
|
+
capture.push('[' + stamp() + '][' + (KARIN_LEVEL[level] ?? 'INFO') + '] ' + message);
|
|
67
|
+
if (!logger) {
|
|
68
|
+
// 兼容层未初始化时退化到 stdout,避免丢日志
|
|
69
|
+
// eslint-disable-next-line no-console
|
|
70
|
+
console[level === 'debug' ? 'log' : level]('[kkk] ' + message);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
// 插件配置里打开 debug 时,把 karin 的 debug 日志提升为 info,避免被 Koishi 默认日志级别吞掉
|
|
74
|
+
const effective = level === 'debug' && (0, runtime_1.tryGetRuntime)()?.config?.debug ? 'info' : level;
|
|
75
|
+
if (effective === 'debug') {
|
|
76
|
+
logger.debug(message);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
logger[effective](message);
|
|
80
|
+
};
|
|
81
|
+
exports.logger = {
|
|
82
|
+
debug: (...args) => emit('debug', args),
|
|
83
|
+
trace: (...args) => emit('debug', args),
|
|
84
|
+
info: (...args) => emit('info', args),
|
|
85
|
+
mark: (...args) => emit('info', args),
|
|
86
|
+
warn: (...args) => emit('warn', args),
|
|
87
|
+
error: (...args) => emit('error', args),
|
|
88
|
+
fatal: (...args) => emit('error', args),
|
|
89
|
+
/**
|
|
90
|
+
* 移植代码用法:`const ctx = logger.runContext(fn); await ctx.run(); ctx.logs()`
|
|
91
|
+
*/
|
|
92
|
+
runContext: (fn) => {
|
|
93
|
+
const buffer = [];
|
|
94
|
+
return {
|
|
95
|
+
run: async () => {
|
|
96
|
+
captureStack.push(buffer);
|
|
97
|
+
try {
|
|
98
|
+
return await fn();
|
|
99
|
+
}
|
|
100
|
+
finally {
|
|
101
|
+
captureStack.pop();
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
// Karin 的 logs() 返回字符串数组:['[12:00:00.000][INFO] xxx', ...]
|
|
105
|
+
logs: () => [...buffer]
|
|
106
|
+
};
|
|
107
|
+
},
|
|
108
|
+
green: wrap(32),
|
|
109
|
+
yellow: wrap(33),
|
|
110
|
+
blue: wrap(34),
|
|
111
|
+
red: wrap(31),
|
|
112
|
+
cyan: wrap(36),
|
|
113
|
+
violet: wrap(35),
|
|
114
|
+
chalk: chalkFn,
|
|
115
|
+
/** karin 的 logger 支持自定义前缀创建 */
|
|
116
|
+
createLogger: () => exports.logger
|
|
117
|
+
};
|
|
118
|
+
exports.default = exports.logger;
|