adonisjs-server-stats 1.10.0 → 1.10.3

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 (210) hide show
  1. package/README.md +23 -14
  2. package/dist/core/config-utils.d.ts +8 -0
  3. package/dist/core/constants.d.ts +4 -0
  4. package/dist/core/dashboard-data-controller.d.ts +16 -0
  5. package/dist/core/dashboard-data-helpers.d.ts +12 -0
  6. package/dist/core/debug-data-controller.d.ts +4 -0
  7. package/dist/core/define-config-helpers.d.ts +25 -0
  8. package/dist/core/feature-detect-helpers.d.ts +36 -0
  9. package/dist/core/formatters-helpers.d.ts +23 -0
  10. package/dist/core/index.js +594 -509
  11. package/dist/core/log-utils-helpers.d.ts +13 -0
  12. package/dist/core/metrics.d.ts +3 -28
  13. package/dist/core/pagination.d.ts +0 -9
  14. package/dist/core/server-stats-controller.d.ts +6 -0
  15. package/dist/core/transmit-helpers.d.ts +7 -0
  16. package/dist/core/types-dashboard.d.ts +178 -0
  17. package/dist/core/types-diagnostics.d.ts +85 -0
  18. package/dist/core/types.d.ts +10 -442
  19. package/dist/react/{CacheSection-UCMptWyn.js → CacheSection-baMZotSn.js} +2 -2
  20. package/dist/react/CacheTab-2cw_rMzj.js +117 -0
  21. package/dist/react/{ConfigSection-DfFd-WRq.js → ConfigSection-DGgqjAal.js} +1 -1
  22. package/dist/react/{ConfigTab-Bdg8YMer.js → ConfigTab-H3OnYqmK.js} +1 -1
  23. package/dist/react/CustomPaneTab-B6r7ha0u.js +98 -0
  24. package/dist/react/{EmailsSection-CM7stSyh.js → EmailsSection-C-UZISG-.js} +2 -2
  25. package/dist/react/EmailsTab-DbK4Eobn.js +139 -0
  26. package/dist/react/{EventsSection-ByQ-9blq.js → EventsSection-C7RQW_LY.js} +2 -2
  27. package/dist/react/EventsTab-CfVr7AiM.js +57 -0
  28. package/dist/react/{FilterBar-DQRXpWrb.js → FilterBar-CQ7bD669.js} +15 -15
  29. package/dist/react/{JobsSection-DF3qEv9O.js → JobsSection-CQHNK_Ls.js} +2 -2
  30. package/dist/react/{JobsTab-BbrBWIOb.js → JobsTab-znzf6jzk.js} +54 -42
  31. package/dist/react/{LogsSection-DcFTZY7b.js → LogsSection-Dmm3rE2B.js} +9 -3
  32. package/dist/react/LogsTab-D8unMV5P.js +108 -0
  33. package/dist/react/{OverviewSection-C4T1ur51.js → OverviewSection-ABP9ueBo.js} +1 -1
  34. package/dist/react/{QueriesSection-PswteoF9.js → QueriesSection-CnmSkznA.js} +2 -2
  35. package/dist/react/{QueriesTab-osLUWd4L.js → QueriesTab-BQzcxEiW.js} +37 -40
  36. package/dist/react/{RelatedLogs-DFDOyUMr.js → RelatedLogs-3A8RuGKH.js} +15 -3
  37. package/dist/react/{RequestsSection-Nag30rEA.js → RequestsSection-kW79_M7k.js} +3 -3
  38. package/dist/react/{RoutesSection-BUSkM6PY.js → RoutesSection-BRhxrtjZ.js} +2 -2
  39. package/dist/react/RoutesTab-CpYH5lUw.js +68 -0
  40. package/dist/react/{TimelineTab-Covg5weo.js → TimelineTab-DjLR35Ce.js} +47 -53
  41. package/dist/react/index-CsImORX6.js +1121 -0
  42. package/dist/react/index.js +1 -1
  43. package/dist/react/react/components/{Dashboard/shared → shared}/FilterBar.d.ts +4 -3
  44. package/dist/react/react/hooks/useDashboardData.d.ts +4 -8
  45. package/dist/react/style.css +1 -1
  46. package/dist/src/collectors/app_collector.d.ts +0 -8
  47. package/dist/src/collectors/app_collector.js +45 -52
  48. package/dist/src/collectors/auto_detect.d.ts +0 -23
  49. package/dist/src/collectors/auto_detect.js +33 -55
  50. package/dist/src/collectors/db_pool_collector.d.ts +14 -16
  51. package/dist/src/collectors/db_pool_collector.js +72 -57
  52. package/dist/src/collectors/log_collector.d.ts +0 -47
  53. package/dist/src/collectors/log_collector.js +36 -65
  54. package/dist/src/collectors/queue_collector.d.ts +0 -20
  55. package/dist/src/collectors/queue_collector.js +60 -76
  56. package/dist/src/collectors/redis_collector.d.ts +10 -10
  57. package/dist/src/collectors/redis_collector.js +69 -66
  58. package/dist/src/config/deprecation_migration.d.ts +7 -0
  59. package/dist/src/config/deprecation_migration.js +201 -0
  60. package/dist/src/controller/debug_controller.d.ts +1 -1
  61. package/dist/src/controller/debug_controller.js +87 -81
  62. package/dist/src/dashboard/cache_handlers.d.ts +14 -0
  63. package/dist/src/dashboard/cache_handlers.js +52 -0
  64. package/dist/src/dashboard/chart_aggregator.d.ts +0 -7
  65. package/dist/src/dashboard/chart_aggregator.js +68 -50
  66. package/dist/src/dashboard/coalesce_cache.d.ts +25 -0
  67. package/dist/src/dashboard/coalesce_cache.js +47 -0
  68. package/dist/src/dashboard/dashboard_controller.d.ts +11 -37
  69. package/dist/src/dashboard/dashboard_controller.js +51 -544
  70. package/dist/src/dashboard/dashboard_page_assets.d.ts +17 -0
  71. package/dist/src/dashboard/dashboard_page_assets.js +51 -0
  72. package/dist/src/dashboard/dashboard_store.d.ts +19 -218
  73. package/dist/src/dashboard/dashboard_store.js +115 -1116
  74. package/dist/src/dashboard/dashboard_types.d.ts +83 -0
  75. package/dist/src/dashboard/dashboard_types.js +4 -0
  76. package/dist/src/dashboard/detail_queries.d.ts +19 -0
  77. package/dist/src/dashboard/detail_queries.js +98 -0
  78. package/dist/src/dashboard/email_event_builder.d.ts +8 -0
  79. package/dist/src/dashboard/email_event_builder.js +65 -0
  80. package/dist/src/dashboard/explain_query.d.ts +8 -0
  81. package/dist/src/dashboard/explain_query.js +22 -0
  82. package/dist/src/dashboard/filter_handlers.d.ts +23 -0
  83. package/dist/src/dashboard/filter_handlers.js +56 -0
  84. package/dist/src/dashboard/filtered_queries.d.ts +15 -0
  85. package/dist/src/dashboard/filtered_queries.js +155 -0
  86. package/dist/src/dashboard/flush_manager.d.ts +25 -0
  87. package/dist/src/dashboard/flush_manager.js +107 -0
  88. package/dist/src/dashboard/format_helpers.d.ts +126 -0
  89. package/dist/src/dashboard/format_helpers.js +140 -0
  90. package/dist/src/dashboard/inspector_manager.d.ts +36 -0
  91. package/dist/src/dashboard/inspector_manager.js +102 -0
  92. package/dist/src/dashboard/integrations/config_inspector.js +11 -13
  93. package/dist/src/dashboard/integrations/queue_inspector.d.ts +3 -3
  94. package/dist/src/dashboard/integrations/queue_inspector.js +13 -10
  95. package/dist/src/dashboard/jobs_handlers.d.ts +14 -0
  96. package/dist/src/dashboard/jobs_handlers.js +61 -0
  97. package/dist/src/dashboard/knex_factory.d.ts +18 -0
  98. package/dist/src/dashboard/knex_factory.js +91 -0
  99. package/dist/src/dashboard/migrator.js +30 -159
  100. package/dist/src/dashboard/migrator_tables.d.ts +19 -0
  101. package/dist/src/dashboard/migrator_tables.js +153 -0
  102. package/dist/src/dashboard/overview_queries.d.ts +66 -0
  103. package/dist/src/dashboard/overview_queries.js +155 -0
  104. package/dist/src/dashboard/overview_query_runners.d.ts +25 -0
  105. package/dist/src/dashboard/overview_query_runners.js +84 -0
  106. package/dist/src/dashboard/overview_store_queries.d.ts +40 -0
  107. package/dist/src/dashboard/overview_store_queries.js +69 -0
  108. package/dist/src/dashboard/paginate_helper.d.ts +12 -0
  109. package/dist/src/dashboard/paginate_helper.js +33 -0
  110. package/dist/src/dashboard/query_explain_handler.d.ts +10 -0
  111. package/dist/src/dashboard/query_explain_handler.js +80 -0
  112. package/dist/src/dashboard/read_queries.d.ts +32 -0
  113. package/dist/src/dashboard/read_queries.js +107 -0
  114. package/dist/src/dashboard/saved_filter_queries.d.ts +10 -0
  115. package/dist/src/dashboard/saved_filter_queries.js +24 -0
  116. package/dist/src/dashboard/storage_stats.d.ts +41 -0
  117. package/dist/src/dashboard/storage_stats.js +81 -0
  118. package/dist/src/dashboard/write_queue.d.ts +106 -0
  119. package/dist/src/dashboard/write_queue.js +225 -0
  120. package/dist/src/data/data_access.d.ts +2 -39
  121. package/dist/src/data/data_access.js +17 -193
  122. package/dist/src/data/data_access_helpers.d.ts +130 -0
  123. package/dist/src/data/data_access_helpers.js +212 -0
  124. package/dist/src/debug/debug_store.js +37 -32
  125. package/dist/src/debug/email_collector.d.ts +1 -10
  126. package/dist/src/debug/email_collector.js +78 -81
  127. package/dist/src/debug/event_collector.d.ts +0 -9
  128. package/dist/src/debug/event_collector.js +79 -62
  129. package/dist/src/debug/query_collector.js +23 -19
  130. package/dist/src/debug/route_inspector.d.ts +1 -5
  131. package/dist/src/debug/route_inspector.js +50 -51
  132. package/dist/src/debug/trace_collector.d.ts +9 -1
  133. package/dist/src/debug/trace_collector.js +21 -15
  134. package/dist/src/debug/types.d.ts +1 -1
  135. package/dist/src/define_config.d.ts +0 -65
  136. package/dist/src/define_config.js +93 -333
  137. package/dist/src/edge/client/dashboard.js +2 -2
  138. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  139. package/dist/src/edge/client/stats-bar.js +1 -1
  140. package/dist/src/edge/client-vue/dashboard.js +5 -5
  141. package/dist/src/edge/client-vue/debug-panel-deferred.js +3 -3
  142. package/dist/src/edge/client-vue/stats-bar.js +3 -3
  143. package/dist/src/edge/plugin.d.ts +0 -16
  144. package/dist/src/edge/plugin.js +57 -64
  145. package/dist/src/engine/request_metrics.d.ts +1 -0
  146. package/dist/src/engine/request_metrics.js +32 -42
  147. package/dist/src/middleware/request_tracking_middleware.d.ts +2 -8
  148. package/dist/src/middleware/request_tracking_middleware.js +65 -93
  149. package/dist/src/provider/auth_middleware_detector.d.ts +16 -0
  150. package/dist/src/provider/auth_middleware_detector.js +97 -0
  151. package/dist/src/provider/boot_helpers.d.ts +20 -0
  152. package/dist/src/provider/boot_helpers.js +91 -0
  153. package/dist/src/provider/boot_initializer.d.ts +28 -0
  154. package/dist/src/provider/boot_initializer.js +35 -0
  155. package/dist/src/provider/dashboard_init.d.ts +30 -0
  156. package/dist/src/provider/dashboard_init.js +138 -0
  157. package/dist/src/provider/dashboard_setup.d.ts +25 -0
  158. package/dist/src/provider/dashboard_setup.js +78 -0
  159. package/dist/src/provider/diagnostics.d.ts +134 -0
  160. package/dist/src/provider/diagnostics.js +127 -0
  161. package/dist/src/provider/email_bridge.d.ts +43 -0
  162. package/dist/src/provider/email_bridge.js +80 -0
  163. package/dist/src/provider/email_helpers.d.ts +13 -0
  164. package/dist/src/provider/email_helpers.js +68 -0
  165. package/dist/src/provider/pino_hook.d.ts +17 -0
  166. package/dist/src/provider/pino_hook.js +35 -0
  167. package/dist/src/provider/provider_helpers_extra.d.ts +47 -0
  168. package/dist/src/provider/provider_helpers_extra.js +177 -0
  169. package/dist/src/provider/server_stats_provider.d.ts +39 -85
  170. package/dist/src/provider/server_stats_provider.js +132 -951
  171. package/dist/src/provider/shutdown_helpers.d.ts +43 -0
  172. package/dist/src/provider/shutdown_helpers.js +70 -0
  173. package/dist/src/provider/toolbar_setup.d.ts +57 -0
  174. package/dist/src/provider/toolbar_setup.js +141 -0
  175. package/dist/src/routes/dashboard_routes.d.ts +14 -0
  176. package/dist/src/routes/dashboard_routes.js +197 -0
  177. package/dist/src/routes/debug_routes.d.ts +14 -0
  178. package/dist/src/routes/debug_routes.js +101 -0
  179. package/dist/src/routes/register_routes.d.ts +0 -78
  180. package/dist/src/routes/register_routes.js +22 -352
  181. package/dist/src/routes/stats_routes.d.ts +5 -0
  182. package/dist/src/routes/stats_routes.js +14 -0
  183. package/dist/src/styles/components.css +96 -0
  184. package/dist/src/styles/dashboard.css +8 -90
  185. package/dist/src/styles/debug-panel.css +1 -31
  186. package/dist/src/types.d.ts +305 -14
  187. package/dist/vue/{CacheSection-oFAJL3mo.js → CacheSection-ITqvpfH5.js} +1 -1
  188. package/dist/vue/{ConfigSection-BhfJ4KqL.js → ConfigSection-DTn3GslE.js} +1 -1
  189. package/dist/vue/{EmailsSection-BcNyhyHs.js → EmailsSection-DtLJ4XoS.js} +1 -1
  190. package/dist/vue/{EventsSection-r60Q5Lmu.js → EventsSection-BOYYz0Ty.js} +1 -1
  191. package/dist/vue/{JobsSection-BHL-hkQw.js → JobsSection-BazTxcJL.js} +1 -1
  192. package/dist/vue/{LogsSection-DRMGzJmg.js → LogsSection-D55PjTKX.js} +9 -3
  193. package/dist/vue/{LogsTab-Bg3o0Mm6.js → LogsTab-47zEK7jL.js} +4 -1
  194. package/dist/vue/{OverviewSection-CXh6Ja1B.js → OverviewSection-1uBKo-Tu.js} +1 -1
  195. package/dist/vue/{QueriesSection-IodIsCJ-.js → QueriesSection-rpoZ4ogd.js} +1 -1
  196. package/dist/vue/{RequestsSection-BPuMdmMc.js → RequestsSection-x7LvT0MC.js} +1 -1
  197. package/dist/vue/{RoutesSection-NKo3Rbq3.js → RoutesSection-CCD0zZqQ.js} +1 -1
  198. package/dist/vue/composables/useDashboardData.d.ts +12 -23
  199. package/dist/vue/index-C8MxnS7Q.js +1232 -0
  200. package/dist/vue/index.js +1 -1
  201. package/dist/vue/style.css +1 -1
  202. package/package.json +1 -1
  203. package/dist/react/CacheTab-CA8LB1J5.js +0 -123
  204. package/dist/react/CustomPaneTab-Bxtv_8Rw.js +0 -104
  205. package/dist/react/EmailsTab-BDhEiomM.js +0 -153
  206. package/dist/react/EventsTab-CMfY98Rl.js +0 -63
  207. package/dist/react/LogsTab-CicucmVk.js +0 -103
  208. package/dist/react/RoutesTab-DgVzd2PZ.js +0 -74
  209. package/dist/react/index-Cflz9Ebj.js +0 -1069
  210. package/dist/vue/index-Dtgysd26.js +0 -1229
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![AdonisJS](https://img.shields.io/badge/AdonisJS-v6-5A45FF.svg)](https://adonisjs.com/)
8
8
  [![AdonisJS](https://img.shields.io/badge/AdonisJS-v7-5A45FF.svg)](https://adonisjs.com/)
9
9
 
10
- A Laravel Telescope-inspired dev toolbar and real-time server monitor for **AdonisJS v6**.
10
+ A Laravel Telescope-inspired dev toolbar and real-time server monitor for **AdonisJS v6 & v7**.
11
11
 
12
12
  Drop a single Edge tag into your layout and get a live stats bar showing CPU, memory, requests/sec, database pool, Redis, queues, and logs -- plus a full debug toolbar with SQL query inspection, event tracing, route listing, live log tailing, and custom panels.
13
13
 
@@ -178,7 +178,7 @@ All fields are optional. `defineConfig({})` works with zero configuration.
178
178
  | Option | Type | Default | Description |
179
179
  | -------------------- | ---------- | ------------------------------------------------- | ----------------------------------------------- |
180
180
  | `slowQueryThreshold` | `number` | `100` | Slow query threshold (ms) |
181
- | `tracing` | `boolean` | `false` | Enable per-request tracing with timeline |
181
+ | `tracing` | `boolean` | `true` | Enable per-request tracing with timeline |
182
182
  | `persist` | `boolean` | `false` | Persist debug data to disk across restarts |
183
183
  | `panes` | `DebugPane[]` | -- | Custom debug panel tabs |
184
184
  | `excludeFromTracing` | `string[]` | `['/admin/api/debug', '/admin/api/server-stats']` | URL prefixes to exclude from tracing/persistence |
@@ -231,7 +231,7 @@ The following field names still work but will show deprecation warnings at boot.
231
231
  | `maxEmails` | `number` | `100` | Max emails to buffer |
232
232
  | `slowQueryThresholdMs` | `number` | `100` | Slow query threshold (ms) |
233
233
  | `persistDebugData` | `boolean \| string` | `false` | Persist debug data to disk across restarts. `true` writes to `.adonisjs/server-stats/debug-data.json`, or pass a custom path. |
234
- | `tracing` | `boolean` | `false` | Enable per-request tracing with timeline visualization |
234
+ | `tracing` | `boolean` | `true` | Enable per-request tracing with timeline visualization |
235
235
  | `maxTraces` | `number` | `200` | Max request traces to buffer |
236
236
  | `dashboard` | `boolean` | `false` | Enable the full-page dashboard (requires `better-sqlite3`) |
237
237
  | `dashboardPath` | `string` | `'/__stats'` | URL path for the dashboard page |
@@ -381,16 +381,18 @@ Registered when `statsEndpoint` is a string (default: `/admin/api/server-stats`)
381
381
 
382
382
  Registered when `toolbar` is enabled. Base path configurable via `advanced.debugEndpoint` (default: `/admin/api/debug`).
383
383
 
384
- | Method | Path | Description |
385
- | ------ | --------------------- | ------------------------------- |
386
- | GET | `/queries` | SQL queries with summary stats |
387
- | GET | `/events` | Application events |
388
- | GET | `/routes` | Registered route table |
389
- | GET | `/logs` | Log file entries (last 256KB) |
390
- | GET | `/emails` | Captured emails (stripped HTML) |
391
- | GET | `/emails/:id/preview` | Email HTML preview |
392
- | GET | `/traces` | Request traces |
393
- | GET | `/traces/:id` | Trace detail with spans |
384
+ | Method | Path | Description |
385
+ | ------ | --------------------- | ---------------------------------------- |
386
+ | GET | `/queries` | SQL queries with summary stats |
387
+ | GET | `/events` | Application events |
388
+ | GET | `/routes` | Registered route table |
389
+ | GET | `/logs` | Paginated log entries (up to 200) |
390
+ | GET | `/emails` | Captured emails (stripped HTML) |
391
+ | GET | `/emails/:id/preview` | Email HTML preview |
392
+ | GET | `/traces` | Request traces with log correlation |
393
+ | GET | `/traces/:id` | Trace detail with spans and related logs |
394
+ | GET | `/config` | Debug store configuration |
395
+ | GET | `/diagnostics` | Provider diagnostics and status |
394
396
 
395
397
  ### Dashboard routes
396
398
 
@@ -415,6 +417,7 @@ Registered when `dashboard` is enabled. Base path configurable via `dashboard.pa
415
417
  | GET | `/api/traces/:id` | Trace detail with spans |
416
418
  | GET | `/api/cache` | Cache stats and key listing |
417
419
  | GET | `/api/cache/:key` | Cache key detail |
420
+ | DELETE | `/api/cache/:key` | Delete a cache key |
418
421
  | GET | `/api/jobs` | Job queue overview |
419
422
  | GET | `/api/jobs/:id` | Job detail |
420
423
  | POST | `/api/jobs/:id/retry` | Retry a failed job |
@@ -582,7 +585,7 @@ The React and Vue components share the same theme system as Edge. Dark/light pre
582
585
  - The dashboard page is large — lazy-loading helps but initial bundle may be significant
583
586
  - Some edge cases in custom pane rendering may not be fully covered yet
584
587
  - Error boundaries are minimal — a bad API response may cause a blank panel
585
- - Only tested with React 18+ and Vue 3.3+
588
+ - Only tested with React 18/19 and Vue 3.3+
586
589
 
587
590
  Found a bug? Have feedback? [Open an issue](https://github.com/simulieren/adonisjs-server-stats/issues) — it helps a lot.
588
591
 
@@ -714,6 +717,12 @@ const result = await trace('organization.fetchMembers', async () => {
714
717
 
715
718
  If tracing is disabled or no request is active, `trace()` executes the function directly with no overhead.
716
719
 
720
+ #### Related Logs
721
+
722
+ When viewing a trace detail (either in the debug panel Timeline tab or the dashboard), related log entries are automatically correlated using the HTTP request ID (`ctx.request.id()`). Any logs emitted during the request appear in a "Related Logs" section below the waterfall chart.
723
+
724
+ This works with both SQLite persistence (joins on `http_request_id`) and in-memory mode (scans the log file for matching `request_id` entries). No configuration needed — if your app uses AdonisJS request IDs, correlation happens automatically.
725
+
717
726
  ### Full-Page Dashboard
718
727
 
719
728
  The dashboard is a dedicated page that provides historical data, charts, query analysis, and integration inspectors -- all persisted to a local SQLite database. It's like having Laravel Telescope built into your dev toolbar.
@@ -20,6 +20,14 @@ export interface FormattedValue {
20
20
  * Redacted objects have the shape `{ __redacted: true, display: string, value: string }`.
21
21
  */
22
22
  export declare function isRedactedValue(val: ConfigValue): val is RedactedValue;
23
+ /**
24
+ * Check whether a config value is a plain config object (not null, not an
25
+ * array, not a redacted value). This consolidates the repeated
26
+ * null/typeof/array/redacted checks into a single reusable guard.
27
+ */
28
+ export declare function isPlainConfigObject(val: ConfigValue): val is {
29
+ [key: string]: ConfigValue;
30
+ };
23
31
  /**
24
32
  * Recursively flatten a nested config object into a list of dot-path entries.
25
33
  *
@@ -8,3 +8,7 @@ export declare const DEBUG_REFRESH_MS = 3000;
8
8
  export declare const SLOW_DURATION_MS = 100;
9
9
  /** Duration (ms) above which a query/request is considered very slow. */
10
10
  export declare const VERY_SLOW_DURATION_MS = 500;
11
+ /** Max data points in the sparkline history buffer per metric. */
12
+ export declare const MAX_HISTORY = 60;
13
+ /** Milliseconds after last success before connection is considered stale. */
14
+ export declare const STALE_MS = 10000;
@@ -153,6 +153,22 @@ export declare class DashboardDataController {
153
153
  * Get the underlying `ApiClient` instance.
154
154
  */
155
155
  getClient(): ApiClient;
156
+ /** Whether this fetch call should be skipped entirely. */
157
+ private shouldSkipFetch;
158
+ /** Prepare abort controller, increment fetch ID, set loading state. */
159
+ private prepareFetch;
160
+ /** Execute the actual API fetch for the current section. */
161
+ private executeFetch;
162
+ /** Check if a response is stale (fetch ID mismatch or controller stopped). */
163
+ private isStaleResponse;
164
+ /** Check if an error should be silently ignored (abort or stale). */
165
+ private shouldIgnoreError;
166
+ /** Build query string from current controller state. */
167
+ private buildCurrentQueryString;
168
+ /** Apply a successful fetch result to the callbacks. */
169
+ private applyFetchResult;
170
+ /** Handle a fetch error (unauthorized, network, etc.). */
171
+ private handleFetchError;
156
172
  private startRefreshTimer;
157
173
  private stopRefreshTimer;
158
174
  }
@@ -0,0 +1,12 @@
1
+ import { PaginatedResponse } from './types.js';
2
+ /**
3
+ * Check if a result is a paginated response (has data + meta).
4
+ */
5
+ export declare function isPaginatedResult(result: unknown): result is {
6
+ data: unknown;
7
+ meta: PaginatedResponse<unknown>['meta'];
8
+ };
9
+ /**
10
+ * Check if an error is an AbortError (request was cancelled).
11
+ */
12
+ export declare function isAbortedRequest(err: unknown, signal: AbortSignal): boolean;
@@ -86,4 +86,8 @@ export declare class DebugDataController<T = unknown> {
86
86
  */
87
87
  clearCache(): void;
88
88
  private fetchData;
89
+ /** Serve cached data if available. Returns true if cache hit. */
90
+ private serveFromCache;
91
+ /** Handle errors from fetchData. */
92
+ private handleFetchError;
89
93
  }
@@ -0,0 +1,25 @@
1
+ import { DevToolbarOptions, ServerStatsConfig, ToolbarConfig } from '../types.js';
2
+ /**
3
+ * Return the first defined (non-undefined) value from the arguments.
4
+ * Falls back to the last argument (the default).
5
+ */
6
+ export declare function firstDefined<T>(...args: Array<T | undefined>): T;
7
+ /**
8
+ * Apply a toolbar boolean or ToolbarConfig onto the result DevToolbarOptions.
9
+ */
10
+ export declare function applyToolbarSetting(toolbar: boolean | ToolbarConfig, result: DevToolbarOptions): void;
11
+ /**
12
+ * Apply a dashboard boolean or DashboardConfig onto the result DevToolbarOptions.
13
+ */
14
+ export declare function applyDashboardSetting(dashboard: boolean | {
15
+ path?: string;
16
+ retentionDays?: number;
17
+ }, result: DevToolbarOptions): void;
18
+ /**
19
+ * Apply advanced config fields onto the result DevToolbarOptions.
20
+ */
21
+ export declare function applyAdvancedConfig(advanced: NonNullable<ServerStatsConfig['advanced']>, result: DevToolbarOptions): void;
22
+ /**
23
+ * Resolve transport from new and deprecated config options.
24
+ */
25
+ export declare function resolveTransport(config: ServerStatsConfig): 'transmit' | 'none';
@@ -0,0 +1,36 @@
1
+ import { FeatureFlags, FeatureConfig } from './types.js';
2
+ /**
3
+ * Mapping from FeatureConfig keys to their default value.
4
+ * Used to data-drive the flattenFlags function.
5
+ */
6
+ export declare const FEATURE_KEYS: Array<keyof Omit<FeatureConfig, 'customPanes'>>;
7
+ /**
8
+ * Flatten a FeatureFlags response to a FeatureConfig using the
9
+ * data-driven FEATURE_KEYS list.
10
+ */
11
+ export declare function flattenFlagsFromKeys(flags: FeatureFlags): FeatureConfig;
12
+ /**
13
+ * Rules for mapping feature flags to metric groups in getVisibleMetricGroups.
14
+ */
15
+ export interface FlagGroupRule {
16
+ flag: string;
17
+ group: string;
18
+ }
19
+ /**
20
+ * Which flags enable which metric groups.
21
+ * Some groups can be triggered by multiple flags (e.g. memory by process or system).
22
+ */
23
+ export declare const FLAG_TO_GROUP: FlagGroupRule[];
24
+ /**
25
+ * Rules for detecting metric groups from actual stats data.
26
+ * Each rule maps stat field names to a group name.
27
+ */
28
+ export interface StatsGroupRule {
29
+ group: string;
30
+ fields: string[];
31
+ }
32
+ export declare const STATS_GROUP_RULES: StatsGroupRule[];
33
+ /**
34
+ * Check if a value is a number (including 0).
35
+ */
36
+ export declare function hasStatValue(v: unknown): v is number;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Create a compact preview of a string value.
3
+ * Truncates at 40 characters and wraps in quotes.
4
+ */
5
+ export declare function previewString(value: string): string;
6
+ /**
7
+ * Create a compact preview of an array value.
8
+ * Shows first 3 items with a summary for larger arrays.
9
+ *
10
+ * @param value - The array to preview.
11
+ * @param maxLen - Maximum preview string length before falling back to a summary.
12
+ * @param recurse - Function to recursively preview nested values.
13
+ */
14
+ export declare function previewArray(value: unknown[], maxLen: number, recurse: (v: unknown, max: number) => string): string;
15
+ /**
16
+ * Create a compact preview of a plain object value.
17
+ * Shows first 4 key-value pairs with a summary for larger objects.
18
+ *
19
+ * @param value - The object to preview.
20
+ * @param maxLen - Maximum preview string length before falling back to keys-only.
21
+ * @param recurse - Function to recursively preview nested values.
22
+ */
23
+ export declare function previewObject(value: Record<string, unknown>, maxLen: number, recurse: (v: unknown, max: number) => string): string;