adonisjs-server-stats 1.5.4 → 1.6.2

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 (527) hide show
  1. package/README.md +351 -171
  2. package/dist/configure.d.ts.map +1 -1
  3. package/dist/core/api-client.d.ts +73 -0
  4. package/dist/core/api-client.d.ts.map +1 -0
  5. package/dist/core/config-utils.d.ts +109 -0
  6. package/dist/core/config-utils.d.ts.map +1 -0
  7. package/dist/core/constants.d.ts +11 -0
  8. package/dist/core/constants.d.ts.map +1 -0
  9. package/dist/core/dashboard-api.d.ts +65 -0
  10. package/dist/core/dashboard-api.d.ts.map +1 -0
  11. package/dist/core/dashboard-data-controller.d.ts +157 -0
  12. package/dist/core/dashboard-data-controller.d.ts.map +1 -0
  13. package/dist/core/debug-data-controller.d.ts +89 -0
  14. package/dist/core/debug-data-controller.d.ts.map +1 -0
  15. package/dist/core/feature-detect.d.ts +67 -0
  16. package/dist/core/feature-detect.d.ts.map +1 -0
  17. package/dist/core/formatters.d.ts +189 -0
  18. package/dist/core/formatters.d.ts.map +1 -0
  19. package/dist/core/history-buffer.d.ts +23 -0
  20. package/dist/core/history-buffer.d.ts.map +1 -0
  21. package/dist/core/icons.d.ts +36 -0
  22. package/dist/core/icons.d.ts.map +1 -0
  23. package/dist/core/index.d.ts +39 -0
  24. package/dist/core/index.d.ts.map +1 -0
  25. package/dist/core/index.js +1961 -0
  26. package/dist/core/internals-utils.d.ts +71 -0
  27. package/dist/core/internals-utils.d.ts.map +1 -0
  28. package/dist/core/job-utils.d.ts +45 -0
  29. package/dist/core/job-utils.d.ts.map +1 -0
  30. package/dist/core/log-utils.d.ts +34 -0
  31. package/dist/core/log-utils.d.ts.map +1 -0
  32. package/dist/core/metrics.d.ts +41 -0
  33. package/dist/core/metrics.d.ts.map +1 -0
  34. package/dist/core/pagination.d.ts +128 -0
  35. package/dist/core/pagination.d.ts.map +1 -0
  36. package/dist/core/query-utils.d.ts +35 -0
  37. package/dist/core/query-utils.d.ts.map +1 -0
  38. package/dist/core/resizable-columns.d.ts +18 -0
  39. package/dist/core/resizable-columns.d.ts.map +1 -0
  40. package/dist/core/routes.d.ts +12 -0
  41. package/dist/core/routes.d.ts.map +1 -0
  42. package/dist/core/server-stats-controller.d.ts +106 -0
  43. package/dist/core/server-stats-controller.d.ts.map +1 -0
  44. package/dist/core/sparkline.d.ts +80 -0
  45. package/dist/core/sparkline.d.ts.map +1 -0
  46. package/dist/core/theme.d.ts +42 -0
  47. package/dist/core/theme.d.ts.map +1 -0
  48. package/dist/core/trace-utils.d.ts +62 -0
  49. package/dist/core/trace-utils.d.ts.map +1 -0
  50. package/dist/core/transmit-adapter.d.ts +59 -0
  51. package/dist/core/transmit-adapter.d.ts.map +1 -0
  52. package/dist/core/types.d.ts +619 -0
  53. package/dist/core/types.d.ts.map +1 -0
  54. package/dist/react/CacheSection-DGxMDlWK.js +146 -0
  55. package/dist/react/CacheTab-CnVW5PLs.js +123 -0
  56. package/dist/react/ConfigContent-CnsEI4j3.js +397 -0
  57. package/dist/react/ConfigSection-DPcrfqXY.js +11 -0
  58. package/dist/react/ConfigTab-BSWq_o2p.js +15 -0
  59. package/dist/react/CustomPaneTab-xjkYwTvH.js +104 -0
  60. package/dist/react/DataTable-YyShr5B-.js +55 -0
  61. package/dist/react/EmailsSection-CSyTg1aX.js +262 -0
  62. package/dist/react/EmailsTab-Dh2YSa_f.js +131 -0
  63. package/dist/react/EventsSection-C1pbJDfW.js +86 -0
  64. package/dist/react/EventsTab-eCh02cdd.js +63 -0
  65. package/dist/react/FilterBar-DQRXpWrb.js +50 -0
  66. package/dist/react/InternalsContent-DBzsI0CG.js +346 -0
  67. package/dist/react/InternalsSection-t7ihcWO-.js +32 -0
  68. package/dist/react/InternalsTab-Oij0A2fN.js +30 -0
  69. package/dist/react/JobsSection-CLAin5vU.js +187 -0
  70. package/dist/react/JobsTab-Dl5nrj2z.js +141 -0
  71. package/dist/react/LogsSection-C1p81fXO.js +212 -0
  72. package/dist/react/LogsTab-D-kR7PjX.js +88 -0
  73. package/dist/react/OverviewSection-nm3xdACz.js +539 -0
  74. package/dist/react/Pagination-BkmzUDY8.js +64 -0
  75. package/dist/react/QueriesSection-DB12HMfQ.js +461 -0
  76. package/dist/react/QueriesTab-fyBB1u_Y.js +90 -0
  77. package/dist/react/RequestsSection-DTqB81ac.js +209 -0
  78. package/dist/react/RoutesSection-DJWa4NPV.js +74 -0
  79. package/dist/react/RoutesTab-D3l8TOpu.js +74 -0
  80. package/dist/react/TimelineSection-C4d-jRX1.js +158 -0
  81. package/dist/react/TimelineTab-C5TFaSmQ.js +193 -0
  82. package/dist/react/WaterfallChart-Cj73WdfM.js +100 -0
  83. package/dist/react/core/api-client.d.ts +73 -0
  84. package/dist/react/core/api-client.d.ts.map +1 -0
  85. package/dist/react/core/config-utils.d.ts +109 -0
  86. package/dist/react/core/config-utils.d.ts.map +1 -0
  87. package/dist/react/core/constants.d.ts +11 -0
  88. package/dist/react/core/constants.d.ts.map +1 -0
  89. package/dist/react/core/dashboard-api.d.ts +65 -0
  90. package/dist/react/core/dashboard-api.d.ts.map +1 -0
  91. package/dist/react/core/dashboard-data-controller.d.ts +157 -0
  92. package/dist/react/core/dashboard-data-controller.d.ts.map +1 -0
  93. package/dist/react/core/debug-data-controller.d.ts +89 -0
  94. package/dist/react/core/debug-data-controller.d.ts.map +1 -0
  95. package/dist/react/core/feature-detect.d.ts +67 -0
  96. package/dist/react/core/feature-detect.d.ts.map +1 -0
  97. package/dist/react/core/formatters.d.ts +189 -0
  98. package/dist/react/core/formatters.d.ts.map +1 -0
  99. package/dist/react/core/history-buffer.d.ts +23 -0
  100. package/dist/react/core/history-buffer.d.ts.map +1 -0
  101. package/dist/react/core/icons.d.ts +36 -0
  102. package/dist/react/core/icons.d.ts.map +1 -0
  103. package/dist/react/core/index.d.ts +39 -0
  104. package/dist/react/core/index.d.ts.map +1 -0
  105. package/dist/react/core/internals-utils.d.ts +71 -0
  106. package/dist/react/core/internals-utils.d.ts.map +1 -0
  107. package/dist/react/core/job-utils.d.ts +45 -0
  108. package/dist/react/core/job-utils.d.ts.map +1 -0
  109. package/dist/react/core/log-utils.d.ts +34 -0
  110. package/dist/react/core/log-utils.d.ts.map +1 -0
  111. package/dist/react/core/metrics.d.ts +41 -0
  112. package/dist/react/core/metrics.d.ts.map +1 -0
  113. package/dist/react/core/pagination.d.ts +128 -0
  114. package/dist/react/core/pagination.d.ts.map +1 -0
  115. package/dist/react/core/query-utils.d.ts +35 -0
  116. package/dist/react/core/query-utils.d.ts.map +1 -0
  117. package/dist/react/core/resizable-columns.d.ts +18 -0
  118. package/dist/react/core/resizable-columns.d.ts.map +1 -0
  119. package/dist/react/core/routes.d.ts +12 -0
  120. package/dist/react/core/routes.d.ts.map +1 -0
  121. package/dist/react/core/server-stats-controller.d.ts +106 -0
  122. package/dist/react/core/server-stats-controller.d.ts.map +1 -0
  123. package/dist/react/core/sparkline.d.ts +80 -0
  124. package/dist/react/core/sparkline.d.ts.map +1 -0
  125. package/dist/react/core/theme.d.ts +42 -0
  126. package/dist/react/core/theme.d.ts.map +1 -0
  127. package/dist/react/core/trace-utils.d.ts +62 -0
  128. package/dist/react/core/trace-utils.d.ts.map +1 -0
  129. package/dist/react/core/transmit-adapter.d.ts +59 -0
  130. package/dist/react/core/transmit-adapter.d.ts.map +1 -0
  131. package/dist/react/core/types.d.ts +619 -0
  132. package/dist/react/core/types.d.ts.map +1 -0
  133. package/dist/react/index-UdTfSvtO.js +1074 -0
  134. package/dist/react/index.js +18 -0
  135. package/dist/react/react/components/Dashboard/DashboardPage.d.ts +17 -0
  136. package/dist/react/react/components/Dashboard/DashboardPage.d.ts.map +1 -0
  137. package/dist/react/react/components/Dashboard/sections/CacheSection.d.ts +7 -0
  138. package/dist/react/react/components/Dashboard/sections/CacheSection.d.ts.map +1 -0
  139. package/dist/react/react/components/Dashboard/sections/ConfigSection.d.ts +7 -0
  140. package/dist/react/react/components/Dashboard/sections/ConfigSection.d.ts.map +1 -0
  141. package/dist/react/react/components/Dashboard/sections/EmailsSection.d.ts +7 -0
  142. package/dist/react/react/components/Dashboard/sections/EmailsSection.d.ts.map +1 -0
  143. package/dist/react/react/components/Dashboard/sections/EventsSection.d.ts +7 -0
  144. package/dist/react/react/components/Dashboard/sections/EventsSection.d.ts.map +1 -0
  145. package/dist/react/react/components/Dashboard/sections/InternalsSection.d.ts +14 -0
  146. package/dist/react/react/components/Dashboard/sections/InternalsSection.d.ts.map +1 -0
  147. package/dist/react/react/components/Dashboard/sections/JobsSection.d.ts +7 -0
  148. package/dist/react/react/components/Dashboard/sections/JobsSection.d.ts.map +1 -0
  149. package/dist/react/react/components/Dashboard/sections/LogsSection.d.ts +7 -0
  150. package/dist/react/react/components/Dashboard/sections/LogsSection.d.ts.map +1 -0
  151. package/dist/react/react/components/Dashboard/sections/OverviewSection.d.ts +7 -0
  152. package/dist/react/react/components/Dashboard/sections/OverviewSection.d.ts.map +1 -0
  153. package/dist/react/react/components/Dashboard/sections/QueriesSection.d.ts +7 -0
  154. package/dist/react/react/components/Dashboard/sections/QueriesSection.d.ts.map +1 -0
  155. package/dist/react/react/components/Dashboard/sections/RequestsSection.d.ts +7 -0
  156. package/dist/react/react/components/Dashboard/sections/RequestsSection.d.ts.map +1 -0
  157. package/dist/react/react/components/Dashboard/sections/RoutesSection.d.ts +7 -0
  158. package/dist/react/react/components/Dashboard/sections/RoutesSection.d.ts.map +1 -0
  159. package/dist/react/react/components/Dashboard/sections/TimelineSection.d.ts +9 -0
  160. package/dist/react/react/components/Dashboard/sections/TimelineSection.d.ts.map +1 -0
  161. package/dist/react/react/components/Dashboard/shared/DataTable.d.ts +27 -0
  162. package/dist/react/react/components/Dashboard/shared/DataTable.d.ts.map +1 -0
  163. package/dist/react/react/components/Dashboard/shared/FilterBar.d.ts +17 -0
  164. package/dist/react/react/components/Dashboard/shared/FilterBar.d.ts.map +1 -0
  165. package/dist/react/react/components/Dashboard/shared/Pagination.d.ts +13 -0
  166. package/dist/react/react/components/Dashboard/shared/Pagination.d.ts.map +1 -0
  167. package/dist/react/react/components/Dashboard/shared/TimeRangeSelector.d.ts +12 -0
  168. package/dist/react/react/components/Dashboard/shared/TimeRangeSelector.d.ts.map +1 -0
  169. package/dist/react/react/components/Dashboard/shared/WaterfallChart.d.ts +16 -0
  170. package/dist/react/react/components/Dashboard/shared/WaterfallChart.d.ts.map +1 -0
  171. package/dist/react/react/components/DebugPanel/DebugPanel.d.ts +16 -0
  172. package/dist/react/react/components/DebugPanel/DebugPanel.d.ts.map +1 -0
  173. package/dist/react/react/components/DebugPanel/tabs/CacheTab.d.ts +8 -0
  174. package/dist/react/react/components/DebugPanel/tabs/CacheTab.d.ts.map +1 -0
  175. package/dist/react/react/components/DebugPanel/tabs/ConfigTab.d.ts +8 -0
  176. package/dist/react/react/components/DebugPanel/tabs/ConfigTab.d.ts.map +1 -0
  177. package/dist/react/react/components/DebugPanel/tabs/CustomPaneTab.d.ts +14 -0
  178. package/dist/react/react/components/DebugPanel/tabs/CustomPaneTab.d.ts.map +1 -0
  179. package/dist/react/react/components/DebugPanel/tabs/EmailsTab.d.ts +7 -0
  180. package/dist/react/react/components/DebugPanel/tabs/EmailsTab.d.ts.map +1 -0
  181. package/dist/react/react/components/DebugPanel/tabs/EventsTab.d.ts +7 -0
  182. package/dist/react/react/components/DebugPanel/tabs/EventsTab.d.ts.map +1 -0
  183. package/dist/react/react/components/DebugPanel/tabs/InternalsTab.d.ts +12 -0
  184. package/dist/react/react/components/DebugPanel/tabs/InternalsTab.d.ts.map +1 -0
  185. package/dist/react/react/components/DebugPanel/tabs/JobsTab.d.ts +9 -0
  186. package/dist/react/react/components/DebugPanel/tabs/JobsTab.d.ts.map +1 -0
  187. package/dist/react/react/components/DebugPanel/tabs/LogsTab.d.ts +7 -0
  188. package/dist/react/react/components/DebugPanel/tabs/LogsTab.d.ts.map +1 -0
  189. package/dist/react/react/components/DebugPanel/tabs/QueriesTab.d.ts +7 -0
  190. package/dist/react/react/components/DebugPanel/tabs/QueriesTab.d.ts.map +1 -0
  191. package/dist/react/react/components/DebugPanel/tabs/RoutesTab.d.ts +8 -0
  192. package/dist/react/react/components/DebugPanel/tabs/RoutesTab.d.ts.map +1 -0
  193. package/dist/react/react/components/DebugPanel/tabs/TimelineTab.d.ts +7 -0
  194. package/dist/react/react/components/DebugPanel/tabs/TimelineTab.d.ts.map +1 -0
  195. package/dist/react/react/components/StatsBar/MetricCard.d.ts +21 -0
  196. package/dist/react/react/components/StatsBar/MetricCard.d.ts.map +1 -0
  197. package/dist/react/react/components/StatsBar/Sparkline.d.ts +15 -0
  198. package/dist/react/react/components/StatsBar/Sparkline.d.ts.map +1 -0
  199. package/dist/react/react/components/StatsBar/StatsBar.d.ts +22 -0
  200. package/dist/react/react/components/StatsBar/StatsBar.d.ts.map +1 -0
  201. package/dist/react/react/components/shared/Badge.d.ts +32 -0
  202. package/dist/react/react/components/shared/Badge.d.ts.map +1 -0
  203. package/dist/react/react/components/shared/ConfigContent.d.ts +13 -0
  204. package/dist/react/react/components/shared/ConfigContent.d.ts.map +1 -0
  205. package/dist/react/react/components/shared/InternalsContent.d.ts +10 -0
  206. package/dist/react/react/components/shared/InternalsContent.d.ts.map +1 -0
  207. package/dist/react/react/components/shared/JsonViewer.d.ts +12 -0
  208. package/dist/react/react/components/shared/JsonViewer.d.ts.map +1 -0
  209. package/dist/react/react/components/shared/ThemeToggle.d.ts +13 -0
  210. package/dist/react/react/components/shared/ThemeToggle.d.ts.map +1 -0
  211. package/dist/react/react/components/shared/Tooltip.d.ts +16 -0
  212. package/dist/react/react/components/shared/Tooltip.d.ts.map +1 -0
  213. package/dist/react/react/hooks/useApiClient.d.ts +10 -0
  214. package/dist/react/react/hooks/useApiClient.d.ts.map +1 -0
  215. package/dist/react/react/hooks/useDashboardApiBase.d.ts +19 -0
  216. package/dist/react/react/hooks/useDashboardApiBase.d.ts.map +1 -0
  217. package/dist/react/react/hooks/useDashboardData.d.ts +27 -0
  218. package/dist/react/react/hooks/useDashboardData.d.ts.map +1 -0
  219. package/dist/react/react/hooks/useDebugData.d.ts +17 -0
  220. package/dist/react/react/hooks/useDebugData.d.ts.map +1 -0
  221. package/dist/react/react/hooks/useFeatures.d.ts +13 -0
  222. package/dist/react/react/hooks/useFeatures.d.ts.map +1 -0
  223. package/dist/react/react/hooks/useResizableTable.d.ts +13 -0
  224. package/dist/react/react/hooks/useResizableTable.d.ts.map +1 -0
  225. package/dist/react/react/hooks/useServerStats.d.ts +21 -0
  226. package/dist/react/react/hooks/useServerStats.d.ts.map +1 -0
  227. package/dist/react/react/hooks/useTheme.d.ts +12 -0
  228. package/dist/react/react/hooks/useTheme.d.ts.map +1 -0
  229. package/dist/react/react/index.d.ts +14 -0
  230. package/dist/react/react/index.d.ts.map +1 -0
  231. package/dist/react/style.css +1 -0
  232. package/dist/react/useApiClient-BVtNCmnL.js +9 -0
  233. package/dist/react/useDashboardApiBase-Bi36pJ2L.js +14 -0
  234. package/dist/react/useResizableTable-CNJmACdt.js +13 -0
  235. package/dist/src/collectors/app_collector.d.ts.map +1 -1
  236. package/dist/src/collectors/app_collector.js +30 -2
  237. package/dist/src/collectors/auto_detect.d.ts +31 -0
  238. package/dist/src/collectors/auto_detect.d.ts.map +1 -0
  239. package/dist/src/collectors/auto_detect.js +120 -0
  240. package/dist/src/collectors/collector.d.ts +17 -0
  241. package/dist/src/collectors/collector.d.ts.map +1 -1
  242. package/dist/src/collectors/db_pool_collector.d.ts.map +1 -1
  243. package/dist/src/collectors/db_pool_collector.js +35 -1
  244. package/dist/src/collectors/http_collector.d.ts +4 -3
  245. package/dist/src/collectors/http_collector.d.ts.map +1 -1
  246. package/dist/src/collectors/http_collector.js +28 -11
  247. package/dist/src/collectors/index.d.ts +2 -0
  248. package/dist/src/collectors/index.d.ts.map +1 -1
  249. package/dist/src/collectors/index.js +1 -0
  250. package/dist/src/collectors/log_collector.d.ts +11 -4
  251. package/dist/src/collectors/log_collector.d.ts.map +1 -1
  252. package/dist/src/collectors/log_collector.js +51 -5
  253. package/dist/src/collectors/process_collector.d.ts.map +1 -1
  254. package/dist/src/collectors/process_collector.js +4 -0
  255. package/dist/src/collectors/queue_collector.d.ts.map +1 -1
  256. package/dist/src/collectors/queue_collector.js +55 -1
  257. package/dist/src/collectors/redis_collector.d.ts.map +1 -1
  258. package/dist/src/collectors/redis_collector.js +42 -3
  259. package/dist/src/collectors/system_collector.d.ts.map +1 -1
  260. package/dist/src/collectors/system_collector.js +4 -0
  261. package/dist/src/controller/api_controller.d.ts +101 -0
  262. package/dist/src/controller/api_controller.d.ts.map +1 -0
  263. package/dist/src/controller/api_controller.js +131 -0
  264. package/dist/src/controller/debug_controller.d.ts +19 -10
  265. package/dist/src/controller/debug_controller.d.ts.map +1 -1
  266. package/dist/src/controller/debug_controller.js +118 -101
  267. package/dist/src/core/theme.d.ts +42 -0
  268. package/dist/src/core/theme.d.ts.map +1 -0
  269. package/dist/src/core/theme.js +115 -0
  270. package/dist/src/dashboard/chart_aggregator.d.ts.map +1 -1
  271. package/dist/src/dashboard/chart_aggregator.js +3 -2
  272. package/dist/src/dashboard/dashboard_controller.d.ts +10 -14
  273. package/dist/src/dashboard/dashboard_controller.d.ts.map +1 -1
  274. package/dist/src/dashboard/dashboard_controller.js +132 -250
  275. package/dist/src/dashboard/dashboard_store.d.ts +62 -19
  276. package/dist/src/dashboard/dashboard_store.d.ts.map +1 -1
  277. package/dist/src/dashboard/dashboard_store.js +242 -53
  278. package/dist/src/dashboard/integrations/cache_inspector.d.ts +19 -1
  279. package/dist/src/dashboard/integrations/cache_inspector.d.ts.map +1 -1
  280. package/dist/src/dashboard/integrations/config_inspector.d.ts +1 -1
  281. package/dist/src/dashboard/integrations/config_inspector.d.ts.map +1 -1
  282. package/dist/src/dashboard/integrations/config_inspector.js +3 -2
  283. package/dist/src/dashboard/integrations/queue_inspector.d.ts +55 -10
  284. package/dist/src/dashboard/integrations/queue_inspector.d.ts.map +1 -1
  285. package/dist/src/dashboard/integrations/queue_inspector.js +70 -24
  286. package/dist/src/dashboard/migrator.d.ts +5 -0
  287. package/dist/src/dashboard/migrator.d.ts.map +1 -1
  288. package/dist/src/dashboard/migrator.js +44 -9
  289. package/dist/src/dashboard/models/stats_event.d.ts +1 -1
  290. package/dist/src/dashboard/models/stats_event.d.ts.map +1 -1
  291. package/dist/src/dashboard/models/stats_log.d.ts +1 -1
  292. package/dist/src/dashboard/models/stats_log.d.ts.map +1 -1
  293. package/dist/src/dashboard/models/stats_query.d.ts +1 -1
  294. package/dist/src/dashboard/models/stats_query.d.ts.map +1 -1
  295. package/dist/src/dashboard/models/stats_saved_filter.d.ts +1 -1
  296. package/dist/src/dashboard/models/stats_saved_filter.d.ts.map +1 -1
  297. package/dist/src/dashboard/models/stats_trace.d.ts +2 -1
  298. package/dist/src/dashboard/models/stats_trace.d.ts.map +1 -1
  299. package/dist/src/data/data_access.d.ts +105 -0
  300. package/dist/src/data/data_access.d.ts.map +1 -0
  301. package/dist/src/data/data_access.js +310 -0
  302. package/dist/src/data/index.d.ts +3 -0
  303. package/dist/src/data/index.d.ts.map +1 -0
  304. package/dist/src/data/index.js +1 -0
  305. package/dist/src/debug/debug_store.d.ts +20 -1
  306. package/dist/src/debug/debug_store.d.ts.map +1 -1
  307. package/dist/src/debug/debug_store.js +43 -15
  308. package/dist/src/debug/email_collector.d.ts +6 -2
  309. package/dist/src/debug/email_collector.d.ts.map +1 -1
  310. package/dist/src/debug/email_collector.js +3 -0
  311. package/dist/src/debug/event_collector.d.ts +6 -2
  312. package/dist/src/debug/event_collector.d.ts.map +1 -1
  313. package/dist/src/debug/event_collector.js +12 -8
  314. package/dist/src/debug/query_collector.d.ts +6 -2
  315. package/dist/src/debug/query_collector.d.ts.map +1 -1
  316. package/dist/src/debug/query_collector.js +3 -0
  317. package/dist/src/debug/ring_buffer.d.ts +1 -0
  318. package/dist/src/debug/ring_buffer.d.ts.map +1 -1
  319. package/dist/src/debug/ring_buffer.js +5 -2
  320. package/dist/src/debug/route_inspector.d.ts +2 -2
  321. package/dist/src/debug/route_inspector.d.ts.map +1 -1
  322. package/dist/src/debug/route_inspector.js +4 -3
  323. package/dist/src/debug/trace_collector.d.ts +7 -3
  324. package/dist/src/debug/trace_collector.d.ts.map +1 -1
  325. package/dist/src/debug/trace_collector.js +7 -5
  326. package/dist/src/debug/types.d.ts +107 -2
  327. package/dist/src/debug/types.d.ts.map +1 -1
  328. package/dist/src/debug/types.js +1 -1
  329. package/dist/src/define_config.d.ts +49 -5
  330. package/dist/src/define_config.d.ts.map +1 -1
  331. package/dist/src/define_config.js +361 -4
  332. package/dist/src/edge/bootstrap.d.ts +17 -0
  333. package/dist/src/edge/bootstrap.d.ts.map +1 -0
  334. package/dist/src/edge/bootstrap.js +29 -0
  335. package/dist/src/edge/client/dashboard.js +2 -3619
  336. package/dist/src/edge/client/debug-panel-deferred.js +1 -0
  337. package/dist/src/edge/client/debug-panel.js +1 -2140
  338. package/dist/src/edge/client/stats-bar.js +1 -801
  339. package/dist/src/edge/client-vue/dashboard.js +5 -0
  340. package/dist/src/edge/client-vue/debug-panel-deferred.js +4 -0
  341. package/dist/src/edge/client-vue/debug-panel.js +4 -0
  342. package/dist/src/edge/client-vue/stats-bar.js +4 -0
  343. package/dist/src/edge/plugin.d.ts +35 -2
  344. package/dist/src/edge/plugin.d.ts.map +1 -1
  345. package/dist/src/edge/plugin.js +30 -66
  346. package/dist/src/edge/types.d.ts +46 -0
  347. package/dist/src/edge/types.d.ts.map +1 -0
  348. package/dist/src/edge/types.js +4 -0
  349. package/dist/src/edge/views/dashboard.edge +1 -358
  350. package/dist/src/edge/views/debug-panel.edge +2 -154
  351. package/dist/src/edge/views/stats-bar.edge +15 -48
  352. package/dist/src/engine/stats_engine.d.ts +18 -0
  353. package/dist/src/engine/stats_engine.d.ts.map +1 -1
  354. package/dist/src/engine/stats_engine.js +45 -2
  355. package/dist/src/index.d.ts +1 -1
  356. package/dist/src/index.d.ts.map +1 -1
  357. package/dist/src/log_stream/log_stream_provider.d.ts.map +1 -1
  358. package/dist/src/log_stream/log_stream_provider.js +21 -4
  359. package/dist/src/log_stream/log_stream_service.d.ts +8 -1
  360. package/dist/src/log_stream/log_stream_service.d.ts.map +1 -1
  361. package/dist/src/log_stream/log_stream_service.js +27 -3
  362. package/dist/src/middleware/request_tracking_middleware.d.ts +1 -1
  363. package/dist/src/middleware/request_tracking_middleware.d.ts.map +1 -1
  364. package/dist/src/middleware/request_tracking_middleware.js +21 -6
  365. package/dist/src/prometheus/prometheus_collector.d.ts +2 -1
  366. package/dist/src/prometheus/prometheus_collector.d.ts.map +1 -1
  367. package/dist/src/provider/server_stats_provider.d.ts +100 -0
  368. package/dist/src/provider/server_stats_provider.d.ts.map +1 -1
  369. package/dist/src/provider/server_stats_provider.js +460 -104
  370. package/dist/src/routes/access_middleware.d.ts +2 -1
  371. package/dist/src/routes/access_middleware.d.ts.map +1 -1
  372. package/dist/src/routes/access_middleware.js +7 -1
  373. package/dist/src/routes/index.d.ts +4 -0
  374. package/dist/src/routes/index.d.ts.map +1 -0
  375. package/dist/src/routes/index.js +1 -0
  376. package/dist/src/routes/register_routes.d.ts +103 -0
  377. package/dist/src/routes/register_routes.d.ts.map +1 -0
  378. package/dist/src/routes/register_routes.js +356 -0
  379. package/dist/src/routes/router_types.d.ts +29 -0
  380. package/dist/src/routes/router_types.d.ts.map +1 -0
  381. package/dist/src/routes/router_types.js +1 -0
  382. package/dist/src/stubs/config.stub +12 -32
  383. package/dist/src/styles/components.css +1048 -0
  384. package/dist/src/{edge/client → styles}/dashboard.css +299 -736
  385. package/dist/src/{edge/client → styles}/debug-panel.css +117 -633
  386. package/dist/src/{edge/client → styles}/stats-bar.css +28 -10
  387. package/dist/src/styles/tokens.css +153 -0
  388. package/dist/src/styles/utilities.css +75 -0
  389. package/dist/src/types.d.ts +119 -16
  390. package/dist/src/types.d.ts.map +1 -1
  391. package/dist/src/utils/app_import.d.ts +23 -0
  392. package/dist/src/utils/app_import.d.ts.map +1 -0
  393. package/dist/src/utils/app_import.js +44 -0
  394. package/dist/src/utils/json_helpers.d.ts +2 -2
  395. package/dist/src/utils/json_helpers.d.ts.map +1 -1
  396. package/dist/src/utils/logger.d.ts +17 -0
  397. package/dist/src/utils/logger.d.ts.map +1 -0
  398. package/dist/src/utils/logger.js +27 -0
  399. package/dist/src/utils/mail_helpers.d.ts +1 -1
  400. package/dist/src/utils/mail_helpers.d.ts.map +1 -1
  401. package/dist/src/utils/mail_helpers.js +1 -1
  402. package/dist/vue/CacheSection-C788Yfai.js +149 -0
  403. package/dist/vue/CacheTab-BPisYYiQ.js +104 -0
  404. package/dist/vue/ConfigSection-CRzYxqW2.js +576 -0
  405. package/dist/vue/ConfigTab-C8cafGUj.js +361 -0
  406. package/dist/vue/CustomPaneTab-BJxT5Dp7.js +172 -0
  407. package/dist/vue/EmailsSection-C8JFMtW7.js +206 -0
  408. package/dist/vue/EmailsTab-DhFhoNmU.js +157 -0
  409. package/dist/vue/EventsSection-C4wXUgxG.js +107 -0
  410. package/dist/vue/EventsTab-DQ4Nd6AK.js +97 -0
  411. package/dist/vue/FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js +62 -0
  412. package/dist/vue/InternalsSection-BJUXE-5F.js +468 -0
  413. package/dist/vue/InternalsTab-DEMjqtlw.js +471 -0
  414. package/dist/vue/JobsSection-CsKWTjgN.js +187 -0
  415. package/dist/vue/JobsTab-BCvhOARO.js +117 -0
  416. package/dist/vue/JsonViewer.vue_vue_type_script_setup_true_lang-Vsqar1zx.js +67 -0
  417. package/dist/vue/LogsSection-BFVjSZ24.js +227 -0
  418. package/dist/vue/LogsTab-DpEQ7euu.js +122 -0
  419. package/dist/vue/OverviewSection-CbMdAido.js +849 -0
  420. package/dist/vue/PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js +50 -0
  421. package/dist/vue/QueriesSection-BPiv7u3r.js +429 -0
  422. package/dist/vue/QueriesTab-C8_7oprC.js +107 -0
  423. package/dist/vue/RequestsSection-LtImH4rD.js +243 -0
  424. package/dist/vue/RoutesSection-CrxOxmzx.js +106 -0
  425. package/dist/vue/RoutesTab-Dz0MkZuF.js +80 -0
  426. package/dist/vue/TimelineSection-DLxMW2J_.js +186 -0
  427. package/dist/vue/TimelineTab-Db6lKKsD.js +250 -0
  428. package/dist/vue/WaterfallChart.vue_vue_type_script_setup_true_lang-tZ13cNj1.js +118 -0
  429. package/dist/vue/components/Dashboard/DashboardPage.vue.d.ts +18 -0
  430. package/dist/vue/components/Dashboard/DashboardPage.vue.d.ts.map +1 -0
  431. package/dist/vue/components/Dashboard/sections/CacheSection.vue.d.ts +5 -0
  432. package/dist/vue/components/Dashboard/sections/CacheSection.vue.d.ts.map +1 -0
  433. package/dist/vue/components/Dashboard/sections/ConfigSection.vue.d.ts +3 -0
  434. package/dist/vue/components/Dashboard/sections/ConfigSection.vue.d.ts.map +1 -0
  435. package/dist/vue/components/Dashboard/sections/EmailsSection.vue.d.ts +5 -0
  436. package/dist/vue/components/Dashboard/sections/EmailsSection.vue.d.ts.map +1 -0
  437. package/dist/vue/components/Dashboard/sections/EventsSection.vue.d.ts +5 -0
  438. package/dist/vue/components/Dashboard/sections/EventsSection.vue.d.ts.map +1 -0
  439. package/dist/vue/components/Dashboard/sections/InternalsSection.vue.d.ts +3 -0
  440. package/dist/vue/components/Dashboard/sections/InternalsSection.vue.d.ts.map +1 -0
  441. package/dist/vue/components/Dashboard/sections/JobsSection.vue.d.ts +5 -0
  442. package/dist/vue/components/Dashboard/sections/JobsSection.vue.d.ts.map +1 -0
  443. package/dist/vue/components/Dashboard/sections/LogsSection.vue.d.ts +3 -0
  444. package/dist/vue/components/Dashboard/sections/LogsSection.vue.d.ts.map +1 -0
  445. package/dist/vue/components/Dashboard/sections/OverviewSection.vue.d.ts +5 -0
  446. package/dist/vue/components/Dashboard/sections/OverviewSection.vue.d.ts.map +1 -0
  447. package/dist/vue/components/Dashboard/sections/QueriesSection.vue.d.ts +45 -0
  448. package/dist/vue/components/Dashboard/sections/QueriesSection.vue.d.ts.map +1 -0
  449. package/dist/vue/components/Dashboard/sections/RequestsSection.vue.d.ts +5 -0
  450. package/dist/vue/components/Dashboard/sections/RequestsSection.vue.d.ts.map +1 -0
  451. package/dist/vue/components/Dashboard/sections/RoutesSection.vue.d.ts +5 -0
  452. package/dist/vue/components/Dashboard/sections/RoutesSection.vue.d.ts.map +1 -0
  453. package/dist/vue/components/Dashboard/sections/TimelineSection.vue.d.ts +11 -0
  454. package/dist/vue/components/Dashboard/sections/TimelineSection.vue.d.ts.map +1 -0
  455. package/dist/vue/components/Dashboard/shared/FilterBar.vue.d.ts +29 -0
  456. package/dist/vue/components/Dashboard/shared/FilterBar.vue.d.ts.map +1 -0
  457. package/dist/vue/components/Dashboard/shared/PaginationControls.vue.d.ts +12 -0
  458. package/dist/vue/components/Dashboard/shared/PaginationControls.vue.d.ts.map +1 -0
  459. package/dist/vue/components/Dashboard/shared/TimeRangeSelector.vue.d.ts +11 -0
  460. package/dist/vue/components/Dashboard/shared/TimeRangeSelector.vue.d.ts.map +1 -0
  461. package/dist/vue/components/Dashboard/shared/WaterfallChart.vue.d.ts +10 -0
  462. package/dist/vue/components/Dashboard/shared/WaterfallChart.vue.d.ts.map +1 -0
  463. package/dist/vue/components/DebugPanel/DebugPanel.vue.d.ts +21 -0
  464. package/dist/vue/components/DebugPanel/DebugPanel.vue.d.ts.map +1 -0
  465. package/dist/vue/components/DebugPanel/tabs/CacheTab.vue.d.ts +12 -0
  466. package/dist/vue/components/DebugPanel/tabs/CacheTab.vue.d.ts.map +1 -0
  467. package/dist/vue/components/DebugPanel/tabs/ConfigTab.vue.d.ts +11 -0
  468. package/dist/vue/components/DebugPanel/tabs/ConfigTab.vue.d.ts.map +1 -0
  469. package/dist/vue/components/DebugPanel/tabs/CustomPaneTab.vue.d.ts +11 -0
  470. package/dist/vue/components/DebugPanel/tabs/CustomPaneTab.vue.d.ts.map +1 -0
  471. package/dist/vue/components/DebugPanel/tabs/EmailsTab.vue.d.ts +12 -0
  472. package/dist/vue/components/DebugPanel/tabs/EmailsTab.vue.d.ts.map +1 -0
  473. package/dist/vue/components/DebugPanel/tabs/EventsTab.vue.d.ts +12 -0
  474. package/dist/vue/components/DebugPanel/tabs/EventsTab.vue.d.ts.map +1 -0
  475. package/dist/vue/components/DebugPanel/tabs/InternalsTab.vue.d.ts +11 -0
  476. package/dist/vue/components/DebugPanel/tabs/InternalsTab.vue.d.ts.map +1 -0
  477. package/dist/vue/components/DebugPanel/tabs/JobsTab.vue.d.ts +13 -0
  478. package/dist/vue/components/DebugPanel/tabs/JobsTab.vue.d.ts.map +1 -0
  479. package/dist/vue/components/DebugPanel/tabs/LogsTab.vue.d.ts +15 -0
  480. package/dist/vue/components/DebugPanel/tabs/LogsTab.vue.d.ts.map +1 -0
  481. package/dist/vue/components/DebugPanel/tabs/QueriesTab.vue.d.ts +12 -0
  482. package/dist/vue/components/DebugPanel/tabs/QueriesTab.vue.d.ts.map +1 -0
  483. package/dist/vue/components/DebugPanel/tabs/RoutesTab.vue.d.ts +12 -0
  484. package/dist/vue/components/DebugPanel/tabs/RoutesTab.vue.d.ts.map +1 -0
  485. package/dist/vue/components/DebugPanel/tabs/TimelineTab.vue.d.ts +15 -0
  486. package/dist/vue/components/DebugPanel/tabs/TimelineTab.vue.d.ts.map +1 -0
  487. package/dist/vue/components/StatsBar/MetricCard.vue.d.ts +19 -0
  488. package/dist/vue/components/StatsBar/MetricCard.vue.d.ts.map +1 -0
  489. package/dist/vue/components/StatsBar/Sparkline.vue.d.ts +17 -0
  490. package/dist/vue/components/StatsBar/Sparkline.vue.d.ts.map +1 -0
  491. package/dist/vue/components/StatsBar/StatsBar.vue.d.ts +22 -0
  492. package/dist/vue/components/StatsBar/StatsBar.vue.d.ts.map +1 -0
  493. package/dist/vue/components/shared/JsonViewer.vue.d.ts +13 -0
  494. package/dist/vue/components/shared/JsonViewer.vue.d.ts.map +1 -0
  495. package/dist/vue/components/shared/ThemeToggle.vue.d.ts +8 -0
  496. package/dist/vue/components/shared/ThemeToggle.vue.d.ts.map +1 -0
  497. package/dist/vue/composables/useApiClient.d.ts +9 -0
  498. package/dist/vue/composables/useApiClient.d.ts.map +1 -0
  499. package/dist/vue/composables/useDashboardData.d.ts +53 -0
  500. package/dist/vue/composables/useDashboardData.d.ts.map +1 -0
  501. package/dist/vue/composables/useDebugData.d.ts +25 -0
  502. package/dist/vue/composables/useDebugData.d.ts.map +1 -0
  503. package/dist/vue/composables/useFeatures.d.ts +80 -0
  504. package/dist/vue/composables/useFeatures.d.ts.map +1 -0
  505. package/dist/vue/composables/useResizableTable.d.ts +16 -0
  506. package/dist/vue/composables/useResizableTable.d.ts.map +1 -0
  507. package/dist/vue/composables/useServerStats.d.ts +104 -0
  508. package/dist/vue/composables/useServerStats.d.ts.map +1 -0
  509. package/dist/vue/composables/useTheme.d.ts +6 -0
  510. package/dist/vue/composables/useTheme.d.ts.map +1 -0
  511. package/dist/vue/index-qCQpBftQ.js +1233 -0
  512. package/dist/vue/index.d.ts +10 -0
  513. package/dist/vue/index.d.ts.map +1 -0
  514. package/dist/vue/index.js +11 -0
  515. package/dist/vue/style.css +1 -0
  516. package/dist/vue/useApiClient-BQQ9CF-q.js +10 -0
  517. package/dist/vue/useResizableTable-BoivAevK.js +17 -0
  518. package/package.json +72 -10
  519. package/dist/src/dashboard/dashboard_routes.d.ts +0 -16
  520. package/dist/src/dashboard/dashboard_routes.d.ts.map +0 -1
  521. package/dist/src/dashboard/dashboard_routes.js +0 -77
  522. package/dist/src/routes/debug_routes.d.ts +0 -14
  523. package/dist/src/routes/debug_routes.d.ts.map +0 -1
  524. package/dist/src/routes/debug_routes.js +0 -42
  525. package/dist/src/routes/stats_routes.d.ts +0 -14
  526. package/dist/src/routes/stats_routes.d.ts.map +0 -1
  527. package/dist/src/routes/stats_routes.js +0 -27
@@ -0,0 +1,101 @@
1
+ import type { DataAccess, ListOptions, PaginatedResult } from '../data/data_access.js';
2
+ import type { EventRecord, QueryRecord, RouteRecord, TraceRecord } from '../debug/types.js';
3
+ /**
4
+ * Unified API controller for all data resource endpoints.
5
+ *
6
+ * Delegates every read operation to the {@link DataAccess} abstraction layer,
7
+ * which transparently routes to either the in-memory {@link DebugStore}
8
+ * (ring buffers) or the persistent {@link DashboardStore} (SQLite),
9
+ * depending on availability.
10
+ *
11
+ * This controller is intentionally **transport-agnostic** — it knows
12
+ * nothing about HTTP, `HttpContext`, or response formatting. Route
13
+ * handlers in {@link registerAllRoutes} call these methods and write
14
+ * the result to the response themselves.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const api = new ApiController(dataAccess)
19
+ * const result = await api.getQueries({ page: 1, perPage: 25, search: 'users' })
20
+ * // → { data: [...], meta: { total, page, perPage, lastPage } }
21
+ * ```
22
+ */
23
+ export declare class ApiController {
24
+ private data;
25
+ constructor(data: DataAccess);
26
+ /**
27
+ * Paginated list of captured SQL queries.
28
+ *
29
+ * Supports full-text search across `sql`, `model`, and `connection`
30
+ * fields, plus optional filter parameters forwarded to the underlying
31
+ * store (e.g. `durationMin`, `method`, `connection`).
32
+ */
33
+ getQueries(opts?: ListOptions): Promise<PaginatedResult<QueryRecord>>;
34
+ /**
35
+ * Aggregate query statistics from the in-memory ring buffer.
36
+ *
37
+ * Returns total count, number of slow queries, duplicate count,
38
+ * and the average execution duration.
39
+ *
40
+ * **Note:** This always reads from the {@link DebugStore} because
41
+ * summary metrics are computed in-memory and not persisted.
42
+ */
43
+ getQuerySummary(): {
44
+ total: number;
45
+ slow: number;
46
+ duplicates: number;
47
+ avgDuration: number;
48
+ };
49
+ /**
50
+ * Paginated list of captured application events.
51
+ *
52
+ * Supports full-text search on the event name.
53
+ */
54
+ getEvents(opts?: ListOptions): Promise<PaginatedResult<EventRecord>>;
55
+ /**
56
+ * Paginated list of captured emails.
57
+ *
58
+ * HTML and text bodies are stripped from the list response to keep
59
+ * payloads lightweight. Use {@link getEmailPreview} for the full body.
60
+ */
61
+ getEmails(opts?: ListOptions): Promise<PaginatedResult>;
62
+ /**
63
+ * Get the HTML body of a single email for iframe preview rendering.
64
+ *
65
+ * Returns the full HTML string, or falls back to the plain-text body.
66
+ * Returns `null` when the email is not found.
67
+ */
68
+ getEmailPreview(id: number, source?: 'memory' | 'auto'): Promise<string | null>;
69
+ /**
70
+ * Paginated list of captured request traces.
71
+ *
72
+ * Span arrays are stripped from the list response to keep payloads
73
+ * lightweight. Use {@link getTraceDetail} for the full span tree.
74
+ */
75
+ getTraces(opts?: ListOptions): Promise<PaginatedResult>;
76
+ /**
77
+ * Get a single trace with its full span tree.
78
+ *
79
+ * Returns `null` when the trace is not found or tracing is disabled.
80
+ */
81
+ getTraceDetail(id: number, source?: 'memory' | 'auto'): Promise<TraceRecord | null>;
82
+ /**
83
+ * Get the registered route table.
84
+ *
85
+ * Routes are always read from the in-memory {@link DebugStore} because
86
+ * they are static boot-time data that is never persisted to SQLite.
87
+ *
88
+ * Supports optional search filtering across pattern, handler, name,
89
+ * and HTTP method fields.
90
+ */
91
+ getRoutes(search?: string): PaginatedResult<RouteRecord>;
92
+ /**
93
+ * Paginated list of log entries.
94
+ *
95
+ * When the dashboard store is available, logs are read from SQLite
96
+ * with full server-side filtering. Otherwise, falls back to reading
97
+ * the last 256 KB of the application log file from the filesystem.
98
+ */
99
+ getLogs(opts?: ListOptions): Promise<PaginatedResult>;
100
+ }
101
+ //# sourceMappingURL=api_controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api_controller.d.ts","sourceRoot":"","sources":["../../../src/controller/api_controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACtF,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE3F;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,aAAa;IACZ,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAMpC;;;;;;OAMG;IACG,UAAU,CAAC,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IAI/E;;;;;;;;OAQG;IACH,eAAe,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE;IAQ3F;;;;OAIG;IACG,SAAS,CAAC,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IAQ9E;;;;;OAKG;IACG,SAAS,CAAC,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAIjE;;;;;OAKG;IACG,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAQrF;;;;;OAKG;IACG,SAAS,CAAC,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAIjE;;;;OAIG;IACG,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAQzF;;;;;;;;OAQG;IACH,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,WAAW,CAAC;IAQxD;;;;;;OAMG;IACG,OAAO,CAAC,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;CAGhE"}
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Unified API controller for all data resource endpoints.
3
+ *
4
+ * Delegates every read operation to the {@link DataAccess} abstraction layer,
5
+ * which transparently routes to either the in-memory {@link DebugStore}
6
+ * (ring buffers) or the persistent {@link DashboardStore} (SQLite),
7
+ * depending on availability.
8
+ *
9
+ * This controller is intentionally **transport-agnostic** — it knows
10
+ * nothing about HTTP, `HttpContext`, or response formatting. Route
11
+ * handlers in {@link registerAllRoutes} call these methods and write
12
+ * the result to the response themselves.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const api = new ApiController(dataAccess)
17
+ * const result = await api.getQueries({ page: 1, perPage: 25, search: 'users' })
18
+ * // → { data: [...], meta: { total, page, perPage, lastPage } }
19
+ * ```
20
+ */
21
+ export class ApiController {
22
+ data;
23
+ constructor(data) {
24
+ this.data = data;
25
+ }
26
+ // ===========================================================================
27
+ // Queries
28
+ // ===========================================================================
29
+ /**
30
+ * Paginated list of captured SQL queries.
31
+ *
32
+ * Supports full-text search across `sql`, `model`, and `connection`
33
+ * fields, plus optional filter parameters forwarded to the underlying
34
+ * store (e.g. `durationMin`, `method`, `connection`).
35
+ */
36
+ async getQueries(opts = {}) {
37
+ return this.data.getQueries(opts);
38
+ }
39
+ /**
40
+ * Aggregate query statistics from the in-memory ring buffer.
41
+ *
42
+ * Returns total count, number of slow queries, duplicate count,
43
+ * and the average execution duration.
44
+ *
45
+ * **Note:** This always reads from the {@link DebugStore} because
46
+ * summary metrics are computed in-memory and not persisted.
47
+ */
48
+ getQuerySummary() {
49
+ return this.data.getQuerySummary();
50
+ }
51
+ // ===========================================================================
52
+ // Events
53
+ // ===========================================================================
54
+ /**
55
+ * Paginated list of captured application events.
56
+ *
57
+ * Supports full-text search on the event name.
58
+ */
59
+ async getEvents(opts = {}) {
60
+ return this.data.getEvents(opts);
61
+ }
62
+ // ===========================================================================
63
+ // Emails
64
+ // ===========================================================================
65
+ /**
66
+ * Paginated list of captured emails.
67
+ *
68
+ * HTML and text bodies are stripped from the list response to keep
69
+ * payloads lightweight. Use {@link getEmailPreview} for the full body.
70
+ */
71
+ async getEmails(opts = {}) {
72
+ return this.data.getEmails(opts);
73
+ }
74
+ /**
75
+ * Get the HTML body of a single email for iframe preview rendering.
76
+ *
77
+ * Returns the full HTML string, or falls back to the plain-text body.
78
+ * Returns `null` when the email is not found.
79
+ */
80
+ async getEmailPreview(id, source) {
81
+ return this.data.getEmailPreview(id, source);
82
+ }
83
+ // ===========================================================================
84
+ // Traces
85
+ // ===========================================================================
86
+ /**
87
+ * Paginated list of captured request traces.
88
+ *
89
+ * Span arrays are stripped from the list response to keep payloads
90
+ * lightweight. Use {@link getTraceDetail} for the full span tree.
91
+ */
92
+ async getTraces(opts = {}) {
93
+ return this.data.getTraces(opts);
94
+ }
95
+ /**
96
+ * Get a single trace with its full span tree.
97
+ *
98
+ * Returns `null` when the trace is not found or tracing is disabled.
99
+ */
100
+ async getTraceDetail(id, source) {
101
+ return this.data.getTraceDetail(id, source);
102
+ }
103
+ // ===========================================================================
104
+ // Routes
105
+ // ===========================================================================
106
+ /**
107
+ * Get the registered route table.
108
+ *
109
+ * Routes are always read from the in-memory {@link DebugStore} because
110
+ * they are static boot-time data that is never persisted to SQLite.
111
+ *
112
+ * Supports optional search filtering across pattern, handler, name,
113
+ * and HTTP method fields.
114
+ */
115
+ getRoutes(search) {
116
+ return this.data.getRoutes(search);
117
+ }
118
+ // ===========================================================================
119
+ // Logs
120
+ // ===========================================================================
121
+ /**
122
+ * Paginated list of log entries.
123
+ *
124
+ * When the dashboard store is available, logs are read from SQLite
125
+ * with full server-side filtering. Otherwise, falls back to reading
126
+ * the last 256 KB of the application log file from the filesystem.
127
+ */
128
+ async getLogs(opts = {}) {
129
+ return this.data.getLogs(opts);
130
+ }
131
+ }
@@ -1,16 +1,25 @@
1
+ import type { DashboardStore } from '../dashboard/dashboard_store.js';
1
2
  import type { DebugStore } from '../debug/debug_store.js';
3
+ import type { StatsEngine } from '../engine/stats_engine.js';
4
+ import type { ResolvedServerStatsConfig } from '../types.js';
5
+ import type { ApplicationService } from '@adonisjs/core/types';
2
6
  import type { HttpContext } from '@adonisjs/core/http';
7
+ interface DiagnosticsDeps {
8
+ getEngine?: () => StatsEngine | null;
9
+ getDashboardStore?: () => DashboardStore | null;
10
+ getProviderDiagnostics?: () => Record<string, unknown>;
11
+ getApp?: () => ApplicationService;
12
+ }
3
13
  export default class DebugController {
4
14
  private store;
5
- private logPath;
6
- constructor(store: DebugStore, logPath: string);
7
- queries({ response }: HttpContext): Promise<void>;
8
- events({ response }: HttpContext): Promise<void>;
9
- routes({ response }: HttpContext): Promise<void>;
10
- emails({ response }: HttpContext): Promise<void>;
11
- emailPreview({ params, response }: HttpContext): Promise<void>;
12
- traces({ response }: HttpContext): Promise<void>;
13
- traceDetail({ params, response }: HttpContext): Promise<void>;
14
- logs({ response }: HttpContext): Promise<void>;
15
+ private serverConfig?;
16
+ private diagnosticsDeps;
17
+ private configInspector;
18
+ constructor(store: DebugStore, serverConfig?: ResolvedServerStatsConfig | undefined, diagnosticsDeps?: DiagnosticsDeps);
19
+ config({ response }: HttpContext): Promise<void>;
20
+ /** Lazily create a ConfigInspector from the app reference. */
21
+ private getConfigInspector;
22
+ diagnostics({ response }: HttpContext): Promise<void>;
15
23
  }
24
+ export {};
16
25
  //# sourceMappingURL=debug_controller.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"debug_controller.d.ts","sourceRoot":"","sources":["../../../src/controller/debug_controller.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAWtD,MAAM,CAAC,OAAO,OAAO,eAAe;IAIhC,OAAO,CAAC,KAAK;IAHf,OAAO,CAAC,OAAO,CAAQ;gBAGb,KAAK,EAAE,UAAU,EACzB,OAAO,EAAE,MAAM;IAKX,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,WAAW;IAMjC,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,WAAW;IAKhC,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,WAAW;IAKhC,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,WAAW;IAOhC,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,WAAW;IAS9C,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,WAAW;IAahC,WAAW,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,WAAW;IAY7C,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE,WAAW;CAgDrC"}
1
+ {"version":3,"file":"debug_controller.d.ts","sourceRoot":"","sources":["../../../src/controller/debug_controller.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEtD,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,CAAA;IACpC,iBAAiB,CAAC,EAAE,MAAM,cAAc,GAAG,IAAI,CAAA;IAC/C,sBAAsB,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtD,MAAM,CAAC,EAAE,MAAM,kBAAkB,CAAA;CAClC;AAED,MAAM,CAAC,OAAO,OAAO,eAAe;IAKhC,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,YAAY,CAAC;IALvB,OAAO,CAAC,eAAe,CAAiB;IACxC,OAAO,CAAC,eAAe,CAA+B;gBAG5C,KAAK,EAAE,UAAU,EACjB,YAAY,CAAC,EAAE,yBAAyB,YAAA,EAChD,eAAe,CAAC,EAAE,eAAe;IAK7B,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,WAAW;IA8DtC,8DAA8D;IAC9D,OAAO,CAAC,kBAAkB;IAQpB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE,WAAW;CA+D5C"}
@@ -1,116 +1,133 @@
1
- import { readFile, stat } from 'node:fs/promises';
2
- const LEVEL_NAMES = {
3
- 10: 'trace',
4
- 20: 'debug',
5
- 30: 'info',
6
- 40: 'warn',
7
- 50: 'error',
8
- 60: 'fatal',
9
- };
1
+ import { readFile } from 'node:fs/promises';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { ConfigInspector } from '../dashboard/integrations/config_inspector.js';
10
4
  export default class DebugController {
11
5
  store;
12
- logPath;
13
- constructor(store, logPath) {
6
+ serverConfig;
7
+ diagnosticsDeps;
8
+ configInspector = null;
9
+ constructor(store, serverConfig, diagnosticsDeps) {
14
10
  this.store = store;
15
- this.logPath = logPath;
11
+ this.serverConfig = serverConfig;
12
+ this.diagnosticsDeps = diagnosticsDeps ?? {};
16
13
  }
17
- async queries({ response }) {
18
- const queries = this.store.queries.getLatest(500);
19
- const summary = this.store.queries.getSummary();
20
- return response.json({ queries, summary });
14
+ async config({ response }) {
15
+ const cfg = this.serverConfig;
16
+ const toolbarConfig = cfg?.devToolbar;
17
+ // Derive feature flags from the actual config
18
+ const rawCollectors = cfg?.collectors;
19
+ const collectorNames = new Set(Array.isArray(rawCollectors) ? rawCollectors.map((c) => c.name) : []);
20
+ const features = {
21
+ statsBar: true,
22
+ debugPanel: !!toolbarConfig?.enabled,
23
+ dashboard: !!toolbarConfig?.dashboard,
24
+ tracing: !!toolbarConfig?.tracing,
25
+ process: collectorNames.has('process'),
26
+ system: collectorNames.has('system'),
27
+ http: collectorNames.has('http'),
28
+ db: collectorNames.has('db_pool'),
29
+ redis: collectorNames.has('redis'),
30
+ queues: collectorNames.has('queue'),
31
+ cache: collectorNames.has('redis'),
32
+ app: collectorNames.has('app'),
33
+ log: collectorNames.has('log'),
34
+ emails: !!toolbarConfig?.enabled,
35
+ };
36
+ // Custom panes from config
37
+ const customPanes = toolbarConfig?.panes ?? [];
38
+ // Endpoint paths
39
+ const debugEndpoint = toolbarConfig?.debugEndpoint ?? '/admin/api/debug';
40
+ const dashboardPath = toolbarConfig?.dashboardPath ?? '/__stats';
41
+ const statsEndpoint = typeof cfg?.endpoint === 'string' ? cfg.endpoint : '/admin/api/server-stats';
42
+ const endpoints = {
43
+ stats: statsEndpoint,
44
+ debug: debugEndpoint,
45
+ dashboard: dashboardPath,
46
+ };
47
+ // Transmit config
48
+ const transmit = {
49
+ channelName: cfg?.channelName ?? 'admin/server-stats',
50
+ };
51
+ // App config + env vars (for the Config tab's APP CONFIG / ENV view)
52
+ const inspector = this.getConfigInspector();
53
+ const appConfig = inspector ? inspector.getConfig().config : {};
54
+ const envVars = inspector ? inspector.getEnvVars().env : {};
55
+ return response.json({
56
+ features,
57
+ customPanes,
58
+ endpoints,
59
+ transmit,
60
+ app: appConfig,
61
+ env: envVars,
62
+ });
21
63
  }
22
- async events({ response }) {
23
- const events = this.store.events.getLatest(200);
24
- return response.json({ events, total: this.store.events.getTotalCount() });
64
+ /** Lazily create a ConfigInspector from the app reference. */
65
+ getConfigInspector() {
66
+ if (this.configInspector)
67
+ return this.configInspector;
68
+ const app = this.diagnosticsDeps.getApp?.();
69
+ if (!app)
70
+ return null;
71
+ this.configInspector = new ConfigInspector(app);
72
+ return this.configInspector;
25
73
  }
26
- async routes({ response }) {
27
- const routes = this.store.routes.getRoutes();
28
- return response.json({ routes, total: this.store.routes.getRouteCount() });
29
- }
30
- async emails({ response }) {
31
- const emails = this.store.emails.getLatest(100);
32
- // Strip html/text from list response to keep it lightweight
33
- const stripped = emails.map(({ html, text, ...rest }) => rest);
34
- return response.json({ emails: stripped, total: this.store.emails.getTotalCount() });
35
- }
36
- async emailPreview({ params, response }) {
37
- const id = Number(params.id);
38
- const html = this.store.emails.getEmailHtml(id);
39
- if (!html) {
40
- return response.notFound({ error: 'Email not found' });
74
+ async diagnostics({ response }) {
75
+ const engine = this.diagnosticsDeps.getEngine?.();
76
+ const dashboardStore = this.diagnosticsDeps.getDashboardStore?.();
77
+ const providerDiag = this.diagnosticsDeps.getProviderDiagnostics?.() ?? {};
78
+ // Package version read from disk since createRequire resolves from
79
+ // the compiled output directory where ../../package.json doesn't exist.
80
+ let packageVersion = 'unknown';
81
+ try {
82
+ const pkgPath = fileURLToPath(new URL('../../../package.json', import.meta.url));
83
+ const pkgJson = JSON.parse(await readFile(pkgPath, 'utf-8'));
84
+ packageVersion = pkgJson.version;
41
85
  }
42
- return response.header('Content-Type', 'text/html; charset=utf-8').send(html);
43
- }
44
- async traces({ response }) {
45
- if (!this.store.traces) {
46
- return response.json({ traces: [], total: 0 });
86
+ catch {
87
+ // Fallback
47
88
  }
48
- const traces = this.store.traces.getLatest(100);
49
- // Strip spans from list view to keep it lightweight
50
- const list = traces.map(({ spans, warnings, ...rest }) => ({
51
- ...rest,
52
- warningCount: warnings.length,
53
- }));
54
- return response.json({ traces: list, total: this.store.traces.getTotalCount() });
55
- }
56
- async traceDetail({ params, response }) {
57
- if (!this.store.traces) {
58
- return response.notFound({ error: 'Tracing not enabled' });
89
+ // AdonisJS version
90
+ let adonisVersion = 'unknown';
91
+ try {
92
+ const { createRequire } = await import('node:module');
93
+ const require = createRequire(import.meta.url);
94
+ const adonisPkg = require('@adonisjs/core/package.json');
95
+ adonisVersion = adonisPkg.version;
59
96
  }
60
- const id = Number(params.id);
61
- const trace = this.store.traces.getTrace(id);
62
- if (!trace) {
63
- return response.notFound({ error: 'Trace not found' });
97
+ catch {
98
+ // Not installed or not resolvable
64
99
  }
65
- return response.json(trace);
66
- }
67
- async logs({ response }) {
68
- try {
69
- const stats = await stat(this.logPath);
70
- // Only read last 256KB to keep response fast
71
- const maxBytes = 256 * 1024;
72
- let content;
73
- if (stats.size > maxBytes) {
74
- const { createReadStream } = await import('node:fs');
75
- const stream = createReadStream(this.logPath, {
76
- start: stats.size - maxBytes,
77
- encoding: 'utf-8',
78
- });
79
- const chunks = [];
80
- for await (const chunk of stream) {
81
- chunks.push(chunk);
82
- }
83
- content = chunks.join('');
84
- // Skip first potentially incomplete line
85
- const firstNewline = content.indexOf('\n');
86
- if (firstNewline !== -1)
87
- content = content.slice(firstNewline + 1);
100
+ // Collector health + configs
101
+ const healthList = engine?.getCollectorHealth() ?? [];
102
+ const configList = engine?.getCollectorConfigs() ?? [];
103
+ const configMap = new Map(configList.map((c) => [c.name, c.config]));
104
+ const collectors = healthList.map((h) => ({
105
+ ...h,
106
+ config: configMap.get(h.name) ?? {},
107
+ }));
108
+ // Buffer stats
109
+ const buffers = this.store.getBufferStats();
110
+ // Storage stats (if dashboard is active)
111
+ let storage = null;
112
+ if (dashboardStore) {
113
+ try {
114
+ storage = await dashboardStore.getStorageStats();
88
115
  }
89
- else {
90
- content = await readFile(this.logPath, 'utf-8');
116
+ catch {
117
+ // Dashboard store not ready
91
118
  }
92
- const entries = content
93
- .trim()
94
- .split('\n')
95
- .filter(Boolean)
96
- .map((line) => {
97
- try {
98
- const entry = JSON.parse(line);
99
- return {
100
- ...entry,
101
- levelName: LEVEL_NAMES[entry.level] || 'unknown',
102
- timestamp: new Date(entry.time).toISOString(),
103
- };
104
- }
105
- catch {
106
- return null;
107
- }
108
- })
109
- .filter(Boolean);
110
- return response.json(entries);
111
- }
112
- catch {
113
- return response.json([]);
114
119
  }
120
+ return response.json({
121
+ package: {
122
+ version: packageVersion,
123
+ nodeVersion: process.version,
124
+ adonisVersion,
125
+ uptime: process.uptime(),
126
+ },
127
+ ...providerDiag,
128
+ collectors,
129
+ buffers,
130
+ storage,
131
+ });
115
132
  }
116
133
  }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * localStorage key for persisted theme preference.
3
+ */
4
+ export declare const STORAGE_KEY = "ss-dash-theme";
5
+ /**
6
+ * The two supported theme values.
7
+ */
8
+ export type Theme = 'dark' | 'light';
9
+ /**
10
+ * Read the current theme preference.
11
+ *
12
+ * Resolution order:
13
+ * 1. Explicit value stored in `localStorage` under {@link STORAGE_KEY}.
14
+ * 2. System preference via `prefers-color-scheme` media query.
15
+ * 3. Falls back to `'light'` if neither is available (e.g. SSR).
16
+ */
17
+ export declare function getTheme(): Theme;
18
+ /**
19
+ * Persist a theme preference to `localStorage` and notify
20
+ * all in-page listeners via a custom DOM event.
21
+ *
22
+ * Other tabs will be notified via the native `storage` event,
23
+ * which listeners created by {@link onThemeChange} also handle.
24
+ */
25
+ export declare function setTheme(theme: Theme): void;
26
+ /**
27
+ * Toggle the current theme and persist the new value.
28
+ *
29
+ * @returns The newly active theme.
30
+ */
31
+ export declare function toggleTheme(): Theme;
32
+ /**
33
+ * Subscribe to theme changes from:
34
+ * - Same-tab components (via custom {@link THEME_CHANGE_EVENT} event)
35
+ * - Other tabs (via native `storage` event)
36
+ * - System preference changes (via `prefers-color-scheme` media query)
37
+ *
38
+ * @param callback - Invoked with the new theme value whenever it changes.
39
+ * @returns An unsubscribe function that removes all listeners.
40
+ */
41
+ export declare function onThemeChange(callback: (theme: Theme) => void): () => void;
42
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/core/theme.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,WAAW,kBAAkB,CAAA;AAa1C;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,OAAO,CAAA;AAEpC;;;;;;;GAOG;AACH,wBAAgB,QAAQ,IAAI,KAAK,CAUhC;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAQ3C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,KAAK,CAKnC;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,MAAM,IAAI,CA6C1E"}