@ttkit/daily-hot-api 0.0.0-stage → 0.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/.env.example +77 -0
- package/LICENSE +21 -0
- package/README.md +315 -2
- package/bin/daily-hot-api.js +25 -0
- package/dist/app.controller.d.ts +41 -0
- package/dist/app.controller.js +91 -0
- package/dist/app.controller.js.map +1 -0
- package/dist/app.module.d.ts +4 -0
- package/dist/app.module.js +44 -0
- package/dist/app.module.js.map +1 -0
- package/dist/app.service.d.ts +19 -0
- package/dist/app.service.js +57 -0
- package/dist/app.service.js.map +1 -0
- package/dist/cache/cache.module.d.ts +2 -0
- package/dist/cache/cache.module.js +52 -0
- package/dist/cache/cache.module.js.map +1 -0
- package/dist/cache/cache.service.d.ts +26 -0
- package/dist/cache/cache.service.js +163 -0
- package/dist/cache/cache.service.js.map +1 -0
- package/dist/cli/args.d.ts +24 -0
- package/dist/cli/args.js +261 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/commands/logs.d.ts +3 -0
- package/dist/cli/commands/logs.js +55 -0
- package/dist/cli/commands/logs.js.map +1 -0
- package/dist/cli/commands/restart.d.ts +3 -0
- package/dist/cli/commands/restart.js +62 -0
- package/dist/cli/commands/restart.js.map +1 -0
- package/dist/cli/commands/start.d.ts +3 -0
- package/dist/cli/commands/start.js +280 -0
- package/dist/cli/commands/start.js.map +1 -0
- package/dist/cli/commands/status.d.ts +3 -0
- package/dist/cli/commands/status.js +78 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/stop.d.ts +12 -0
- package/dist/cli/commands/stop.js +135 -0
- package/dist/cli/commands/stop.js.map +1 -0
- package/dist/cli/context.d.ts +4 -0
- package/dist/cli/context.js +3 -0
- package/dist/cli/context.js.map +1 -0
- package/dist/cli/env.d.ts +2 -0
- package/dist/cli/env.js +80 -0
- package/dist/cli/env.js.map +1 -0
- package/dist/cli/errors.d.ts +14 -0
- package/dist/cli/errors.js +25 -0
- package/dist/cli/errors.js.map +1 -0
- package/dist/cli/health.d.ts +2 -0
- package/dist/cli/health.js +44 -0
- package/dist/cli/health.js.map +1 -0
- package/dist/cli/help.d.ts +3 -0
- package/dist/cli/help.js +158 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +94 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/log-file.d.ts +8 -0
- package/dist/cli/log-file.js +58 -0
- package/dist/cli/log-file.js.map +1 -0
- package/dist/cli/output.d.ts +7 -0
- package/dist/cli/output.js +46 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/cli/paths.d.ts +33 -0
- package/dist/cli/paths.js +76 -0
- package/dist/cli/paths.js.map +1 -0
- package/dist/cli/run-state.d.ts +25 -0
- package/dist/cli/run-state.js +159 -0
- package/dist/cli/run-state.js.map +1 -0
- package/dist/common/middlewares/logger.middleware.d.ts +7 -0
- package/dist/common/middlewares/logger.middleware.js +29 -0
- package/dist/common/middlewares/logger.middleware.js.map +1 -0
- package/dist/config/config.module.d.ts +2 -0
- package/dist/config/config.module.js +47 -0
- package/dist/config/config.module.js.map +1 -0
- package/dist/config/configuration.d.ts +3 -0
- package/dist/config/configuration.js +5 -0
- package/dist/config/configuration.js.map +1 -0
- package/dist/config/validation.schema.d.ts +114 -0
- package/dist/config/validation.schema.js +69 -0
- package/dist/config/validation.schema.js.map +1 -0
- package/dist/daily-brief/clients/ai-analysis.client.d.ts +20 -0
- package/dist/daily-brief/clients/ai-analysis.client.js +217 -0
- package/dist/daily-brief/clients/ai-analysis.client.js.map +1 -0
- package/dist/daily-brief/clients/brief-search.service.d.ts +11 -0
- package/dist/daily-brief/clients/brief-search.service.js +52 -0
- package/dist/daily-brief/clients/brief-search.service.js.map +1 -0
- package/dist/daily-brief/clients/deepseek-search.client.d.ts +11 -0
- package/dist/daily-brief/clients/deepseek-search.client.js +70 -0
- package/dist/daily-brief/clients/deepseek-search.client.js.map +1 -0
- package/dist/daily-brief/clients/tavily-search.client.d.ts +11 -0
- package/dist/daily-brief/clients/tavily-search.client.js +72 -0
- package/dist/daily-brief/clients/tavily-search.client.js.map +1 -0
- package/dist/daily-brief/daily-brief.config.d.ts +31 -0
- package/dist/daily-brief/daily-brief.config.js +108 -0
- package/dist/daily-brief/daily-brief.config.js.map +1 -0
- package/dist/daily-brief/daily-brief.controller.d.ts +72 -0
- package/dist/daily-brief/daily-brief.controller.js +169 -0
- package/dist/daily-brief/daily-brief.controller.js.map +1 -0
- package/dist/daily-brief/daily-brief.module.d.ts +2 -0
- package/dist/daily-brief/daily-brief.module.js +49 -0
- package/dist/daily-brief/daily-brief.module.js.map +1 -0
- package/dist/daily-brief/daily-brief.scheduler.d.ts +30 -0
- package/dist/daily-brief/daily-brief.scheduler.js +113 -0
- package/dist/daily-brief/daily-brief.scheduler.js.map +1 -0
- package/dist/daily-brief/daily-brief.service.d.ts +101 -0
- package/dist/daily-brief/daily-brief.service.js +412 -0
- package/dist/daily-brief/daily-brief.service.js.map +1 -0
- package/dist/daily-brief/dto/brief-date-param.dto.d.ts +3 -0
- package/dist/daily-brief/dto/brief-date-param.dto.js +23 -0
- package/dist/daily-brief/dto/brief-date-param.dto.js.map +1 -0
- package/dist/daily-brief/dto/generate-brief.dto.d.ts +6 -0
- package/dist/daily-brief/dto/generate-brief.dto.js +39 -0
- package/dist/daily-brief/dto/generate-brief.dto.js.map +1 -0
- package/dist/daily-brief/dto/list-briefs-query.dto.d.ts +6 -0
- package/dist/daily-brief/dto/list-briefs-query.dto.js +42 -0
- package/dist/daily-brief/dto/list-briefs-query.dto.js.map +1 -0
- package/dist/daily-brief/dto/stock-ranking-query.dto.d.ts +6 -0
- package/dist/daily-brief/dto/stock-ranking-query.dto.js +46 -0
- package/dist/daily-brief/dto/stock-ranking-query.dto.js.map +1 -0
- package/dist/daily-brief/interfaces/daily-brief.interface.d.ts +59 -0
- package/dist/daily-brief/interfaces/daily-brief.interface.js +3 -0
- package/dist/daily-brief/interfaces/daily-brief.interface.js.map +1 -0
- package/dist/daily-brief/interfaces/search-provider.interface.d.ts +11 -0
- package/dist/daily-brief/interfaces/search-provider.interface.js +3 -0
- package/dist/daily-brief/interfaces/search-provider.interface.js.map +1 -0
- package/dist/daily-brief/utils/brief-date.d.ts +2 -0
- package/dist/daily-brief/utils/brief-date.js +16 -0
- package/dist/daily-brief/utils/brief-date.js.map +1 -0
- package/dist/daily-brief/utils/concurrency.d.ts +1 -0
- package/dist/daily-brief/utils/concurrency.js +20 -0
- package/dist/daily-brief/utils/concurrency.js.map +1 -0
- package/dist/database/database.module.d.ts +2 -0
- package/dist/database/database.module.js +57 -0
- package/dist/database/database.module.js.map +1 -0
- package/dist/database/repositories/daily-brief.repository.d.ts +96 -0
- package/dist/database/repositories/daily-brief.repository.js +457 -0
- package/dist/database/repositories/daily-brief.repository.js.map +1 -0
- package/dist/database/repositories/hot-item.repository.d.ts +52 -0
- package/dist/database/repositories/hot-item.repository.js +255 -0
- package/dist/database/repositories/hot-item.repository.js.map +1 -0
- package/dist/database/repositories/source-config.repository.d.ts +15 -0
- package/dist/database/repositories/source-config.repository.js +77 -0
- package/dist/database/repositories/source-config.repository.js.map +1 -0
- package/dist/database/schemas/daily-brief.schema.d.ts +30 -0
- package/dist/database/schemas/daily-brief.schema.js +103 -0
- package/dist/database/schemas/daily-brief.schema.js.map +1 -0
- package/dist/database/schemas/hot-item.schema.d.ts +20 -0
- package/dist/database/schemas/hot-item.schema.js +72 -0
- package/dist/database/schemas/hot-item.schema.js.map +1 -0
- package/dist/database/schemas/source-config.schema.d.ts +15 -0
- package/dist/database/schemas/source-config.schema.js +47 -0
- package/dist/database/schemas/source-config.schema.js.map +1 -0
- package/dist/history/dto/history-response.dto.d.ts +17 -0
- package/dist/history/dto/history-response.dto.js +13 -0
- package/dist/history/dto/history-response.dto.js.map +1 -0
- package/dist/history/dto/search-history.dto.d.ts +10 -0
- package/dist/history/dto/search-history.dto.js +72 -0
- package/dist/history/dto/search-history.dto.js.map +1 -0
- package/dist/history/history.controller.d.ts +13 -0
- package/dist/history/history.controller.js +92 -0
- package/dist/history/history.controller.js.map +1 -0
- package/dist/history/history.module.d.ts +2 -0
- package/dist/history/history.module.js +25 -0
- package/dist/history/history.module.js.map +1 -0
- package/dist/history/history.service.d.ts +15 -0
- package/dist/history/history.service.js +68 -0
- package/dist/history/history.service.js.map +1 -0
- package/dist/host-lists/decorators/hot-source.decorator.d.ts +9 -0
- package/dist/host-lists/decorators/hot-source.decorator.js +11 -0
- package/dist/host-lists/decorators/hot-source.decorator.js.map +1 -0
- package/dist/host-lists/dto/hot-list.dto.d.ts +14 -0
- package/dist/host-lists/dto/hot-list.dto.js +94 -0
- package/dist/host-lists/dto/hot-list.dto.js.map +1 -0
- package/dist/host-lists/hot-lists.controller.d.ts +39 -0
- package/dist/host-lists/hot-lists.controller.js +87 -0
- package/dist/host-lists/hot-lists.controller.js.map +1 -0
- package/dist/host-lists/hot-lists.module.d.ts +2 -0
- package/dist/host-lists/hot-lists.module.js +36 -0
- package/dist/host-lists/hot-lists.module.js.map +1 -0
- package/dist/host-lists/hot-lists.service.d.ts +21 -0
- package/dist/host-lists/hot-lists.service.js +115 -0
- package/dist/host-lists/hot-lists.service.js.map +1 -0
- package/dist/host-lists/interfaces/hot-list-source.interface.d.ts +5 -0
- package/dist/host-lists/interfaces/hot-list-source.interface.js +3 -0
- package/dist/host-lists/interfaces/hot-list-source.interface.js.map +1 -0
- package/dist/host-lists/interfaces/hot-list.interface.d.ts +31 -0
- package/dist/host-lists/interfaces/hot-list.interface.js +3 -0
- package/dist/host-lists/interfaces/hot-list.interface.js.map +1 -0
- package/dist/host-lists/interfaces/router-data.interface.d.ts +19 -0
- package/dist/host-lists/interfaces/router-data.interface.js +3 -0
- package/dist/host-lists/interfaces/router-data.interface.js.map +1 -0
- package/dist/host-lists/sources/36kr.source.d.ts +9 -0
- package/dist/host-lists/sources/36kr.source.js +89 -0
- package/dist/host-lists/sources/36kr.source.js.map +1 -0
- package/dist/host-lists/sources/51cto.source.d.ts +11 -0
- package/dist/host-lists/sources/51cto.source.js +71 -0
- package/dist/host-lists/sources/51cto.source.js.map +1 -0
- package/dist/host-lists/sources/52pojie.source.d.ts +9 -0
- package/dist/host-lists/sources/52pojie.source.js +109 -0
- package/dist/host-lists/sources/52pojie.source.js.map +1 -0
- package/dist/host-lists/sources/acfun.source.d.ts +9 -0
- package/dist/host-lists/sources/acfun.source.js +90 -0
- package/dist/host-lists/sources/acfun.source.js.map +1 -0
- package/dist/host-lists/sources/baidu.source.d.ts +9 -0
- package/dist/host-lists/sources/baidu.source.js +85 -0
- package/dist/host-lists/sources/baidu.source.js.map +1 -0
- package/dist/host-lists/sources/bilibili.source.d.ts +14 -0
- package/dist/host-lists/sources/bilibili.source.js +188 -0
- package/dist/host-lists/sources/bilibili.source.js.map +1 -0
- package/dist/host-lists/sources/caixin.source.d.ts +9 -0
- package/dist/host-lists/sources/caixin.source.js +102 -0
- package/dist/host-lists/sources/caixin.source.js.map +1 -0
- package/dist/host-lists/sources/cls.source.d.ts +9 -0
- package/dist/host-lists/sources/cls.source.js +62 -0
- package/dist/host-lists/sources/cls.source.js.map +1 -0
- package/dist/host-lists/sources/coolapk.source.d.ts +9 -0
- package/dist/host-lists/sources/coolapk.source.js +57 -0
- package/dist/host-lists/sources/coolapk.source.js.map +1 -0
- package/dist/host-lists/sources/csdn.source.d.ts +9 -0
- package/dist/host-lists/sources/csdn.source.js +59 -0
- package/dist/host-lists/sources/csdn.source.js.map +1 -0
- package/dist/host-lists/sources/dgtle.source.d.ts +9 -0
- package/dist/host-lists/sources/dgtle.source.js +57 -0
- package/dist/host-lists/sources/dgtle.source.js.map +1 -0
- package/dist/host-lists/sources/douban-group.source.d.ts +11 -0
- package/dist/host-lists/sources/douban-group.source.js +100 -0
- package/dist/host-lists/sources/douban-group.source.js.map +1 -0
- package/dist/host-lists/sources/douban-movie.source.d.ts +10 -0
- package/dist/host-lists/sources/douban-movie.source.js +103 -0
- package/dist/host-lists/sources/douban-movie.source.js.map +1 -0
- package/dist/host-lists/sources/douyin.d.ts +16 -0
- package/dist/host-lists/sources/douyin.js +215 -0
- package/dist/host-lists/sources/douyin.js.map +1 -0
- package/dist/host-lists/sources/eastmoney-stock.source.d.ts +11 -0
- package/dist/host-lists/sources/eastmoney-stock.source.js +151 -0
- package/dist/host-lists/sources/eastmoney-stock.source.js.map +1 -0
- package/dist/host-lists/sources/eastmoney.source.d.ts +9 -0
- package/dist/host-lists/sources/eastmoney.source.js +86 -0
- package/dist/host-lists/sources/eastmoney.source.js.map +1 -0
- package/dist/host-lists/sources/geekpark.source.d.ts +9 -0
- package/dist/host-lists/sources/geekpark.source.js +60 -0
- package/dist/host-lists/sources/geekpark.source.js.map +1 -0
- package/dist/host-lists/sources/gelonghui.source.d.ts +9 -0
- package/dist/host-lists/sources/gelonghui.source.js +139 -0
- package/dist/host-lists/sources/gelonghui.source.js.map +1 -0
- package/dist/host-lists/sources/github.source.d.ts +12 -0
- package/dist/host-lists/sources/github.source.js +171 -0
- package/dist/host-lists/sources/github.source.js.map +1 -0
- package/dist/host-lists/sources/guokr.source.d.ts +11 -0
- package/dist/host-lists/sources/guokr.source.js +98 -0
- package/dist/host-lists/sources/guokr.source.js.map +1 -0
- package/dist/host-lists/sources/hackernews.source.d.ts +11 -0
- package/dist/host-lists/sources/hackernews.source.js +121 -0
- package/dist/host-lists/sources/hackernews.source.js.map +1 -0
- package/dist/host-lists/sources/hellogithub.source.d.ts +11 -0
- package/dist/host-lists/sources/hellogithub.source.js +98 -0
- package/dist/host-lists/sources/hellogithub.source.js.map +1 -0
- package/dist/host-lists/sources/history.source.d.ts +11 -0
- package/dist/host-lists/sources/history.source.js +92 -0
- package/dist/host-lists/sources/history.source.js.map +1 -0
- package/dist/host-lists/sources/honkai.source.d.ts +9 -0
- package/dist/host-lists/sources/honkai.source.js +72 -0
- package/dist/host-lists/sources/honkai.source.js.map +1 -0
- package/dist/host-lists/sources/hostloc.source.d.ts +9 -0
- package/dist/host-lists/sources/hostloc.source.js +75 -0
- package/dist/host-lists/sources/hostloc.source.js.map +1 -0
- package/dist/host-lists/sources/hupu.source.d.ts +9 -0
- package/dist/host-lists/sources/hupu.source.js +73 -0
- package/dist/host-lists/sources/hupu.source.js.map +1 -0
- package/dist/host-lists/sources/huxiu.source.d.ts +9 -0
- package/dist/host-lists/sources/huxiu.source.js +153 -0
- package/dist/host-lists/sources/huxiu.source.js.map +1 -0
- package/dist/host-lists/sources/ifanr.source.d.ts +9 -0
- package/dist/host-lists/sources/ifanr.source.js +57 -0
- package/dist/host-lists/sources/ifanr.source.js.map +1 -0
- package/dist/host-lists/sources/index.d.ts +2 -0
- package/dist/host-lists/sources/index.js +134 -0
- package/dist/host-lists/sources/index.js.map +1 -0
- package/dist/host-lists/sources/ithome-xijiayi.source.d.ts +9 -0
- package/dist/host-lists/sources/ithome-xijiayi.source.js +75 -0
- package/dist/host-lists/sources/ithome-xijiayi.source.js.map +1 -0
- package/dist/host-lists/sources/ithome.source.d.ts +9 -0
- package/dist/host-lists/sources/ithome.source.js +71 -0
- package/dist/host-lists/sources/ithome.source.js.map +1 -0
- package/dist/host-lists/sources/jd.source.d.ts +9 -0
- package/dist/host-lists/sources/jd.source.js +82 -0
- package/dist/host-lists/sources/jd.source.js.map +1 -0
- package/dist/host-lists/sources/jianshu.source.d.ts +9 -0
- package/dist/host-lists/sources/jianshu.source.js +72 -0
- package/dist/host-lists/sources/jianshu.source.js.map +1 -0
- package/dist/host-lists/sources/jin10.source.d.ts +9 -0
- package/dist/host-lists/sources/jin10.source.js +63 -0
- package/dist/host-lists/sources/jin10.source.js.map +1 -0
- package/dist/host-lists/sources/juejin.source.d.ts +10 -0
- package/dist/host-lists/sources/juejin.source.js +81 -0
- package/dist/host-lists/sources/juejin.source.js.map +1 -0
- package/dist/host-lists/sources/kuaishou.source.d.ts +13 -0
- package/dist/host-lists/sources/kuaishou.source.js +179 -0
- package/dist/host-lists/sources/kuaishou.source.js.map +1 -0
- package/dist/host-lists/sources/linuxdo.source.d.ts +9 -0
- package/dist/host-lists/sources/linuxdo.source.js +62 -0
- package/dist/host-lists/sources/linuxdo.source.js.map +1 -0
- package/dist/host-lists/sources/lol.source.d.ts +9 -0
- package/dist/host-lists/sources/lol.source.js +58 -0
- package/dist/host-lists/sources/lol.source.js.map +1 -0
- package/dist/host-lists/sources/miyoushe.source.d.ts +9 -0
- package/dist/host-lists/sources/miyoushe.source.js +88 -0
- package/dist/host-lists/sources/miyoushe.source.js.map +1 -0
- package/dist/host-lists/sources/netease-news.source.d.ts +9 -0
- package/dist/host-lists/sources/netease-news.source.js +56 -0
- package/dist/host-lists/sources/netease-news.source.js.map +1 -0
- package/dist/host-lists/sources/ngabbs.source.d.ts +9 -0
- package/dist/host-lists/sources/ngabbs.source.js +70 -0
- package/dist/host-lists/sources/ngabbs.source.js.map +1 -0
- package/dist/host-lists/sources/nodeseek.source.d.ts +9 -0
- package/dist/host-lists/sources/nodeseek.source.js +62 -0
- package/dist/host-lists/sources/nodeseek.source.js.map +1 -0
- package/dist/host-lists/sources/nytimes.source.d.ts +9 -0
- package/dist/host-lists/sources/nytimes.source.js +77 -0
- package/dist/host-lists/sources/nytimes.source.js.map +1 -0
- package/dist/host-lists/sources/producthunt.source.d.ts +9 -0
- package/dist/host-lists/sources/producthunt.source.js +75 -0
- package/dist/host-lists/sources/producthunt.source.js.map +1 -0
- package/dist/host-lists/sources/qq-news.source.d.ts +9 -0
- package/dist/host-lists/sources/qq-news.source.js +53 -0
- package/dist/host-lists/sources/qq-news.source.js.map +1 -0
- package/dist/host-lists/sources/sina-news.source.d.ts +9 -0
- package/dist/host-lists/sources/sina-news.source.js +98 -0
- package/dist/host-lists/sources/sina-news.source.js.map +1 -0
- package/dist/host-lists/sources/sina.source.d.ts +9 -0
- package/dist/host-lists/sources/sina.source.js +78 -0
- package/dist/host-lists/sources/sina.source.js.map +1 -0
- package/dist/host-lists/sources/smzdm.source.d.ts +9 -0
- package/dist/host-lists/sources/smzdm.source.js +71 -0
- package/dist/host-lists/sources/smzdm.source.js.map +1 -0
- package/dist/host-lists/sources/sspai.source.d.ts +9 -0
- package/dist/host-lists/sources/sspai.source.js +69 -0
- package/dist/host-lists/sources/sspai.source.js.map +1 -0
- package/dist/host-lists/sources/starrail.source.d.ts +9 -0
- package/dist/host-lists/sources/starrail.source.js +72 -0
- package/dist/host-lists/sources/starrail.source.js.map +1 -0
- package/dist/host-lists/sources/taobao.source.d.ts +10 -0
- package/dist/host-lists/sources/taobao.source.js +169 -0
- package/dist/host-lists/sources/taobao.source.js.map +1 -0
- package/dist/host-lists/sources/thepaper.source.d.ts +9 -0
- package/dist/host-lists/sources/thepaper.source.js +56 -0
- package/dist/host-lists/sources/thepaper.source.js.map +1 -0
- package/dist/host-lists/sources/tieba.source.d.ts +9 -0
- package/dist/host-lists/sources/tieba.source.js +58 -0
- package/dist/host-lists/sources/tieba.source.js.map +1 -0
- package/dist/host-lists/sources/tonghuashun.source.d.ts +9 -0
- package/dist/host-lists/sources/tonghuashun.source.js +112 -0
- package/dist/host-lists/sources/tonghuashun.source.js.map +1 -0
- package/dist/host-lists/sources/toutiao.source.d.ts +9 -0
- package/dist/host-lists/sources/toutiao.source.js +56 -0
- package/dist/host-lists/sources/toutiao.source.js.map +1 -0
- package/dist/host-lists/sources/v2ex.source.d.ts +9 -0
- package/dist/host-lists/sources/v2ex.source.js +67 -0
- package/dist/host-lists/sources/v2ex.source.js.map +1 -0
- package/dist/host-lists/sources/wallstreet.source.d.ts +9 -0
- package/dist/host-lists/sources/wallstreet.source.js +59 -0
- package/dist/host-lists/sources/wallstreet.source.js.map +1 -0
- package/dist/host-lists/sources/weatheralarm.source.d.ts +9 -0
- package/dist/host-lists/sources/weatheralarm.source.js +68 -0
- package/dist/host-lists/sources/weatheralarm.source.js.map +1 -0
- package/dist/host-lists/sources/weibo.source.d.ts +15 -0
- package/dist/host-lists/sources/weibo.source.js +180 -0
- package/dist/host-lists/sources/weibo.source.js.map +1 -0
- package/dist/host-lists/sources/weread.source.d.ts +9 -0
- package/dist/host-lists/sources/weread.source.js +82 -0
- package/dist/host-lists/sources/weread.source.js.map +1 -0
- package/dist/host-lists/sources/xinyu.source.d.ts +9 -0
- package/dist/host-lists/sources/xinyu.source.js +151 -0
- package/dist/host-lists/sources/xinyu.source.js.map +1 -0
- package/dist/host-lists/sources/yicai.source.d.ts +9 -0
- package/dist/host-lists/sources/yicai.source.js +113 -0
- package/dist/host-lists/sources/yicai.source.js.map +1 -0
- package/dist/host-lists/sources/yystv.source.d.ts +9 -0
- package/dist/host-lists/sources/yystv.source.js +57 -0
- package/dist/host-lists/sources/yystv.source.js.map +1 -0
- package/dist/host-lists/sources/zhihu-daily.source.d.ts +9 -0
- package/dist/host-lists/sources/zhihu-daily.source.js +60 -0
- package/dist/host-lists/sources/zhihu-daily.source.js.map +1 -0
- package/dist/host-lists/sources/zhihu.source.d.ts +12 -0
- package/dist/host-lists/sources/zhihu.source.js +195 -0
- package/dist/host-lists/sources/zhihu.source.js.map +1 -0
- package/dist/http/http.module.d.ts +2 -0
- package/dist/http/http.module.js +30 -0
- package/dist/http/http.module.js.map +1 -0
- package/dist/http/http.service.d.ts +53 -0
- package/dist/http/http.service.js +277 -0
- package/dist/http/http.service.js.map +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.js +70 -0
- package/dist/main.js.map +1 -0
- package/dist/rss/rss.module.d.ts +2 -0
- package/dist/rss/rss.module.js +21 -0
- package/dist/rss/rss.module.js.map +1 -0
- package/dist/rss/rss.service.d.ts +5 -0
- package/dist/rss/rss.service.js +55 -0
- package/dist/rss/rss.service.js.map +1 -0
- package/dist/scheduler/dto/trigger-fetch.dto.d.ts +3 -0
- package/dist/scheduler/dto/trigger-fetch.dto.js +22 -0
- package/dist/scheduler/dto/trigger-fetch.dto.js.map +1 -0
- package/dist/scheduler/dto/update-source-config.dto.d.ts +4 -0
- package/dist/scheduler/dto/update-source-config.dto.js +29 -0
- package/dist/scheduler/dto/update-source-config.dto.js.map +1 -0
- package/dist/scheduler/scheduler.controller.d.ts +52 -0
- package/dist/scheduler/scheduler.controller.js +132 -0
- package/dist/scheduler/scheduler.controller.js.map +1 -0
- package/dist/scheduler/scheduler.module.d.ts +2 -0
- package/dist/scheduler/scheduler.module.js +34 -0
- package/dist/scheduler/scheduler.module.js.map +1 -0
- package/dist/scheduler/scheduler.service.d.ts +54 -0
- package/dist/scheduler/scheduler.service.js +238 -0
- package/dist/scheduler/scheduler.service.js.map +1 -0
- package/dist/scheduler/tasks/fetch-hot-data.task.d.ts +34 -0
- package/dist/scheduler/tasks/fetch-hot-data.task.js +175 -0
- package/dist/scheduler/tasks/fetch-hot-data.task.js.map +1 -0
- package/dist/token/coolapk.d.ts +11 -0
- package/dist/token/coolapk.js +40 -0
- package/dist/token/coolapk.js.map +1 -0
- package/dist/token/token.module.d.ts +2 -0
- package/dist/token/token.module.js +23 -0
- package/dist/token/token.module.js.map +1 -0
- package/dist/token/token.service.d.ts +19 -0
- package/dist/token/token.service.js +115 -0
- package/dist/token/token.service.js.map +1 -0
- package/dist/token/tools.d.ts +1 -0
- package/dist/token/tools.js +15 -0
- package/dist/token/tools.js.map +1 -0
- package/dist/token/weread.d.ts +2 -0
- package/dist/token/weread.js +55 -0
- package/dist/token/weread.js.map +1 -0
- package/dist/utils/getNum.d.ts +1 -0
- package/dist/utils/getNum.js +20 -0
- package/dist/utils/getNum.js.map +1 -0
- package/dist/utils/getTime.d.ts +11 -0
- package/dist/utils/getTime.js +134 -0
- package/dist/utils/getTime.js.map +1 -0
- package/dist/utils/headers.d.ts +16 -0
- package/dist/utils/headers.js +20 -0
- package/dist/utils/headers.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +12 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/parseRSS.d.ts +11 -0
- package/dist/utils/parseRSS.js +47 -0
- package/dist/utils/parseRSS.js.map +1 -0
- package/package.json +148 -4
- package/views/home.hbs +65 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
var TokenService_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.TokenService = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const http_service_1 = require("../http/http.service");
|
|
19
|
+
const md5_1 = __importDefault(require("md5"));
|
|
20
|
+
let TokenService = TokenService_1 = class TokenService {
|
|
21
|
+
constructor(httpClientService) {
|
|
22
|
+
this.httpClientService = httpClientService;
|
|
23
|
+
this.logger = new common_1.Logger(TokenService_1.name);
|
|
24
|
+
this.wbiNavRequest = {
|
|
25
|
+
url: 'https://api.bilibili.com/x/web-interface/nav',
|
|
26
|
+
headers: {
|
|
27
|
+
Cookie: 'SESSDATA=xxxxxx',
|
|
28
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36',
|
|
29
|
+
Referer: 'https://www.bilibili.com/',
|
|
30
|
+
},
|
|
31
|
+
ttl: 1800,
|
|
32
|
+
};
|
|
33
|
+
this.mixinKeyEncTab = [
|
|
34
|
+
46, 47, 18, 2, 53, 8, 23, 32, 15, 50, 10, 31, 58, 3, 45, 35, 27, 43, 5, 49,
|
|
35
|
+
33, 9, 42, 19, 29, 28, 14, 39, 12, 38, 41, 13, 37, 48, 7, 16, 24, 55, 40,
|
|
36
|
+
61, 26, 17, 0, 1, 60, 51, 30, 4, 22, 25, 54, 21, 56, 59, 6, 63, 57, 62, 11,
|
|
37
|
+
36, 20, 34, 44, 52,
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
getMixinKey(orig) {
|
|
41
|
+
return this.mixinKeyEncTab
|
|
42
|
+
.map((n) => orig[n])
|
|
43
|
+
.join('')
|
|
44
|
+
.slice(0, 32);
|
|
45
|
+
}
|
|
46
|
+
encWbi(params, img_key, sub_key) {
|
|
47
|
+
const mixin_key = this.getMixinKey(img_key + sub_key);
|
|
48
|
+
const curr_time = Math.round(Date.now() / 1000);
|
|
49
|
+
const chr_filter = /[!'()*]/g;
|
|
50
|
+
params = { ...params, wts: curr_time };
|
|
51
|
+
const query = Object.keys(params)
|
|
52
|
+
.sort()
|
|
53
|
+
.map((key) => {
|
|
54
|
+
const value = params[key].toString().replace(chr_filter, '');
|
|
55
|
+
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
56
|
+
})
|
|
57
|
+
.join('&');
|
|
58
|
+
const wbi_sign = (0, md5_1.default)(query + mixin_key);
|
|
59
|
+
return query + '&w_rid=' + wbi_sign;
|
|
60
|
+
}
|
|
61
|
+
async getWbiKeys() {
|
|
62
|
+
try {
|
|
63
|
+
const response = await this.httpClientService.get({
|
|
64
|
+
...this.wbiNavRequest,
|
|
65
|
+
});
|
|
66
|
+
const img_url = response.data?.data?.wbi_img?.img_url ?? '';
|
|
67
|
+
const sub_url = response.data?.data?.wbi_img?.sub_url ?? '';
|
|
68
|
+
if (!img_url || !sub_url) {
|
|
69
|
+
throw new Error('Failed to get WBI keys from Bilibili API');
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
img_key: img_url.slice(img_url.lastIndexOf('/') + 1, img_url.lastIndexOf('.')),
|
|
73
|
+
sub_key: sub_url.slice(sub_url.lastIndexOf('/') + 1, sub_url.lastIndexOf('.')),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
this.logger.error('Failed to fetch WBI keys', error);
|
|
78
|
+
throw new Error('Unable to retrieve Bilibili WBI keys');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async getBiliWbi(customParams) {
|
|
82
|
+
try {
|
|
83
|
+
const web_keys = await this.getWbiKeys();
|
|
84
|
+
const params = customParams || { foo: '114', bar: '514', baz: 1919810 };
|
|
85
|
+
const query = this.encWbi(params, web_keys.img_key, web_keys.sub_key);
|
|
86
|
+
return query;
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
this.logger.error('Failed to generate Bilibili WBI signature', error);
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async clearBiliWbiCache() {
|
|
94
|
+
await this.httpClientService.invalidateGet(this.wbiNavRequest);
|
|
95
|
+
}
|
|
96
|
+
async generateWbiSignedUrl(baseUrl, params) {
|
|
97
|
+
const signedQuery = await this.getBiliWbi(params);
|
|
98
|
+
const separator = baseUrl.includes('?') ? '&' : '?';
|
|
99
|
+
return `${baseUrl}${separator}${signedQuery}`;
|
|
100
|
+
}
|
|
101
|
+
async get51ctoToken() {
|
|
102
|
+
const url = 'https://api-media.51cto.com/api/token-get';
|
|
103
|
+
const response = await this.httpClientService.get({
|
|
104
|
+
url,
|
|
105
|
+
});
|
|
106
|
+
const token = response.data?.data?.data?.token;
|
|
107
|
+
return token;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
exports.TokenService = TokenService;
|
|
111
|
+
exports.TokenService = TokenService = TokenService_1 = __decorate([
|
|
112
|
+
(0, common_1.Injectable)(),
|
|
113
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
114
|
+
], TokenService);
|
|
115
|
+
//# sourceMappingURL=token.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.service.js","sourceRoot":"","sources":["../../src/token/token.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,uDAAyD;AACzD,8CAAsB;AAsBf,IAAM,YAAY,oBAAlB,MAAM,YAAY;IAqBvB,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;QApBhD,WAAM,GAAG,IAAI,eAAM,CAAC,cAAY,CAAC,IAAI,CAAC,CAAC;QACvC,kBAAa,GAAG;YAC/B,GAAG,EAAE,8CAA8C;YACnD,OAAO,EAAE;gBACP,MAAM,EAAE,iBAAiB;gBACzB,YAAY,EACV,qHAAqH;gBACvH,OAAO,EAAE,2BAA2B;aACrC;YACD,GAAG,EAAE,IAAI;SACV,CAAC;QAGe,mBAAc,GAAG;YAChC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE;YAC1E,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;YACxE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAA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, unknown> | undefined, timestamp: number, token: string) => string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.sign = void 0;
|
|
7
|
+
const md5_1 = __importDefault(require("md5"));
|
|
8
|
+
const sign = (requestPath, payload = {}, timestamp, token) => {
|
|
9
|
+
payload.timestamp = timestamp;
|
|
10
|
+
payload.token = token;
|
|
11
|
+
const sortedParams = String(Object.keys(payload).sort());
|
|
12
|
+
return (0, md5_1.default)((0, md5_1.default)(requestPath) + (0, md5_1.default)(sortedParams + (0, md5_1.default)(token) + timestamp));
|
|
13
|
+
};
|
|
14
|
+
exports.sign = sign;
|
|
15
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/token/tools.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AAEf,MAAM,IAAI,GAAG,CAClB,WAAmB,EACnB,UAAmC,EAAE,EACrC,SAAiB,EACjB,KAAa,EACb,EAAE;IACF,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IACtB,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACzD,OAAO,IAAA,aAAG,EAAC,IAAA,aAAG,EAAC,WAAW,CAAC,GAAG,IAAA,aAAG,EAAC,YAAY,GAAG,IAAA,aAAG,EAAC,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;AAC5E,CAAC,CAAC;AAVW,QAAA,IAAI,QAUf"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
7
|
+
const getWereadID = (bookId) => {
|
|
8
|
+
try {
|
|
9
|
+
const hash = crypto_1.default.createHash('md5');
|
|
10
|
+
hash.update(bookId);
|
|
11
|
+
const str = hash.digest('hex');
|
|
12
|
+
let strSub = str.substring(0, 3);
|
|
13
|
+
let fa;
|
|
14
|
+
if (/^\d*$/.test(bookId)) {
|
|
15
|
+
const chunks = [];
|
|
16
|
+
for (let i = 0; i < bookId.length; i += 9) {
|
|
17
|
+
const chunk = bookId.substring(i, i + 9);
|
|
18
|
+
chunks.push(parseInt(chunk).toString(16));
|
|
19
|
+
}
|
|
20
|
+
fa = ['3', chunks];
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
let hexStr = '';
|
|
24
|
+
for (let i = 0; i < bookId.length; i++) {
|
|
25
|
+
hexStr += bookId.charCodeAt(i).toString(16);
|
|
26
|
+
}
|
|
27
|
+
fa = ['4', [hexStr]];
|
|
28
|
+
}
|
|
29
|
+
strSub += String(fa[0]);
|
|
30
|
+
strSub += '2' + str.substring(str.length - 2);
|
|
31
|
+
for (let i = 0; i < fa[1].length; i++) {
|
|
32
|
+
const sub = fa[1][i];
|
|
33
|
+
const subLength = sub.length.toString(16);
|
|
34
|
+
const subLengthPadded = subLength.length === 1 ? '0' + subLength : subLength;
|
|
35
|
+
strSub += subLengthPadded + sub;
|
|
36
|
+
if (i < fa[1].length - 1) {
|
|
37
|
+
strSub += 'g';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (strSub.length < 20) {
|
|
41
|
+
strSub += str.substring(0, 20 - strSub.length);
|
|
42
|
+
}
|
|
43
|
+
const finalHash = crypto_1.default.createHash('md5');
|
|
44
|
+
finalHash.update(strSub);
|
|
45
|
+
const finalStr = finalHash.digest('hex');
|
|
46
|
+
strSub += finalStr.substring(0, 3);
|
|
47
|
+
return strSub;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
console.error('处理微信读书 ID 时出现错误:' + error);
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.default = getWereadID;
|
|
55
|
+
//# sourceMappingURL=weread.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weread.js","sourceRoot":"","sources":["../../src/token/weread.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAM5B,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,EAAE;IACrC,IAAI,CAAC;QAEH,MAAM,IAAI,GAAG,gBAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpB,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAE/B,IAAI,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAEjC,IAAI,EAAsB,CAAC;QAC3B,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAEzB,MAAM,MAAM,GAAa,EAAE,CAAC;YAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;gBACzC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;YAC5C,CAAC;YACD,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACrB,CAAC;aAAM,CAAC;YAE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S,GAAG,gBAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC3C,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACzB,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEzC,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,kBAAkB,GAAG,KAAK,CAAC,CAAC;QAC1C,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseChineseNumber: (chineseNumber: string) => number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseChineseNumber = void 0;
|
|
4
|
+
const parseChineseNumber = (chineseNumber) => {
|
|
5
|
+
const units = {
|
|
6
|
+
亿: 1e8,
|
|
7
|
+
万: 1e4,
|
|
8
|
+
千: 1e3,
|
|
9
|
+
百: 1e2,
|
|
10
|
+
};
|
|
11
|
+
for (const unit in units) {
|
|
12
|
+
if (chineseNumber.includes(unit)) {
|
|
13
|
+
const numberPart = parseFloat(chineseNumber.replace(unit, ''));
|
|
14
|
+
return numberPart * units[unit];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return parseFloat(chineseNumber);
|
|
18
|
+
};
|
|
19
|
+
exports.parseChineseNumber = parseChineseNumber;
|
|
20
|
+
//# sourceMappingURL=getNum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNum.js","sourceRoot":"","sources":["../../src/utils/getNum.ts"],"names":[],"mappings":";;;AAAO,MAAM,kBAAkB,GAAG,CAAC,aAAqB,EAAU,EAAE;IAElE,MAAM,KAAK,GAA8B;QACvC,CAAC,EAAE,GAAG;QACN,CAAC,EAAE,GAAG;QACN,CAAC,EAAE,GAAG;QACN,CAAC,EAAE,GAAG;KACP,CAAC;IAGF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAEjC,MAAM,UAAU,GAAG,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;YAC/D,OAAO,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC,aAAa,CAAC,CAAC;AACnC,CAAC,CAAC;AAnBW,QAAA,kBAAkB,sBAmB7B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface CurrentDateTime {
|
|
2
|
+
year: string;
|
|
3
|
+
month: string;
|
|
4
|
+
day: string;
|
|
5
|
+
hour: string;
|
|
6
|
+
minute: string;
|
|
7
|
+
second: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const getTime: (timeInput: string | number) => number | undefined;
|
|
10
|
+
export declare const getCurrentDateTime: (padZero?: boolean) => CurrentDateTime;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getCurrentDateTime = exports.getTime = void 0;
|
|
7
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
8
|
+
const getTime = (timeInput) => {
|
|
9
|
+
try {
|
|
10
|
+
let num;
|
|
11
|
+
if (typeof timeInput === 'string') {
|
|
12
|
+
num = Number(timeInput);
|
|
13
|
+
if (isNaN(num)) {
|
|
14
|
+
const now = (0, dayjs_1.default)();
|
|
15
|
+
if (/^\d{2}:\d{2}$/.test(timeInput)) {
|
|
16
|
+
const [hour, minute] = timeInput.split(':').map(Number);
|
|
17
|
+
return now
|
|
18
|
+
.set('hour', hour)
|
|
19
|
+
.set('minute', minute)
|
|
20
|
+
.set('second', 0)
|
|
21
|
+
.valueOf();
|
|
22
|
+
}
|
|
23
|
+
if (/^昨日\s+\d{2}:\d{2}$/.test(timeInput)) {
|
|
24
|
+
const timeStr = timeInput.replace('昨日', '').trim();
|
|
25
|
+
const [hour, minute] = timeStr.split(':').map(Number);
|
|
26
|
+
return now
|
|
27
|
+
.subtract(1, 'day')
|
|
28
|
+
.set('hour', hour)
|
|
29
|
+
.set('minute', minute)
|
|
30
|
+
.set('second', 0)
|
|
31
|
+
.valueOf();
|
|
32
|
+
}
|
|
33
|
+
if (/^\d{1,2}月\d{1,2}日$/.test(timeInput)) {
|
|
34
|
+
const [month, day] = timeInput
|
|
35
|
+
.replace('月', '-')
|
|
36
|
+
.replace('日', '')
|
|
37
|
+
.split('-')
|
|
38
|
+
.map(Number);
|
|
39
|
+
return now
|
|
40
|
+
.set('month', month - 1)
|
|
41
|
+
.set('date', day)
|
|
42
|
+
.startOf('day')
|
|
43
|
+
.valueOf();
|
|
44
|
+
}
|
|
45
|
+
if (/^\d{1,2}月\d{1,2}日\s+\d{2}:\d{2}$/.test(timeInput)) {
|
|
46
|
+
const [datePart, timePart] = timeInput.split(' ');
|
|
47
|
+
const [month, day] = datePart
|
|
48
|
+
.replace('月', '-')
|
|
49
|
+
.replace('日', '')
|
|
50
|
+
.split('-')
|
|
51
|
+
.map(Number);
|
|
52
|
+
const [hour, minute] = timePart.split(':').map(Number);
|
|
53
|
+
return now
|
|
54
|
+
.set('month', month - 1)
|
|
55
|
+
.set('date', day)
|
|
56
|
+
.set('hour', hour)
|
|
57
|
+
.set('minute', minute)
|
|
58
|
+
.set('second', 0)
|
|
59
|
+
.valueOf();
|
|
60
|
+
}
|
|
61
|
+
if (/今天/.test(timeInput)) {
|
|
62
|
+
const timeStr = timeInput.replace('今天', '').trim();
|
|
63
|
+
return (0, dayjs_1.default)()
|
|
64
|
+
.set('hour', parseInt(timeStr.split(':')[0]))
|
|
65
|
+
.set('minute', parseInt(timeStr.split(':')[1]))
|
|
66
|
+
.valueOf();
|
|
67
|
+
}
|
|
68
|
+
if (/昨天/.test(timeInput)) {
|
|
69
|
+
const timeStr = timeInput.replace('昨天', '').trim();
|
|
70
|
+
return (0, dayjs_1.default)()
|
|
71
|
+
.subtract(1, 'day')
|
|
72
|
+
.set('hour', parseInt(timeStr.split(':')[0]))
|
|
73
|
+
.set('minute', parseInt(timeStr.split(':')[1]))
|
|
74
|
+
.valueOf();
|
|
75
|
+
}
|
|
76
|
+
if (/分钟前/.test(timeInput)) {
|
|
77
|
+
const minutesAgo = parseInt(timeInput.replace('分钟前', ''));
|
|
78
|
+
return (0, dayjs_1.default)().subtract(minutesAgo, 'minute').valueOf();
|
|
79
|
+
}
|
|
80
|
+
let standardizedInput = timeInput
|
|
81
|
+
.replace(/(\d{4})-(\d{2})-(\d{2})-(\d{2})/, '$1-$2-$3 $4')
|
|
82
|
+
.replace(/(\d{4})-(\d{2})-(\d{2})[T\s](\d{2}):?(\d{2})?:?(\d{2})?/, '$1-$2-$3 $4:$5:$6')
|
|
83
|
+
.replace(/(\d{4})[-/](\d{2})[-/](\d{2})/, '$1-$2-$3');
|
|
84
|
+
standardizedInput = standardizedInput.replace(/\s+/, ' ').trim();
|
|
85
|
+
const formatPatterns = [
|
|
86
|
+
'YYYY-MM-DD HH:mm:ss',
|
|
87
|
+
'YYYY-MM-DD HH:mm',
|
|
88
|
+
'YYYY-MM-DD HH',
|
|
89
|
+
'YYYY-MM-DD',
|
|
90
|
+
];
|
|
91
|
+
let parsedDate;
|
|
92
|
+
for (const pattern of formatPatterns) {
|
|
93
|
+
parsedDate = (0, dayjs_1.default)(standardizedInput, pattern, true);
|
|
94
|
+
if (parsedDate.isValid()) {
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (parsedDate && parsedDate.isValid()) {
|
|
99
|
+
return parsedDate.valueOf();
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
return 0;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
num = timeInput;
|
|
108
|
+
}
|
|
109
|
+
if (num > 946684800000) {
|
|
110
|
+
return num;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
return num * 1000;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
console.error(error);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
exports.getTime = getTime;
|
|
121
|
+
const getCurrentDateTime = (padZero = false) => {
|
|
122
|
+
const now = (0, dayjs_1.default)();
|
|
123
|
+
const pad = (num) => (num < 10 ? `0${num}` : `${num}`);
|
|
124
|
+
return {
|
|
125
|
+
year: now.year().toString(),
|
|
126
|
+
month: padZero ? pad(now.month() + 1) : (now.month() + 1).toString(),
|
|
127
|
+
day: padZero ? pad(now.date()) : now.date().toString(),
|
|
128
|
+
hour: padZero ? pad(now.hour()) : now.hour().toString(),
|
|
129
|
+
minute: padZero ? pad(now.minute()) : now.minute().toString(),
|
|
130
|
+
second: padZero ? pad(now.second()) : now.second().toString(),
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
exports.getCurrentDateTime = getCurrentDateTime;
|
|
134
|
+
//# sourceMappingURL=getTime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTime.js","sourceRoot":"","sources":["../../src/utils/getTime.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAgBnB,MAAM,OAAO,GAAG,CAAC,SAA0B,EAAsB,EAAE;IACxE,IAAI,CAAC;QACH,IAAI,GAAW,CAAC;QAGhB,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;YAElC,GAAG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EAAE,CAAC,QAAQ,EAAE;QAC3B,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE;QACpE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;QACtD,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;QACvD,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7D,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC9D,CAAC;AACJ,CAAC,CAAC;AAhBW,QAAA,kBAAkB,sBAgB7B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const headers: {
|
|
2
|
+
'User-Agent': string;
|
|
3
|
+
Accept: string;
|
|
4
|
+
'Accept-Language': string;
|
|
5
|
+
'Accept-Encoding': string;
|
|
6
|
+
'Cache-Control': string;
|
|
7
|
+
Connection: string;
|
|
8
|
+
'Sec-Ch-Ua': string;
|
|
9
|
+
'Sec-Ch-Ua-Mobile': string;
|
|
10
|
+
'Sec-Ch-Ua-Platform': string;
|
|
11
|
+
'Sec-Fetch-Dest': string;
|
|
12
|
+
'Sec-Fetch-Mode': string;
|
|
13
|
+
'Sec-Fetch-Site': string;
|
|
14
|
+
'Sec-Fetch-User': string;
|
|
15
|
+
'Upgrade-Insecure-Requests': string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.headers = void 0;
|
|
4
|
+
exports.headers = {
|
|
5
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36',
|
|
6
|
+
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
|
7
|
+
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
|
8
|
+
'Accept-Encoding': 'gzip, deflate, br',
|
|
9
|
+
'Cache-Control': 'no-cache',
|
|
10
|
+
Connection: 'keep-alive',
|
|
11
|
+
'Sec-Ch-Ua': '"Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"',
|
|
12
|
+
'Sec-Ch-Ua-Mobile': '?0',
|
|
13
|
+
'Sec-Ch-Ua-Platform': '"Windows"',
|
|
14
|
+
'Sec-Fetch-Dest': 'document',
|
|
15
|
+
'Sec-Fetch-Mode': 'navigate',
|
|
16
|
+
'Sec-Fetch-Site': 'same-origin',
|
|
17
|
+
'Sec-Fetch-User': '?1',
|
|
18
|
+
'Upgrade-Insecure-Requests': '1',
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=headers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.js","sourceRoot":"","sources":["../../src/utils/headers.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG;IACrB,YAAY,EACV,iHAAiH;IACnH,MAAM,EACJ,8HAA8H;IAChI,iBAAiB,EAAE,yBAAyB;IAC5C,iBAAiB,EAAE,mBAAmB;IACtC,eAAe,EAAE,UAAU;IAC3B,UAAU,EAAE,YAAY;IACxB,WAAW,EACT,kEAAkE;IACpE,kBAAkB,EAAE,IAAI;IACxB,oBAAoB,EAAE,WAAW;IACjC,gBAAgB,EAAE,UAAU;IAC5B,gBAAgB,EAAE,UAAU;IAC5B,gBAAgB,EAAE,aAAa;IAC/B,gBAAgB,EAAE,IAAI;IACtB,2BAA2B,EAAE,GAAG;CACjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function generateRandomId(length: number): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateRandomId = generateRandomId;
|
|
4
|
+
function generateRandomId(length) {
|
|
5
|
+
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
6
|
+
let result = '';
|
|
7
|
+
for (let i = 0; i < length; i++) {
|
|
8
|
+
result += characters.charAt(Math.floor(Math.random() * characters.length));
|
|
9
|
+
}
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;AACA,4CAQC;AARD,SAAgB,gBAAgB,CAAC,MAAc;IAC7C,MAAM,UAAU,GACd,gEAAgE,CAAC;IACnE,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const extractRss: (content: string) => string | null;
|
|
2
|
+
export declare const parseRSS: (rssContent: string) => Promise<{
|
|
3
|
+
title: string | undefined;
|
|
4
|
+
link: string | undefined;
|
|
5
|
+
pubDate: string | undefined;
|
|
6
|
+
author: any;
|
|
7
|
+
content: string | undefined;
|
|
8
|
+
contentSnippet: string | undefined;
|
|
9
|
+
guid: string | undefined;
|
|
10
|
+
categories: string[] | undefined;
|
|
11
|
+
}[]>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.parseRSS = exports.extractRss = void 0;
|
|
7
|
+
const rss_parser_1 = __importDefault(require("rss-parser"));
|
|
8
|
+
const extractRss = (content) => {
|
|
9
|
+
const rssRegex = /(<rss[\s\S]*?<\/rss>)/i;
|
|
10
|
+
const matches = content.match(rssRegex);
|
|
11
|
+
return matches ? matches[0] : null;
|
|
12
|
+
};
|
|
13
|
+
exports.extractRss = extractRss;
|
|
14
|
+
const parseRSS = async (rssContent) => {
|
|
15
|
+
const parser = new rss_parser_1.default();
|
|
16
|
+
const isUrl = (url) => {
|
|
17
|
+
try {
|
|
18
|
+
new URL(url);
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
try {
|
|
26
|
+
const feed = isUrl(rssContent)
|
|
27
|
+
? await parser.parseURL(rssContent)
|
|
28
|
+
: await parser.parseString(rssContent);
|
|
29
|
+
const items = feed.items.map((item) => ({
|
|
30
|
+
title: item.title,
|
|
31
|
+
link: item.link,
|
|
32
|
+
pubDate: item.pubDate,
|
|
33
|
+
author: item.creator ?? item.author,
|
|
34
|
+
content: item.content,
|
|
35
|
+
contentSnippet: item.contentSnippet,
|
|
36
|
+
guid: item.guid,
|
|
37
|
+
categories: item.categories,
|
|
38
|
+
}));
|
|
39
|
+
return items;
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
console.error('❌ [RSS] An error occurred while parsing RSS content');
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.parseRSS = parseRSS;
|
|
47
|
+
//# sourceMappingURL=parseRSS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseRSS.js","sourceRoot":"","sources":["../../src/utils/parseRSS.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAmC;AAO5B,MAAM,UAAU,GAAG,CAAC,OAAe,EAAiB,EAAE;IAE3D,MAAM,QAAQ,GAAG,wBAAwB,CAAC;IAC1C,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxC,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACrC,CAAC,CAAC;AALW,QAAA,UAAU,cAKrB;AAOK,MAAM,QAAQ,GAAG,KAAK,EAAE,UAAkB,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAI,oBAAS,EAAE,CAAC;IAE/B,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,EAAE;QAC5B,IAAI,CAAC;YACH,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;YACb,OAAO,IAAI,CAAC;QAEd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC,CAAC;IACF,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC;YAC5B,CAAC,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;YACnC,CAAC,CAAC,MAAM,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,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