@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,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logsCommand = logsCommand;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const promises_1 = require("fs/promises");
|
|
6
|
+
const errors_1 = require("../errors");
|
|
7
|
+
const log_file_1 = require("../log-file");
|
|
8
|
+
const output_1 = require("../output");
|
|
9
|
+
const paths_1 = require("../paths");
|
|
10
|
+
const FOLLOW_INTERVAL_MS = 500;
|
|
11
|
+
async function logsCommand(options, context = {}) {
|
|
12
|
+
const cwd = context.cwd ?? process.cwd();
|
|
13
|
+
const env = context.env ?? process.env;
|
|
14
|
+
const homeDir = (0, paths_1.resolveHomeDir)({ home: options.home, cwd, env });
|
|
15
|
+
const paths = (0, paths_1.buildCliPaths)(homeDir);
|
|
16
|
+
if (!(0, fs_1.existsSync)(paths.logFile)) {
|
|
17
|
+
(0, output_1.fail)(`日志文件不存在: ${paths.logFile}`);
|
|
18
|
+
(0, output_1.fail)('前台模式的标准输出直接打印在启动终端,不会写入日志文件;请使用 daily-hot-api start -d 后台启动');
|
|
19
|
+
return errors_1.EXIT_CODES.error;
|
|
20
|
+
}
|
|
21
|
+
const content = (0, log_file_1.tailFile)(paths.logFile, options.lines);
|
|
22
|
+
if (content) {
|
|
23
|
+
process.stdout.write(content.endsWith('\n') ? content : `${content}\n`);
|
|
24
|
+
}
|
|
25
|
+
if (!options.follow) {
|
|
26
|
+
return errors_1.EXIT_CODES.ok;
|
|
27
|
+
}
|
|
28
|
+
(0, output_1.progress)(`正在跟踪日志: ${paths.logFile}(按 Ctrl+C 退出)`);
|
|
29
|
+
let position = (await (0, promises_1.stat)(paths.logFile)).size;
|
|
30
|
+
const timer = setInterval(() => {
|
|
31
|
+
try {
|
|
32
|
+
const chunk = (0, log_file_1.readLogChunk)(paths.logFile, position);
|
|
33
|
+
position = chunk.nextPosition;
|
|
34
|
+
if (chunk.text) {
|
|
35
|
+
process.stdout.write(chunk.text);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
}
|
|
40
|
+
}, FOLLOW_INTERVAL_MS);
|
|
41
|
+
const stopFollowing = () => {
|
|
42
|
+
clearInterval(timer);
|
|
43
|
+
};
|
|
44
|
+
process.once('SIGINT', () => {
|
|
45
|
+
stopFollowing();
|
|
46
|
+
process.stdout.write('\n');
|
|
47
|
+
process.exit(0);
|
|
48
|
+
});
|
|
49
|
+
process.once('SIGTERM', () => {
|
|
50
|
+
stopFollowing();
|
|
51
|
+
process.exit(0);
|
|
52
|
+
});
|
|
53
|
+
return errors_1.EXIT_CODES.ok;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=logs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../../src/cli/commands/logs.ts"],"names":[],"mappings":";;AAWA,kCAuDC;AAlED,2BAAgC;AAChC,0CAAmC;AAGnC,sCAAuC;AACvC,0CAAqD;AACrD,sCAA2C;AAC3C,oCAAyD;AAEzD,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAExB,KAAK,UAAU,WAAW,CAC/B,OAAmB,EACnB,UAAmC,EAAE;IAErC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACzC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACvC,MAAM,OAAO,GAAG,IAAA,sBAAc,EAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IACjE,MAAM,KAAK,GAAG,IAAA,qBAAa,EAAC,OAAO,CAAC,CAAC;IAErC,IAAI,CAAC,IAAA,eAAU,EAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/B,IAAA,aAAI,EAAC,YAAY,KAAK,CAAC,OAAO,EAAE,CAAC,C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QAChB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;QAC3B,aAAa,EAAE,CAAC;QAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,OAAO,mBAAU,CAAC,EAAE,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.restartCommand = restartCommand;
|
|
4
|
+
const args_1 = require("../args");
|
|
5
|
+
const errors_1 = require("../errors");
|
|
6
|
+
const output_1 = require("../output");
|
|
7
|
+
const paths_1 = require("../paths");
|
|
8
|
+
const run_state_1 = require("../run-state");
|
|
9
|
+
const start_1 = require("./start");
|
|
10
|
+
const stop_1 = require("./stop");
|
|
11
|
+
async function restartCommand(options, context = {}) {
|
|
12
|
+
const cwd = context.cwd ?? process.cwd();
|
|
13
|
+
const env = context.env ?? process.env;
|
|
14
|
+
const homeDir = (0, paths_1.resolveHomeDir)({ home: options.home, cwd, env });
|
|
15
|
+
const paths = (0, paths_1.buildCliPaths)(homeDir);
|
|
16
|
+
const existing = (0, run_state_1.readRunState)(paths.stateFile);
|
|
17
|
+
if (existing.state &&
|
|
18
|
+
(0, run_state_1.isProcessAlive)(existing.state.pid) &&
|
|
19
|
+
!(0, run_state_1.processLooksLikeService)(existing.state.pid, (0, paths_1.getPackageRoot)())) {
|
|
20
|
+
throw new errors_1.CliError(`运行状态文件记录的 PID ${existing.state.pid} 仍存活,但无法确认是 ${paths_1.APP_NAME} 进程。` +
|
|
21
|
+
`请先执行 ${paths_1.APP_NAME} stop --force 终止并清理状态文件,或手动删除 ${paths.stateFile}`);
|
|
22
|
+
}
|
|
23
|
+
const runningState = existing.state &&
|
|
24
|
+
(0, run_state_1.isProcessAlive)(existing.state.pid) &&
|
|
25
|
+
(0, run_state_1.processLooksLikeService)(existing.state.pid, (0, paths_1.getPackageRoot)())
|
|
26
|
+
? existing.state
|
|
27
|
+
: null;
|
|
28
|
+
const mode = options.daemon
|
|
29
|
+
? 'daemon'
|
|
30
|
+
: options.foreground
|
|
31
|
+
? 'foreground'
|
|
32
|
+
: (runningState?.mode ?? 'foreground');
|
|
33
|
+
const port = options.port ?? runningState?.port;
|
|
34
|
+
const envFile = options.envFile ?? runningState?.envFile ?? undefined;
|
|
35
|
+
if (runningState) {
|
|
36
|
+
(0, output_1.info)(`正在重启热点服务(当前 PID ${runningState.pid},端口 ${runningState.port})...`);
|
|
37
|
+
await (0, stop_1.stopCommand)({ ...options, command: 'stop', json: false }, context);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
if (existing.state || existing.corrupt) {
|
|
41
|
+
(0, output_1.warn)('清理了过期运行状态');
|
|
42
|
+
}
|
|
43
|
+
(0, output_1.info)('热点服务未在运行,将直接启动');
|
|
44
|
+
}
|
|
45
|
+
const startOptions = {
|
|
46
|
+
...options,
|
|
47
|
+
command: 'start',
|
|
48
|
+
commandExplicit: true,
|
|
49
|
+
help: false,
|
|
50
|
+
version: false,
|
|
51
|
+
json: false,
|
|
52
|
+
follow: false,
|
|
53
|
+
lines: args_1.DEFAULT_LOG_LINES,
|
|
54
|
+
daemon: mode === 'daemon',
|
|
55
|
+
foreground: false,
|
|
56
|
+
port,
|
|
57
|
+
envFile,
|
|
58
|
+
helpTarget: undefined,
|
|
59
|
+
};
|
|
60
|
+
return (0, start_1.startCommand)(startOptions, context);
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=restart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restart.js","sourceRoot":"","sources":["../../../src/cli/commands/restart.ts"],"names":[],"mappings":";;AAmBA,wCAiEC;AApFD,kCAA6D;A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inding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.startCommand = startCommand;
|
|
37
|
+
const config_1 = require("@nestjs/config");
|
|
38
|
+
const child_process_1 = require("child_process");
|
|
39
|
+
const fs_1 = require("fs");
|
|
40
|
+
const path_1 = require("path");
|
|
41
|
+
const env_1 = require("../env");
|
|
42
|
+
const errors_1 = require("../errors");
|
|
43
|
+
const health_1 = require("../health");
|
|
44
|
+
const log_file_1 = require("../log-file");
|
|
45
|
+
const output_1 = require("../output");
|
|
46
|
+
const paths_1 = require("../paths");
|
|
47
|
+
const run_state_1 = require("../run-state");
|
|
48
|
+
async function startCommand(options, context = {}) {
|
|
49
|
+
const cwd = context.cwd ?? process.cwd();
|
|
50
|
+
const env = context.env ?? process.env;
|
|
51
|
+
const homeDir = (0, paths_1.resolveHomeDir)({ home: options.home, cwd, env });
|
|
52
|
+
const paths = (0, paths_1.buildCliPaths)(homeDir);
|
|
53
|
+
const envResolution = (0, paths_1.resolveEnvFile)({
|
|
54
|
+
cwd,
|
|
55
|
+
homeDir,
|
|
56
|
+
envFile: options.envFile,
|
|
57
|
+
env,
|
|
58
|
+
});
|
|
59
|
+
if (envResolution) {
|
|
60
|
+
(0, env_1.applyEnvFile)(envResolution.path, env);
|
|
61
|
+
}
|
|
62
|
+
const port = (0, env_1.resolvePort)(options.port, env);
|
|
63
|
+
env.PORT = String(port);
|
|
64
|
+
assertNoRunningInstance(paths);
|
|
65
|
+
if (await (0, run_state_1.isPortInUse)(port)) {
|
|
66
|
+
throw new errors_1.CliError(`端口 ${port} 已被其他进程占用,请使用 --port 指定其他端口,或先停止占用进程`);
|
|
67
|
+
}
|
|
68
|
+
const target = {
|
|
69
|
+
cwd,
|
|
70
|
+
env,
|
|
71
|
+
paths,
|
|
72
|
+
port,
|
|
73
|
+
envFile: envResolution?.path ?? null,
|
|
74
|
+
};
|
|
75
|
+
if (options.daemon) {
|
|
76
|
+
return startDaemon(target);
|
|
77
|
+
}
|
|
78
|
+
const daemonChild = env[paths_1.DAEMON_CHILD_ENV] === '1';
|
|
79
|
+
delete env[paths_1.DAEMON_CHILD_ENV];
|
|
80
|
+
return startForeground(target, daemonChild ? 'daemon' : 'foreground');
|
|
81
|
+
}
|
|
82
|
+
function ensureStateDir(homeDir) {
|
|
83
|
+
try {
|
|
84
|
+
(0, fs_1.mkdirSync)((0, path_1.join)(homeDir, 'logs'), { recursive: true });
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
88
|
+
throw new errors_1.CliError(`无法创建状态目录 ${homeDir}: ${reason}。请检查 --home / DAILY_HOT_API_HOME 是否指向可写的目录`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function assertNoRunningInstance(paths) {
|
|
92
|
+
const existing = (0, run_state_1.readRunState)(paths.stateFile);
|
|
93
|
+
if (existing.corrupt) {
|
|
94
|
+
(0, output_1.warn)(`运行状态文件损坏,已清理: ${paths.stateFile}`);
|
|
95
|
+
(0, run_state_1.clearRunState)(paths.stateFile);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const state = existing.state;
|
|
99
|
+
if (!state) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if ((0, run_state_1.isProcessAlive)(state.pid)) {
|
|
103
|
+
if ((0, run_state_1.processLooksLikeService)(state.pid)) {
|
|
104
|
+
throw new errors_1.CliError(`热点服务已在运行(PID ${state.pid},端口 ${state.port})。如需重启请运行: ${paths_1.APP_NAME} restart`);
|
|
105
|
+
}
|
|
106
|
+
throw new errors_1.CliError(`运行状态文件记录的 PID ${state.pid} 仍存活,但无法确认是 ${paths_1.APP_NAME} 进程。` +
|
|
107
|
+
`请先执行 ${paths_1.APP_NAME} stop --force 终止并清理状态文件,或手动删除 ${paths.stateFile}`);
|
|
108
|
+
}
|
|
109
|
+
(0, output_1.warn)(`清理过期运行状态(PID ${state.pid} 已退出)`);
|
|
110
|
+
(0, run_state_1.clearRunState)(paths.stateFile, state.pid);
|
|
111
|
+
}
|
|
112
|
+
async function startForeground(target, mode) {
|
|
113
|
+
(0, output_1.info)(`正在启动 ${paths_1.APP_NAME}(${mode === 'daemon' ? '后台' : '前台'}模式)...`);
|
|
114
|
+
(0, output_1.info)(`端口: ${target.port}`);
|
|
115
|
+
if (target.envFile) {
|
|
116
|
+
(0, output_1.info)(`配置文件: ${target.envFile}`);
|
|
117
|
+
}
|
|
118
|
+
(0, output_1.info)(`状态目录: ${target.paths.homeDir}`);
|
|
119
|
+
const state = {
|
|
120
|
+
pid: process.pid,
|
|
121
|
+
port: target.port,
|
|
122
|
+
mode,
|
|
123
|
+
startedAt: new Date().toISOString(),
|
|
124
|
+
cwd: target.cwd,
|
|
125
|
+
envFile: target.envFile,
|
|
126
|
+
logFile: mode === 'daemon' ? target.paths.logFile : null,
|
|
127
|
+
version: (0, paths_1.getPackageVersion)(),
|
|
128
|
+
entry: (0, paths_1.getBinPath)(),
|
|
129
|
+
};
|
|
130
|
+
try {
|
|
131
|
+
(0, run_state_1.writeRunState)(target.paths.stateFile, state);
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
135
|
+
throw new errors_1.CliError(`无法写入运行状态文件(状态目录不可用): ${reason}。请检查 --home / DAILY_HOT_API_HOME 是否指向可写的目录`);
|
|
136
|
+
}
|
|
137
|
+
const clearStateFile = () => {
|
|
138
|
+
try {
|
|
139
|
+
(0, run_state_1.clearRunState)(target.paths.stateFile, process.pid);
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
process.once('exit', clearStateFile);
|
|
145
|
+
process.once('SIGINT', clearStateFile);
|
|
146
|
+
process.once('SIGTERM', clearStateFile);
|
|
147
|
+
process.once('SIGHUP', clearStateFile);
|
|
148
|
+
const { bootstrap } = await Promise.resolve().then(() => __importStar(require('../../main')));
|
|
149
|
+
let app;
|
|
150
|
+
try {
|
|
151
|
+
app = await bootstrap();
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
clearStateFile();
|
|
155
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
156
|
+
throw new errors_1.CliError(`服务启动失败: ${reason}`);
|
|
157
|
+
}
|
|
158
|
+
const config = app.get(config_1.ConfigService);
|
|
159
|
+
const actualPort = config.getOrThrow('PORT');
|
|
160
|
+
if (actualPort !== state.port) {
|
|
161
|
+
state.port = actualPort;
|
|
162
|
+
try {
|
|
163
|
+
(0, run_state_1.writeRunState)(target.paths.stateFile, state);
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
(0, output_1.info)(`热点服务已启动: http://localhost:${actualPort}`);
|
|
169
|
+
if (mode === 'daemon') {
|
|
170
|
+
(0, output_1.info)(`PID: ${process.pid}`);
|
|
171
|
+
(0, output_1.info)(`日志: ${target.paths.logFile}`);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
(0, output_1.info)(`PID: ${process.pid},按 Ctrl+C 停止服务`);
|
|
175
|
+
}
|
|
176
|
+
return errors_1.EXIT_CODES.ok;
|
|
177
|
+
}
|
|
178
|
+
async function startDaemon(target) {
|
|
179
|
+
ensureStateDir(target.paths.homeDir);
|
|
180
|
+
let logFd;
|
|
181
|
+
try {
|
|
182
|
+
logFd = (0, fs_1.openSync)(target.paths.logFile, 'a');
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
186
|
+
throw new errors_1.CliError(`无法写入日志文件 ${target.paths.logFile}: ${reason}。请检查状态目录是否可写`);
|
|
187
|
+
}
|
|
188
|
+
const startedAt = new Date().toISOString();
|
|
189
|
+
(0, fs_1.writeSync)(logFd, `\n[${startedAt}] ${paths_1.APP_NAME} background start (port=${target.port}${target.envFile ? `, env_file=${target.envFile}` : ''})\n`);
|
|
190
|
+
const childArgs = [(0, paths_1.getBinPath)(), 'start', '--home', target.paths.homeDir];
|
|
191
|
+
if (target.envFile) {
|
|
192
|
+
childArgs.push('--config', target.envFile);
|
|
193
|
+
}
|
|
194
|
+
const childEnv = {
|
|
195
|
+
...target.env,
|
|
196
|
+
PORT: String(target.port),
|
|
197
|
+
[paths_1.DAEMON_CHILD_ENV]: '1',
|
|
198
|
+
};
|
|
199
|
+
let child;
|
|
200
|
+
try {
|
|
201
|
+
child = (0, child_process_1.spawn)(process.execPath, childArgs, {
|
|
202
|
+
cwd: target.cwd,
|
|
203
|
+
detached: true,
|
|
204
|
+
stdio: ['ignore', logFd, logFd],
|
|
205
|
+
env: childEnv,
|
|
206
|
+
windowsHide: true,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
(0, fs_1.closeSync)(logFd);
|
|
211
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
212
|
+
throw new errors_1.CliError(`后台进程创建失败: ${reason}`);
|
|
213
|
+
}
|
|
214
|
+
(0, fs_1.closeSync)(logFd);
|
|
215
|
+
child.unref();
|
|
216
|
+
const childPid = child.pid;
|
|
217
|
+
if (!childPid) {
|
|
218
|
+
throw new errors_1.CliError('后台进程创建失败: 未返回进程 PID');
|
|
219
|
+
}
|
|
220
|
+
(0, output_1.info)(`正在后台启动 ${paths_1.APP_NAME}(PID ${childPid})...`);
|
|
221
|
+
const ready = await waitForDaemonReady(childPid, child, target.port, target.paths.stateFile);
|
|
222
|
+
if (!ready.ok) {
|
|
223
|
+
await terminateFailedChild(childPid, target.paths.stateFile);
|
|
224
|
+
const reason = ready.reason === 'timeout'
|
|
225
|
+
? `等待服务就绪超时(${Math.round(paths_1.START_TIMEOUT_MS / 1000)} 秒)`
|
|
226
|
+
: `后台进程提前退出(退出码 ${ready.exitCode ?? 'unknown'})`;
|
|
227
|
+
const logTail = safeTailLog(target.paths.logFile, 30);
|
|
228
|
+
throw new errors_1.CliError([
|
|
229
|
+
`后台启动失败: ${reason}`,
|
|
230
|
+
`日志: ${target.paths.logFile}`,
|
|
231
|
+
logTail ? `最近日志:\n${logTail}` : '',
|
|
232
|
+
]
|
|
233
|
+
.filter(Boolean)
|
|
234
|
+
.join('\n'));
|
|
235
|
+
}
|
|
236
|
+
(0, output_1.info)(`热点服务已在后台启动: http://localhost:${target.port}`);
|
|
237
|
+
(0, output_1.field)('PID', childPid);
|
|
238
|
+
(0, output_1.field)('日志', target.paths.logFile);
|
|
239
|
+
(0, output_1.info)(`停止: ${paths_1.APP_NAME} stop 状态: ${paths_1.APP_NAME} status 日志: ${paths_1.APP_NAME} logs -f`);
|
|
240
|
+
return errors_1.EXIT_CODES.ok;
|
|
241
|
+
}
|
|
242
|
+
async function waitForDaemonReady(pid, child, port, stateFile) {
|
|
243
|
+
const deadline = Date.now() + paths_1.START_TIMEOUT_MS;
|
|
244
|
+
while (Date.now() < deadline) {
|
|
245
|
+
if (!(0, run_state_1.isProcessAlive)(pid) || child.exitCode !== null) {
|
|
246
|
+
return { ok: false, reason: 'exited', exitCode: child.exitCode };
|
|
247
|
+
}
|
|
248
|
+
const { state } = (0, run_state_1.readRunState)(stateFile);
|
|
249
|
+
if (state?.pid === pid && (await (0, health_1.checkHealth)(port))) {
|
|
250
|
+
return { ok: true };
|
|
251
|
+
}
|
|
252
|
+
await (0, run_state_1.sleep)(paths_1.START_POLL_INTERVAL_MS);
|
|
253
|
+
}
|
|
254
|
+
return { ok: false, reason: 'timeout' };
|
|
255
|
+
}
|
|
256
|
+
async function terminateFailedChild(pid, stateFile) {
|
|
257
|
+
try {
|
|
258
|
+
process.kill(pid, 'SIGTERM');
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
}
|
|
262
|
+
if (!(await (0, run_state_1.waitForProcessExit)(pid, 3000))) {
|
|
263
|
+
try {
|
|
264
|
+
process.kill(pid, 'SIGKILL');
|
|
265
|
+
}
|
|
266
|
+
catch {
|
|
267
|
+
}
|
|
268
|
+
await (0, run_state_1.waitForProcessExit)(pid, 2000);
|
|
269
|
+
}
|
|
270
|
+
(0, run_state_1.clearRunState)(stateFile, pid);
|
|
271
|
+
}
|
|
272
|
+
function safeTailLog(logFile, lines) {
|
|
273
|
+
try {
|
|
274
|
+
return (0, log_file_1.tailFile)(logFile, lines);
|
|
275
|
+
}
|
|
276
|
+
catch {
|
|
277
|
+
return '';
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=start.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/cli/commands/start.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,oCA8CC;AAhGD,2CAA+C;AAC/C,iDAAyD;AACzD,2BAA+D;AAC/D,+BAA4B;AAG5B,gCAAmD;AACnD,sCAAiD;AACjD,sCAAwC;AACxC,0CAAuC;AACvC,sCAA8C;AAC9C,oCAWkB;AAClB,4CAWsB;AAgBf,KAAK,UAAU,YAAY,CAChC,OAAmB,EACnB,UAAmC,EAAE;IAErC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACzC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACvC,MAAM,OAAO,GAAG,IAAA,sBAAc,EAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IACjE,MAAM,KAAK,GAAG,IAAA,qBAAa,EAAC,OAAO,CAAC,CAAC;IAErC,MAAM,aAAa,GAAG,IAAA,sBAAc,EAAC;QACnC,GAAG;QACH,OAAO;QACP,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,GAAG;KACJ,CAAC,CAAC;IACH,IAAI,aAAa,EAAE,CAAC;QAClB,IAAA,kBAAY,EAAC,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,IAAI,GAAG,IAAA,iBAAW,EAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC5C,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAExB,uBAAuB,CAAC,KAAK,CAAC,CAAC;IAE/B,IAAI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K,EAAE,GAAG,KAAK,GAAG,IAAI,CAAC,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YACpD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;QACtB,CAAC;QAED,MAAM,IAAA,iBAAK,EAAC,8BAAsB,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAC1C,CAAC;AAED,KAAK,UAAU,oBAAoB,CACjC,GAAW,EACX,SAAiB;IAEjB,IAAI,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;IAET,CAAC;IACD,IAAI,CAAC,CAAC,MAAM,IAAA,8BAAkB,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC;QAC3C,IAAI,CAAC;YACH,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAC/B,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;QACD,MAAM,IAAA,8BAAkB,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,IAAA,yBAAa,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,WAAW,CAAC,OAAe,EAAE,KAAa;IACjD,IAAI,CAAC;QACH,OAAO,IAAA,mBAAQ,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.statusCommand = statusCommand;
|
|
4
|
+
const errors_1 = require("../errors");
|
|
5
|
+
const health_1 = require("../health");
|
|
6
|
+
const output_1 = require("../output");
|
|
7
|
+
const paths_1 = require("../paths");
|
|
8
|
+
const run_state_1 = require("../run-state");
|
|
9
|
+
async function statusCommand(options, context = {}) {
|
|
10
|
+
const cwd = context.cwd ?? process.cwd();
|
|
11
|
+
const env = context.env ?? process.env;
|
|
12
|
+
const homeDir = (0, paths_1.resolveHomeDir)({ home: options.home, cwd, env });
|
|
13
|
+
const paths = (0, paths_1.buildCliPaths)(homeDir);
|
|
14
|
+
const existing = (0, run_state_1.readRunState)(paths.stateFile);
|
|
15
|
+
if (existing.corrupt) {
|
|
16
|
+
(0, run_state_1.clearRunState)(paths.stateFile);
|
|
17
|
+
return reportNotRunning(options.json, '运行状态文件损坏,已清理', paths);
|
|
18
|
+
}
|
|
19
|
+
const state = existing.state;
|
|
20
|
+
if (!state) {
|
|
21
|
+
return reportNotRunning(options.json, '未找到运行状态', paths);
|
|
22
|
+
}
|
|
23
|
+
if (!(0, run_state_1.isProcessAlive)(state.pid)) {
|
|
24
|
+
(0, run_state_1.clearRunState)(paths.stateFile, state.pid);
|
|
25
|
+
return reportNotRunning(options.json, `PID ${state.pid} 已退出,已清理过期状态文件`, paths);
|
|
26
|
+
}
|
|
27
|
+
if (!(0, run_state_1.processLooksLikeService)(state.pid, (0, paths_1.getPackageRoot)())) {
|
|
28
|
+
return reportNotRunning(options.json, `PID ${state.pid} 仍存活但无法确认是 daily-hot-api 进程,状态文件可能已过期;可执行 daily-hot-api stop --force 清理`, paths);
|
|
29
|
+
}
|
|
30
|
+
const health = await (0, health_1.checkHealth)(state.port);
|
|
31
|
+
const startedAtMs = Date.parse(state.startedAt);
|
|
32
|
+
const uptimeSeconds = Number.isFinite(startedAtMs)
|
|
33
|
+
? Math.max(0, Math.floor((Date.now() - startedAtMs) / 1000))
|
|
34
|
+
: 0;
|
|
35
|
+
const url = `http://localhost:${state.port}`;
|
|
36
|
+
if (options.json) {
|
|
37
|
+
console.log(JSON.stringify({
|
|
38
|
+
running: true,
|
|
39
|
+
pid: state.pid,
|
|
40
|
+
port: state.port,
|
|
41
|
+
url,
|
|
42
|
+
mode: state.mode,
|
|
43
|
+
startedAt: state.startedAt,
|
|
44
|
+
uptimeSeconds,
|
|
45
|
+
health,
|
|
46
|
+
cwd: state.cwd,
|
|
47
|
+
envFile: state.envFile,
|
|
48
|
+
logFile: state.logFile,
|
|
49
|
+
version: state.version,
|
|
50
|
+
}, null, 2));
|
|
51
|
+
return errors_1.EXIT_CODES.ok;
|
|
52
|
+
}
|
|
53
|
+
(0, output_1.info)('热点服务运行中');
|
|
54
|
+
(0, output_1.field)('PID', state.pid);
|
|
55
|
+
(0, output_1.field)('端口', state.port);
|
|
56
|
+
(0, output_1.field)('地址', url);
|
|
57
|
+
(0, output_1.field)('模式', state.mode === 'daemon' ? '后台 (daemon)' : '前台 (foreground)');
|
|
58
|
+
(0, output_1.field)('启动时间', `${state.startedAt}(已运行 ${(0, output_1.formatDuration)(uptimeSeconds)})`);
|
|
59
|
+
(0, output_1.field)('健康检查', health ? 'ok' : '无响应(进程存在但 /health 不可达)');
|
|
60
|
+
if (state.envFile) {
|
|
61
|
+
(0, output_1.field)('配置文件', state.envFile);
|
|
62
|
+
}
|
|
63
|
+
(0, output_1.field)('运行目录', state.cwd || 'unknown');
|
|
64
|
+
if (state.logFile) {
|
|
65
|
+
(0, output_1.field)('日志文件', state.logFile);
|
|
66
|
+
}
|
|
67
|
+
return errors_1.EXIT_CODES.ok;
|
|
68
|
+
}
|
|
69
|
+
function reportNotRunning(json, reason, paths) {
|
|
70
|
+
if (json) {
|
|
71
|
+
console.log(JSON.stringify({ running: false, reason, stateFile: paths.stateFile }));
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
(0, output_1.info)(`热点服务未在运行(${reason})`);
|
|
75
|
+
}
|
|
76
|
+
return errors_1.EXIT_CODES.notRunning;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/cli/commands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IACD,OAAO,mBAAU,CAAC,UAAU,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CliOptions } from '../args';
|
|
2
|
+
import type { CommandContext } from '../context';
|
|
3
|
+
export interface StopOutcome {
|
|
4
|
+
stopped: boolean;
|
|
5
|
+
stale: boolean;
|
|
6
|
+
forced: boolean;
|
|
7
|
+
pid?: number;
|
|
8
|
+
port?: number;
|
|
9
|
+
message: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function stopCommand(options: CliOptions, context?: Partial<CommandContext>): Promise<number>;
|
|
12
|
+
export declare function stopService(options: CliOptions, context?: Partial<CommandContext>): Promise<StopOutcome>;
|