@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,87 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.HotListsController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const hot_lists_service_1 = require("./hot-lists.service");
18
+ const config_1 = require("@nestjs/config");
19
+ const hot_list_dto_1 = require("./dto/hot-list.dto");
20
+ const rss_service_1 = require("../rss/rss.service");
21
+ let HotListsController = class HotListsController {
22
+ constructor(hotListsService, configService, rssService) {
23
+ this.hotListsService = hotListsService;
24
+ this.configService = configService;
25
+ this.rssService = rssService;
26
+ }
27
+ getAllSources() {
28
+ const sources = this.hotListsService.getAllSourcesWithMetadata();
29
+ return {
30
+ code: 200,
31
+ count: sources.length,
32
+ routes: sources.map(({ name, title }) => ({
33
+ name,
34
+ title,
35
+ path: `/${name}`,
36
+ })),
37
+ };
38
+ }
39
+ async getHotList(source, query, res) {
40
+ const { limit, rss, ...otherParams } = query;
41
+ let { noCache = false } = query;
42
+ const notAllowedRefreshSource = this.configService.get('NOT_ALLOWED_REFRESH_SOURCE', '');
43
+ const hasNotRefresh = notAllowedRefreshSource.split(',').includes(source);
44
+ if (hasNotRefresh) {
45
+ noCache = false;
46
+ }
47
+ const listData = await this.hotListsService.getHotList(source, {
48
+ limit: limit ? parseInt(limit, 10) : undefined,
49
+ rss,
50
+ ...otherParams,
51
+ }, noCache);
52
+ if (limit && listData?.data?.length > parseInt(limit)) {
53
+ listData.total = parseInt(limit);
54
+ listData.data = listData.data.slice(0, parseInt(limit));
55
+ }
56
+ const rssEnabled = rss || this.configService.get('RSS_MODE');
57
+ if (rssEnabled) {
58
+ const rssContent = this.rssService.generateRss(listData);
59
+ res.header('Content-Type', 'application/xml; charset=utf-8');
60
+ return rssContent;
61
+ }
62
+ return { code: 200, ...listData };
63
+ }
64
+ };
65
+ exports.HotListsController = HotListsController;
66
+ __decorate([
67
+ (0, common_1.Get)('all'),
68
+ __metadata("design:type", Function),
69
+ __metadata("design:paramtypes", []),
70
+ __metadata("design:returntype", void 0)
71
+ ], HotListsController.prototype, "getAllSources", null);
72
+ __decorate([
73
+ (0, common_1.Get)(':source'),
74
+ __param(0, (0, common_1.Param)('source')),
75
+ __param(1, (0, common_1.Query)()),
76
+ __param(2, (0, common_1.Res)({ passthrough: true })),
77
+ __metadata("design:type", Function),
78
+ __metadata("design:paramtypes", [String, hot_list_dto_1.HotListQueryDto, Object]),
79
+ __metadata("design:returntype", Promise)
80
+ ], HotListsController.prototype, "getHotList", null);
81
+ exports.HotListsController = HotListsController = __decorate([
82
+ (0, common_1.Controller)('hot-lists'),
83
+ __metadata("design:paramtypes", [hot_lists_service_1.HotListsService,
84
+ config_1.ConfigService,
85
+ rss_service_1.RssService])
86
+ ], HotListsController);
87
+ //# sourceMappingURL=hot-lists.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hot-lists.controller.js","sourceRoot":"","sources":["../../src/host-lists/hot-lists.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoE;AACpE,2DAAsD;AACtD,2CAA+C;AAC/C,qDAAqD;AAErD,oDAAgD;AAGzC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YACmB,eAAgC,EAChC,aAA4B,EAC5B,UAAsB;QAFtB,oBAAe,GAAf,eAAe,CAAiB;QAChC,kBAAa,GAAb,aAAa,CAAe;QAC5B,eAAU,GAAV,UAAU,CAAY;IACtC,CA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C;YACjC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1D,CAAC;QAGD,MAAM,UAAU,GAAG,GAAG,IAAI,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC7D,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YACzD,GAAG,CAAC,MAAM,CAAC,cAAc,EAAE,gCAAgC,CAAC,CAAC;YAC7D,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC;IACpC,CAAC;CACF,CAAA;AApEY,gDAAkB;AAQ7B;IADC,IAAA,YAAG,EAAC,KAAK,CAAC;;;;uDAYV;AAGK;IADL,IAAA,YAAG,EAAC,SAAS,CAAC;IAEZ,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;IACf,WAAA,IAAA,cAAK,GAAE,CAAA;IACP,WAAA,IAAA,YAAG,EAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAA;;6CADX,8BAAe;;oDA2ChC;6BAnEU,kBAAkB;IAD9B,IAAA,mBAAU,EAAC,WAAW,CAAC;qCAGc,mCAAe;QACjB,sBAAa;QAChB,wBAAU;GAJ9B,kBAAkB,CAoE9B"}
@@ -0,0 +1,2 @@
1
+ export declare class HotListsModule {
2
+ }
@@ -0,0 +1,36 @@
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.HotListsModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const axios_1 = require("@nestjs/axios");
12
+ const core_1 = require("@nestjs/core");
13
+ const hot_lists_controller_1 = require("./hot-lists.controller");
14
+ const hot_lists_service_1 = require("./hot-lists.service");
15
+ const sources_1 = require("./sources");
16
+ const http_module_1 = require("../http/http.module");
17
+ const token_module_1 = require("../token/token.module");
18
+ const rss_module_1 = require("../rss/rss.module");
19
+ let HotListsModule = class HotListsModule {
20
+ };
21
+ exports.HotListsModule = HotListsModule;
22
+ exports.HotListsModule = HotListsModule = __decorate([
23
+ (0, common_1.Module)({
24
+ imports: [
25
+ core_1.DiscoveryModule,
26
+ http_module_1.HttpClientModule,
27
+ axios_1.HttpModule.register({ timeout: 8000 }),
28
+ token_module_1.TokenModule,
29
+ rss_module_1.RssModule,
30
+ ],
31
+ controllers: [hot_lists_controller_1.HotListsController],
32
+ providers: [hot_lists_service_1.HotListsService, ...sources_1.HOT_LIST_SOURCES],
33
+ exports: [hot_lists_service_1.HotListsService],
34
+ })
35
+ ], HotListsModule);
36
+ //# sourceMappingURL=hot-lists.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hot-lists.module.js","sourceRoot":"","sources":["../../src/host-lists/hot-lists.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,yCAA2C;AAC3C,uCAA+C;AAC/C,iEAA4D;AAC5D,2DAAsD;AACtD,uCAA6C;AAC7C,qDAAuD;AACvD,wDAAoD;AACpD,kDAA8C;AAmBvC,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAjB1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YAEP,sBAAe;YAEf,8BAAgB;YAEhB,kBAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAEtC,0BAAW;YAEX,sBAAS;SACV;QACD,WAAW,EAAE,CAAC,yCAAkB,CAAC;QACjC,SAAS,EAAE,CAAC,mCAAe,EAAE,GAAG,0BAAgB,CAAC;QACjD,OAAO,EAAE,CAAC,mCAAe,CAAC;KAC3B,CAAC;GACW,cAAc,CAAG"}
@@ -0,0 +1,21 @@
1
+ import { OnModuleInit } from '@nestjs/common';
2
+ import { DiscoveryService } from '@nestjs/core';
3
+ import { RouterData } from './interfaces/router-data.interface';
4
+ import { GetListOptions } from './sources/source.types';
5
+ export declare class HotListsService implements OnModuleInit {
6
+ private readonly discoveryService;
7
+ private readonly sources;
8
+ private readonly sourceMetadata;
9
+ private readonly logger;
10
+ constructor(discoveryService: DiscoveryService);
11
+ onModuleInit(): Promise<void>;
12
+ private discoverSources;
13
+ private isHotListSource;
14
+ getAllSources(): string[];
15
+ getAllSourcesWithMetadata(): Array<{
16
+ name: string;
17
+ title: string;
18
+ }>;
19
+ getHotList(sourceName: string, options: GetListOptions, noCache?: boolean): Promise<RouterData>;
20
+ fetchSource(sourceName: string, options: GetListOptions, noCache?: boolean): Promise<RouterData>;
21
+ }
@@ -0,0 +1,115 @@
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 HotListsService_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.HotListsService = void 0;
14
+ const common_1 = require("@nestjs/common");
15
+ const core_1 = require("@nestjs/core");
16
+ const hot_source_decorator_1 = require("./decorators/hot-source.decorator");
17
+ const common_2 = require("@nestjs/common");
18
+ let HotListsService = HotListsService_1 = class HotListsService {
19
+ constructor(discoveryService) {
20
+ this.discoveryService = discoveryService;
21
+ this.sources = new Map();
22
+ this.sourceMetadata = new Map();
23
+ this.logger = new common_2.Logger(HotListsService_1.name);
24
+ }
25
+ async onModuleInit() {
26
+ await this.discoverSources();
27
+ }
28
+ async discoverSources() {
29
+ const providers = this.discoveryService.getProviders();
30
+ await Promise.all(providers.map((provider) => {
31
+ if (provider.instance && provider.metatype) {
32
+ const metadata = Reflect.getMetadata(hot_source_decorator_1.HOT_SOURCE_METADATA, provider.metatype);
33
+ if (metadata && this.isHotListSource(provider.instance)) {
34
+ const { name, title, type, link, description } = metadata;
35
+ if (this.sources.has(name)) {
36
+ throw new Error(`Duplicate hot list source name: ${name}`);
37
+ }
38
+ this.sources.set(name, provider.instance);
39
+ this.sourceMetadata.set(name, {
40
+ title,
41
+ type: type ?? '热榜',
42
+ link,
43
+ description,
44
+ });
45
+ this.logger.log(`Registered hot list source: ${name} - ${title}`);
46
+ }
47
+ }
48
+ return Promise.resolve();
49
+ }));
50
+ }
51
+ isHotListSource(instance) {
52
+ return (instance !== null &&
53
+ typeof instance === 'object' &&
54
+ 'getList' in instance &&
55
+ typeof instance.getList === 'function');
56
+ }
57
+ getAllSources() {
58
+ return Array.from(this.sources.keys());
59
+ }
60
+ getAllSourcesWithMetadata() {
61
+ return Array.from(this.sources.keys()).map((name) => ({
62
+ name,
63
+ title: this.sourceMetadata.get(name)?.title ?? name,
64
+ }));
65
+ }
66
+ async getHotList(sourceName, options, noCache = false) {
67
+ try {
68
+ return await this.fetchSource(sourceName, options, noCache);
69
+ }
70
+ catch (error) {
71
+ if (error instanceof common_1.NotFoundException)
72
+ throw error;
73
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
74
+ this.logger.error(`Failed to get data from ${sourceName}: ${errorMessage}`);
75
+ const metadata = this.sourceMetadata.get(sourceName);
76
+ return {
77
+ name: sourceName,
78
+ title: metadata?.title || sourceName,
79
+ type: metadata?.type || '热榜',
80
+ link: metadata?.link,
81
+ description: metadata?.description,
82
+ total: 0,
83
+ data: [],
84
+ fromCache: false,
85
+ updateTime: new Date().toISOString(),
86
+ message: `Failed to get data: ${errorMessage}`,
87
+ };
88
+ }
89
+ }
90
+ async fetchSource(sourceName, options, noCache = false) {
91
+ const source = this.sources.get(sourceName);
92
+ if (!source)
93
+ throw new common_1.NotFoundException(`Source '${sourceName}' not found`);
94
+ const result = await source.getList(options, noCache);
95
+ const metadata = this.sourceMetadata.get(sourceName);
96
+ return {
97
+ name: sourceName,
98
+ title: metadata?.title || sourceName,
99
+ type: result.type || metadata?.type || '热榜',
100
+ link: metadata?.link,
101
+ description: metadata?.description,
102
+ total: result.data.length,
103
+ data: result.data,
104
+ fromCache: result.fromCache ?? false,
105
+ updateTime: result.updateTime ?? new Date().toISOString(),
106
+ params: result.params,
107
+ };
108
+ }
109
+ };
110
+ exports.HotListsService = HotListsService;
111
+ exports.HotListsService = HotListsService = HotListsService_1 = __decorate([
112
+ (0, common_1.Injectable)(),
113
+ __metadata("design:paramtypes", [core_1.DiscoveryService])
114
+ ], HotListsService);
115
+ //# sourceMappingURL=hot-lists.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hot-lists.service.js","sourceRoot":"","sources":["../../src/host-lists/hot-lists.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA6E;AAC7E,uCAAgD;AAGhD,4EAG2C;AAC3C,2CAAwC;AAIjC,IAAM,eAAe,uBAArB,MAAM,eAAe;IAQ1B,YAA6B,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAP9C,YAAO,GAA+B,IAAI,GAA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,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACzD,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC;IACJ,CAAC;CACF,CAAA;AApJY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCASoC,uBAAgB;GARpD,eAAe,CAoJ3B"}
@@ -0,0 +1,5 @@
1
+ import { HotListGetListResponse } from './hot-list.interface';
2
+ import { GetListOptions } from '../sources/source.types';
3
+ export interface HotListSource {
4
+ getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=hot-list-source.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hot-list-source.interface.js","sourceRoot":"","sources":["../../../src/host-lists/interfaces/hot-list-source.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,31 @@
1
+ export interface HotListItem {
2
+ id: string | number;
3
+ title: string;
4
+ desc?: string;
5
+ cover?: string;
6
+ author?: string;
7
+ hot?: number | string;
8
+ timestamp?: number;
9
+ url: string;
10
+ mobileUrl: string;
11
+ }
12
+ export interface HotListGetListResponse {
13
+ data: HotListItem[];
14
+ type?: string;
15
+ fromCache?: boolean;
16
+ params?: {
17
+ type: {
18
+ name: string;
19
+ type: Record<string, string>;
20
+ };
21
+ range?: {
22
+ name: string;
23
+ type: Record<string, string>;
24
+ };
25
+ [key: string]: {
26
+ name: string;
27
+ type: Record<string, string>;
28
+ } | undefined;
29
+ };
30
+ [key: string]: any;
31
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=hot-list.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hot-list.interface.js","sourceRoot":"","sources":["../../../src/host-lists/interfaces/hot-list.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { HotListItem } from './hot-list.interface';
2
+ export interface RouterData {
3
+ name: string;
4
+ title: string;
5
+ type: string;
6
+ description?: string;
7
+ link?: string;
8
+ total: number;
9
+ data: HotListItem[];
10
+ fromCache?: boolean;
11
+ updateTime?: string;
12
+ message?: string;
13
+ params?: {
14
+ type: {
15
+ name: string;
16
+ type: Record<string, string>;
17
+ };
18
+ };
19
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=router-data.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router-data.interface.js","sourceRoot":"","sources":["../../../src/host-lists/interfaces/router-data.interface.ts"],"names":[],"mappings":""}
@@ -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 Kr36Source implements HotListSource {
6
+ private readonly httpService;
7
+ constructor(httpService: HttpClientService);
8
+ getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
9
+ }
@@ -0,0 +1,89 @@
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.Kr36Source = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
15
+ const http_service_1 = require("../../http/http.service");
16
+ const getTime_1 = require("../../utils/getTime");
17
+ const typeMap = {
18
+ hot: '人气榜',
19
+ video: '视频榜',
20
+ comment: '热议榜',
21
+ collect: '收藏榜',
22
+ };
23
+ let Kr36Source = class Kr36Source {
24
+ constructor(httpService) {
25
+ this.httpService = httpService;
26
+ }
27
+ async getList(options, noCache) {
28
+ const type = options?.type ?? 'hot';
29
+ const url = `https://gateway.36kr.com/api/mis/nav/home/nav/rank/${type}`;
30
+ const result = await this.httpService.post({
31
+ url,
32
+ noCache,
33
+ headers: {
34
+ 'Content-Type': 'application/json; charset=utf-8',
35
+ },
36
+ data: {
37
+ partner_id: 'wap',
38
+ param: {
39
+ siteId: 1,
40
+ platformId: 2,
41
+ },
42
+ timestamp: new Date().getTime(),
43
+ },
44
+ });
45
+ const listType = {
46
+ hot: 'hotRankList',
47
+ video: 'videoList',
48
+ comment: 'remarkList',
49
+ collect: 'collectList',
50
+ };
51
+ const list = result.data.data[listType[type || 'hot']] || [];
52
+ return {
53
+ data: list.map((v) => {
54
+ const item = v.templateMaterial;
55
+ return {
56
+ id: v.itemId,
57
+ title: item.widgetTitle,
58
+ cover: item.widgetImage,
59
+ author: item.authorName,
60
+ timestamp: (0, getTime_1.getTime)(v.publishTime),
61
+ hot: item.statCollect || undefined,
62
+ url: `https://www.36kr.com/${type === 'video' ? 'video' : 'p'}/${v.itemId}`,
63
+ mobileUrl: `https://m.36kr.com/${type === 'video' ? 'video' : 'p'}/${v.itemId}`,
64
+ };
65
+ }),
66
+ type: typeMap[type] || '热搜',
67
+ params: {
68
+ type: {
69
+ name: '热搜类别',
70
+ type: typeMap,
71
+ },
72
+ },
73
+ fromCache: result.fromCache,
74
+ updateTime: result.updateTime,
75
+ };
76
+ }
77
+ };
78
+ exports.Kr36Source = Kr36Source;
79
+ exports.Kr36Source = Kr36Source = __decorate([
80
+ (0, common_1.Injectable)(),
81
+ (0, hot_source_decorator_1.HotSource)({
82
+ name: '36kr',
83
+ title: '36氪',
84
+ type: '热榜',
85
+ link: 'https://m.36kr.com/hot-list-m',
86
+ }),
87
+ __metadata("design:paramtypes", [http_service_1.HttpClientService])
88
+ ], Kr36Source);
89
+ //# sourceMappingURL=36kr.source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"36kr.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/36kr.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAA4C;AAW5C,MAAM,OAAO,GAA2B;IACtC,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,KAAK;IACZ,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;CACf,CAAC;AASK,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,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,KAAK,CAAC;QAEpC,MAAM,GAAG,GAAG,sDAAsD,IAAI,EAAE,CAAC;QACzE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAkB;YAC1D,GAAG;YACH,OAAO;YACP,OAAO,EAAE;gBACP,cAAc,EAAE,iCAAiC;aAClD;YACD,IAAI,EAAE;gBACJ,UAAU,EAAE,KAAK;gBACjB,KAAK,EAAE;oBACL,MAAM,EAAE,CAAC;oBACT,UAAU,EAAE,CAAC;iBACd;gBACD,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;aAChC;SACF,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG;YACf,GAAG,EAAE,aAAa;YAClB,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,YAAY;YACrB,OAAO,EAAE,aAAa;S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AI,EAAE,+BAA+B;KACtC,CAAC;qCAE0C,gCAAiB;GADhD,UAAU,CA2DtB"}
@@ -0,0 +1,11 @@
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
+ import { TokenService } from 'src/token/token.service';
6
+ export declare class _51ctoSource implements HotListSource {
7
+ private readonly httpService;
8
+ private readonly tokenService;
9
+ constructor(httpService: HttpClientService, tokenService: TokenService);
10
+ getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
11
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports._51ctoSource = 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 token_service_1 = require("../../token/token.service");
17
+ const tools_1 = require("../../token/tools");
18
+ let _51ctoSource = class _51ctoSource {
19
+ constructor(httpService, tokenService) {
20
+ this.httpService = httpService;
21
+ this.tokenService = tokenService;
22
+ }
23
+ async getList(options, noCache) {
24
+ const url = `https://api-media.51cto.com/index/index/recommend`;
25
+ const params = {
26
+ page: 1,
27
+ page_size: 50,
28
+ limit_time: 0,
29
+ name_en: '',
30
+ };
31
+ const timestamp = Date.now();
32
+ const token = await this.tokenService.get51ctoToken();
33
+ const result = await this.httpService.get({
34
+ url,
35
+ noCache,
36
+ params: {
37
+ ...params,
38
+ timestamp,
39
+ token,
40
+ sign: (0, tools_1.sign)('index/index/recommend', params, timestamp, token),
41
+ },
42
+ });
43
+ const list = result.data?.data?.data?.list || [];
44
+ return {
45
+ data: list.map((v) => ({
46
+ id: v.source_id,
47
+ title: v.title,
48
+ cover: v.cover,
49
+ desc: v.abstract,
50
+ hot: undefined,
51
+ url: v.url,
52
+ mobileUrl: v.url,
53
+ })),
54
+ fromCache: result.fromCache,
55
+ updateTime: result.updateTime,
56
+ };
57
+ }
58
+ };
59
+ exports._51ctoSource = _51ctoSource;
60
+ exports._51ctoSource = _51ctoSource = __decorate([
61
+ (0, common_1.Injectable)(),
62
+ (0, hot_source_decorator_1.HotSource)({
63
+ name: '51cto',
64
+ title: '51CTO',
65
+ type: '热榜',
66
+ link: 'https://www.51cto.com/',
67
+ }),
68
+ __metadata("design:paramtypes", [http_service_1.HttpClientService,
69
+ token_service_1.TokenService])
70
+ ], _51ctoSource);
71
+ //# sourceMappingURL=51cto.source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"51cto.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/51cto.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,6DAAuD;AACvD,6CAAuC;AAiBhC,IAAM,YAAY,GAAlB,MAAM,YAAY;IACvB,YACmB,WAA8B,EAC9B,YAA0B;QAD1B,gBAAW,GAAX,WAAW,CAAmB;QAC9B,iBAAY,GAAZ,YAAY,CAAc;IAC1C,CAAC;IAEJ,KAAK,CAAC,OAAO,CACX,OAAuB,EACvB,OAAiB;QAEjB,MAAM,GAAG,GAAG,mDAAmD,CAAC;QAChE,MAAM,MAAM,GAAG;Y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qCAGgC,gCAAiB;QAChB,4BAAY;GAHlC,YAAY,CA4CxB"}
@@ -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 PojieSource implements HotListSource {
6
+ private readonly httpService;
7
+ constructor(httpService: HttpClientService);
8
+ getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
9
+ }