@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,23 @@
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.BriefDateParamDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class BriefDateParamDto {
15
+ }
16
+ exports.BriefDateParamDto = BriefDateParamDto;
17
+ __decorate([
18
+ (0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
19
+ message: 'date must be in YYYY-MM-DD format',
20
+ }),
21
+ __metadata("design:type", String)
22
+ ], BriefDateParamDto.prototype, "date", void 0);
23
+ //# sourceMappingURL=brief-date-param.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brief-date-param.dto.js","sourceRoot":"","sources":["../../../src/daily-brief/dto/brief-date-param.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA0C;AAE1C,MAAa,iBAAiB;CAK7B;AALD,8CAKC;AADC;IAHC,IAAA,yBAAO,EAAC,qBAAqB,EAAE;QAC9B,OAAO,EAAE,mCAAmC;KAC7C,CAAC;;+CACW"}
@@ -0,0 +1,6 @@
1
+ export declare class GenerateBriefDto {
2
+ date?: string;
3
+ period?: string;
4
+ sources?: string[];
5
+ force?: boolean;
6
+ }
@@ -0,0 +1,39 @@
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.GenerateBriefDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class GenerateBriefDto {
15
+ }
16
+ exports.GenerateBriefDto = GenerateBriefDto;
17
+ __decorate([
18
+ (0, class_validator_1.IsOptional)(),
19
+ (0, class_validator_1.IsString)(),
20
+ (0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/),
21
+ __metadata("design:type", String)
22
+ ], GenerateBriefDto.prototype, "date", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsOptional)(),
25
+ (0, class_validator_1.IsString)(),
26
+ __metadata("design:type", String)
27
+ ], GenerateBriefDto.prototype, "period", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsOptional)(),
30
+ (0, class_validator_1.IsArray)(),
31
+ (0, class_validator_1.IsString)({ each: true }),
32
+ __metadata("design:type", Array)
33
+ ], GenerateBriefDto.prototype, "sources", void 0);
34
+ __decorate([
35
+ (0, class_validator_1.IsOptional)(),
36
+ (0, class_validator_1.IsBoolean)(),
37
+ __metadata("design:type", Boolean)
38
+ ], GenerateBriefDto.prototype, "force", void 0);
39
+ //# sourceMappingURL=generate-brief.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-brief.dto.js","sourceRoot":"","sources":["../../../src/daily-brief/dto/generate-brief.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAMyB;AAEzB,MAAa,gBAAgB;CAkB5B;AAlBD,4CAkBC;AAdC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,yBAAO,EAAC,qBAAqB,CAAC;;8CACjB;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;gDACK;AAKhB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;iDACN;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;+CACI"}
@@ -0,0 +1,6 @@
1
+ export declare class ListBriefsQueryDto {
2
+ page?: number;
3
+ limit?: number;
4
+ status?: 'generating' | 'success' | 'failed';
5
+ period?: string;
6
+ }
@@ -0,0 +1,42 @@
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.ListBriefsQueryDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ class ListBriefsQueryDto {
16
+ }
17
+ exports.ListBriefsQueryDto = ListBriefsQueryDto;
18
+ __decorate([
19
+ (0, class_validator_1.IsOptional)(),
20
+ (0, class_transformer_1.Type)(() => Number),
21
+ (0, class_validator_1.IsInt)(),
22
+ (0, class_validator_1.Min)(1),
23
+ __metadata("design:type", Number)
24
+ ], ListBriefsQueryDto.prototype, "page", void 0);
25
+ __decorate([
26
+ (0, class_validator_1.IsOptional)(),
27
+ (0, class_transformer_1.Type)(() => Number),
28
+ (0, class_validator_1.IsInt)(),
29
+ (0, class_validator_1.Min)(1),
30
+ __metadata("design:type", Number)
31
+ ], ListBriefsQueryDto.prototype, "limit", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsOptional)(),
34
+ (0, class_validator_1.IsIn)(['generating', 'success', 'failed']),
35
+ __metadata("design:type", String)
36
+ ], ListBriefsQueryDto.prototype, "status", void 0);
37
+ __decorate([
38
+ (0, class_validator_1.IsOptional)(),
39
+ (0, class_validator_1.IsString)(),
40
+ __metadata("design:type", String)
41
+ ], ListBriefsQueryDto.prototype, "period", void 0);
42
+ //# sourceMappingURL=list-briefs-query.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-briefs-query.dto.js","sourceRoot":"","sources":["../../../src/daily-brief/dto/list-briefs-query.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAAyE;AAEzE,MAAa,kBAAkB;CAoB9B;AApBD,gDAoBC;AAfC;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;gDACO;AAMd;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;iDACQ;AAIf;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,sBAAI,EAAC,CAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;;kDACG;AAI7C;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;kDACK"}
@@ -0,0 +1,6 @@
1
+ export declare class StockRankingQueryDto {
2
+ period?: string;
3
+ startDate?: string;
4
+ endDate?: string;
5
+ limit?: number;
6
+ }
@@ -0,0 +1,46 @@
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.StockRankingQueryDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ class StockRankingQueryDto {
16
+ constructor() {
17
+ this.limit = 50;
18
+ }
19
+ }
20
+ exports.StockRankingQueryDto = StockRankingQueryDto;
21
+ __decorate([
22
+ (0, class_validator_1.IsOptional)(),
23
+ (0, class_validator_1.IsString)(),
24
+ __metadata("design:type", String)
25
+ ], StockRankingQueryDto.prototype, "period", void 0);
26
+ __decorate([
27
+ (0, class_validator_1.IsOptional)(),
28
+ (0, class_validator_1.IsString)(),
29
+ (0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/),
30
+ __metadata("design:type", String)
31
+ ], StockRankingQueryDto.prototype, "startDate", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsOptional)(),
34
+ (0, class_validator_1.IsString)(),
35
+ (0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/),
36
+ __metadata("design:type", String)
37
+ ], StockRankingQueryDto.prototype, "endDate", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.IsOptional)(),
40
+ (0, class_transformer_1.Type)(() => Number),
41
+ (0, class_validator_1.IsInt)(),
42
+ (0, class_validator_1.Min)(1),
43
+ (0, class_validator_1.Max)(200),
44
+ __metadata("design:type", Number)
45
+ ], StockRankingQueryDto.prototype, "limit", void 0);
46
+ //# sourceMappingURL=stock-ranking-query.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stock-ranking-query.dto.js","sourceRoot":"","sources":["../../../src/daily-brief/dto/stock-ranking-query.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAOyB;AAEzB,MAAa,oBAAoB;IAAjC;QAoBE,UAAK,GAAY,EAAE,CAAC;IACtB,CAAC;CAAA;AArBD,oDAqBC;AAlBC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACK;AAKhB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,yBAAO,EAAC,qBAAqB,CAAC;;uDACZ;AAKnB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,yBAAO,EAAC,qBAAqB,CAAC;;qDACd;AAOjB;IALC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;IACN,IAAA,qBAAG,EAAC,GAAG,CAAC;;mDACW"}
@@ -0,0 +1,59 @@
1
+ import type { SearchProviderName } from './search-provider.interface';
2
+ export interface BriefInputItem {
3
+ source: string;
4
+ title: string;
5
+ desc?: string;
6
+ hot?: number | string;
7
+ url: string;
8
+ mobileUrl?: string;
9
+ timestamp?: number;
10
+ }
11
+ export interface BriefSearchResult {
12
+ title: string;
13
+ url: string;
14
+ content?: string;
15
+ score?: number;
16
+ }
17
+ export interface BriefSearchEvidence {
18
+ topicTitle: string;
19
+ query: string;
20
+ provider: SearchProviderName | null;
21
+ results: BriefSearchResult[];
22
+ }
23
+ export interface BriefTopic {
24
+ title: string;
25
+ event: string;
26
+ importance: string;
27
+ impactDirection: '利好' | '利空' | '中性' | '待验证';
28
+ impactHorizon: '短期' | '中期' | '长期';
29
+ confidence: number;
30
+ industryChain: {
31
+ upstream: string[];
32
+ midstream: string[];
33
+ downstream: string[];
34
+ bottlenecks: string[];
35
+ };
36
+ aShareMapping: Array<{
37
+ company: string;
38
+ code?: string;
39
+ logic: string;
40
+ relationType: '直接受益' | '间接受益' | '题材映射' | '承压' | '待验证';
41
+ }>;
42
+ risks: string[];
43
+ followUpSignals: string[];
44
+ sourceUrls: string[];
45
+ }
46
+ export interface BriefAnalysis {
47
+ summary: string;
48
+ highlights: string[];
49
+ topics: BriefTopic[];
50
+ risks: string[];
51
+ followUpSignals: string[];
52
+ markdown: string;
53
+ }
54
+ export interface GenerateBriefOptions {
55
+ date?: string;
56
+ period?: string;
57
+ sources?: string[];
58
+ force?: boolean;
59
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=daily-brief.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daily-brief.interface.js","sourceRoot":"","sources":["../../../src/daily-brief/interfaces/daily-brief.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import type { BriefSearchResult } from './daily-brief.interface';
2
+ export type SearchProviderName = 'tavily' | 'deepseek';
3
+ export interface SearchProvider {
4
+ readonly name: SearchProviderName;
5
+ isConfigured(): boolean;
6
+ search(query: string): Promise<BriefSearchResult[]>;
7
+ }
8
+ export interface SearchOutcome {
9
+ provider: SearchProviderName | null;
10
+ results: BriefSearchResult[];
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=search-provider.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-provider.interface.js","sourceRoot":"","sources":["../../../src/daily-brief/interfaces/search-provider.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare const formatBriefDate: (date: Date, tz: string) => string;
2
+ export declare const endOfBriefDate: (briefDate: string, tz: string) => Date;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.endOfBriefDate = exports.formatBriefDate = void 0;
7
+ const dayjs_1 = __importDefault(require("dayjs"));
8
+ const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
9
+ const utc_1 = __importDefault(require("dayjs/plugin/utc"));
10
+ dayjs_1.default.extend(utc_1.default);
11
+ dayjs_1.default.extend(timezone_1.default);
12
+ const formatBriefDate = (date, tz) => (0, dayjs_1.default)(date).tz(tz).format('YYYY-MM-DD');
13
+ exports.formatBriefDate = formatBriefDate;
14
+ const endOfBriefDate = (briefDate, tz) => dayjs_1.default.tz(`${briefDate} 23:59:59`, tz).toDate();
15
+ exports.endOfBriefDate = endOfBriefDate;
16
+ //# sourceMappingURL=brief-date.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brief-date.js","sourceRoot":"","sources":["../../../src/daily-brief/utils/brief-date.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,qEAA6C;AAC7C,2DAAmC;AAEnC,eAAK,CAAC,MAAM,CAAC,aAAG,CAAC,CAAC;AAClB,eAAK,CAAC,MAAM,CAAC,kBAAQ,CAAC,CAAC;AAGhB,MAAM,eAAe,GAAG,CAAC,IAAU,EAAE,EAAU,EAAU,EAAE,CAChE,IAAA,eAAK,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAD7B,QAAA,eAAe,mBACc;AAGnC,MAAM,cAAc,GAAG,CAAC,SAAiB,EAAE,EAAU,EAAQ,EAAE,CACpE,eAAK,CAAC,EAAE,CAAC,GAAG,SAAS,WAAW,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AADpC,QAAA,cAAc,kBACsB"}
@@ -0,0 +1 @@
1
+ export declare function mapWithConcurrency<T, R>(items: T[], concurrency: number, mapper: (item: T, index: number) => Promise<R>): Promise<R[]>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapWithConcurrency = mapWithConcurrency;
4
+ async function mapWithConcurrency(items, concurrency, mapper) {
5
+ const limit = Math.max(1, Math.floor(concurrency) || 1);
6
+ if (items.length === 0) {
7
+ return [];
8
+ }
9
+ const results = new Array(items.length);
10
+ let cursor = 0;
11
+ const worker = async () => {
12
+ while (cursor < items.length) {
13
+ const index = cursor++;
14
+ results[index] = await mapper(items[index], index);
15
+ }
16
+ };
17
+ await Promise.all(Array.from({ length: Math.min(limit, items.length) }, () => worker()));
18
+ return results;
19
+ }
20
+ //# sourceMappingURL=concurrency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"concurrency.js","sourceRoot":"","sources":["../../../src/daily-brief/utils/concurrency.ts"],"names":[],"mappings":";;AAIA,gDAyBC;AAzBM,KAAK,UAAU,kBAAkB,CACtC,KAAU,EACV,WAAmB,EACnB,MAA8C;IAE9C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IACxD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,KAAK,CAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,MAAM,MAAM,GAAG,KAAK,IAAI,EAAE;QACxB,OAAO,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YAC7B,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC;YACvB,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;QACrD,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,OAAO,CAAC,GAAG,CACf,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CACtE,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare class DatabaseModule {
2
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.DatabaseModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const mongoose_1 = require("@nestjs/mongoose");
12
+ const config_1 = require("@nestjs/config");
13
+ const hot_item_schema_1 = require("./schemas/hot-item.schema");
14
+ const daily_brief_schema_1 = require("./schemas/daily-brief.schema");
15
+ const source_config_schema_1 = require("./schemas/source-config.schema");
16
+ const daily_brief_repository_1 = require("./repositories/daily-brief.repository");
17
+ const hot_item_repository_1 = require("./repositories/hot-item.repository");
18
+ const source_config_repository_1 = require("./repositories/source-config.repository");
19
+ let DatabaseModule = class DatabaseModule {
20
+ };
21
+ exports.DatabaseModule = DatabaseModule;
22
+ exports.DatabaseModule = DatabaseModule = __decorate([
23
+ (0, common_1.Module)({
24
+ imports: [
25
+ mongoose_1.MongooseModule.forRootAsync({
26
+ useFactory: (configService) => ({
27
+ uri: configService.get('MONGODB_URI') ||
28
+ 'mongodb://localhost:27017/daily-hot-api',
29
+ lazyConnection: true,
30
+ retryAttempts: 3,
31
+ retryDelay: 2000,
32
+ serverSelectionTimeoutMS: 5000,
33
+ connectTimeoutMS: 5000,
34
+ socketTimeoutMS: 10000,
35
+ connectionFactory: (connection) => {
36
+ connection.on('error', (error) => {
37
+ console.warn('MongoDB连接错误,但服务继续运行:', error.message);
38
+ });
39
+ connection.on('disconnected', () => {
40
+ console.warn('MongoDB连接断开,但服务继续运行');
41
+ });
42
+ return connection;
43
+ },
44
+ }),
45
+ inject: [config_1.ConfigService],
46
+ }),
47
+ mongoose_1.MongooseModule.forFeature([
48
+ { name: hot_item_schema_1.HotItem.name, schema: hot_item_schema_1.HotItemSchema },
49
+ { name: daily_brief_schema_1.DailyBrief.name, schema: daily_brief_schema_1.DailyBriefSchema },
50
+ { name: source_config_schema_1.SourceConfig.name, schema: source_config_schema_1.SourceConfigSchema },
51
+ ]),
52
+ ],
53
+ providers: [hot_item_repository_1.HotItemRepository, daily_brief_repository_1.DailyBriefRepository, source_config_repository_1.SourceConfigRepository],
54
+ exports: [hot_item_repository_1.HotItemRepository, daily_brief_repository_1.DailyBriefRepository, source_config_repository_1.SourceConfigRepository],
55
+ })
56
+ ], DatabaseModule);
57
+ //# sourceMappingURL=database.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.module.js","sourceRoot":"","sources":["../../src/database/database.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAClD,2CAA+C;AAC/C,+DAAmE;AACnE,qEAA4E;AAC5E,yEAGwC;AACxC,kFAA6E;AAC7E,4EAAuE;AACvE,sFAAiF;AAqC1E,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAnC1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,yBAAc,CAAC,YAAY,CAAC;gBAC1B,UAAU,EAAE,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC;oBAC7C,GAAG,EACD,aAAa,CAAC,GAAG,CAAS,aAAa,CAAC;wBACxC,yCAAyC;oBAC3C,cAAc,EAAE,IAAI;oBACpB,aAAa,EAAE,CAAC;oBAChB,UAAU,EAAE,IAAI;oBAChB,wBAAwB,EAAE,IAAI;oBAC9B,gBAAgB,EAAE,IAAI;oBACtB,eAAe,EAAE,KAAK;oBACtB,iBAAiB,EAAE,CAAC,UAAU,EAAE,EAAE;wBAChC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;4BAC/B,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;wBACtD,CAAC,CAAC,CAAC;wBACH,UAAU,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;4BACjC,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;wBACtC,CAAC,CAAC,CAAC;wBAEH,OAAO,UAAU,CAAC;oBACpB,CAAC;iBACF,CAAC;gBACF,MAAM,EAAE,CAAC,sBAAa,CAAC;aACxB,CAAC;YACF,yBAAc,CAAC,UAAU,CAAC;gBACxB,EAAE,IAAI,EAAE,yBAAO,CAAC,IAAI,EAAE,MAAM,EAAE,+BAAa,EAAE;gBAC7C,EAAE,IAAI,EAAE,+BAAU,CAAC,IAAI,EAAE,MAAM,EAAE,qCAAgB,EAAE;gBACnD,EAAE,IAAI,EAAE,mCAAY,CAAC,IAAI,EAAE,MAAM,EAAE,yCAAkB,EAAE;aACxD,CAAC;SACH;QACD,SAAS,EAAE,CAAC,uCAAiB,EAAE,6CAAoB,EAAE,iDAAsB,CAAC;QAC5E,OAAO,EAAE,CAAC,uCAAiB,EAAE,6CAAoB,EAAE,iDAAsB,CAAC;KAC3E,CAAC;GACW,cAAc,CAAG"}
@@ -0,0 +1,96 @@
1
+ import { Model } from 'mongoose';
2
+ import { DailyBriefDocument } from '../schemas/daily-brief.schema';
3
+ export interface DailyBriefListOptions {
4
+ page?: number;
5
+ limit?: number;
6
+ status?: 'generating' | 'success' | 'failed';
7
+ period?: string;
8
+ }
9
+ export interface DailyBriefListItem {
10
+ status: 'generating' | 'success' | 'failed';
11
+ briefDate: string;
12
+ period: string;
13
+ analysis: {
14
+ summary?: string;
15
+ };
16
+ topicCount?: number;
17
+ updatedAt?: Date;
18
+ }
19
+ interface DeleteBriefResult {
20
+ deletedCount?: number;
21
+ }
22
+ export interface StockRankingOptions {
23
+ period?: string;
24
+ startDate?: string;
25
+ endDate?: string;
26
+ limit?: number;
27
+ }
28
+ export interface StockRankingItem {
29
+ company: string;
30
+ code: string | null;
31
+ appearanceCount: number;
32
+ briefCount: number;
33
+ firstAppearedDate: string;
34
+ lastAppearedDate: string;
35
+ }
36
+ export declare class DailyBriefRepository {
37
+ private readonly dailyBriefModel;
38
+ private readonly publicProjection;
39
+ constructor(dailyBriefModel: Model<DailyBriefDocument>);
40
+ findByDate(briefDate: string, period?: string, includeDebug?: boolean): Promise<(import("mongoose").FlattenMaps<DailyBriefDocument> & {
41
+ _id: import("mongoose").Types.ObjectId;
42
+ }) | null>;
43
+ findLatest(period?: string, includeDebug?: boolean): Promise<(import("mongoose").FlattenMaps<DailyBriefDocument> & {
44
+ _id: import("mongoose").Types.ObjectId;
45
+ }) | null>;
46
+ list(options?: DailyBriefListOptions): Promise<{
47
+ data: DailyBriefListItem[];
48
+ total: number;
49
+ page: number;
50
+ limit: number;
51
+ totalPages: number;
52
+ }>;
53
+ getStockRanking(options?: StockRankingOptions): Promise<{
54
+ totalBriefs: number;
55
+ uniqueStocks: number;
56
+ totalAppearances: number;
57
+ rankings: StockRankingItem[];
58
+ }>;
59
+ claimGeneration(data: {
60
+ briefDate: string;
61
+ period: string;
62
+ sources: string[];
63
+ inputWindow: {
64
+ start: Date;
65
+ end: Date;
66
+ lookbackHours: number;
67
+ };
68
+ model?: string;
69
+ generationId: string;
70
+ staleBefore: Date;
71
+ }): Promise<boolean>;
72
+ heartbeatGeneration(briefDate: string, period: string, generationId: string): Promise<void>;
73
+ markSuccess(briefDate: string, period: string, generationId: string, data: {
74
+ analysis: Record<string, unknown>;
75
+ markdown: string;
76
+ rawInputItems: Record<string, unknown>[];
77
+ searchEvidence: Record<string, unknown>[];
78
+ model?: string;
79
+ tavilyUsed: boolean;
80
+ searchProvidersUsed: string[];
81
+ sources: string[];
82
+ inputWindow: {
83
+ start: Date;
84
+ end: Date;
85
+ lookbackHours: number;
86
+ };
87
+ }): Promise<(import("mongoose").FlattenMaps<DailyBriefDocument> & {
88
+ _id: import("mongoose").Types.ObjectId;
89
+ }) | null>;
90
+ markFailed(briefDate: string, period: string, generationId: string, error: string): Promise<(import("mongoose").FlattenMaps<DailyBriefDocument> & {
91
+ _id: import("mongoose").Types.ObjectId;
92
+ }) | null>;
93
+ deleteByDate(briefDate: string, period?: string): Promise<DeleteBriefResult>;
94
+ deleteBeforeDate(beforeDate: string, period?: string): Promise<DeleteBriefResult>;
95
+ }
96
+ export {};