@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,63 @@
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.Jin10Source = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
15
+ const http_service_1 = require("../../http/http.service");
16
+ const getTime_1 = require("../../utils/getTime");
17
+ let Jin10Source = class Jin10Source {
18
+ constructor(httpService) {
19
+ this.httpService = httpService;
20
+ }
21
+ async getList(options, noCache) {
22
+ const url = 'https://cdn.jin10.com/json/index/latest_news.json';
23
+ const result = await this.httpService.get({
24
+ url,
25
+ noCache,
26
+ });
27
+ const list = result.data.list || [];
28
+ return {
29
+ data: list.map((v) => {
30
+ return {
31
+ id: v.id,
32
+ title: v.title,
33
+ cover: v.mobile_thumbs?.[0] || undefined,
34
+ desc: v?.introduction,
35
+ author: undefined,
36
+ timestamp: (0, getTime_1.getTime)(v.display_datetime),
37
+ hot: undefined,
38
+ url: v?.source_url
39
+ ? v.source_url
40
+ : `https://xnews.jin10.com/details/${v.id}`,
41
+ mobileUrl: v?.source_url
42
+ ? v.source_url
43
+ : `https://xnews.jin10.com/details/${v.id}`,
44
+ };
45
+ }),
46
+ fromCache: result.fromCache,
47
+ updateTime: result.updateTime,
48
+ };
49
+ }
50
+ };
51
+ exports.Jin10Source = Jin10Source;
52
+ exports.Jin10Source = Jin10Source = __decorate([
53
+ (0, common_1.Injectable)(),
54
+ (0, hot_source_decorator_1.HotSource)({
55
+ name: 'jin10',
56
+ title: '金十数据',
57
+ type: '推荐榜',
58
+ description: '金十数据',
59
+ link: 'https://www.jin10.com/',
60
+ }),
61
+ __metadata("design:paramtypes", [http_service_1.HttpClientService])
62
+ ], Jin10Source);
63
+ //# sourceMappingURL=jin10.source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jin10.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/jin10.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAA4C;AAcrC,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,OAAuB,EACvB,OAAiB;QAEjB,MAAM,GAAG,GAAG,mDAAmD,CAAC;QAEhE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAmB;YAC1D,GAAG;YACH,OAAO;SACR,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QAEpC,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBACnB,OAAO;oBACL,EAAE,EAAE,CAAC,CAAC,EAAE;oBACR,KAAK,EAAE,CAAC,CAAC,KAAK;oBACd,KAAK,EAAE,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,IAAI,SAAS;oBACxC,IAAI,EAAE,CAAC,EAAE,YAAY;oBACrB,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,IAAA,iBAAO,EAAC,CAAC,CAAC,gBAAgB,CAAC;oBACtC,GAAG,EAAE,SAAS;oBACd,GAAG,EAAE,CAAC,EAAE,UAAU;wBAChB,CAAC,CAAC,CAAC,CAAC,UAAU;wBACd,CAAC,CAAC,mCAAmC,CAAC,CAAC,EAAE,EAAE;oBAC7C,SAAS,EAAE,CAAC,EAAE,UAAU;wBACtB,CAAC,CAAC,CAAC,CAAC,UAAU;wBACd,CAAC,CAAC,mCAAmC,CAAC,CAAC,EAAE,EAAE;iBAC9C,CAAC;YACJ,CAAC,CAAC;YACF,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AAtCY,kCAAW;sBAAX,WAAW;IARvB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,wBAAwB;KAC/B,CAAC;qCAE0C,gCAAiB;GADhD,WAAW,CAsCvB"}
@@ -0,0 +1,10 @@
1
+ import { HotListSource } from '../interfaces/hot-list-source.interface';
2
+ import { HotListGetListResponse } from '../interfaces/hot-list.interface';
3
+ import { HttpClientService } from '../../http/http.service';
4
+ import { GetListOptions } from './source.types';
5
+ export declare class JuejinSource implements HotListSource {
6
+ private readonly httpService;
7
+ constructor(httpService: HttpClientService);
8
+ private getCategory;
9
+ getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
10
+ }
@@ -0,0 +1,81 @@
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.JuejinSource = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
15
+ const http_service_1 = require("../../http/http.service");
16
+ const category_url = 'https://api.juejin.cn/tag_api/v1/query_category_briefs';
17
+ let JuejinSource = class JuejinSource {
18
+ constructor(httpService) {
19
+ this.httpService = httpService;
20
+ }
21
+ async getCategory() {
22
+ const res = await this.httpService.get({
23
+ url: category_url,
24
+ headers: {
25
+ 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/605.1.15',
26
+ },
27
+ });
28
+ const data = res?.data?.data || [];
29
+ const typeObj = {};
30
+ typeObj['1'] = '综合';
31
+ data.forEach((c) => {
32
+ typeObj[c.category_id] = c.category_name;
33
+ });
34
+ return typeObj;
35
+ }
36
+ async getList(options, noCache) {
37
+ const typeMap = await this.getCategory();
38
+ const type = options?.type ?? 1;
39
+ const url = `https://api.juejin.cn/content_api/v1/content/article_rank?category_id=${type}&type=hot`;
40
+ const result = await this.httpService.get({
41
+ url,
42
+ noCache,
43
+ headers: {
44
+ 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/605.1.15',
45
+ },
46
+ });
47
+ const list = result.data.data;
48
+ return {
49
+ data: list.map((v) => ({
50
+ id: v.content.content_id,
51
+ title: v.content.title,
52
+ author: v.author.name,
53
+ hot: v.content_counter.hot_rank,
54
+ timestamp: undefined,
55
+ url: `https://juejin.cn/post/${v.content.content_id}`,
56
+ mobileUrl: `https://juejin.cn/post/${v.content.content_id}`,
57
+ })),
58
+ type: typeMap[type] || '热搜',
59
+ params: {
60
+ type: {
61
+ name: '热搜类别',
62
+ type: typeMap,
63
+ },
64
+ },
65
+ fromCache: result.fromCache,
66
+ updateTime: result.updateTime,
67
+ };
68
+ }
69
+ };
70
+ exports.JuejinSource = JuejinSource;
71
+ exports.JuejinSource = JuejinSource = __decorate([
72
+ (0, common_1.Injectable)(),
73
+ (0, hot_source_decorator_1.HotSource)({
74
+ name: 'juejin',
75
+ title: '掘金',
76
+ type: '热榜',
77
+ link: 'https://juejin.cn/hot/articles',
78
+ }),
79
+ __metadata("design:paramtypes", [http_service_1.HttpClientService])
80
+ ], JuejinSource);
81
+ //# sourceMappingURL=juejin.source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"juejin.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/juejin.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAG5D,MAAM,YAAY,GAAG,wDAAwD,CAAC;AAavE,IAAM,YAAY,GAAlB,MAAM,YAAY;IACvB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAEvD,KAAK,CAAC,WAAW;QACvB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAM;YAC1C,GAAG,EAAE,YAAY;YACjB,OAAO,EAAE;gBACP,YAAY,EACV,0IAA0I;aAC7I;SACF,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,GAAG,EAAE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;QACnC,MAAM,OAAO,GAA2B,EAAE,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAiD,EAAE,EAAE;YACjE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,OAAO,CACX,OAAuB,EACvB,OAAiB;QAEjB,MA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X,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,gCAAgC;KACvC,CAAC;qCAE0C,gCAAiB;GADhD,YAAY,CA6DxB"}
@@ -0,0 +1,13 @@
1
+ import { HotListSource } from '../interfaces/hot-list-source.interface';
2
+ import { HotListGetListResponse } from '../interfaces/hot-list.interface';
3
+ import { HttpClientService } from '../../http/http.service';
4
+ import { GetListOptions } from './source.types';
5
+ export declare class KuaishouSource implements HotListSource {
6
+ private readonly httpService;
7
+ private readonly logger;
8
+ constructor(httpService: HttpClientService);
9
+ getList(options?: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
10
+ private fetchFromAPI;
11
+ private fetchFromApollo;
12
+ private fetchFromTianchenw;
13
+ }
@@ -0,0 +1,179 @@
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 KuaishouSource_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.KuaishouSource = void 0;
14
+ const common_1 = require("@nestjs/common");
15
+ const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
16
+ const http_service_1 = require("../../http/http.service");
17
+ const getTime_1 = require("../../utils/getTime");
18
+ let KuaishouSource = KuaishouSource_1 = class KuaishouSource {
19
+ constructor(httpService) {
20
+ this.httpService = httpService;
21
+ this.logger = new common_1.Logger(KuaishouSource_1.name);
22
+ }
23
+ async getList(options = {}, noCache) {
24
+ try {
25
+ const result = await this.fetchFromAPI(noCache ?? options.noCache);
26
+ return {
27
+ data: result.data ?? [],
28
+ params: {
29
+ type: { name: '热榜类型', type: {} },
30
+ },
31
+ fromCache: result.fromCache,
32
+ updateTime: result.updateTime,
33
+ };
34
+ }
35
+ catch (e) {
36
+ const msg = e instanceof Error ? e.message : String(e);
37
+ this.logger.error(`快手热搜获取失败: ${msg}`);
38
+ return {
39
+ data: [],
40
+ params: { type: { name: '热榜类型', type: {} } },
41
+ fromCache: false,
42
+ updateTime: 0,
43
+ };
44
+ }
45
+ }
46
+ async fetchFromAPI(noCache) {
47
+ try {
48
+ return await this.fetchFromApollo(noCache);
49
+ }
50
+ catch (e) {
51
+ this.logger.warn(`快手主源(Apollo)失败: ${e instanceof Error ? e.message : String(e)},尝试备用源`);
52
+ return this.fetchFromTianchenw(noCache);
53
+ }
54
+ }
55
+ async fetchFromApollo(noCache) {
56
+ const url = 'https://www.kuaishou.com/?isHome=1';
57
+ const res = await this.httpService.get({
58
+ url,
59
+ headers: {
60
+ Referer: 'https://www.kuaishou.com/',
61
+ 'Accept-Language': 'zh-CN,zh;q=0.9',
62
+ Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
63
+ },
64
+ noCache,
65
+ responseType: 'text',
66
+ });
67
+ const html = res.data;
68
+ if (typeof html !== 'string' || !html) {
69
+ throw new Error('快手首页返回非文本');
70
+ }
71
+ const re = /window\.__APOLLO_STATE__\s*=\s*([\s\S]*);\s*\(function\s*\(\s*\)/;
72
+ const m = html.match(re);
73
+ if (!m?.[1]) {
74
+ throw new Error('快手首页未找到 __APOLLO_STATE__');
75
+ }
76
+ let apollo;
77
+ try {
78
+ apollo = JSON.parse(m[1]);
79
+ }
80
+ catch {
81
+ throw new Error('快手 __APOLLO_STATE__ 解析失败');
82
+ }
83
+ const client = apollo.defaultClient;
84
+ if (!client || typeof client !== 'object') {
85
+ throw new Error('快手 Apollo 缺少 defaultClient');
86
+ }
87
+ const visionKey = Object.keys(client).find((k) => /visionHotRank|vision.*[Hh]ot.*[Rr]ank/.test(k));
88
+ const vision = visionKey
89
+ ? client[visionKey]
90
+ : undefined;
91
+ const items = vision?.items ?? [];
92
+ if (items.length === 0) {
93
+ throw new Error('快手 Apollo visionHotRank 为空');
94
+ }
95
+ const data = [];
96
+ for (let i = 0; i < items.length; i++) {
97
+ const it = items[i];
98
+ const ref = (typeof it?.__ref === 'string' ? it.__ref : null) ||
99
+ (typeof it?.id === 'string' ? it.id : null);
100
+ const node = ref
101
+ ? client[ref]
102
+ : undefined;
103
+ const name = typeof node?.name === 'string' ? node.name : '';
104
+ const poster = typeof node?.poster === 'string' ? node.poster : '';
105
+ const cap = /clientCacheKey=([A-Za-z0-9]+)/.exec(poster);
106
+ const vid = cap?.[1] ?? `apollo-${i}`;
107
+ const link = `https://www.kuaishou.com/short-video/${vid}`;
108
+ data.push({
109
+ id: vid,
110
+ title: name || link,
111
+ timestamp: (0, getTime_1.getTime)(0) ?? 0,
112
+ hot: 0,
113
+ url: link,
114
+ mobileUrl: link,
115
+ });
116
+ }
117
+ this.logger.log(`快手 Apollo 解析成功,共 ${data.length} 条`);
118
+ return {
119
+ data,
120
+ fromCache: res.fromCache,
121
+ updateTime: res.updateTime,
122
+ };
123
+ }
124
+ async fetchFromTianchenw(noCache) {
125
+ const url = 'https://www.tianchenw.com/hot/kuaishou';
126
+ const res = await this.httpService.get({
127
+ url,
128
+ headers: {
129
+ Referer: 'https://www.kuaishou.com/',
130
+ 'Accept-Language': 'zh-CN,zh;q=0.9',
131
+ },
132
+ noCache,
133
+ });
134
+ const raw = res.data;
135
+ if (raw?.error) {
136
+ throw new Error(`第三方 API: ${raw.error}`);
137
+ }
138
+ if (!raw || typeof raw !== 'object') {
139
+ throw new Error('快手备用 API 返回非对象');
140
+ }
141
+ const list = Array.isArray(raw.data) ? raw.data : [];
142
+ if (list.length === 0) {
143
+ throw new Error('快手备用 API 返回空列表');
144
+ }
145
+ const data = list.map((v, i) => {
146
+ const id = (v.url && /(?:^|\/)short-video\/([^/?#]+)/.exec(v.url)?.[1]) ??
147
+ `k-${v.index ?? i}`;
148
+ const link = v.url?.replace(/\\\//g, '/') ||
149
+ `https://www.kuaishou.com/short-video/${id}`;
150
+ return {
151
+ id,
152
+ title: v.title ?? String(id),
153
+ timestamp: (0, getTime_1.getTime)(0) ?? 0,
154
+ hot: v.hot ?? 0,
155
+ url: link,
156
+ mobileUrl: link,
157
+ };
158
+ });
159
+ this.logger.log(`快手备用源(tianchenw)成功,共 ${data.length} 条`);
160
+ return {
161
+ data,
162
+ fromCache: res.fromCache,
163
+ updateTime: res.updateTime,
164
+ };
165
+ }
166
+ };
167
+ exports.KuaishouSource = KuaishouSource;
168
+ exports.KuaishouSource = KuaishouSource = KuaishouSource_1 = __decorate([
169
+ (0, common_1.Injectable)(),
170
+ (0, hot_source_decorator_1.HotSource)({
171
+ name: 'kuaishou',
172
+ title: '快手',
173
+ type: '热榜',
174
+ description: '快手热搜榜',
175
+ link: 'https://www.kuaishou.com',
176
+ }),
177
+ __metadata("design:paramtypes", [http_service_1.HttpClientService])
178
+ ], KuaishouSource);
179
+ //# sourceMappingURL=kuaishou.source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kuaishou.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/kuaishou.source.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,6EAA+D;AAM/D,0DAA4D;AAE5D,iDAA8C;AAyBvC,IAAM,cAAc,sBAApB,MAAM,cAAc;IAGzB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;QAF1C,WAAM,GAAG,IAAI,eAAM,CAAC,gBAAc,CAAC,IAAI,CAAC,CAAC;IAEI,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,UAA0B,EAAE,EAC5B,OAAiB;QAEjB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC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B"}
@@ -0,0 +1,9 @@
1
+ import { HotListSource } from '../interfaces/hot-list-source.interface';
2
+ import { HotListGetListResponse } from '../interfaces/hot-list.interface';
3
+ import { HttpClientService } from '../../http/http.service';
4
+ import { GetListOptions } from './source.types';
5
+ export declare class LinuxdoSource implements HotListSource {
6
+ private readonly httpService;
7
+ constructor(httpService: HttpClientService);
8
+ getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
9
+ }
@@ -0,0 +1,62 @@
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.LinuxdoSource = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
15
+ const http_service_1 = require("../../http/http.service");
16
+ const getTime_1 = require("../../utils/getTime");
17
+ let LinuxdoSource = class LinuxdoSource {
18
+ constructor(httpService) {
19
+ this.httpService = httpService;
20
+ }
21
+ async getList(options, noCache) {
22
+ const url = 'https://linux.do/top.json?period=weekly';
23
+ const result = await this.httpService.get({
24
+ url,
25
+ noCache,
26
+ headers: {
27
+ Accept: 'application/json',
28
+ },
29
+ });
30
+ const topics = result.data.topic_list.topics;
31
+ const list = topics.map((topic) => {
32
+ return {
33
+ id: topic.id,
34
+ title: topic.title,
35
+ desc: topic.excerpt,
36
+ author: topic.last_poster_username,
37
+ timestamp: (0, getTime_1.getTime)(topic.created_at),
38
+ url: `https://linux.do/t/${topic.id}`,
39
+ mobileUrl: `https://linux.do/t/${topic.id}`,
40
+ hot: topic.views || topic.like_count,
41
+ };
42
+ });
43
+ return {
44
+ data: list,
45
+ fromCache: result.fromCache,
46
+ updateTime: result.updateTime,
47
+ };
48
+ }
49
+ };
50
+ exports.LinuxdoSource = LinuxdoSource;
51
+ exports.LinuxdoSource = LinuxdoSource = __decorate([
52
+ (0, common_1.Injectable)(),
53
+ (0, hot_source_decorator_1.HotSource)({
54
+ name: 'linuxdo',
55
+ title: 'Linux.do',
56
+ type: '热门文章',
57
+ description: 'Linux 技术社区热搜',
58
+ link: 'https://linux.do/hot',
59
+ }),
60
+ __metadata("design:paramtypes", [http_service_1.HttpClientService])
61
+ ], LinuxdoSource);
62
+ //# sourceMappingURL=linuxdo.source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linuxdo.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/linuxdo.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAA4C;AA0BrC,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,OAAuB,EACvB,OAAiB;QAEjB,MAAM,GAAG,GAAG,yCAAyC,CAAC;QAEtD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAqB;YAC5D,GAAG;YACH,OAAO;YACP,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;aAC3B;SACF,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YAChC,OAAO;gBACL,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,IAAI,EAAE,KAAK,CAAC,OAAO;gBACnB,MAAM,EAAE,KAAK,CAAC,oBAAoB;gBAClC,SAAS,EAAE,IAAA,iBAAO,EAAC,KAAK,CAAC,UAAU,CAAC;gBACpC,GAAG,EAAE,sBAAsB,KAAK,CAAC,EAAE,EAAE;gBACrC,SAAS,EAAE,sBAAsB,KAAK,CAAC,EAAE,EAAE;gBAC3C,GAAG,EAAE,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,UAAU;aACrC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO;YACL,IAAI,EAAE,IAAI;YACV,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AArCY,sCAAa;wBAAb,aAAa;IARzB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,cAAc;QAC3B,IAAI,EAAE,sBAAsB;KAC7B,CAAC;qCAE0C,gCAAiB;GADhD,aAAa,CAqCzB"}
@@ -0,0 +1,9 @@
1
+ import { HotListSource } from '../interfaces/hot-list-source.interface';
2
+ import { HotListGetListResponse } from '../interfaces/hot-list.interface';
3
+ import { HttpClientService } from '../../http/http.service';
4
+ import { GetListOptions } from './source.types';
5
+ export declare class LolSource implements HotListSource {
6
+ private readonly httpService;
7
+ constructor(httpService: HttpClientService);
8
+ getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
9
+ }
@@ -0,0 +1,58 @@
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.LolSource = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
15
+ const http_service_1 = require("../../http/http.service");
16
+ const getTime_1 = require("../../utils/getTime");
17
+ let LolSource = class LolSource {
18
+ constructor(httpService) {
19
+ this.httpService = httpService;
20
+ }
21
+ async getList(options, noCache) {
22
+ const url = 'https://apps.game.qq.com/cmc/zmMcnTargetContentList?r0=json&page=1&num=30&target=24&source=web_pc';
23
+ const result = await this.httpService.get({
24
+ url,
25
+ noCache,
26
+ headers: {
27
+ Accept: 'application/json',
28
+ },
29
+ });
30
+ const list = result.data.data.result;
31
+ return {
32
+ data: list.map((v) => ({
33
+ id: v.iDocID,
34
+ title: v.sTitle,
35
+ cover: `https:${v.sIMG}`,
36
+ author: v.sAuthor,
37
+ hot: Number(v.iTotalPlay),
38
+ timestamp: (0, getTime_1.getTime)(v.sCreated),
39
+ url: `https://lol.qq.com/news/detail.shtml?docid=${encodeURIComponent(v.iDocID)}`,
40
+ mobileUrl: `https://lol.qq.com/news/detail.shtml?docid=${encodeURIComponent(v.iDocID)}`,
41
+ })),
42
+ fromCache: result.fromCache,
43
+ updateTime: result.updateTime,
44
+ };
45
+ }
46
+ };
47
+ exports.LolSource = LolSource;
48
+ exports.LolSource = LolSource = __decorate([
49
+ (0, common_1.Injectable)(),
50
+ (0, hot_source_decorator_1.HotSource)({
51
+ name: 'lol',
52
+ title: '英雄联盟',
53
+ type: '更新公告',
54
+ link: 'https://lol.qq.com/gicp/news/423/2/1334/1.html',
55
+ }),
56
+ __metadata("design:paramtypes", [http_service_1.HttpClientService])
57
+ ], LolSource);
58
+ //# sourceMappingURL=lol.source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lol.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/lol.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAA4C;AAerC,IAAM,SAAS,GAAf,MAAM,SAAS;IACpB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,OAAuB,EACvB,OAAiB;QAEjB,MAAM,GAAG,GACP,mGAAmG,CAAC;QAEtG,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAiB;YACxD,GAAG;YACH,OAAO;YACP,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;aAC3B;SACF,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;QAErC,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACrB,EAAE,EAAE,CAAC,CAAC,MAAM;gBACZ,KAAK,EAAE,CAAC,CAAC,MAAM;gBACf,KAAK,EAAE,SAAS,CAAC,CAAC,IAAI,EAAE;gBACxB,MAAM,EAAE,CAAC,CAAC,OAAO;gBACjB,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC;gBACzB,SAAS,EAAE,IAAA,iBAAO,EAAC,CAAC,CAAC,QAAQ,CAAC;gBAC9B,GAAG,EAAE,8CAA8C,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE;gBACjF,SAAS,EAAE,8CAA8C,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE;aACxF,CAAC,CAAC;YACH,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AAnCY,8BAAS;oBAAT,SAAS;IAPrB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,gDAAgD;KACvD,CAAC;qCAE0C,gCAAiB;GADhD,SAAS,CAmCrB"}
@@ -0,0 +1,9 @@
1
+ import { HotListSource } from '../interfaces/hot-list-source.interface';
2
+ import { HotListGetListResponse } from '../interfaces/hot-list.interface';
3
+ import { HttpClientService } from '../../http/http.service';
4
+ import { GetListOptions } from './source.types';
5
+ export declare class MiyousheSource implements HotListSource {
6
+ private readonly httpService;
7
+ constructor(httpService: HttpClientService);
8
+ getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
9
+ }
@@ -0,0 +1,88 @@
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.MiyousheSource = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
15
+ const http_service_1 = require("../../http/http.service");
16
+ const getTime_1 = require("../../utils/getTime");
17
+ const gameMap = {
18
+ '1': '崩坏3',
19
+ '2': '原神',
20
+ '3': '崩坏学园2',
21
+ '4': '未定事件簿',
22
+ '5': '大别野',
23
+ '6': '崩坏:星穹铁道',
24
+ '7': '暂无',
25
+ '8': '绝区零',
26
+ };
27
+ const typeMap = {
28
+ '1': '公告',
29
+ '2': '活动',
30
+ '3': '资讯',
31
+ };
32
+ let MiyousheSource = class MiyousheSource {
33
+ constructor(httpService) {
34
+ this.httpService = httpService;
35
+ }
36
+ async getList(options, noCache) {
37
+ const game = options?.game || '1';
38
+ const type = options?.type || '1';
39
+ const url = `https://bbs-api-static.miyoushe.com/painter/wapi/getNewsList?client_type=4&gids=${game}&last_id=&page_size=30&type=${type}`;
40
+ const result = await this.httpService.get({
41
+ url,
42
+ noCache,
43
+ });
44
+ const list = result.data.data.list || [];
45
+ return {
46
+ data: list.map((v) => {
47
+ const data = v.post;
48
+ return {
49
+ id: data.post_id,
50
+ title: data.subject,
51
+ desc: data.content,
52
+ cover: data.cover || data?.images?.[0],
53
+ author: v.user?.nickname || undefined,
54
+ timestamp: (0, getTime_1.getTime)(data.created_at),
55
+ hot: data.view_status || 0,
56
+ url: `https://www.miyoushe.com/ys/article/${data.post_id}`,
57
+ mobileUrl: `https://m.miyoushe.com/ys/#/article/${data.post_id}`,
58
+ };
59
+ }),
60
+ type: `最新${typeMap[type] || ''}`,
61
+ title: `米游社 · ${gameMap[game]} · ${typeMap[type]}`,
62
+ params: {
63
+ game: {
64
+ name: '游戏分类',
65
+ type: gameMap,
66
+ },
67
+ type: {
68
+ name: '榜单分类',
69
+ type: typeMap,
70
+ },
71
+ },
72
+ fromCache: result.fromCache,
73
+ updateTime: result.updateTime,
74
+ };
75
+ }
76
+ };
77
+ exports.MiyousheSource = MiyousheSource;
78
+ exports.MiyousheSource = MiyousheSource = __decorate([
79
+ (0, common_1.Injectable)(),
80
+ (0, hot_source_decorator_1.HotSource)({
81
+ name: 'miyoushe',
82
+ title: '米游社',
83
+ type: '最新动态',
84
+ link: 'https://www.miyoushe.com/',
85
+ }),
86
+ __metadata("design:paramtypes", [http_service_1.HttpClientService])
87
+ ], MiyousheSource);
88
+ //# sourceMappingURL=miyoushe.source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"miyoushe.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/miyoushe.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAA4C;AAG5C,MAAM,OAAO,GAA2B;IACtC,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,KAAK;CACX,CAAC;AAGF,MAAM,OAAO,GAA2B;IACtC,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;CACV,CAAC;AAeK,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,OAAuB,EACvB,OAAiB;QAEjB,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,GAAG,CAAC;QAClC,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,GAAG,CAAC;QAClC,MAAM,GAAG,GAAG,mFAAmF,IAAI,+BAA+B,IAAI,EAAE,CAAC;QACzI,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAsB;YAC7D,GAAG;YACH,OAAO;SACR,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,I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IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,2BAA2B;KAClC,CAAC;qCAE0C,gCAAiB;GADhD,cAAc,CA8C1B"}
@@ -0,0 +1,9 @@
1
+ import { HotListSource } from '../interfaces/hot-list-source.interface';
2
+ import { HotListGetListResponse } from '../interfaces/hot-list.interface';
3
+ import { HttpClientService } from '../../http/http.service';
4
+ import { GetListOptions } from './source.types';
5
+ export declare class NeteaseNewsSource implements HotListSource {
6
+ private readonly httpService;
7
+ constructor(httpService: HttpClientService);
8
+ getList(_options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
9
+ }