@ttkit/daily-hot-api 0.0.0-stage → 0.1.1

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.
Files changed (450) hide show
  1. package/.env.example +77 -0
  2. package/LICENSE +21 -0
  3. package/README.md +317 -2
  4. package/bin/daily-hot-api.js +25 -0
  5. package/dist/app.controller.d.ts +41 -0
  6. package/dist/app.controller.js +91 -0
  7. package/dist/app.controller.js.map +1 -0
  8. package/dist/app.module.d.ts +4 -0
  9. package/dist/app.module.js +44 -0
  10. package/dist/app.module.js.map +1 -0
  11. package/dist/app.service.d.ts +19 -0
  12. package/dist/app.service.js +57 -0
  13. package/dist/app.service.js.map +1 -0
  14. package/dist/cache/cache.module.d.ts +2 -0
  15. package/dist/cache/cache.module.js +52 -0
  16. package/dist/cache/cache.module.js.map +1 -0
  17. package/dist/cache/cache.service.d.ts +26 -0
  18. package/dist/cache/cache.service.js +163 -0
  19. package/dist/cache/cache.service.js.map +1 -0
  20. package/dist/cli/args.d.ts +24 -0
  21. package/dist/cli/args.js +261 -0
  22. package/dist/cli/args.js.map +1 -0
  23. package/dist/cli/commands/logs.d.ts +3 -0
  24. package/dist/cli/commands/logs.js +55 -0
  25. package/dist/cli/commands/logs.js.map +1 -0
  26. package/dist/cli/commands/restart.d.ts +3 -0
  27. package/dist/cli/commands/restart.js +62 -0
  28. package/dist/cli/commands/restart.js.map +1 -0
  29. package/dist/cli/commands/start.d.ts +3 -0
  30. package/dist/cli/commands/start.js +280 -0
  31. package/dist/cli/commands/start.js.map +1 -0
  32. package/dist/cli/commands/status.d.ts +3 -0
  33. package/dist/cli/commands/status.js +78 -0
  34. package/dist/cli/commands/status.js.map +1 -0
  35. package/dist/cli/commands/stop.d.ts +12 -0
  36. package/dist/cli/commands/stop.js +135 -0
  37. package/dist/cli/commands/stop.js.map +1 -0
  38. package/dist/cli/context.d.ts +4 -0
  39. package/dist/cli/context.js +3 -0
  40. package/dist/cli/context.js.map +1 -0
  41. package/dist/cli/env.d.ts +2 -0
  42. package/dist/cli/env.js +80 -0
  43. package/dist/cli/env.js.map +1 -0
  44. package/dist/cli/errors.d.ts +14 -0
  45. package/dist/cli/errors.js +25 -0
  46. package/dist/cli/errors.js.map +1 -0
  47. package/dist/cli/health.d.ts +2 -0
  48. package/dist/cli/health.js +44 -0
  49. package/dist/cli/health.js.map +1 -0
  50. package/dist/cli/help.d.ts +3 -0
  51. package/dist/cli/help.js +158 -0
  52. package/dist/cli/help.js.map +1 -0
  53. package/dist/cli/index.d.ts +2 -0
  54. package/dist/cli/index.js +94 -0
  55. package/dist/cli/index.js.map +1 -0
  56. package/dist/cli/log-file.d.ts +8 -0
  57. package/dist/cli/log-file.js +58 -0
  58. package/dist/cli/log-file.js.map +1 -0
  59. package/dist/cli/output.d.ts +7 -0
  60. package/dist/cli/output.js +46 -0
  61. package/dist/cli/output.js.map +1 -0
  62. package/dist/cli/paths.d.ts +33 -0
  63. package/dist/cli/paths.js +76 -0
  64. package/dist/cli/paths.js.map +1 -0
  65. package/dist/cli/run-state.d.ts +25 -0
  66. package/dist/cli/run-state.js +159 -0
  67. package/dist/cli/run-state.js.map +1 -0
  68. package/dist/common/middlewares/logger.middleware.d.ts +7 -0
  69. package/dist/common/middlewares/logger.middleware.js +29 -0
  70. package/dist/common/middlewares/logger.middleware.js.map +1 -0
  71. package/dist/config/config.module.d.ts +2 -0
  72. package/dist/config/config.module.js +47 -0
  73. package/dist/config/config.module.js.map +1 -0
  74. package/dist/config/configuration.d.ts +3 -0
  75. package/dist/config/configuration.js +5 -0
  76. package/dist/config/configuration.js.map +1 -0
  77. package/dist/config/validation.schema.d.ts +114 -0
  78. package/dist/config/validation.schema.js +69 -0
  79. package/dist/config/validation.schema.js.map +1 -0
  80. package/dist/daily-brief/clients/ai-analysis.client.d.ts +20 -0
  81. package/dist/daily-brief/clients/ai-analysis.client.js +217 -0
  82. package/dist/daily-brief/clients/ai-analysis.client.js.map +1 -0
  83. package/dist/daily-brief/clients/brief-search.service.d.ts +11 -0
  84. package/dist/daily-brief/clients/brief-search.service.js +52 -0
  85. package/dist/daily-brief/clients/brief-search.service.js.map +1 -0
  86. package/dist/daily-brief/clients/deepseek-search.client.d.ts +11 -0
  87. package/dist/daily-brief/clients/deepseek-search.client.js +70 -0
  88. package/dist/daily-brief/clients/deepseek-search.client.js.map +1 -0
  89. package/dist/daily-brief/clients/tavily-search.client.d.ts +11 -0
  90. package/dist/daily-brief/clients/tavily-search.client.js +72 -0
  91. package/dist/daily-brief/clients/tavily-search.client.js.map +1 -0
  92. package/dist/daily-brief/daily-brief.config.d.ts +31 -0
  93. package/dist/daily-brief/daily-brief.config.js +108 -0
  94. package/dist/daily-brief/daily-brief.config.js.map +1 -0
  95. package/dist/daily-brief/daily-brief.controller.d.ts +72 -0
  96. package/dist/daily-brief/daily-brief.controller.js +169 -0
  97. package/dist/daily-brief/daily-brief.controller.js.map +1 -0
  98. package/dist/daily-brief/daily-brief.module.d.ts +2 -0
  99. package/dist/daily-brief/daily-brief.module.js +49 -0
  100. package/dist/daily-brief/daily-brief.module.js.map +1 -0
  101. package/dist/daily-brief/daily-brief.scheduler.d.ts +30 -0
  102. package/dist/daily-brief/daily-brief.scheduler.js +113 -0
  103. package/dist/daily-brief/daily-brief.scheduler.js.map +1 -0
  104. package/dist/daily-brief/daily-brief.service.d.ts +101 -0
  105. package/dist/daily-brief/daily-brief.service.js +412 -0
  106. package/dist/daily-brief/daily-brief.service.js.map +1 -0
  107. package/dist/daily-brief/dto/brief-date-param.dto.d.ts +3 -0
  108. package/dist/daily-brief/dto/brief-date-param.dto.js +23 -0
  109. package/dist/daily-brief/dto/brief-date-param.dto.js.map +1 -0
  110. package/dist/daily-brief/dto/generate-brief.dto.d.ts +6 -0
  111. package/dist/daily-brief/dto/generate-brief.dto.js +39 -0
  112. package/dist/daily-brief/dto/generate-brief.dto.js.map +1 -0
  113. package/dist/daily-brief/dto/list-briefs-query.dto.d.ts +6 -0
  114. package/dist/daily-brief/dto/list-briefs-query.dto.js +42 -0
  115. package/dist/daily-brief/dto/list-briefs-query.dto.js.map +1 -0
  116. package/dist/daily-brief/dto/stock-ranking-query.dto.d.ts +6 -0
  117. package/dist/daily-brief/dto/stock-ranking-query.dto.js +46 -0
  118. package/dist/daily-brief/dto/stock-ranking-query.dto.js.map +1 -0
  119. package/dist/daily-brief/interfaces/daily-brief.interface.d.ts +59 -0
  120. package/dist/daily-brief/interfaces/daily-brief.interface.js +3 -0
  121. package/dist/daily-brief/interfaces/daily-brief.interface.js.map +1 -0
  122. package/dist/daily-brief/interfaces/search-provider.interface.d.ts +11 -0
  123. package/dist/daily-brief/interfaces/search-provider.interface.js +3 -0
  124. package/dist/daily-brief/interfaces/search-provider.interface.js.map +1 -0
  125. package/dist/daily-brief/utils/brief-date.d.ts +2 -0
  126. package/dist/daily-brief/utils/brief-date.js +16 -0
  127. package/dist/daily-brief/utils/brief-date.js.map +1 -0
  128. package/dist/daily-brief/utils/concurrency.d.ts +1 -0
  129. package/dist/daily-brief/utils/concurrency.js +20 -0
  130. package/dist/daily-brief/utils/concurrency.js.map +1 -0
  131. package/dist/database/database.module.d.ts +2 -0
  132. package/dist/database/database.module.js +57 -0
  133. package/dist/database/database.module.js.map +1 -0
  134. package/dist/database/repositories/daily-brief.repository.d.ts +96 -0
  135. package/dist/database/repositories/daily-brief.repository.js +457 -0
  136. package/dist/database/repositories/daily-brief.repository.js.map +1 -0
  137. package/dist/database/repositories/hot-item.repository.d.ts +52 -0
  138. package/dist/database/repositories/hot-item.repository.js +255 -0
  139. package/dist/database/repositories/hot-item.repository.js.map +1 -0
  140. package/dist/database/repositories/source-config.repository.d.ts +15 -0
  141. package/dist/database/repositories/source-config.repository.js +77 -0
  142. package/dist/database/repositories/source-config.repository.js.map +1 -0
  143. package/dist/database/schemas/daily-brief.schema.d.ts +30 -0
  144. package/dist/database/schemas/daily-brief.schema.js +103 -0
  145. package/dist/database/schemas/daily-brief.schema.js.map +1 -0
  146. package/dist/database/schemas/hot-item.schema.d.ts +20 -0
  147. package/dist/database/schemas/hot-item.schema.js +72 -0
  148. package/dist/database/schemas/hot-item.schema.js.map +1 -0
  149. package/dist/database/schemas/source-config.schema.d.ts +15 -0
  150. package/dist/database/schemas/source-config.schema.js +47 -0
  151. package/dist/database/schemas/source-config.schema.js.map +1 -0
  152. package/dist/history/dto/history-response.dto.d.ts +17 -0
  153. package/dist/history/dto/history-response.dto.js +13 -0
  154. package/dist/history/dto/history-response.dto.js.map +1 -0
  155. package/dist/history/dto/search-history.dto.d.ts +10 -0
  156. package/dist/history/dto/search-history.dto.js +72 -0
  157. package/dist/history/dto/search-history.dto.js.map +1 -0
  158. package/dist/history/history.controller.d.ts +13 -0
  159. package/dist/history/history.controller.js +92 -0
  160. package/dist/history/history.controller.js.map +1 -0
  161. package/dist/history/history.module.d.ts +2 -0
  162. package/dist/history/history.module.js +25 -0
  163. package/dist/history/history.module.js.map +1 -0
  164. package/dist/history/history.service.d.ts +15 -0
  165. package/dist/history/history.service.js +68 -0
  166. package/dist/history/history.service.js.map +1 -0
  167. package/dist/host-lists/decorators/hot-source.decorator.d.ts +9 -0
  168. package/dist/host-lists/decorators/hot-source.decorator.js +11 -0
  169. package/dist/host-lists/decorators/hot-source.decorator.js.map +1 -0
  170. package/dist/host-lists/dto/hot-list.dto.d.ts +14 -0
  171. package/dist/host-lists/dto/hot-list.dto.js +94 -0
  172. package/dist/host-lists/dto/hot-list.dto.js.map +1 -0
  173. package/dist/host-lists/hot-lists.controller.d.ts +39 -0
  174. package/dist/host-lists/hot-lists.controller.js +87 -0
  175. package/dist/host-lists/hot-lists.controller.js.map +1 -0
  176. package/dist/host-lists/hot-lists.module.d.ts +2 -0
  177. package/dist/host-lists/hot-lists.module.js +36 -0
  178. package/dist/host-lists/hot-lists.module.js.map +1 -0
  179. package/dist/host-lists/hot-lists.service.d.ts +21 -0
  180. package/dist/host-lists/hot-lists.service.js +115 -0
  181. package/dist/host-lists/hot-lists.service.js.map +1 -0
  182. package/dist/host-lists/interfaces/hot-list-source.interface.d.ts +5 -0
  183. package/dist/host-lists/interfaces/hot-list-source.interface.js +3 -0
  184. package/dist/host-lists/interfaces/hot-list-source.interface.js.map +1 -0
  185. package/dist/host-lists/interfaces/hot-list.interface.d.ts +31 -0
  186. package/dist/host-lists/interfaces/hot-list.interface.js +3 -0
  187. package/dist/host-lists/interfaces/hot-list.interface.js.map +1 -0
  188. package/dist/host-lists/interfaces/router-data.interface.d.ts +19 -0
  189. package/dist/host-lists/interfaces/router-data.interface.js +3 -0
  190. package/dist/host-lists/interfaces/router-data.interface.js.map +1 -0
  191. package/dist/host-lists/sources/36kr.source.d.ts +9 -0
  192. package/dist/host-lists/sources/36kr.source.js +89 -0
  193. package/dist/host-lists/sources/36kr.source.js.map +1 -0
  194. package/dist/host-lists/sources/51cto.source.d.ts +11 -0
  195. package/dist/host-lists/sources/51cto.source.js +71 -0
  196. package/dist/host-lists/sources/51cto.source.js.map +1 -0
  197. package/dist/host-lists/sources/52pojie.source.d.ts +9 -0
  198. package/dist/host-lists/sources/52pojie.source.js +109 -0
  199. package/dist/host-lists/sources/52pojie.source.js.map +1 -0
  200. package/dist/host-lists/sources/acfun.source.d.ts +9 -0
  201. package/dist/host-lists/sources/acfun.source.js +90 -0
  202. package/dist/host-lists/sources/acfun.source.js.map +1 -0
  203. package/dist/host-lists/sources/baidu.source.d.ts +9 -0
  204. package/dist/host-lists/sources/baidu.source.js +85 -0
  205. package/dist/host-lists/sources/baidu.source.js.map +1 -0
  206. package/dist/host-lists/sources/bilibili.source.d.ts +14 -0
  207. package/dist/host-lists/sources/bilibili.source.js +188 -0
  208. package/dist/host-lists/sources/bilibili.source.js.map +1 -0
  209. package/dist/host-lists/sources/caixin.source.d.ts +9 -0
  210. package/dist/host-lists/sources/caixin.source.js +102 -0
  211. package/dist/host-lists/sources/caixin.source.js.map +1 -0
  212. package/dist/host-lists/sources/cls.source.d.ts +9 -0
  213. package/dist/host-lists/sources/cls.source.js +62 -0
  214. package/dist/host-lists/sources/cls.source.js.map +1 -0
  215. package/dist/host-lists/sources/coolapk.source.d.ts +9 -0
  216. package/dist/host-lists/sources/coolapk.source.js +57 -0
  217. package/dist/host-lists/sources/coolapk.source.js.map +1 -0
  218. package/dist/host-lists/sources/csdn.source.d.ts +9 -0
  219. package/dist/host-lists/sources/csdn.source.js +59 -0
  220. package/dist/host-lists/sources/csdn.source.js.map +1 -0
  221. package/dist/host-lists/sources/dgtle.source.d.ts +9 -0
  222. package/dist/host-lists/sources/dgtle.source.js +57 -0
  223. package/dist/host-lists/sources/dgtle.source.js.map +1 -0
  224. package/dist/host-lists/sources/douban-group.source.d.ts +11 -0
  225. package/dist/host-lists/sources/douban-group.source.js +100 -0
  226. package/dist/host-lists/sources/douban-group.source.js.map +1 -0
  227. package/dist/host-lists/sources/douban-movie.source.d.ts +10 -0
  228. package/dist/host-lists/sources/douban-movie.source.js +103 -0
  229. package/dist/host-lists/sources/douban-movie.source.js.map +1 -0
  230. package/dist/host-lists/sources/douyin.d.ts +16 -0
  231. package/dist/host-lists/sources/douyin.js +215 -0
  232. package/dist/host-lists/sources/douyin.js.map +1 -0
  233. package/dist/host-lists/sources/eastmoney-stock.source.d.ts +11 -0
  234. package/dist/host-lists/sources/eastmoney-stock.source.js +151 -0
  235. package/dist/host-lists/sources/eastmoney-stock.source.js.map +1 -0
  236. package/dist/host-lists/sources/eastmoney.source.d.ts +9 -0
  237. package/dist/host-lists/sources/eastmoney.source.js +86 -0
  238. package/dist/host-lists/sources/eastmoney.source.js.map +1 -0
  239. package/dist/host-lists/sources/geekpark.source.d.ts +9 -0
  240. package/dist/host-lists/sources/geekpark.source.js +60 -0
  241. package/dist/host-lists/sources/geekpark.source.js.map +1 -0
  242. package/dist/host-lists/sources/gelonghui.source.d.ts +9 -0
  243. package/dist/host-lists/sources/gelonghui.source.js +139 -0
  244. package/dist/host-lists/sources/gelonghui.source.js.map +1 -0
  245. package/dist/host-lists/sources/github.source.d.ts +12 -0
  246. package/dist/host-lists/sources/github.source.js +171 -0
  247. package/dist/host-lists/sources/github.source.js.map +1 -0
  248. package/dist/host-lists/sources/guokr.source.d.ts +11 -0
  249. package/dist/host-lists/sources/guokr.source.js +98 -0
  250. package/dist/host-lists/sources/guokr.source.js.map +1 -0
  251. package/dist/host-lists/sources/hackernews.source.d.ts +11 -0
  252. package/dist/host-lists/sources/hackernews.source.js +121 -0
  253. package/dist/host-lists/sources/hackernews.source.js.map +1 -0
  254. package/dist/host-lists/sources/hellogithub.source.d.ts +11 -0
  255. package/dist/host-lists/sources/hellogithub.source.js +98 -0
  256. package/dist/host-lists/sources/hellogithub.source.js.map +1 -0
  257. package/dist/host-lists/sources/history.source.d.ts +11 -0
  258. package/dist/host-lists/sources/history.source.js +92 -0
  259. package/dist/host-lists/sources/history.source.js.map +1 -0
  260. package/dist/host-lists/sources/honkai.source.d.ts +9 -0
  261. package/dist/host-lists/sources/honkai.source.js +72 -0
  262. package/dist/host-lists/sources/honkai.source.js.map +1 -0
  263. package/dist/host-lists/sources/hostloc.source.d.ts +9 -0
  264. package/dist/host-lists/sources/hostloc.source.js +75 -0
  265. package/dist/host-lists/sources/hostloc.source.js.map +1 -0
  266. package/dist/host-lists/sources/hupu.source.d.ts +9 -0
  267. package/dist/host-lists/sources/hupu.source.js +73 -0
  268. package/dist/host-lists/sources/hupu.source.js.map +1 -0
  269. package/dist/host-lists/sources/huxiu.source.d.ts +9 -0
  270. package/dist/host-lists/sources/huxiu.source.js +153 -0
  271. package/dist/host-lists/sources/huxiu.source.js.map +1 -0
  272. package/dist/host-lists/sources/ifanr.source.d.ts +9 -0
  273. package/dist/host-lists/sources/ifanr.source.js +57 -0
  274. package/dist/host-lists/sources/ifanr.source.js.map +1 -0
  275. package/dist/host-lists/sources/index.d.ts +2 -0
  276. package/dist/host-lists/sources/index.js +134 -0
  277. package/dist/host-lists/sources/index.js.map +1 -0
  278. package/dist/host-lists/sources/ithome-xijiayi.source.d.ts +9 -0
  279. package/dist/host-lists/sources/ithome-xijiayi.source.js +75 -0
  280. package/dist/host-lists/sources/ithome-xijiayi.source.js.map +1 -0
  281. package/dist/host-lists/sources/ithome.source.d.ts +9 -0
  282. package/dist/host-lists/sources/ithome.source.js +71 -0
  283. package/dist/host-lists/sources/ithome.source.js.map +1 -0
  284. package/dist/host-lists/sources/jd.source.d.ts +9 -0
  285. package/dist/host-lists/sources/jd.source.js +82 -0
  286. package/dist/host-lists/sources/jd.source.js.map +1 -0
  287. package/dist/host-lists/sources/jianshu.source.d.ts +9 -0
  288. package/dist/host-lists/sources/jianshu.source.js +72 -0
  289. package/dist/host-lists/sources/jianshu.source.js.map +1 -0
  290. package/dist/host-lists/sources/jin10.source.d.ts +9 -0
  291. package/dist/host-lists/sources/jin10.source.js +63 -0
  292. package/dist/host-lists/sources/jin10.source.js.map +1 -0
  293. package/dist/host-lists/sources/juejin.source.d.ts +10 -0
  294. package/dist/host-lists/sources/juejin.source.js +81 -0
  295. package/dist/host-lists/sources/juejin.source.js.map +1 -0
  296. package/dist/host-lists/sources/kuaishou.source.d.ts +13 -0
  297. package/dist/host-lists/sources/kuaishou.source.js +179 -0
  298. package/dist/host-lists/sources/kuaishou.source.js.map +1 -0
  299. package/dist/host-lists/sources/linuxdo.source.d.ts +9 -0
  300. package/dist/host-lists/sources/linuxdo.source.js +62 -0
  301. package/dist/host-lists/sources/linuxdo.source.js.map +1 -0
  302. package/dist/host-lists/sources/lol.source.d.ts +9 -0
  303. package/dist/host-lists/sources/lol.source.js +58 -0
  304. package/dist/host-lists/sources/lol.source.js.map +1 -0
  305. package/dist/host-lists/sources/miyoushe.source.d.ts +9 -0
  306. package/dist/host-lists/sources/miyoushe.source.js +88 -0
  307. package/dist/host-lists/sources/miyoushe.source.js.map +1 -0
  308. package/dist/host-lists/sources/netease-news.source.d.ts +9 -0
  309. package/dist/host-lists/sources/netease-news.source.js +56 -0
  310. package/dist/host-lists/sources/netease-news.source.js.map +1 -0
  311. package/dist/host-lists/sources/ngabbs.source.d.ts +9 -0
  312. package/dist/host-lists/sources/ngabbs.source.js +70 -0
  313. package/dist/host-lists/sources/ngabbs.source.js.map +1 -0
  314. package/dist/host-lists/sources/nodeseek.source.d.ts +9 -0
  315. package/dist/host-lists/sources/nodeseek.source.js +62 -0
  316. package/dist/host-lists/sources/nodeseek.source.js.map +1 -0
  317. package/dist/host-lists/sources/nytimes.source.d.ts +9 -0
  318. package/dist/host-lists/sources/nytimes.source.js +77 -0
  319. package/dist/host-lists/sources/nytimes.source.js.map +1 -0
  320. package/dist/host-lists/sources/producthunt.source.d.ts +9 -0
  321. package/dist/host-lists/sources/producthunt.source.js +75 -0
  322. package/dist/host-lists/sources/producthunt.source.js.map +1 -0
  323. package/dist/host-lists/sources/qq-news.source.d.ts +9 -0
  324. package/dist/host-lists/sources/qq-news.source.js +53 -0
  325. package/dist/host-lists/sources/qq-news.source.js.map +1 -0
  326. package/dist/host-lists/sources/sina-news.source.d.ts +9 -0
  327. package/dist/host-lists/sources/sina-news.source.js +98 -0
  328. package/dist/host-lists/sources/sina-news.source.js.map +1 -0
  329. package/dist/host-lists/sources/sina.source.d.ts +9 -0
  330. package/dist/host-lists/sources/sina.source.js +78 -0
  331. package/dist/host-lists/sources/sina.source.js.map +1 -0
  332. package/dist/host-lists/sources/smzdm.source.d.ts +9 -0
  333. package/dist/host-lists/sources/smzdm.source.js +71 -0
  334. package/dist/host-lists/sources/smzdm.source.js.map +1 -0
  335. package/dist/host-lists/sources/sspai.source.d.ts +9 -0
  336. package/dist/host-lists/sources/sspai.source.js +69 -0
  337. package/dist/host-lists/sources/sspai.source.js.map +1 -0
  338. package/dist/host-lists/sources/starrail.source.d.ts +9 -0
  339. package/dist/host-lists/sources/starrail.source.js +72 -0
  340. package/dist/host-lists/sources/starrail.source.js.map +1 -0
  341. package/dist/host-lists/sources/taobao.source.d.ts +10 -0
  342. package/dist/host-lists/sources/taobao.source.js +169 -0
  343. package/dist/host-lists/sources/taobao.source.js.map +1 -0
  344. package/dist/host-lists/sources/thepaper.source.d.ts +9 -0
  345. package/dist/host-lists/sources/thepaper.source.js +56 -0
  346. package/dist/host-lists/sources/thepaper.source.js.map +1 -0
  347. package/dist/host-lists/sources/tieba.source.d.ts +9 -0
  348. package/dist/host-lists/sources/tieba.source.js +58 -0
  349. package/dist/host-lists/sources/tieba.source.js.map +1 -0
  350. package/dist/host-lists/sources/tonghuashun.source.d.ts +9 -0
  351. package/dist/host-lists/sources/tonghuashun.source.js +112 -0
  352. package/dist/host-lists/sources/tonghuashun.source.js.map +1 -0
  353. package/dist/host-lists/sources/toutiao.source.d.ts +9 -0
  354. package/dist/host-lists/sources/toutiao.source.js +56 -0
  355. package/dist/host-lists/sources/toutiao.source.js.map +1 -0
  356. package/dist/host-lists/sources/v2ex.source.d.ts +9 -0
  357. package/dist/host-lists/sources/v2ex.source.js +67 -0
  358. package/dist/host-lists/sources/v2ex.source.js.map +1 -0
  359. package/dist/host-lists/sources/wallstreet.source.d.ts +9 -0
  360. package/dist/host-lists/sources/wallstreet.source.js +59 -0
  361. package/dist/host-lists/sources/wallstreet.source.js.map +1 -0
  362. package/dist/host-lists/sources/weatheralarm.source.d.ts +9 -0
  363. package/dist/host-lists/sources/weatheralarm.source.js +68 -0
  364. package/dist/host-lists/sources/weatheralarm.source.js.map +1 -0
  365. package/dist/host-lists/sources/weibo.source.d.ts +15 -0
  366. package/dist/host-lists/sources/weibo.source.js +180 -0
  367. package/dist/host-lists/sources/weibo.source.js.map +1 -0
  368. package/dist/host-lists/sources/weread.source.d.ts +9 -0
  369. package/dist/host-lists/sources/weread.source.js +82 -0
  370. package/dist/host-lists/sources/weread.source.js.map +1 -0
  371. package/dist/host-lists/sources/xinyu.source.d.ts +9 -0
  372. package/dist/host-lists/sources/xinyu.source.js +151 -0
  373. package/dist/host-lists/sources/xinyu.source.js.map +1 -0
  374. package/dist/host-lists/sources/yicai.source.d.ts +9 -0
  375. package/dist/host-lists/sources/yicai.source.js +113 -0
  376. package/dist/host-lists/sources/yicai.source.js.map +1 -0
  377. package/dist/host-lists/sources/yystv.source.d.ts +9 -0
  378. package/dist/host-lists/sources/yystv.source.js +57 -0
  379. package/dist/host-lists/sources/yystv.source.js.map +1 -0
  380. package/dist/host-lists/sources/zhihu-daily.source.d.ts +9 -0
  381. package/dist/host-lists/sources/zhihu-daily.source.js +60 -0
  382. package/dist/host-lists/sources/zhihu-daily.source.js.map +1 -0
  383. package/dist/host-lists/sources/zhihu.source.d.ts +12 -0
  384. package/dist/host-lists/sources/zhihu.source.js +195 -0
  385. package/dist/host-lists/sources/zhihu.source.js.map +1 -0
  386. package/dist/http/http.module.d.ts +2 -0
  387. package/dist/http/http.module.js +30 -0
  388. package/dist/http/http.module.js.map +1 -0
  389. package/dist/http/http.service.d.ts +53 -0
  390. package/dist/http/http.service.js +277 -0
  391. package/dist/http/http.service.js.map +1 -0
  392. package/dist/main.d.ts +3 -0
  393. package/dist/main.js +70 -0
  394. package/dist/main.js.map +1 -0
  395. package/dist/rss/rss.module.d.ts +2 -0
  396. package/dist/rss/rss.module.js +21 -0
  397. package/dist/rss/rss.module.js.map +1 -0
  398. package/dist/rss/rss.service.d.ts +5 -0
  399. package/dist/rss/rss.service.js +55 -0
  400. package/dist/rss/rss.service.js.map +1 -0
  401. package/dist/scheduler/dto/trigger-fetch.dto.d.ts +3 -0
  402. package/dist/scheduler/dto/trigger-fetch.dto.js +22 -0
  403. package/dist/scheduler/dto/trigger-fetch.dto.js.map +1 -0
  404. package/dist/scheduler/dto/update-source-config.dto.d.ts +4 -0
  405. package/dist/scheduler/dto/update-source-config.dto.js +29 -0
  406. package/dist/scheduler/dto/update-source-config.dto.js.map +1 -0
  407. package/dist/scheduler/scheduler.controller.d.ts +52 -0
  408. package/dist/scheduler/scheduler.controller.js +132 -0
  409. package/dist/scheduler/scheduler.controller.js.map +1 -0
  410. package/dist/scheduler/scheduler.module.d.ts +2 -0
  411. package/dist/scheduler/scheduler.module.js +34 -0
  412. package/dist/scheduler/scheduler.module.js.map +1 -0
  413. package/dist/scheduler/scheduler.service.d.ts +54 -0
  414. package/dist/scheduler/scheduler.service.js +238 -0
  415. package/dist/scheduler/scheduler.service.js.map +1 -0
  416. package/dist/scheduler/tasks/fetch-hot-data.task.d.ts +34 -0
  417. package/dist/scheduler/tasks/fetch-hot-data.task.js +175 -0
  418. package/dist/scheduler/tasks/fetch-hot-data.task.js.map +1 -0
  419. package/dist/token/coolapk.d.ts +11 -0
  420. package/dist/token/coolapk.js +40 -0
  421. package/dist/token/coolapk.js.map +1 -0
  422. package/dist/token/token.module.d.ts +2 -0
  423. package/dist/token/token.module.js +23 -0
  424. package/dist/token/token.module.js.map +1 -0
  425. package/dist/token/token.service.d.ts +19 -0
  426. package/dist/token/token.service.js +115 -0
  427. package/dist/token/token.service.js.map +1 -0
  428. package/dist/token/tools.d.ts +1 -0
  429. package/dist/token/tools.js +15 -0
  430. package/dist/token/tools.js.map +1 -0
  431. package/dist/token/weread.d.ts +2 -0
  432. package/dist/token/weread.js +55 -0
  433. package/dist/token/weread.js.map +1 -0
  434. package/dist/utils/getNum.d.ts +1 -0
  435. package/dist/utils/getNum.js +20 -0
  436. package/dist/utils/getNum.js.map +1 -0
  437. package/dist/utils/getTime.d.ts +11 -0
  438. package/dist/utils/getTime.js +134 -0
  439. package/dist/utils/getTime.js.map +1 -0
  440. package/dist/utils/headers.d.ts +16 -0
  441. package/dist/utils/headers.js +20 -0
  442. package/dist/utils/headers.js.map +1 -0
  443. package/dist/utils/index.d.ts +1 -0
  444. package/dist/utils/index.js +12 -0
  445. package/dist/utils/index.js.map +1 -0
  446. package/dist/utils/parseRSS.d.ts +11 -0
  447. package/dist/utils/parseRSS.js +47 -0
  448. package/dist/utils/parseRSS.js.map +1 -0
  449. package/package.json +148 -4
  450. package/views/home.hbs +65 -0
@@ -0,0 +1,57 @@
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.AppService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const hot_lists_service_1 = require("./host-lists/hot-lists.service");
15
+ let AppService = class AppService {
16
+ constructor(hotListsService) {
17
+ this.hotListsService = hotListsService;
18
+ }
19
+ getHomeData() {
20
+ const allSources = this.hotListsService.getAllSources();
21
+ const apiExamples = allSources.map((source) => {
22
+ return {
23
+ name: source,
24
+ path: `/hot-lists/${source}`,
25
+ };
26
+ });
27
+ return {
28
+ title: '每日热榜聚合 API',
29
+ description: '一个基于 NestJS 的每日热榜聚合 API 服务,支持多个平台的热榜数据获取,支持本地部署,pm2部署、docker部署。',
30
+ features: [
31
+ {
32
+ icon: '📊',
33
+ title: '多平台支持',
34
+ description: '知乎、微博、百度、豆瓣、B站等',
35
+ },
36
+ {
37
+ icon: '⚡',
38
+ title: '高性能',
39
+ description: '基于 NestJS 框架构建',
40
+ },
41
+ {
42
+ icon: '🐳',
43
+ title: '容器化',
44
+ description: '支持 Docker 部署',
45
+ },
46
+ ],
47
+ apiExamples,
48
+ slogan: '让数据获取更简单,让信息聚合更高效',
49
+ };
50
+ }
51
+ };
52
+ exports.AppService = AppService;
53
+ exports.AppService = AppService = __decorate([
54
+ (0, common_1.Injectable)(),
55
+ __metadata("design:paramtypes", [hot_lists_service_1.HotListsService])
56
+ ], AppService);
57
+ //# sourceMappingURL=app.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.service.js","sourceRoot":"","sources":["../src/app.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,sEAAiE;AAG1D,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAEjE,WAAW;QAET,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;QAGxD,MAAM,WAAW,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAC5C,OAAO;gBACL,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,cAAc,MAAM,EAAE;aAC7B,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO;YACL,KAAK,EAAE,YAAY;YACnB,WAAW,EACT,iEAAiE;YACnE,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,OAAO;oBACd,WAAW,EAAE,iBAAiB;iBAC/B;gBACD;oBACE,IAAI,EAAE,GAAG;oBACT,KAAK,EAAE,KAAK;oBACZ,WAAW,EAAE,gBAAgB;iBAC9B;gBACD;oBACE,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,KAAK;oBACZ,WAAW,EAAE,cAAc;iBAC5B;aACF;YACD,WAAW;YACX,MAAM,EAAE,mBAAmB;SAC5B,CAAC;IACJ,CAAC;CACF,CAAA;AAxCY,gCAAU;qBAAV,UAAU;IADtB,IAAA,mBAAU,GAAE;qCAEmC,mCAAe;GADlD,UAAU,CAwCtB"}
@@ -0,0 +1,2 @@
1
+ export declare class CacheModule {
2
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.CacheModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const cache_service_1 = require("./cache.service");
12
+ const ioredis_1 = require("@nestjs-modules/ioredis");
13
+ const config_1 = require("@nestjs/config");
14
+ const cache_manager_1 = require("@nestjs/cache-manager");
15
+ let CacheModule = class CacheModule {
16
+ };
17
+ exports.CacheModule = CacheModule;
18
+ exports.CacheModule = CacheModule = __decorate([
19
+ (0, common_1.Module)({
20
+ imports: [
21
+ ioredis_1.RedisModule.forRootAsync({
22
+ imports: [config_1.ConfigModule],
23
+ inject: [config_1.ConfigService],
24
+ useFactory: (configService) => ({
25
+ type: 'single',
26
+ options: {
27
+ host: configService.get('REDIS_HOST'),
28
+ port: configService.get('REDIS_PORT'),
29
+ password: configService.get('REDIS_PASSWORD'),
30
+ lazyConnect: true,
31
+ maxRetriesPerRequest: 1,
32
+ enableReadyCheck: false,
33
+ retryStrategy: () => null,
34
+ },
35
+ onClientReady: () => {
36
+ new common_1.Logger(CacheModule.name).log('Redis client ready');
37
+ },
38
+ onClientError: (error) => {
39
+ new common_1.Logger(CacheModule.name).error(`Redis client error: ${error.message}`);
40
+ },
41
+ }),
42
+ }),
43
+ cache_manager_1.CacheModule.register({
44
+ ttl: 0,
45
+ max: 1000,
46
+ }),
47
+ ],
48
+ providers: [cache_service_1.CacheService],
49
+ exports: [cache_service_1.CacheService],
50
+ })
51
+ ], CacheModule);
52
+ //# sourceMappingURL=cache.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.module.js","sourceRoot":"","sources":["../../src/cache/cache.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAgD;AAChD,mDAA+C;AAC/C,qDAAyE;AACzE,2CAA6D;AAC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';
3
+ import { Cache } from '@nestjs/cache-manager';
4
+ export type CacheData<T> = {
5
+ data: T;
6
+ updateTime: string;
7
+ };
8
+ export declare class CacheService {
9
+ private readonly redis;
10
+ private readonly configService;
11
+ private readonly memoryCache;
12
+ private readonly DEFAULT_TTL;
13
+ private readonly logger;
14
+ private useMemoryCache;
15
+ private readonly memoryCacheKeys;
16
+ constructor(redis: Redis, configService: ConfigService, memoryCache: Cache);
17
+ private checkRedisConnection;
18
+ get<T>(key: string): Promise<T | null>;
19
+ set(key: string, value: CacheData<unknown>, ttl?: number): Promise<void>;
20
+ del(key: string): Promise<void>;
21
+ delByPattern(prefix: string): Promise<void>;
22
+ ping(): Promise<boolean>;
23
+ private getFromMemory;
24
+ private setToMemory;
25
+ private delFromMemory;
26
+ }
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ var CacheService_1;
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.CacheService = void 0;
20
+ const common_1 = require("@nestjs/common");
21
+ const ioredis_1 = require("@nestjs-modules/ioredis");
22
+ const ioredis_2 = __importDefault(require("ioredis"));
23
+ const config_1 = require("@nestjs/config");
24
+ const cache_manager_1 = require("@nestjs/cache-manager");
25
+ let CacheService = CacheService_1 = class CacheService {
26
+ constructor(redis, configService, memoryCache) {
27
+ this.redis = redis;
28
+ this.configService = configService;
29
+ this.memoryCache = memoryCache;
30
+ this.logger = new common_1.Logger(CacheService_1.name);
31
+ this.useMemoryCache = false;
32
+ this.memoryCacheKeys = new Set();
33
+ this.DEFAULT_TTL = this.configService.get('CACHE_TTL', 3600);
34
+ void this.checkRedisConnection();
35
+ }
36
+ async checkRedisConnection() {
37
+ try {
38
+ await this.redis.ping();
39
+ this.logger.log('Redis 连接正常');
40
+ }
41
+ catch {
42
+ this.useMemoryCache = true;
43
+ this.logger.warn('Redis 不可用,已降级到内存缓存');
44
+ }
45
+ }
46
+ async get(key) {
47
+ if (this.useMemoryCache) {
48
+ return this.getFromMemory(key);
49
+ }
50
+ try {
51
+ const data = await this.redis.get(key);
52
+ if (!data)
53
+ return null;
54
+ const parsed = JSON.parse(data);
55
+ this.logger.debug(`Cache hit for key: ${key}`);
56
+ return parsed;
57
+ }
58
+ catch (error) {
59
+ this.logger.error(`Error getting cached data for key: ${key}`, error);
60
+ return null;
61
+ }
62
+ }
63
+ async set(key, value, ttl = this.DEFAULT_TTL) {
64
+ if (this.useMemoryCache) {
65
+ return this.setToMemory(key, value, ttl);
66
+ }
67
+ try {
68
+ await this.redis.set(key, JSON.stringify(value), 'EX', ttl);
69
+ this.logger.log(`💾 [REDIS] ${key} has been cached for ${ttl}s`);
70
+ }
71
+ catch (error) {
72
+ this.logger.error(`Error setting cache for key: ${key}`, error);
73
+ }
74
+ }
75
+ async del(key) {
76
+ if (this.useMemoryCache) {
77
+ return this.delFromMemory(key);
78
+ }
79
+ try {
80
+ await this.redis.del(key);
81
+ this.logger.log(`🗑️ [REDIS] Deleted cache for ${key}`);
82
+ }
83
+ catch (error) {
84
+ this.logger.error(`Error deleting cache for key: ${key}`, error);
85
+ }
86
+ }
87
+ async delByPattern(prefix) {
88
+ if (this.useMemoryCache) {
89
+ const keys = [...this.memoryCacheKeys].filter((key) => key.startsWith(prefix));
90
+ await Promise.all(keys.map((key) => this.delFromMemory(key)));
91
+ return;
92
+ }
93
+ try {
94
+ const stream = this.redis.scanStream({
95
+ match: `${prefix}*`,
96
+ count: 100,
97
+ });
98
+ let deleted = 0;
99
+ for await (const keys of stream) {
100
+ if (keys.length > 0) {
101
+ deleted += await this.redis.del(...keys);
102
+ }
103
+ }
104
+ if (deleted > 0) {
105
+ this.logger.log(`🗑️ [REDIS] Deleted ${deleted} keys with prefix: ${prefix}`);
106
+ }
107
+ }
108
+ catch (error) {
109
+ this.logger.error(`Error deleting cache by pattern: ${prefix}`, error);
110
+ }
111
+ }
112
+ async ping() {
113
+ try {
114
+ const result = await this.redis.ping();
115
+ return result === 'PONG';
116
+ }
117
+ catch (error) {
118
+ this.logger.error('Redis ping failed', error);
119
+ return false;
120
+ }
121
+ }
122
+ async getFromMemory(key) {
123
+ try {
124
+ const data = await this.memoryCache.get(key);
125
+ this.logger.debug(`[MEMORY] Cache hit for key: ${key}`);
126
+ return data;
127
+ }
128
+ catch (error) {
129
+ this.logger.error(`内存缓存读取失败: ${error.message}`);
130
+ return null;
131
+ }
132
+ }
133
+ async setToMemory(key, value, ttl) {
134
+ try {
135
+ await this.memoryCache.set(key, value, ttl * 1000);
136
+ this.memoryCacheKeys.add(key);
137
+ this.logger.log(`💾 [MEMORY] ${key} cached for ${ttl}s`);
138
+ }
139
+ catch (error) {
140
+ this.logger.error(`内存缓存写入失败: ${error.message}`);
141
+ }
142
+ }
143
+ async delFromMemory(key) {
144
+ try {
145
+ await this.memoryCache.del(key);
146
+ this.memoryCacheKeys.delete(key);
147
+ this.logger.log(`🗑️ [MEMORY] Deleted cache for ${key}`);
148
+ }
149
+ catch (error) {
150
+ this.logger.error(`内存缓存删除失败: ${error.message}`);
151
+ }
152
+ }
153
+ };
154
+ exports.CacheService = CacheService;
155
+ exports.CacheService = CacheService = CacheService_1 = __decorate([
156
+ (0, common_1.Injectable)(),
157
+ __param(0, (0, ioredis_1.InjectRedis)()),
158
+ __param(2, (0, common_1.Inject)(cache_manager_1.CACHE_MANAGER)),
159
+ __metadata("design:paramtypes", [ioredis_2.default,
160
+ config_1.ConfigService,
161
+ cache_manager_1.Cache])
162
+ ], CacheService);
163
+ //# sourceMappingURL=cache.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.service.js","sourceRoot":"","sources":["../../src/cache/cache.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,qDAAsD;AACtD,sDAA4B;AAC5B,2CAA+C;AAC/C,yDAA6D;AAQtD,IAAM,YAAY,oBAAlB,MAAM,YAAY;IAMvB,YACiB,KAA6B,EAC3B,aAA4B,EACtB,WAAmC;QAF1B,UAAK,GAAL,KAAK,CAAO;QAC3B,kBAAa,GAAb,aAAa,CAAe;QACL,gBAAW,GAAX,WAAW,CAAO;QAP3C,WAAM,GAAG,IAAI,eAAM,CAAC,cAAY,CAAC,IAAI,CAAC,CAAC;QAChD,mBAAc,GAAG,KAAK,CAAC;QACd,oBAAe,GAAG,IAAI,GAAG,EAAU,CAAC;QAQnD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,WAAW,EAAE,IAAI,CAAC,CAAC;QACrE,KAAK,IAAI,CAAC,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAGO,KAAK,CAAC,oBAAoB;QAChC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;YAC3B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACzC,CAAC;IACH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AAC,CAAC;YACnD,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC9B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,GAAG,eAAe,GAAG,GAAG,CAAC,CAAC;QAC3D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,aAAa,CAAC,GAAW;QACrC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAChC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,kCAAkC,GAAG,EAAE,CAAC,CAAC;QAC3D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;CACF,CAAA;AA5KY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAQR,WAAA,IAAA,qBAAW,GAAE,CAAA;IAEb,WAAA,IAAA,eAAM,EAAC,6BAAa,CAAC,CAAA;qCAFiB,iBAAK;QACZ,sBAAa;QACQ,qBAAK;GATjD,YAAY,CA4KxB"}
@@ -0,0 +1,24 @@
1
+ export type CommandName = 'start' | 'stop' | 'status' | 'restart' | 'logs' | 'help' | 'version';
2
+ export type OptionKey = 'help' | 'version' | 'json' | 'daemon' | 'foreground' | 'port' | 'envFile' | 'home' | 'timeout' | 'force' | 'follow' | 'lines';
3
+ export declare const COMMAND_NAMES: readonly CommandName[];
4
+ export interface CliOptions {
5
+ command: CommandName;
6
+ commandExplicit: boolean;
7
+ help: boolean;
8
+ version: boolean;
9
+ json: boolean;
10
+ daemon: boolean;
11
+ foreground: boolean;
12
+ port?: number;
13
+ envFile?: string;
14
+ home?: string;
15
+ timeoutSeconds: number;
16
+ force: boolean;
17
+ follow: boolean;
18
+ lines: number;
19
+ helpTarget?: CommandName;
20
+ }
21
+ export declare const DEFAULT_LOG_LINES = 50;
22
+ export declare function isCommandName(value: string): value is CommandName;
23
+ export declare function parseArgs(argv: string[]): CliOptions;
24
+ export declare function supportedOptions(command: CommandName): string[];
@@ -0,0 +1,261 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_LOG_LINES = exports.COMMAND_NAMES = void 0;
4
+ exports.isCommandName = isCommandName;
5
+ exports.parseArgs = parseArgs;
6
+ exports.supportedOptions = supportedOptions;
7
+ const errors_1 = require("./errors");
8
+ const paths_1 = require("./paths");
9
+ exports.COMMAND_NAMES = [
10
+ 'start',
11
+ 'stop',
12
+ 'status',
13
+ 'restart',
14
+ 'logs',
15
+ 'help',
16
+ 'version',
17
+ ];
18
+ exports.DEFAULT_LOG_LINES = 50;
19
+ const FLAG_MAP = {
20
+ '-h': 'help',
21
+ '--help': 'help',
22
+ '-v': 'version',
23
+ '--version': 'version',
24
+ '--json': 'json',
25
+ '-d': 'daemon',
26
+ '--daemon': 'daemon',
27
+ '--foreground': 'foreground',
28
+ '-p': 'port',
29
+ '--port': 'port',
30
+ '--config': 'envFile',
31
+ '--env-file': 'envFile',
32
+ '--home': 'home',
33
+ '--timeout': 'timeout',
34
+ '--force': 'force',
35
+ '-f': 'follow',
36
+ '--follow': 'follow',
37
+ '-n': 'lines',
38
+ '--lines': 'lines',
39
+ };
40
+ const FLAG_DISPLAY = {
41
+ help: '--help',
42
+ version: '--version',
43
+ json: '--json',
44
+ daemon: '--daemon',
45
+ foreground: '--foreground',
46
+ port: '--port',
47
+ envFile: '--config',
48
+ home: '--home',
49
+ timeout: '--timeout',
50
+ force: '--force',
51
+ follow: '--follow',
52
+ lines: '--lines',
53
+ };
54
+ const VALUE_OPTIONS = new Set([
55
+ 'port',
56
+ 'envFile',
57
+ 'home',
58
+ 'timeout',
59
+ 'lines',
60
+ ]);
61
+ const COMMAND_OPTIONS = {
62
+ start: ['help', 'daemon', 'port', 'envFile', 'home'],
63
+ stop: ['help', 'json', 'timeout', 'force', 'home'],
64
+ status: ['help', 'json', 'home'],
65
+ restart: [
66
+ 'help',
67
+ 'daemon',
68
+ 'foreground',
69
+ 'port',
70
+ 'envFile',
71
+ 'home',
72
+ 'timeout',
73
+ 'force',
74
+ ],
75
+ logs: ['help', 'follow', 'lines', 'home'],
76
+ help: ['help'],
77
+ version: [],
78
+ };
79
+ function isCommandName(value) {
80
+ return exports.COMMAND_NAMES.includes(value);
81
+ }
82
+ function parseNumberOption(key, raw) {
83
+ switch (key) {
84
+ case 'port': {
85
+ if (!/^\d+$/.test(raw)) {
86
+ throw new errors_1.UsageError(`--port 必须是 1-65535 的整数,收到: ${raw}`);
87
+ }
88
+ const port = Number(raw);
89
+ if (port < 1 || port > 65535) {
90
+ throw new errors_1.UsageError(`--port 必须是 1-65535 的整数,收到: ${raw}`);
91
+ }
92
+ return port;
93
+ }
94
+ case 'timeout': {
95
+ const seconds = Number(raw);
96
+ if (!Number.isFinite(seconds) || seconds <= 0) {
97
+ throw new errors_1.UsageError(`--timeout 必须是大于 0 的秒数,收到: ${raw}`);
98
+ }
99
+ return seconds;
100
+ }
101
+ case 'lines': {
102
+ if (!/^\d+$/.test(raw) || Number(raw) < 0) {
103
+ throw new errors_1.UsageError(`--lines 必须是大于等于 0 的整数,收到: ${raw}`);
104
+ }
105
+ return Number(raw);
106
+ }
107
+ default:
108
+ throw new errors_1.UsageError(`选项 ${FLAG_DISPLAY[key]} 不是数字选项`);
109
+ }
110
+ }
111
+ function parseArgs(argv) {
112
+ let command;
113
+ let commandExplicit = false;
114
+ let helpTarget;
115
+ const flags = {
116
+ help: false,
117
+ version: false,
118
+ json: false,
119
+ daemon: false,
120
+ foreground: false,
121
+ force: false,
122
+ follow: false,
123
+ };
124
+ let port;
125
+ let envFile;
126
+ let home;
127
+ let timeoutSeconds = paths_1.DEFAULT_STOP_TIMEOUT_SECONDS;
128
+ let lines = exports.DEFAULT_LOG_LINES;
129
+ const seen = new Set();
130
+ for (let index = 0; index < argv.length; index += 1) {
131
+ const token = argv[index];
132
+ if (token.startsWith('-') && token.length > 1) {
133
+ const equalsIndex = token.indexOf('=');
134
+ const flagName = equalsIndex >= 0 ? token.slice(0, equalsIndex) : token;
135
+ const inlineValue = equalsIndex >= 0 ? token.slice(equalsIndex + 1) : undefined;
136
+ const key = FLAG_MAP[flagName];
137
+ if (!key) {
138
+ throw new errors_1.UsageError(`未知选项: ${flagName}`);
139
+ }
140
+ seen.add(key);
141
+ if (VALUE_OPTIONS.has(key)) {
142
+ const raw = inlineValue ?? argv[index + 1];
143
+ if (inlineValue === undefined) {
144
+ index += 1;
145
+ }
146
+ if (raw === undefined || raw === '') {
147
+ throw new errors_1.UsageError(`选项 ${flagName} 需要一个值`);
148
+ }
149
+ if (key === 'port') {
150
+ port = parseNumberOption(key, raw);
151
+ }
152
+ else if (key === 'timeout') {
153
+ timeoutSeconds = parseNumberOption(key, raw);
154
+ }
155
+ else if (key === 'lines') {
156
+ lines = parseNumberOption(key, raw);
157
+ }
158
+ else if (key === 'home') {
159
+ home = raw;
160
+ }
161
+ else {
162
+ envFile = raw;
163
+ }
164
+ continue;
165
+ }
166
+ if (inlineValue !== undefined) {
167
+ throw new errors_1.UsageError(`选项 ${flagName} 不接受值`);
168
+ }
169
+ switch (key) {
170
+ case 'help':
171
+ flags.help = true;
172
+ break;
173
+ case 'version':
174
+ flags.version = true;
175
+ break;
176
+ case 'json':
177
+ flags.json = true;
178
+ break;
179
+ case 'daemon':
180
+ flags.daemon = true;
181
+ break;
182
+ case 'foreground':
183
+ flags.foreground = true;
184
+ break;
185
+ case 'force':
186
+ flags.force = true;
187
+ break;
188
+ case 'follow':
189
+ flags.follow = true;
190
+ break;
191
+ default:
192
+ throw new errors_1.UsageError(`未知选项: ${flagName}`);
193
+ }
194
+ continue;
195
+ }
196
+ if (!command) {
197
+ if (!isCommandName(token)) {
198
+ throw new errors_1.UsageError(`未知命令: ${token}\n运行 daily-hot-api --help 查看可用命令`);
199
+ }
200
+ command = token;
201
+ commandExplicit = true;
202
+ continue;
203
+ }
204
+ if (command === 'help' && !helpTarget) {
205
+ if (!isCommandName(token)) {
206
+ throw new errors_1.UsageError(`未知命令: ${token}`);
207
+ }
208
+ helpTarget = token;
209
+ continue;
210
+ }
211
+ throw new errors_1.UsageError(`多余的参数: ${token}`);
212
+ }
213
+ if (flags.version) {
214
+ return {
215
+ command: 'version',
216
+ commandExplicit: true,
217
+ help: false,
218
+ version: true,
219
+ json: false,
220
+ daemon: false,
221
+ foreground: false,
222
+ timeoutSeconds: paths_1.DEFAULT_STOP_TIMEOUT_SECONDS,
223
+ force: false,
224
+ follow: false,
225
+ lines: exports.DEFAULT_LOG_LINES,
226
+ };
227
+ }
228
+ const effectiveCommand = command ?? 'start';
229
+ if (flags.daemon && flags.foreground) {
230
+ throw new errors_1.UsageError('--daemon 与 --foreground 不能同时使用');
231
+ }
232
+ if (!flags.help) {
233
+ const supported = COMMAND_OPTIONS[effectiveCommand];
234
+ for (const key of seen) {
235
+ if (!supported.includes(key)) {
236
+ throw new errors_1.UsageError(`命令 ${effectiveCommand} 不支持选项 ${FLAG_DISPLAY[key]}`);
237
+ }
238
+ }
239
+ }
240
+ return {
241
+ command: effectiveCommand,
242
+ commandExplicit,
243
+ help: flags.help,
244
+ version: false,
245
+ json: flags.json,
246
+ daemon: flags.daemon,
247
+ foreground: flags.foreground,
248
+ port,
249
+ envFile,
250
+ home,
251
+ timeoutSeconds,
252
+ force: flags.force,
253
+ follow: flags.follow,
254
+ lines,
255
+ helpTarget,
256
+ };
257
+ }
258
+ function supportedOptions(command) {
259
+ return COMMAND_OPTIONS[command].map((key) => FLAG_DISPLAY[key]);
260
+ }
261
+ //# sourceMappingURL=args.js.map
@@ -0,0 +1 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,gBAAgB,UAAU,YAAY,CAAC,GAAG,CAAC,EAAE,CACpD,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE,gBAAgB;QACzB,eAAe;QACf,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,IAAI;QACJ,OAAO;QACP,IAAI;QACJ,cAAc;QACd,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,KAAK;QACL,UAAU;KACX,CAAC;AACJ,CAAC;AAGD,SAAgB,gBAAgB,CAAC,OAAoB;IACnD,OAAO,eAAe,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;AAClE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CliOptions } from '../args';
2
+ import type { CommandContext } from '../context';
3
+ export declare function logsCommand(options: CliOptions, context?: Partial<CommandContext>): Promise<number>;