@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,238 @@
|
|
|
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 SchedulerService_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.SchedulerService = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const schedule_1 = require("@nestjs/schedule");
|
|
16
|
+
const config_1 = require("@nestjs/config");
|
|
17
|
+
const hot_lists_service_1 = require("../host-lists/hot-lists.service");
|
|
18
|
+
const source_config_repository_1 = require("../database/repositories/source-config.repository");
|
|
19
|
+
const fetch_hot_data_task_1 = require("./tasks/fetch-hot-data.task");
|
|
20
|
+
const cron_1 = require("cron");
|
|
21
|
+
const crypto_1 = require("crypto");
|
|
22
|
+
let SchedulerService = SchedulerService_1 = class SchedulerService {
|
|
23
|
+
constructor(schedulerRegistry, configService, hotListsService, sourceConfigRepository, fetchHotDataTask) {
|
|
24
|
+
this.schedulerRegistry = schedulerRegistry;
|
|
25
|
+
this.configService = configService;
|
|
26
|
+
this.hotListsService = hotListsService;
|
|
27
|
+
this.sourceConfigRepository = sourceConfigRepository;
|
|
28
|
+
this.fetchHotDataTask = fetchHotDataTask;
|
|
29
|
+
this.logger = new common_1.Logger(SchedulerService_1.name);
|
|
30
|
+
this.isRunning = false;
|
|
31
|
+
this.schedulerEnabled = false;
|
|
32
|
+
this.cronJobName = 'hot-data-fetch';
|
|
33
|
+
this.ignoreSources = [];
|
|
34
|
+
this.runs = new Map();
|
|
35
|
+
this.loadIgnoreSources();
|
|
36
|
+
this.loadSchedulerConfig();
|
|
37
|
+
}
|
|
38
|
+
async onModuleInit() {
|
|
39
|
+
await this.initializeSourceConfigs();
|
|
40
|
+
this.setupDynamicCronJob();
|
|
41
|
+
}
|
|
42
|
+
onModuleDestroy() {
|
|
43
|
+
this.stopDynamicCronJob();
|
|
44
|
+
}
|
|
45
|
+
loadIgnoreSources() {
|
|
46
|
+
const ignoreSaveConfig = this.configService.get('IGNORE_SAVE_SOURCES');
|
|
47
|
+
if (ignoreSaveConfig) {
|
|
48
|
+
this.ignoreSources.push(...ignoreSaveConfig.split(',').map((s) => s.trim()));
|
|
49
|
+
this.logger.log(`Ignoring sources for saving: ${this.ignoreSources.join(', ')}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
loadSchedulerConfig() {
|
|
53
|
+
const autoStart = this.configService.get('SCHEDULER_AUTO_START', true);
|
|
54
|
+
this.schedulerEnabled = autoStart;
|
|
55
|
+
this.logger.log(`Scheduler auto-start: ${autoStart ? 'enabled' : 'disabled'}`);
|
|
56
|
+
}
|
|
57
|
+
setupDynamicCronJob() {
|
|
58
|
+
try {
|
|
59
|
+
this.stopDynamicCronJob();
|
|
60
|
+
const cronExpression = this.configService.get('SCHEDULER_CRON_EXPRESSION', '0 */12 * * *');
|
|
61
|
+
this.logger.log(`cronExpression: ${cronExpression}`);
|
|
62
|
+
if (this.schedulerEnabled) {
|
|
63
|
+
const job = new cron_1.CronJob(cronExpression, () => {
|
|
64
|
+
void this.handleCron();
|
|
65
|
+
});
|
|
66
|
+
this.schedulerRegistry.addCronJob(this.cronJobName, job);
|
|
67
|
+
job.start();
|
|
68
|
+
this.logger.log(`Dynamic cron job setup with expression: ${cronExpression}`);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
this.logger.log('Scheduler is disabled, not starting cron job');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
this.logger.error('Failed to setup dynamic cron job:', error);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
stopDynamicCronJob() {
|
|
79
|
+
try {
|
|
80
|
+
if (this.schedulerRegistry.doesExist('cron', this.cronJobName)) {
|
|
81
|
+
this.schedulerRegistry.deleteCronJob(this.cronJobName);
|
|
82
|
+
this.logger.log(`Stopped cron job: ${this.cronJobName}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
this.logger.error('Failed to stop cron job:', error);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
shouldIgnoreSource(source) {
|
|
90
|
+
return this.ignoreSources.includes(source);
|
|
91
|
+
}
|
|
92
|
+
async initializeSourceConfigs() {
|
|
93
|
+
try {
|
|
94
|
+
const sources = this.hotListsService.getAllSources();
|
|
95
|
+
await this.sourceConfigRepository.initializeConfigs(sources);
|
|
96
|
+
this.logger.log(`Initialized ${sources.length} source configurations`);
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
this.logger.error('Failed to initialize source configs:', error);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
async handleCron() {
|
|
103
|
+
this.logger.log('handleCron');
|
|
104
|
+
if (!this.schedulerEnabled) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (this.isRunning) {
|
|
108
|
+
this.logger.debug('Previous task still running, skipping...');
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
this.isRunning = true;
|
|
112
|
+
try {
|
|
113
|
+
await this.processScheduledTasks();
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
this.logger.error('Error in scheduled task:', error);
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
this.isRunning = false;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async processScheduledTasks() {
|
|
123
|
+
await this.initializeSourceConfigs();
|
|
124
|
+
const enabledConfigs = await this.sourceConfigRepository.findEnabled();
|
|
125
|
+
const now = Date.now();
|
|
126
|
+
const sources = enabledConfigs
|
|
127
|
+
.filter((config) => {
|
|
128
|
+
if (this.shouldIgnoreSource(config.source))
|
|
129
|
+
return false;
|
|
130
|
+
const interval = Number.isFinite(config.interval) && config.interval > 0
|
|
131
|
+
? config.interval
|
|
132
|
+
: 30;
|
|
133
|
+
return (!config.lastFetchAt ||
|
|
134
|
+
config.lastFetchAt.getTime() + interval * 60_000 <= now);
|
|
135
|
+
})
|
|
136
|
+
.map((config) => config.source);
|
|
137
|
+
await this.fetchHotDataTask.executeBatch(sources);
|
|
138
|
+
}
|
|
139
|
+
async triggerFetch(source) {
|
|
140
|
+
let sources;
|
|
141
|
+
if (source) {
|
|
142
|
+
if (this.shouldIgnoreSource(source)) {
|
|
143
|
+
throw new common_1.BadRequestException(`Source '${source}' is ignored`);
|
|
144
|
+
}
|
|
145
|
+
if (!this.hotListsService.getAllSources().includes(source)) {
|
|
146
|
+
throw new common_1.NotFoundException(`Source '${source}' not found`);
|
|
147
|
+
}
|
|
148
|
+
sources = [source];
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
await this.initializeSourceConfigs();
|
|
152
|
+
const enabledConfigs = await this.sourceConfigRepository.findEnabled();
|
|
153
|
+
sources = enabledConfigs
|
|
154
|
+
.map((config) => config.source)
|
|
155
|
+
.filter((name) => !this.shouldIgnoreSource(name));
|
|
156
|
+
}
|
|
157
|
+
this.pruneRuns(true);
|
|
158
|
+
const run = {
|
|
159
|
+
runId: (0, crypto_1.randomUUID)(),
|
|
160
|
+
status: 'running',
|
|
161
|
+
sourceCount: sources.length,
|
|
162
|
+
startedAt: new Date().toISOString(),
|
|
163
|
+
};
|
|
164
|
+
this.runs.set(run.runId, run);
|
|
165
|
+
void this.fetchHotDataTask.executeBatch(sources).then((results) => {
|
|
166
|
+
run.status = 'completed';
|
|
167
|
+
run.completedAt = new Date().toISOString();
|
|
168
|
+
run.results = results.map(({ items, ...summary }) => {
|
|
169
|
+
void items;
|
|
170
|
+
return {
|
|
171
|
+
...summary,
|
|
172
|
+
error: summary.success ? undefined : 'Source refresh failed',
|
|
173
|
+
};
|
|
174
|
+
});
|
|
175
|
+
}, () => {
|
|
176
|
+
run.status = 'failed';
|
|
177
|
+
run.completedAt = new Date().toISOString();
|
|
178
|
+
run.error = 'Batch fetch failed';
|
|
179
|
+
});
|
|
180
|
+
return run;
|
|
181
|
+
}
|
|
182
|
+
getRun(runId) {
|
|
183
|
+
this.pruneRuns();
|
|
184
|
+
const run = this.runs.get(runId);
|
|
185
|
+
if (!run)
|
|
186
|
+
throw new common_1.NotFoundException(`Fetch run '${runId}' not found`);
|
|
187
|
+
return run;
|
|
188
|
+
}
|
|
189
|
+
pruneRuns(ensureCapacity = false) {
|
|
190
|
+
const cutoff = Date.now() - 60 * 60_000;
|
|
191
|
+
for (const [id, run] of this.runs) {
|
|
192
|
+
if (run.status !== 'running' && Date.parse(run.startedAt) < cutoff) {
|
|
193
|
+
this.runs.delete(id);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
while (ensureCapacity && this.runs.size >= 100) {
|
|
197
|
+
const oldest = [...this.runs].find(([, run]) => run.status !== 'running')?.[0];
|
|
198
|
+
if (!oldest) {
|
|
199
|
+
throw new common_1.ServiceUnavailableException('Too many active fetch runs');
|
|
200
|
+
}
|
|
201
|
+
this.runs.delete(oldest);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
getStatus() {
|
|
205
|
+
return {
|
|
206
|
+
isRunning: this.isRunning,
|
|
207
|
+
schedulerEnabled: this.schedulerEnabled,
|
|
208
|
+
cronJobs: this.schedulerRegistry.getCronJobs().size,
|
|
209
|
+
ignoreSources: this.ignoreSources,
|
|
210
|
+
cronExpression: this.configService.get('SCHEDULER_CRON_EXPRESSION'),
|
|
211
|
+
cronJobExists: this.schedulerRegistry.doesExist('cron', this.cronJobName),
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
start() {
|
|
215
|
+
this.schedulerEnabled = true;
|
|
216
|
+
this.setupDynamicCronJob();
|
|
217
|
+
this.logger.log('Scheduler enabled');
|
|
218
|
+
}
|
|
219
|
+
stop() {
|
|
220
|
+
this.schedulerEnabled = false;
|
|
221
|
+
this.stopDynamicCronJob();
|
|
222
|
+
this.logger.log('Scheduler disabled');
|
|
223
|
+
}
|
|
224
|
+
reconfigureCron() {
|
|
225
|
+
this.setupDynamicCronJob();
|
|
226
|
+
this.logger.log('Cron job reconfigured');
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
exports.SchedulerService = SchedulerService;
|
|
230
|
+
exports.SchedulerService = SchedulerService = SchedulerService_1 = __decorate([
|
|
231
|
+
(0, common_1.Injectable)(),
|
|
232
|
+
__metadata("design:paramtypes", [schedule_1.SchedulerRegistry,
|
|
233
|
+
config_1.ConfigService,
|
|
234
|
+
hot_lists_service_1.HotListsService,
|
|
235
|
+
source_config_repository_1.SourceConfigRepository,
|
|
236
|
+
fetch_hot_data_task_1.FetchHotDataTask])
|
|
237
|
+
], SchedulerService);
|
|
238
|
+
//# sourceMappingURL=scheduler.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler.service.js","sourceRoot":"","sources":["../../src/scheduler/scheduler.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAQwB;AACxB,+CAAqD;AACrD,2CAA+C;AAC/C,uEAAkE;AAClE,gGAA2F;AAC3F,qEAA4E;AAC5E,+BAA+B;AAC/B,mCAAoC;AAa7B,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAS3B,YACmB,iBAAoC,EACpC,aAA4B,EAC5B,eAAgC,EAChC,sBAA8C,EAC9C,gBAAkC;QAJlC,sBAAiB,GAAjB,iBAAiB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,iDAAsB;QAC5B,sCAAgB;GAd1C,gBAAgB,CA6Q5B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BeforeApplicationShutdown } from '@nestjs/common';
|
|
2
|
+
import { HotListsService } from '../../host-lists/hot-lists.service';
|
|
3
|
+
import { HotItemRepository } from '../../database/repositories/hot-item.repository';
|
|
4
|
+
import { SourceConfigRepository } from '../../database/repositories/source-config.repository';
|
|
5
|
+
import { ConfigService } from '@nestjs/config';
|
|
6
|
+
import { HotListItem } from '../../host-lists/interfaces/hot-list.interface';
|
|
7
|
+
export interface FetchResult {
|
|
8
|
+
sourceName: string;
|
|
9
|
+
success: boolean;
|
|
10
|
+
duration: number;
|
|
11
|
+
savedCount: number;
|
|
12
|
+
totalCount: number;
|
|
13
|
+
items?: HotListItem[];
|
|
14
|
+
error?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class FetchHotDataTask implements BeforeApplicationShutdown {
|
|
17
|
+
private readonly hotListsService;
|
|
18
|
+
private readonly hotItemRepository;
|
|
19
|
+
private readonly sourceConfigRepository;
|
|
20
|
+
private readonly logger;
|
|
21
|
+
private readonly maxConcurrency;
|
|
22
|
+
private active;
|
|
23
|
+
private readonly waiters;
|
|
24
|
+
private readonly inFlight;
|
|
25
|
+
private shuttingDown;
|
|
26
|
+
private readonly ignoredSaveSources;
|
|
27
|
+
constructor(hotListsService: HotListsService, hotItemRepository: HotItemRepository, sourceConfigRepository: SourceConfigRepository, configService: ConfigService);
|
|
28
|
+
execute(sourceName: string): Promise<FetchResult>;
|
|
29
|
+
beforeApplicationShutdown(): Promise<void>;
|
|
30
|
+
private withSlot;
|
|
31
|
+
private executeSource;
|
|
32
|
+
executeBatch(sourceNames: string[]): Promise<FetchResult[]>;
|
|
33
|
+
private validateSource;
|
|
34
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
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 FetchHotDataTask_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.FetchHotDataTask = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const hot_lists_service_1 = require("../../host-lists/hot-lists.service");
|
|
16
|
+
const hot_item_repository_1 = require("../../database/repositories/hot-item.repository");
|
|
17
|
+
const source_config_repository_1 = require("../../database/repositories/source-config.repository");
|
|
18
|
+
const config_1 = require("@nestjs/config");
|
|
19
|
+
let FetchHotDataTask = FetchHotDataTask_1 = class FetchHotDataTask {
|
|
20
|
+
constructor(hotListsService, hotItemRepository, sourceConfigRepository, configService) {
|
|
21
|
+
this.hotListsService = hotListsService;
|
|
22
|
+
this.hotItemRepository = hotItemRepository;
|
|
23
|
+
this.sourceConfigRepository = sourceConfigRepository;
|
|
24
|
+
this.logger = new common_1.Logger(FetchHotDataTask_1.name);
|
|
25
|
+
this.maxConcurrency = 5;
|
|
26
|
+
this.active = 0;
|
|
27
|
+
this.waiters = [];
|
|
28
|
+
this.inFlight = new Map();
|
|
29
|
+
this.shuttingDown = false;
|
|
30
|
+
this.ignoredSaveSources = new Set((configService.get('IGNORE_SAVE_SOURCES') ?? '')
|
|
31
|
+
.split(',')
|
|
32
|
+
.map((name) => name.trim())
|
|
33
|
+
.filter(Boolean));
|
|
34
|
+
}
|
|
35
|
+
execute(sourceName) {
|
|
36
|
+
const current = this.inFlight.get(sourceName);
|
|
37
|
+
if (current !== undefined)
|
|
38
|
+
return current;
|
|
39
|
+
if (this.shuttingDown) {
|
|
40
|
+
return Promise.resolve({
|
|
41
|
+
sourceName,
|
|
42
|
+
success: false,
|
|
43
|
+
duration: 0,
|
|
44
|
+
savedCount: 0,
|
|
45
|
+
totalCount: 0,
|
|
46
|
+
error: 'Application is shutting down',
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
const pending = this.withSlot(() => this.executeSource(sourceName));
|
|
50
|
+
this.inFlight.set(sourceName, pending);
|
|
51
|
+
void pending.then(() => this.inFlight.delete(sourceName), () => this.inFlight.delete(sourceName));
|
|
52
|
+
return pending;
|
|
53
|
+
}
|
|
54
|
+
async beforeApplicationShutdown() {
|
|
55
|
+
this.shuttingDown = true;
|
|
56
|
+
if (this.inFlight.size === 0)
|
|
57
|
+
return;
|
|
58
|
+
this.logger.log(`Waiting for ${this.inFlight.size} active fetches to finish`);
|
|
59
|
+
let timer;
|
|
60
|
+
try {
|
|
61
|
+
await Promise.race([
|
|
62
|
+
Promise.allSettled([...this.inFlight.values()]),
|
|
63
|
+
new Promise((resolve) => {
|
|
64
|
+
timer = setTimeout(resolve, 30_000);
|
|
65
|
+
}),
|
|
66
|
+
]);
|
|
67
|
+
}
|
|
68
|
+
finally {
|
|
69
|
+
if (timer)
|
|
70
|
+
clearTimeout(timer);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
async withSlot(operation) {
|
|
74
|
+
if (this.active < this.maxConcurrency) {
|
|
75
|
+
this.active++;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
await new Promise((resolve) => this.waiters.push(resolve));
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
return await operation();
|
|
82
|
+
}
|
|
83
|
+
finally {
|
|
84
|
+
const next = this.waiters.shift();
|
|
85
|
+
if (next)
|
|
86
|
+
next();
|
|
87
|
+
else
|
|
88
|
+
this.active--;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
async executeSource(sourceName) {
|
|
92
|
+
const startTime = Date.now();
|
|
93
|
+
const result = {
|
|
94
|
+
sourceName,
|
|
95
|
+
success: false,
|
|
96
|
+
duration: 0,
|
|
97
|
+
savedCount: 0,
|
|
98
|
+
totalCount: 0,
|
|
99
|
+
};
|
|
100
|
+
try {
|
|
101
|
+
this.logger.log(`🚀 Starting to fetch data for source: ${sourceName}`);
|
|
102
|
+
if (!this.validateSource(sourceName)) {
|
|
103
|
+
result.error = `Source '${sourceName}' not found`;
|
|
104
|
+
this.logger.error(result.error);
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
const sourceConfig = await this.sourceConfigRepository.findBySource(sourceName);
|
|
108
|
+
if (sourceConfig && !sourceConfig.enabled) {
|
|
109
|
+
result.error = `Source '${sourceName}' is disabled`;
|
|
110
|
+
this.logger.warn(result.error);
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
const hotListData = await this.hotListsService.fetchSource(sourceName, {}, true);
|
|
114
|
+
if (!hotListData || !hotListData.data || hotListData.data.length === 0) {
|
|
115
|
+
result.error = `No data received for source: ${sourceName}`;
|
|
116
|
+
this.logger.warn(result.error);
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
result.totalCount = hotListData.data.length;
|
|
120
|
+
result.items = hotListData.data;
|
|
121
|
+
const savedCount = this.ignoredSaveSources.has(sourceName)
|
|
122
|
+
? 0
|
|
123
|
+
: await this.hotItemRepository.saveHotItems(hotListData.data, sourceName);
|
|
124
|
+
result.savedCount = savedCount;
|
|
125
|
+
result.success = true;
|
|
126
|
+
await this.sourceConfigRepository.updateLastFetchTime(sourceName);
|
|
127
|
+
const duration = Date.now() - startTime;
|
|
128
|
+
result.duration = duration;
|
|
129
|
+
const saveSummary = this.ignoredSaveSources.has(sourceName)
|
|
130
|
+
? 'not saved (IGNORE_SAVE_SOURCES)'
|
|
131
|
+
: `${savedCount} new`;
|
|
132
|
+
this.logger.log(`✅ Source ${sourceName}: ${hotListData.data.length} fetched, ${saveSummary} in ${duration}ms`);
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
const duration = Date.now() - startTime;
|
|
137
|
+
result.duration = duration;
|
|
138
|
+
result.error = error instanceof Error ? error.message : String(error);
|
|
139
|
+
this.logger.error(`❌ Failed to fetch data for ${sourceName} after ${duration}ms:`, error);
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
async executeBatch(sourceNames) {
|
|
144
|
+
const startTime = Date.now();
|
|
145
|
+
this.logger.log(`🚀 Starting batch fetch for ${sourceNames.length} sources with max concurrency: ${this.maxConcurrency}`);
|
|
146
|
+
const results = await Promise.all(sourceNames.map((source) => this.execute(source)));
|
|
147
|
+
const totalDuration = Date.now() - startTime;
|
|
148
|
+
const succeeded = results.filter((r) => r.success).length;
|
|
149
|
+
const failed = results.filter((r) => !r.success).length;
|
|
150
|
+
const totalSaved = results.reduce((sum, r) => sum + r.savedCount, 0);
|
|
151
|
+
const totalItems = results.reduce((sum, r) => sum + r.totalCount, 0);
|
|
152
|
+
this.logger.log(`📊 Batch fetch completed in ${totalDuration}ms: ${succeeded} succeeded, ${failed} failed, ${totalItems} fetched, ${totalSaved} new`);
|
|
153
|
+
if (failed > 0) {
|
|
154
|
+
const failedSources = results
|
|
155
|
+
.filter((r) => !r.success)
|
|
156
|
+
.map((r) => `${r.sourceName}(${r.error})`)
|
|
157
|
+
.join(', ');
|
|
158
|
+
this.logger.warn(`Failed sources: ${failedSources}`);
|
|
159
|
+
}
|
|
160
|
+
return results;
|
|
161
|
+
}
|
|
162
|
+
validateSource(sourceName) {
|
|
163
|
+
const sources = this.hotListsService.getAllSources();
|
|
164
|
+
return sources.includes(sourceName);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
exports.FetchHotDataTask = FetchHotDataTask;
|
|
168
|
+
exports.FetchHotDataTask = FetchHotDataTask = FetchHotDataTask_1 = __decorate([
|
|
169
|
+
(0, common_1.Injectable)(),
|
|
170
|
+
__metadata("design:paramtypes", [hot_lists_service_1.HotListsService,
|
|
171
|
+
hot_item_repository_1.HotItemRepository,
|
|
172
|
+
source_config_repository_1.SourceConfigRepository,
|
|
173
|
+
config_1.ConfigService])
|
|
174
|
+
], FetchHotDataTask);
|
|
175
|
+
//# sourceMappingURL=fetch-hot-data.task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-hot-data.task.js","sourceRoot":"","sources":["../../../src/scheduler/tasks/fetch-hot-data.task.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA+E;AAC/E,0EAAqE;AACrE,yFAAoF;AACpF,mGAA8F;AAC9F,2CAA+C;AAcxC,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAS3B,YACmB,eAAgC,EAChC,iBAAoC,EACpC,sBAA8C,EAC/D,aAA4B;QAHX,oBAAe,GAAf,eAAe,CAAiB;QAChC,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,2BAAsB,GAAtB,sBAAsB,CAAwB;QAXhD,WAAM,GAAG,IAAI,eAAM,CAAC,kBAAgB,CAAC,IAAI,CAAC,CAAC;QAC3C,mBAAc,GAAG,CAAC,CAAC;QAC5B,WAAM,GAAG,CAAC,CAAC;QACF,YAAO,GAAsB,EAAE,CAAC;QAChC,aAAQ,GAAG,IAAI,GAAG,EAAgC,CAAC;QAC5D,iBAAY,GAAG,KAAK,CAAC;QAS3B,IAAI,CAAC,kBAAkB,GAAG,IAAI,GAAG,CAC/B,CAAC,aAAa,CAAC,GAAG,CAAS,qBAAqB,CAAC,IAAI,EAAE,CAAC;aACrD,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;aAC1B,M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;IACjB,CAAC;IAKO,cAAc,CAAC,UAAkB;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;QACrD,OAAO,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;CACF,CAAA;AAjNY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAWyB,mCAAe;QACb,uCAAiB;QACZ,iDAAsB;QAChD,sBAAa;GAbnB,gBAAgB,CAiN5B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const genCoolapkHeaders: () => {
|
|
2
|
+
'X-Requested-With': string;
|
|
3
|
+
'X-App-Id': string;
|
|
4
|
+
'X-App-Token': string;
|
|
5
|
+
'X-Sdk-Int': string;
|
|
6
|
+
'X-Sdk-Locale': string;
|
|
7
|
+
'X-App-Version': string;
|
|
8
|
+
'X-Api-Version': string;
|
|
9
|
+
'X-App-Code': string;
|
|
10
|
+
'User-Agent': string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
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.genCoolapkHeaders = void 0;
|
|
7
|
+
const md5_1 = __importDefault(require("md5"));
|
|
8
|
+
const getRandomDEVICE_ID = () => {
|
|
9
|
+
const id = [10, 6, 6, 6, 14];
|
|
10
|
+
return id.map((i) => Math.random().toString(36).substring(2, i)).join('-');
|
|
11
|
+
};
|
|
12
|
+
const get_app_token = () => {
|
|
13
|
+
const DEVICE_ID = getRandomDEVICE_ID();
|
|
14
|
+
const now = Math.round(Date.now() / 1000);
|
|
15
|
+
const hex_now = '0x' + now.toString(16);
|
|
16
|
+
const md5_now = (0, md5_1.default)(now.toString());
|
|
17
|
+
const s = 'token://com.coolapk.market/c67ef5943784d09750dcfbb31020f0ab?' +
|
|
18
|
+
md5_now +
|
|
19
|
+
'$' +
|
|
20
|
+
DEVICE_ID +
|
|
21
|
+
'&com.coolapk.market';
|
|
22
|
+
const md5_s = (0, md5_1.default)(Buffer.from(s).toString('base64'));
|
|
23
|
+
const token = md5_s + DEVICE_ID + hex_now;
|
|
24
|
+
return token;
|
|
25
|
+
};
|
|
26
|
+
const genCoolapkHeaders = () => {
|
|
27
|
+
return {
|
|
28
|
+
'X-Requested-With': 'XMLHttpRequest',
|
|
29
|
+
'X-App-Id': 'com.coolapk.market',
|
|
30
|
+
'X-App-Token': get_app_token(),
|
|
31
|
+
'X-Sdk-Int': '29',
|
|
32
|
+
'X-Sdk-Locale': 'zh-CN',
|
|
33
|
+
'X-App-Version': '11.0',
|
|
34
|
+
'X-Api-Version': '11',
|
|
35
|
+
'X-App-Code': '2101202',
|
|
36
|
+
'User-Agent': 'Mozilla/5.0 (Linux; Android 10; Mi 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.5563.15 Mobile Safari/537.36',
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
exports.genCoolapkHeaders = genCoolapkHeaders;
|
|
40
|
+
//# sourceMappingURL=coolapk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coolapk.js","sourceRoot":"","sources":["../../src/token/coolapk.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AAMtB,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,MAAM,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC7B,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7E,CAAC,CAAC;AAMF,MAAM,aAAa,GAAG,GAAG,EAAE;IACzB,MAAM,SAAS,GAAG,kBAAkB,EAAE,CAAC;IACvC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,IAAA,aAAG,EAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACpC,MAAM,CAAC,GACL,8DAA8D;QAC9D,OAAO;QACP,GAAG;QACH,SAAS;QACT,qBAAqB,CAAC;IACxB,MAAM,KAAK,GAAG,IAAA,aAAG,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrD,MAAM,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC;IAC1C,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAMK,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,OAAO;QACL,kBAAkB,EAAE,gBAAgB;QACpC,UAAU,EAAE,oBAAoB;QAChC,aAAa,EAAE,aAAa,EAAE;QAC9B,WAAW,EAAE,IAAI;QACjB,cAAc,EAAE,OAAO;QACvB,eAAe,EAAE,MAAM;QACvB,eAAe,EAAE,IAAI;QACrB,YAAY,EAAE,SAAS;QACvB,YAAY,EACV,yHAAyH;KAC5H,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,iBAAiB,qBAa5B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.TokenModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const token_service_1 = require("./token.service");
|
|
12
|
+
const http_module_1 = require("../http/http.module");
|
|
13
|
+
let TokenModule = class TokenModule {
|
|
14
|
+
};
|
|
15
|
+
exports.TokenModule = TokenModule;
|
|
16
|
+
exports.TokenModule = TokenModule = __decorate([
|
|
17
|
+
(0, common_1.Module)({
|
|
18
|
+
imports: [http_module_1.HttpClientModule],
|
|
19
|
+
providers: [token_service_1.TokenService],
|
|
20
|
+
exports: [token_service_1.TokenService],
|
|
21
|
+
})
|
|
22
|
+
], TokenModule);
|
|
23
|
+
//# sourceMappingURL=token.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.module.js","sourceRoot":"","sources":["../../src/token/token.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,mDAA+C;AAC/C,qDAAuD;AAOhD,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IALvB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,8BAAgB,CAAC;QAC3B,SAAS,EAAE,CAAC,4BAAY,CAAC;QACzB,OAAO,EAAE,CAAC,4BAAY,CAAC;KACxB,CAAC;GACW,WAAW,CAAG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HttpClientService } from '../http/http.service';
|
|
2
|
+
interface WbiParams {
|
|
3
|
+
[key: string]: string | number;
|
|
4
|
+
}
|
|
5
|
+
export declare class TokenService {
|
|
6
|
+
private readonly httpClientService;
|
|
7
|
+
private readonly logger;
|
|
8
|
+
private readonly wbiNavRequest;
|
|
9
|
+
private readonly mixinKeyEncTab;
|
|
10
|
+
constructor(httpClientService: HttpClientService);
|
|
11
|
+
private getMixinKey;
|
|
12
|
+
private encWbi;
|
|
13
|
+
private getWbiKeys;
|
|
14
|
+
getBiliWbi(customParams?: WbiParams): Promise<string>;
|
|
15
|
+
clearBiliWbiCache(): Promise<void>;
|
|
16
|
+
generateWbiSignedUrl(baseUrl: string, params: WbiParams): Promise<string>;
|
|
17
|
+
get51ctoToken(): Promise<string>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|