@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,78 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SinaSource = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
|
|
15
|
+
const http_service_1 = require("../../http/http.service");
|
|
16
|
+
const getNum_1 = require("../../utils/getNum");
|
|
17
|
+
const typeMap = {
|
|
18
|
+
all: '新浪热榜',
|
|
19
|
+
hotcmnt: '热议榜',
|
|
20
|
+
minivideo: '视频热榜',
|
|
21
|
+
ent: '娱乐热榜',
|
|
22
|
+
ai: 'AI热榜',
|
|
23
|
+
auto: '汽车热榜',
|
|
24
|
+
mother: '育儿热榜',
|
|
25
|
+
fashion: '时尚热榜',
|
|
26
|
+
travel: '旅游热榜',
|
|
27
|
+
esg: 'ESG热榜',
|
|
28
|
+
};
|
|
29
|
+
let SinaSource = class SinaSource {
|
|
30
|
+
constructor(httpService) {
|
|
31
|
+
this.httpService = httpService;
|
|
32
|
+
}
|
|
33
|
+
async getList(options, noCache) {
|
|
34
|
+
const type = options?.type || 'all';
|
|
35
|
+
const url = `https://newsapp.sina.cn/api/hotlist?newsId=HB-1-snhs%2Ftop_news_list-${type}`;
|
|
36
|
+
const result = await this.httpService.get({ url, noCache });
|
|
37
|
+
const list = result.data.data.hotList;
|
|
38
|
+
return {
|
|
39
|
+
data: list.map((v) => {
|
|
40
|
+
const base = v.base;
|
|
41
|
+
const info = v.info;
|
|
42
|
+
return {
|
|
43
|
+
id: base.base.uniqueId,
|
|
44
|
+
title: info.title,
|
|
45
|
+
desc: undefined,
|
|
46
|
+
author: undefined,
|
|
47
|
+
timestamp: undefined,
|
|
48
|
+
hot: (0, getNum_1.parseChineseNumber)(info.hotValue),
|
|
49
|
+
url: base.base.url,
|
|
50
|
+
mobileUrl: base.base.url,
|
|
51
|
+
};
|
|
52
|
+
}),
|
|
53
|
+
type: typeMap[type],
|
|
54
|
+
description: '热榜太多,一个就够',
|
|
55
|
+
params: {
|
|
56
|
+
type: {
|
|
57
|
+
name: '榜单分类',
|
|
58
|
+
type: typeMap,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
fromCache: result.fromCache,
|
|
62
|
+
updateTime: result.updateTime,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
exports.SinaSource = SinaSource;
|
|
67
|
+
exports.SinaSource = SinaSource = __decorate([
|
|
68
|
+
(0, common_1.Injectable)(),
|
|
69
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
70
|
+
name: 'sina',
|
|
71
|
+
title: '新浪网',
|
|
72
|
+
type: '热榜',
|
|
73
|
+
description: '热榜太多,一个就够',
|
|
74
|
+
link: 'https://sinanews.sina.cn/',
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
77
|
+
], SinaSource);
|
|
78
|
+
//# sourceMappingURL=sina.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sina.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/sina.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAA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C,GAAG;oBAClB,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG;iBACzB,CAAC;YACJ,CAAC,CAAC;YACF,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC;YACnB,WAAW,EAAE,WAAW;YACxB,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,OAAO;iBACd;aACF;YACD,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AAtCY,gCAAU;qBAAV,UAAU;IARtB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,IAAI;QACV,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,2BAA2B;KAClC,CAAC;qCAE0C,gCAAiB;GADhD,UAAU,CAsCtB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HotListSource } from '../interfaces/hot-list-source.interface';
|
|
2
|
+
import { HotListGetListResponse } from '../interfaces/hot-list.interface';
|
|
3
|
+
import { HttpClientService } from '../../http/http.service';
|
|
4
|
+
import { GetListOptions } from './source.types';
|
|
5
|
+
export declare class SmzdmSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SmzdmSource = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
|
|
15
|
+
const http_service_1 = require("../../http/http.service");
|
|
16
|
+
const getTime_1 = require("../../utils/getTime");
|
|
17
|
+
const typeMap = {
|
|
18
|
+
'1': '今日热门',
|
|
19
|
+
'7': '周热门',
|
|
20
|
+
'30': '月热门',
|
|
21
|
+
};
|
|
22
|
+
let SmzdmSource = class SmzdmSource {
|
|
23
|
+
constructor(httpService) {
|
|
24
|
+
this.httpService = httpService;
|
|
25
|
+
}
|
|
26
|
+
async getList(options, noCache) {
|
|
27
|
+
const type = options?.type || '1';
|
|
28
|
+
const url = `https://post.smzdm.com/rank/json_more/?unit=${type}`;
|
|
29
|
+
const result = await this.httpService.get({
|
|
30
|
+
url,
|
|
31
|
+
noCache,
|
|
32
|
+
});
|
|
33
|
+
const list = result.data.data;
|
|
34
|
+
return {
|
|
35
|
+
data: list.map((v) => ({
|
|
36
|
+
id: v.article_id,
|
|
37
|
+
title: v.title,
|
|
38
|
+
desc: v.content,
|
|
39
|
+
cover: v.pic_url,
|
|
40
|
+
author: v.nickname,
|
|
41
|
+
hot: Number(v.collection_count),
|
|
42
|
+
timestamp: (0, getTime_1.getTime)(v.time_sort),
|
|
43
|
+
url: v.jump_link,
|
|
44
|
+
mobileUrl: v.jump_link,
|
|
45
|
+
})),
|
|
46
|
+
type: typeMap[type],
|
|
47
|
+
description: '什么值得买是一个中立的、致力于帮助广大网友买到更有性价比网购产品的最热门推荐网站。',
|
|
48
|
+
params: {
|
|
49
|
+
type: {
|
|
50
|
+
name: '文章分类',
|
|
51
|
+
type: typeMap,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
fromCache: result.fromCache,
|
|
55
|
+
updateTime: result.updateTime,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.SmzdmSource = SmzdmSource;
|
|
60
|
+
exports.SmzdmSource = SmzdmSource = __decorate([
|
|
61
|
+
(0, common_1.Injectable)(),
|
|
62
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
63
|
+
name: 'smzdm',
|
|
64
|
+
title: '什么值得买',
|
|
65
|
+
type: '热门榜',
|
|
66
|
+
description: '什么值得买是一个中立的、致力于帮助广大网友买到更有性价比网购产品的最热门推荐网站。',
|
|
67
|
+
link: 'https://www.smzdm.com/top/',
|
|
68
|
+
}),
|
|
69
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
70
|
+
], SmzdmSource);
|
|
71
|
+
//# sourceMappingURL=smzdm.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smzdm.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/smzdm.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAA4C;AAE5C,MAAM,OAAO,GAA2B;IACtC,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,KAAK;CACZ,CAAC;AAcK,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,OAAuB,EACvB,OAAiB;QAEjB,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,GAAG,CAAC;QAClC,MAAM,G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 +1,9 @@
|
|
|
1
|
+
import { HotListSource } from '../interfaces/hot-list-source.interface';
|
|
2
|
+
import { HotListGetListResponse } from '../interfaces/hot-list.interface';
|
|
3
|
+
import { HttpClientService } from '../../http/http.service';
|
|
4
|
+
import { GetListOptions } from './source.types';
|
|
5
|
+
export declare class SsPaiSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SsPaiSource = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
|
|
15
|
+
const http_service_1 = require("../../http/http.service");
|
|
16
|
+
const getTime_1 = require("../../utils/getTime");
|
|
17
|
+
let SsPaiSource = class SsPaiSource {
|
|
18
|
+
constructor(httpService) {
|
|
19
|
+
this.httpService = httpService;
|
|
20
|
+
}
|
|
21
|
+
async getList(options, noCache) {
|
|
22
|
+
const type = options?.type || '热门文章';
|
|
23
|
+
const url = `https://sspai.com/api/v1/article/tag/page/get?limit=40&tag=${type}`;
|
|
24
|
+
const result = await this.httpService.get({
|
|
25
|
+
url,
|
|
26
|
+
noCache,
|
|
27
|
+
});
|
|
28
|
+
const list = result.data?.data || [];
|
|
29
|
+
return {
|
|
30
|
+
data: list.map((v) => ({
|
|
31
|
+
id: v.id,
|
|
32
|
+
title: v.title,
|
|
33
|
+
desc: v.summary,
|
|
34
|
+
cover: v.banner,
|
|
35
|
+
author: v.author.nickname,
|
|
36
|
+
timestamp: (0, getTime_1.getTime)(v.released_time),
|
|
37
|
+
hot: v.like_count,
|
|
38
|
+
url: `https://sspai.com/post/${v.id}`,
|
|
39
|
+
mobileUrl: `https://sspai.com/post/${v.id}`,
|
|
40
|
+
})),
|
|
41
|
+
params: {
|
|
42
|
+
type: {
|
|
43
|
+
name: '分类',
|
|
44
|
+
type: {
|
|
45
|
+
热门文章: '热门文章',
|
|
46
|
+
应用推荐: '应用推荐',
|
|
47
|
+
生活方式: '生活方式',
|
|
48
|
+
效率技巧: '效率技巧',
|
|
49
|
+
少数派播客: '播客',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
fromCache: result.fromCache,
|
|
54
|
+
updateTime: result.updateTime,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.SsPaiSource = SsPaiSource;
|
|
59
|
+
exports.SsPaiSource = SsPaiSource = __decorate([
|
|
60
|
+
(0, common_1.Injectable)(),
|
|
61
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
62
|
+
name: 'sspai',
|
|
63
|
+
title: '少数派',
|
|
64
|
+
type: '热榜',
|
|
65
|
+
link: 'https://sspai.com/',
|
|
66
|
+
}),
|
|
67
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
68
|
+
], SsPaiSource);
|
|
69
|
+
//# sourceMappingURL=sspai.source.js.map
|
|
@@ -0,0 +1 @@
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AI,EAAE,MAAM;wBACZ,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,MAAM;wBACZ,KAAK,EAAE,IAAI;qBACZ;iBACF;aACF;YACD,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AA3CY,kCAAW;sBAAX,WAAW;IAPvB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,oBAAoB;KAC3B,CAAC;qCAE0C,gCAAiB;GADhD,WAAW,CA2CvB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HotListSource } from '../interfaces/hot-list-source.interface';
|
|
2
|
+
import { HotListGetListResponse } from '../interfaces/hot-list.interface';
|
|
3
|
+
import { HttpClientService } from '../../http/http.service';
|
|
4
|
+
import { GetListOptions } from './source.types';
|
|
5
|
+
export declare class StarrailSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.StarrailSource = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
|
|
15
|
+
const http_service_1 = require("../../http/http.service");
|
|
16
|
+
const getTime_1 = require("../../utils/getTime");
|
|
17
|
+
const typeMap = {
|
|
18
|
+
1: '公告',
|
|
19
|
+
2: '活动',
|
|
20
|
+
3: '资讯',
|
|
21
|
+
};
|
|
22
|
+
let StarrailSource = class StarrailSource {
|
|
23
|
+
constructor(httpService) {
|
|
24
|
+
this.httpService = httpService;
|
|
25
|
+
}
|
|
26
|
+
async getList(options, noCache) {
|
|
27
|
+
const type = options?.type || 1;
|
|
28
|
+
const url = `https://bbs-api-static.miyoushe.com/painter/wapi/getNewsList?client_type=4&gids=6&page_size=20&type=${type}`;
|
|
29
|
+
const result = await this.httpService.get({
|
|
30
|
+
url,
|
|
31
|
+
noCache,
|
|
32
|
+
});
|
|
33
|
+
const list = result.data.data.list || [];
|
|
34
|
+
return {
|
|
35
|
+
data: list.map((v) => {
|
|
36
|
+
const data = v.post;
|
|
37
|
+
return {
|
|
38
|
+
id: data.post_id,
|
|
39
|
+
title: data.subject,
|
|
40
|
+
desc: data.content,
|
|
41
|
+
cover: data.cover || data?.images?.[0],
|
|
42
|
+
author: v.user?.nickname || undefined,
|
|
43
|
+
timestamp: (0, getTime_1.getTime)(data.created_at),
|
|
44
|
+
hot: data.view_status,
|
|
45
|
+
url: `https://www.miyoushe.com/sr/article/${data.post_id}`,
|
|
46
|
+
mobileUrl: `https://m.miyoushe.com/sr/#/article/${data.post_id}`,
|
|
47
|
+
};
|
|
48
|
+
}),
|
|
49
|
+
type: '最新动态',
|
|
50
|
+
params: {
|
|
51
|
+
type: {
|
|
52
|
+
name: '榜单分类',
|
|
53
|
+
type: typeMap,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
fromCache: result.fromCache,
|
|
57
|
+
updateTime: result.updateTime,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.StarrailSource = StarrailSource;
|
|
62
|
+
exports.StarrailSource = StarrailSource = __decorate([
|
|
63
|
+
(0, common_1.Injectable)(),
|
|
64
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
65
|
+
name: 'starrail',
|
|
66
|
+
title: '崩坏:星穹铁道',
|
|
67
|
+
type: '最新动态',
|
|
68
|
+
link: 'https://www.miyoushe.com/sr/home/53',
|
|
69
|
+
}),
|
|
70
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
71
|
+
], StarrailSource);
|
|
72
|
+
//# sourceMappingURL=starrail.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starrail.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/starrail.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAA4C;AAE5C,MAAM,OAAO,GAA2B;IACtC,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;CACR,CAAC;AAeK,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,OAAuB,EACvB,OAAiB;QAEjB,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,CAAC,CAAC;QAChC,MAAM,GAAG,GAAG,uGAAuG,IAAI,EAAE,CAAC;QAC1H,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAsB;YAC7D,GAAG;YACH,OAAO;SACR,CAAC,CAAC;QACH,MAAM,IAAI,G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
2
|
+
import { HotListGetListResponse } from '../interfaces/hot-list.interface';
|
|
3
|
+
import { HttpClientService } from '../../http/http.service';
|
|
4
|
+
import { GetListOptions } from './source.types';
|
|
5
|
+
export declare class TaobaoSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
private fetchItems;
|
|
9
|
+
getList(_options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TaobaoSource = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
|
|
15
|
+
const http_service_1 = require("../../http/http.service");
|
|
16
|
+
const TAOBAO_HOME_URL = 'https://www.taobao.com/';
|
|
17
|
+
const toTaobaoMobileSearchUrl = (keyword) => `https://main.m.taobao.com/search/index.html?q=${encodeURIComponent(keyword)}&sort=sale-desc`;
|
|
18
|
+
const toStringValue = (value) => {
|
|
19
|
+
if (typeof value === 'string')
|
|
20
|
+
return value;
|
|
21
|
+
if (typeof value === 'number')
|
|
22
|
+
return String(value);
|
|
23
|
+
return '';
|
|
24
|
+
};
|
|
25
|
+
const normalizeUrl = (url) => {
|
|
26
|
+
if (url.startsWith('//'))
|
|
27
|
+
return `https:${url}`;
|
|
28
|
+
return url;
|
|
29
|
+
};
|
|
30
|
+
const extractStaticConfig = (html) => {
|
|
31
|
+
const match = /window\.staticConfig\s*=/.exec(html);
|
|
32
|
+
const start = match?.index ?? -1;
|
|
33
|
+
if (start === -1) {
|
|
34
|
+
throw new Error('Failed to find taobao static config');
|
|
35
|
+
}
|
|
36
|
+
const braceStart = html.indexOf('{', start);
|
|
37
|
+
let depth = 0;
|
|
38
|
+
let inString = false;
|
|
39
|
+
let escaped = false;
|
|
40
|
+
for (let i = braceStart; i < html.length; i += 1) {
|
|
41
|
+
const char = html[i];
|
|
42
|
+
if (inString) {
|
|
43
|
+
if (escaped) {
|
|
44
|
+
escaped = false;
|
|
45
|
+
}
|
|
46
|
+
else if (char === '\\') {
|
|
47
|
+
escaped = true;
|
|
48
|
+
}
|
|
49
|
+
else if (char === '"') {
|
|
50
|
+
inString = false;
|
|
51
|
+
}
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (char === '"') {
|
|
55
|
+
inString = true;
|
|
56
|
+
}
|
|
57
|
+
else if (char === '{') {
|
|
58
|
+
depth += 1;
|
|
59
|
+
}
|
|
60
|
+
else if (char === '}') {
|
|
61
|
+
depth -= 1;
|
|
62
|
+
if (depth === 0) {
|
|
63
|
+
return JSON.parse(html.slice(braceStart, i + 1));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
throw new Error('Failed to parse taobao static config');
|
|
68
|
+
};
|
|
69
|
+
const collectItems = (value, cardTitle = '', items = []) => {
|
|
70
|
+
if (!value || typeof value !== 'object')
|
|
71
|
+
return items;
|
|
72
|
+
if (Array.isArray(value)) {
|
|
73
|
+
value.forEach((item) => collectItems(item, cardTitle, items));
|
|
74
|
+
return items;
|
|
75
|
+
}
|
|
76
|
+
const objectValue = value;
|
|
77
|
+
const nextCardTitle = typeof objectValue.cardTitle === 'string'
|
|
78
|
+
? objectValue.cardTitle
|
|
79
|
+
: cardTitle;
|
|
80
|
+
const itemId = toStringValue(objectValue.itemId);
|
|
81
|
+
const shortTitle = typeof objectValue.shortTitle === 'string' ? objectValue.shortTitle : '';
|
|
82
|
+
const clickUrl = typeof objectValue.clickUrl === 'string' ? objectValue.clickUrl : '';
|
|
83
|
+
if (itemId &&
|
|
84
|
+
shortTitle &&
|
|
85
|
+
/(?:item\.taobao\.com|detail\.tmall\.com)\/item\.htm/.test(clickUrl)) {
|
|
86
|
+
items.push({
|
|
87
|
+
itemId,
|
|
88
|
+
shortTitle,
|
|
89
|
+
clickUrl: normalizeUrl(clickUrl),
|
|
90
|
+
price: toStringValue(objectValue.price) || undefined,
|
|
91
|
+
benefit: typeof objectValue.benefit === 'string'
|
|
92
|
+
? objectValue.benefit
|
|
93
|
+
: undefined,
|
|
94
|
+
itemWhiteImg: typeof objectValue.itemWhiteImg === 'string'
|
|
95
|
+
? normalizeUrl(objectValue.itemWhiteImg)
|
|
96
|
+
: undefined,
|
|
97
|
+
cardTitle: nextCardTitle,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
Object.values(objectValue).forEach((item) => collectItems(item, nextCardTitle, items));
|
|
101
|
+
return items;
|
|
102
|
+
};
|
|
103
|
+
let TaobaoSource = class TaobaoSource {
|
|
104
|
+
constructor(httpService) {
|
|
105
|
+
this.httpService = httpService;
|
|
106
|
+
}
|
|
107
|
+
async fetchItems(noCache) {
|
|
108
|
+
const result = await this.httpService.get({
|
|
109
|
+
url: TAOBAO_HOME_URL,
|
|
110
|
+
noCache,
|
|
111
|
+
responseType: 'text',
|
|
112
|
+
headers: {
|
|
113
|
+
Referer: TAOBAO_HOME_URL,
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
let items;
|
|
117
|
+
try {
|
|
118
|
+
items = collectItems(extractStaticConfig(result.data));
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
if (result.fromCache && !noCache) {
|
|
122
|
+
return this.fetchItems(true);
|
|
123
|
+
}
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
if (items.length === 0 && result.fromCache && !noCache) {
|
|
127
|
+
return this.fetchItems(true);
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
items,
|
|
131
|
+
fromCache: result.fromCache,
|
|
132
|
+
updateTime: result.updateTime,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
async getList(_options, noCache) {
|
|
136
|
+
const result = await this.fetchItems(noCache);
|
|
137
|
+
return {
|
|
138
|
+
data: result.items.map((item) => ({
|
|
139
|
+
id: item.itemId,
|
|
140
|
+
title: item.shortTitle,
|
|
141
|
+
desc: ['淘宝', item.cardTitle, item.benefit]
|
|
142
|
+
.filter(Boolean)
|
|
143
|
+
.join(' · '),
|
|
144
|
+
cover: item.itemWhiteImg,
|
|
145
|
+
hot: item.price ? `¥${item.price}` : undefined,
|
|
146
|
+
timestamp: 0,
|
|
147
|
+
url: item.clickUrl,
|
|
148
|
+
mobileUrl: toTaobaoMobileSearchUrl(item.shortTitle),
|
|
149
|
+
})),
|
|
150
|
+
type: '淘宝首页好货',
|
|
151
|
+
description: '淘宝首页公开静态配置中的商品卡片。',
|
|
152
|
+
fromCache: result.fromCache,
|
|
153
|
+
updateTime: result.updateTime,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
exports.TaobaoSource = TaobaoSource;
|
|
158
|
+
exports.TaobaoSource = TaobaoSource = __decorate([
|
|
159
|
+
(0, common_1.Injectable)(),
|
|
160
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
161
|
+
name: 'taobao',
|
|
162
|
+
title: '淘宝',
|
|
163
|
+
type: '首页好货',
|
|
164
|
+
description: '淘宝首页公开静态配置中的商品卡片。',
|
|
165
|
+
link: TAOBAO_HOME_URL,
|
|
166
|
+
}),
|
|
167
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
168
|
+
], TaobaoSource);
|
|
169
|
+
//# sourceMappingURL=taobao.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taobao.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/taobao.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAG5D,MAAM,eAAe,GAAG,yBAAyB,CAAC;AAkBlD,MAAM,uBAAuB,GAAG,CAAC,OAAe,EAAE,EAAE,CAClD,iDAAiD,kBAAkB,CACjE,OAAO,CACR,iBAAiB,CAAC;AAErB,MAAM,aAAa,GAAG,CAAC,KAAc,EAAE,EAAE;IACvC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACpD,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE;IACnC,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,GAAG,EAAE,CAAC;IAChD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAW,EAAE;IACpD,MAAM,KAAK,GAAG,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,KAAK,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IAEjC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CA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MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAE9C,OAAO;YACL,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBAChC,EAAE,EAAE,IAAI,CAAC,MAAM;gBACf,KAAK,EAAE,IAAI,CAAC,UAAU;gBACtB,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC;qBACvC,MAAM,CAAC,OAAO,CAAC;qBACf,IAAI,CAAC,KAAK,CAAC;gBACd,KAAK,EAAE,IAAI,CAAC,YAAY;gBACxB,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS;gBAC9C,SAAS,EAAE,CAAC;gBACZ,GAAG,EAAE,IAAI,CAAC,QAAQ;gBAClB,SAAS,EAAE,uBAAuB,CAAC,IAAI,CAAC,UAAU,CAAC;aACpD,CAAC,CAAC;YACH,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,mBAAmB;YAChC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AA5DY,oCAAY;uBAAZ,YAAY;IARxB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,eAAe;KACtB,CAAC;qCAE0C,gCAAiB;GADhD,YAAY,CA4DxB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HotListSource } from '../interfaces/hot-list-source.interface';
|
|
2
|
+
import { HotListGetListResponse } from '../interfaces/hot-list.interface';
|
|
3
|
+
import { HttpClientService } from '../../http/http.service';
|
|
4
|
+
import { GetListOptions } from './source.types';
|
|
5
|
+
export declare class ThepaperSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options?: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ThepaperSource = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
|
|
15
|
+
const http_service_1 = require("../../http/http.service");
|
|
16
|
+
const getTime_1 = require("../../utils/getTime");
|
|
17
|
+
let ThepaperSource = class ThepaperSource {
|
|
18
|
+
constructor(httpService) {
|
|
19
|
+
this.httpService = httpService;
|
|
20
|
+
}
|
|
21
|
+
async getList(options = {}, noCache) {
|
|
22
|
+
const url = 'https://cache.thepaper.cn/contentapi/wwwIndex/rightSidebar';
|
|
23
|
+
const result = await this.httpService.get({
|
|
24
|
+
url,
|
|
25
|
+
noCache: noCache ?? options.noCache,
|
|
26
|
+
});
|
|
27
|
+
const list = result?.data?.data?.hotNews || [];
|
|
28
|
+
const data = list.map((v) => ({
|
|
29
|
+
id: v.contId,
|
|
30
|
+
title: v.name,
|
|
31
|
+
cover: v.pic,
|
|
32
|
+
hot: Number(v.praiseTimes),
|
|
33
|
+
timestamp: (0, getTime_1.getTime)(v.pubTimeLong),
|
|
34
|
+
url: `https://www.thepaper.cn/newsDetail_forward_${v.contId}`,
|
|
35
|
+
mobileUrl: `https://m.thepaper.cn/newsDetail_forward_${v.contId}`,
|
|
36
|
+
}));
|
|
37
|
+
return {
|
|
38
|
+
data,
|
|
39
|
+
type: '热榜',
|
|
40
|
+
fromCache: result.fromCache,
|
|
41
|
+
updateTime: result.updateTime,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.ThepaperSource = ThepaperSource;
|
|
46
|
+
exports.ThepaperSource = ThepaperSource = __decorate([
|
|
47
|
+
(0, common_1.Injectable)(),
|
|
48
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
49
|
+
name: 'thepaper',
|
|
50
|
+
title: '澎湃新闻',
|
|
51
|
+
type: '热榜',
|
|
52
|
+
link: 'https://www.thepaper.cn/',
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
55
|
+
], ThepaperSource);
|
|
56
|
+
//# sourceMappingURL=thepaper.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thepaper.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/thepaper.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAM/D,0DAA4D;AAE5D,iDAA8C;AAevC,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,UAA0B,EAAE,EAC5B,OAAiB;QAEjB,MAAM,GAAG,GAAG,4DAA4D,CAAC;QACzE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAsB;YAC7D,GAAG;YACH,OAAO,EAAE,OAAO,IAAI,OAAO,CAAC,OAAO;SACpC,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,IAAI,EAAE,CAAC;QAC/C,MAAM,IAAI,GAAkB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3C,EAAE,EAAE,CAAC,CAAC,MAAM;YACZ,KAAK,EAAE,CAAC,CAAC,IAAI;YACb,KAAK,EAAE,CAAC,CAAC,GAAG;YACZ,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC;YAC1B,SAAS,EAAE,IAAA,iBAAO,EAAC,CAAC,CAAC,WAAW,CAAC;YACjC,GAAG,EAAE,8CAA8C,CAAC,CAAC,MAAM,EAAE;YAC7D,SAAS,EAAE,4CAA4C,CAAC,CAAC,MAAM,EAAE;SAClE,CAAC,CAAC,CAAC;QACJ,OAAO;YACL,IAAI;YACJ,IAAI,EAAE,IAAI;YACV,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AA7BY,wCAAc;yBAAd,cAAc;IAP1B,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,0BAA0B;KACjC,CAAC;qCAE0C,gCAAiB;GADhD,cAAc,CA6B1B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HotListSource } from '../interfaces/hot-list-source.interface';
|
|
2
|
+
import { HotListGetListResponse } from '../interfaces/hot-list.interface';
|
|
3
|
+
import { HttpClientService } from '../../http/http.service';
|
|
4
|
+
import { GetListOptions } from './source.types';
|
|
5
|
+
export declare class TiebaSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options?: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|