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