@antelopejs/dms-api 0.1.7 → 0.3.0

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 (346) hide show
  1. package/README.md +99 -8
  2. package/dist/automation/get-api-health.js +4 -3
  3. package/dist/automation/get-api-health.js.map +1 -1
  4. package/dist/automation/route-unhealthy.js +2 -2
  5. package/dist/automation/route-unhealthy.js.map +1 -1
  6. package/dist/automation/scope.d.ts +0 -1
  7. package/dist/automation/scope.js +0 -7
  8. package/dist/automation/scope.js.map +1 -1
  9. package/dist/config.d.ts +4 -0
  10. package/dist/config.js +15 -9
  11. package/dist/config.js.map +1 -1
  12. package/dist/db/models/request_log.model.d.ts +37 -2
  13. package/dist/db/models/request_log.model.js +130 -35
  14. package/dist/db/models/request_log.model.js.map +1 -1
  15. package/dist/db/models/request_log.search.d.ts +5 -0
  16. package/dist/db/models/request_log.search.js +35 -0
  17. package/dist/db/models/request_log.search.js.map +1 -0
  18. package/dist/db/models/request_log.status.d.ts +5 -0
  19. package/dist/db/models/request_log.status.js +9 -0
  20. package/dist/db/models/request_log.status.js.map +1 -0
  21. package/dist/db/models/routes.model.d.ts +1 -0
  22. package/dist/db/models/routes.model.js +5 -1
  23. package/dist/db/models/routes.model.js.map +1 -1
  24. package/dist/db/models/routes_statistics.model.js +1 -1
  25. package/dist/db/models/routes_statistics.model.js.map +1 -1
  26. package/dist/db/tables/api_settings.table.d.ts +1 -0
  27. package/dist/db/tables/api_settings.table.js +4 -0
  28. package/dist/db/tables/api_settings.table.js.map +1 -1
  29. package/dist/db/tables/request_log.table.d.ts +18 -3
  30. package/dist/db/tables/request_log.table.js +34 -1
  31. package/dist/db/tables/request_log.table.js.map +1 -1
  32. package/dist/db/tables/routes.table.d.ts +1 -2
  33. package/dist/db/tables/routes.table.js.map +1 -1
  34. package/dist/db/tables/routes_statistics.table.d.ts +4 -3
  35. package/dist/db/tables/routes_statistics.table.js +5 -1
  36. package/dist/db/tables/routes_statistics.table.js.map +1 -1
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.js +9 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/memo.d.ts +5 -0
  41. package/dist/memo.js +36 -0
  42. package/dist/memo.js.map +1 -0
  43. package/dist/pages/blocks.d.ts +3 -0
  44. package/dist/pages/blocks.js +31 -0
  45. package/dist/pages/blocks.js.map +1 -0
  46. package/dist/pages/displays.d.ts +7 -0
  47. package/dist/pages/displays.js +23 -0
  48. package/dist/pages/displays.js.map +1 -0
  49. package/dist/pages/index.d.ts +5 -2
  50. package/dist/pages/index.js +5 -2
  51. package/dist/pages/index.js.map +1 -1
  52. package/dist/pages/logs.d.ts +18 -0
  53. package/dist/pages/logs.js +112 -0
  54. package/dist/pages/logs.js.map +1 -0
  55. package/dist/pages/module.d.ts +3 -0
  56. package/dist/pages/module.js +102 -6
  57. package/dist/pages/module.js.map +1 -1
  58. package/dist/pages/overview.d.ts +14 -0
  59. package/dist/pages/overview.js +215 -0
  60. package/dist/pages/overview.js.map +1 -0
  61. package/dist/pages/period.d.ts +9 -0
  62. package/dist/pages/period.js +24 -0
  63. package/dist/pages/period.js.map +1 -0
  64. package/dist/pages/request-table.d.ts +11 -0
  65. package/dist/pages/request-table.js +187 -0
  66. package/dist/pages/request-table.js.map +1 -0
  67. package/dist/pages/routes.d.ts +15 -0
  68. package/dist/pages/routes.js +269 -0
  69. package/dist/pages/routes.js.map +1 -0
  70. package/dist/pages/scope-chip.d.ts +9 -0
  71. package/dist/pages/scope-chip.js +28 -0
  72. package/dist/pages/scope-chip.js.map +1 -0
  73. package/dist/pages/{logs/page.d.ts → settings.d.ts} +3 -3
  74. package/dist/pages/settings.js +218 -0
  75. package/dist/pages/settings.js.map +1 -0
  76. package/dist/pages/toolbar.d.ts +9 -0
  77. package/dist/pages/toolbar.js +33 -0
  78. package/dist/pages/toolbar.js.map +1 -0
  79. package/dist/realtime.d.ts +2 -0
  80. package/dist/realtime.js +21 -0
  81. package/dist/realtime.js.map +1 -0
  82. package/dist/routes/index.d.ts +2 -2
  83. package/dist/routes/index.js +2 -2
  84. package/dist/routes/index.js.map +1 -1
  85. package/dist/routes/logs.d.ts +173 -2
  86. package/dist/routes/logs.js +177 -86
  87. package/dist/routes/logs.js.map +1 -1
  88. package/dist/routes/overview.d.ts +27 -0
  89. package/dist/routes/overview.js +131 -0
  90. package/dist/routes/overview.js.map +1 -0
  91. package/dist/routes/routes.d.ts +92 -28
  92. package/dist/routes/routes.js +165 -97
  93. package/dist/routes/routes.js.map +1 -1
  94. package/dist/routes/settings.d.ts +16 -11
  95. package/dist/routes/settings.js +62 -54
  96. package/dist/routes/settings.js.map +1 -1
  97. package/dist/routes/tester.d.ts +7 -0
  98. package/dist/routes/tester.js +34 -0
  99. package/dist/routes/tester.js.map +1 -0
  100. package/dist/services/activity.d.ts +49 -0
  101. package/dist/services/activity.js +207 -0
  102. package/dist/services/activity.js.map +1 -0
  103. package/dist/services/aggregate-cache.d.ts +3 -0
  104. package/dist/services/aggregate-cache.js +16 -0
  105. package/dist/services/aggregate-cache.js.map +1 -0
  106. package/dist/services/api-origin.d.ts +1 -0
  107. package/dist/services/api-origin.js +9 -0
  108. package/dist/services/api-origin.js.map +1 -0
  109. package/dist/services/attention.d.ts +45 -0
  110. package/dist/services/attention.js +203 -0
  111. package/dist/services/attention.js.map +1 -0
  112. package/dist/services/composed-text.d.ts +6 -0
  113. package/dist/services/composed-text.js +23 -0
  114. package/dist/services/composed-text.js.map +1 -0
  115. package/dist/services/health-rules.d.ts +49 -0
  116. package/dist/services/health-rules.js +233 -0
  117. package/dist/services/health-rules.js.map +1 -0
  118. package/dist/services/index.d.ts +1 -3
  119. package/dist/services/index.js +3 -3
  120. package/dist/services/index.js.map +1 -1
  121. package/dist/services/introspection/decorators.d.ts +14 -0
  122. package/dist/services/introspection/decorators.js +192 -0
  123. package/dist/services/introspection/decorators.js.map +1 -0
  124. package/dist/services/introspection/errors.js +4 -4
  125. package/dist/services/introspection/errors.js.map +1 -1
  126. package/dist/services/introspection/index.d.ts +6 -8
  127. package/dist/services/introspection/index.js +96 -32
  128. package/dist/services/introspection/index.js.map +1 -1
  129. package/dist/services/introspection/probe.d.ts +2 -1
  130. package/dist/services/introspection/probe.js +11 -0
  131. package/dist/services/introspection/probe.js.map +1 -1
  132. package/dist/services/links.d.ts +25 -0
  133. package/dist/services/links.js +72 -0
  134. package/dist/services/links.js.map +1 -0
  135. package/dist/services/live-feed.d.ts +6 -0
  136. package/dist/services/live-feed.js +18 -0
  137. package/dist/services/live-feed.js.map +1 -0
  138. package/dist/services/live.d.ts +16 -0
  139. package/dist/services/live.js +32 -0
  140. package/dist/services/live.js.map +1 -0
  141. package/dist/services/overview.d.ts +122 -0
  142. package/dist/services/overview.js +324 -0
  143. package/dist/services/overview.js.map +1 -0
  144. package/dist/services/period.d.ts +0 -9
  145. package/dist/services/period.js +5 -52
  146. package/dist/services/period.js.map +1 -1
  147. package/dist/services/request-log/access.d.ts +5 -0
  148. package/dist/services/request-log/access.js +21 -0
  149. package/dist/services/request-log/access.js.map +1 -0
  150. package/dist/services/request-log/capture.d.ts +30 -0
  151. package/dist/services/request-log/capture.js +216 -39
  152. package/dist/services/request-log/capture.js.map +1 -1
  153. package/dist/services/request-log/list.d.ts +36 -0
  154. package/dist/services/request-log/list.js +201 -0
  155. package/dist/services/request-log/list.js.map +1 -0
  156. package/dist/services/request-log/read.d.ts +15 -2
  157. package/dist/services/request-log/read.js +47 -4
  158. package/dist/services/request-log/read.js.map +1 -1
  159. package/dist/services/request-log/redaction.d.ts +16 -3
  160. package/dist/services/request-log/redaction.js +149 -27
  161. package/dist/services/request-log/redaction.js.map +1 -1
  162. package/dist/services/request-log/util.d.ts +10 -3
  163. package/dist/services/request-log/util.js +39 -22
  164. package/dist/services/request-log/util.js.map +1 -1
  165. package/dist/services/route-catalog.d.ts +62 -0
  166. package/dist/services/route-catalog.js +163 -0
  167. package/dist/services/route-catalog.js.map +1 -0
  168. package/dist/services/route-contract.d.ts +66 -0
  169. package/dist/services/route-contract.js +266 -0
  170. package/dist/services/route-contract.js.map +1 -0
  171. package/dist/services/route-health.d.ts +35 -0
  172. package/dist/services/route-health.js +179 -0
  173. package/dist/services/route-health.js.map +1 -0
  174. package/dist/services/route-statistics.d.ts +68 -0
  175. package/dist/services/route-statistics.js +277 -0
  176. package/dist/services/route-statistics.js.map +1 -0
  177. package/dist/services/routes-sync.d.ts +7 -3
  178. package/dist/services/routes-sync.js +96 -20
  179. package/dist/services/routes-sync.js.map +1 -1
  180. package/dist/services/scope.d.ts +0 -1
  181. package/dist/services/scope.js +4 -17
  182. package/dist/services/scope.js.map +1 -1
  183. package/dist/services/settings-form.d.ts +131 -0
  184. package/dist/services/settings-form.js +210 -0
  185. package/dist/services/settings-form.js.map +1 -0
  186. package/dist/services/settings.d.ts +2 -0
  187. package/dist/services/settings.js +5 -0
  188. package/dist/services/settings.js.map +1 -1
  189. package/dist/services/statistics-aggregate.d.ts +6 -41
  190. package/dist/services/statistics-aggregate.js +55 -280
  191. package/dist/services/statistics-aggregate.js.map +1 -1
  192. package/dist/services/statistics-utils.d.ts +7 -12
  193. package/dist/services/statistics-utils.js +36 -51
  194. package/dist/services/statistics-utils.js.map +1 -1
  195. package/dist/services/statistics-write.js +64 -22
  196. package/dist/services/statistics-write.js.map +1 -1
  197. package/dist/services/tester-source.d.ts +11 -0
  198. package/dist/services/tester-source.js +48 -0
  199. package/dist/services/tester-source.js.map +1 -0
  200. package/dist/services/traffic-samples.d.ts +18 -0
  201. package/dist/services/traffic-samples.js +134 -0
  202. package/dist/services/traffic-samples.js.map +1 -0
  203. package/dist/services/traffic.d.ts +43 -0
  204. package/dist/services/traffic.js +270 -0
  205. package/dist/services/traffic.js.map +1 -0
  206. package/dist/services/window.d.ts +48 -0
  207. package/dist/services/window.js +179 -0
  208. package/dist/services/window.js.map +1 -0
  209. package/dist/types/constants.d.ts +11 -20
  210. package/dist/types/constants.js +15 -25
  211. package/dist/types/constants.js.map +1 -1
  212. package/dist/types/index.d.ts +0 -1
  213. package/dist/types/index.js +0 -1
  214. package/dist/types/index.js.map +1 -1
  215. package/dist/types/statistics.d.ts +5 -3
  216. package/dist/types/statistics.js +5 -0
  217. package/dist/types/statistics.js.map +1 -1
  218. package/frontend-vue/app/components/blocks/BetaBadge.vue +20 -0
  219. package/frontend-vue/app/components/blocks/HealthHero.vue +708 -0
  220. package/frontend-vue/app/components/blocks/LiveTraffic.vue +356 -0
  221. package/frontend-vue/app/components/blocks/LogsEmptyState.vue +228 -0
  222. package/frontend-vue/app/components/blocks/LogsFilters.vue +279 -0
  223. package/frontend-vue/app/components/blocks/RequestDetail.vue +722 -0
  224. package/frontend-vue/app/components/blocks/RetentionInput.vue +227 -0
  225. package/frontend-vue/app/components/blocks/RouteDocumentation.vue +611 -0
  226. package/frontend-vue/app/components/blocks/RouteHeader.vue +320 -0
  227. package/frontend-vue/app/components/blocks/RouteTester.vue +1879 -0
  228. package/frontend-vue/app/components/blocks/RouteTree.vue +676 -0
  229. package/frontend-vue/app/components/blocks/ScopeChip.vue +89 -0
  230. package/frontend-vue/app/components/blocks/SettingNumberInput.vue +65 -0
  231. package/frontend-vue/app/components/blocks/SplitLayout.vue +41 -0
  232. package/frontend-vue/app/components/internal/ApiBody.vue +129 -0
  233. package/frontend-vue/app/components/internal/ApiJsonTree.vue +82 -0
  234. package/frontend-vue/app/components/internal/ApiKeyValues.vue +41 -0
  235. package/frontend-vue/app/components/internal/ApiMethodBadge.vue +19 -19
  236. package/frontend-vue/app/components/internal/ApiPath.vue +33 -0
  237. package/frontend-vue/app/components/internal/ApiStatusBadge.vue +20 -15
  238. package/frontend-vue/app/components/internal/ApiTesterBadge.vue +17 -0
  239. package/frontend-vue/app/composables/useApiOrigin.ts +19 -0
  240. package/frontend-vue/app/composables/useApiPeriod.ts +19 -0
  241. package/frontend-vue/app/composables/useApiResource.ts +92 -0
  242. package/frontend-vue/app/composables/useDateFormat.ts +23 -0
  243. package/frontend-vue/app/composables/useLiveMissedErrors.ts +33 -0
  244. package/frontend-vue/app/composables/useRouteDetail.ts +253 -0
  245. package/frontend-vue/app/composables/useRouteSelection.ts +43 -0
  246. package/frontend-vue/app/config/shortcuts-registry.ts +30 -0
  247. package/frontend-vue/app/plugins/displays.ts +92 -0
  248. package/frontend-vue/app/utils/format.ts +281 -0
  249. package/frontend-vue/app/utils/http.ts +127 -0
  250. package/frontend-vue/app/utils/logsQuery.ts +261 -0
  251. package/frontend-vue/app/utils/minuteHistogram.ts +116 -0
  252. package/frontend-vue/app/utils/requestDrawer.ts +257 -0
  253. package/frontend-vue/app/utils/routeExplorer.ts +206 -0
  254. package/frontend-vue/app/utils/search.ts +45 -0
  255. package/frontend-vue/app/utils/settingsForm.ts +119 -0
  256. package/frontend-vue/app/utils/snippets.ts +501 -0
  257. package/frontend-vue/app/utils/testerHistory.ts +354 -0
  258. package/frontend-vue/app/utils/testerRequest.ts +632 -11
  259. package/frontend-vue/dms.frontend.build.ts +7 -0
  260. package/frontend-vue/dms.frontend.ts +10 -3
  261. package/frontend-vue/i18n/locales/api-en-GB.json +866 -0
  262. package/frontend-vue/i18n/locales/api-fr-FR.json +866 -0
  263. package/frontend-vue/package.json +2 -6
  264. package/frontend-vue/pnpm-lock.yaml +97 -3375
  265. package/frontend-vue/tests/format.test.ts +180 -0
  266. package/frontend-vue/tests/http.test.ts +61 -0
  267. package/frontend-vue/tests/logsQuery.test.ts +255 -0
  268. package/frontend-vue/tests/minuteHistogram.test.ts +94 -0
  269. package/frontend-vue/tests/registration.test.ts +24 -7
  270. package/frontend-vue/tests/requestDrawer.test.ts +179 -0
  271. package/frontend-vue/tests/routeExplorer.test.ts +206 -0
  272. package/frontend-vue/tests/settingsForm.test.ts +155 -0
  273. package/frontend-vue/tests/snippets.test.ts +285 -0
  274. package/frontend-vue/tests/testerHistory.test.ts +295 -0
  275. package/frontend-vue/tests/testerRequest.test.ts +471 -76
  276. package/package.json +9 -9
  277. package/dist/middlewares/index.d.ts +0 -1
  278. package/dist/middlewares/index.js +0 -18
  279. package/dist/middlewares/index.js.map +0 -1
  280. package/dist/middlewares/request-log-capture.d.ts +0 -1
  281. package/dist/middlewares/request-log-capture.js +0 -6
  282. package/dist/middlewares/request-log-capture.js.map +0 -1
  283. package/dist/pages/all.d.ts +0 -4
  284. package/dist/pages/all.js +0 -21
  285. package/dist/pages/all.js.map +0 -1
  286. package/dist/pages/logs/page.js +0 -29
  287. package/dist/pages/logs/page.js.map +0 -1
  288. package/dist/pages/routes/page.d.ts +0 -9
  289. package/dist/pages/routes/page.js +0 -29
  290. package/dist/pages/routes/page.js.map +0 -1
  291. package/dist/pages/settings/form.d.ts +0 -3
  292. package/dist/pages/settings/form.js +0 -80
  293. package/dist/pages/settings/form.js.map +0 -1
  294. package/dist/pages/settings/page.d.ts +0 -9
  295. package/dist/pages/settings/page.js +0 -26
  296. package/dist/pages/settings/page.js.map +0 -1
  297. package/dist/pages/summary/page.d.ts +0 -9
  298. package/dist/pages/summary/page.js +0 -29
  299. package/dist/pages/summary/page.js.map +0 -1
  300. package/dist/routes/monitoring.d.ts +0 -17
  301. package/dist/routes/monitoring.js +0 -101
  302. package/dist/routes/monitoring.js.map +0 -1
  303. package/dist/routes/summary.d.ts +0 -32
  304. package/dist/routes/summary.js +0 -181
  305. package/dist/routes/summary.js.map +0 -1
  306. package/dist/services/request-log/index.d.ts +0 -3
  307. package/dist/services/request-log/index.js +0 -12
  308. package/dist/services/request-log/index.js.map +0 -1
  309. package/dist/services/statistics-read.d.ts +0 -4
  310. package/dist/services/statistics-read.js +0 -48
  311. package/dist/services/statistics-read.js.map +0 -1
  312. package/dist/services/tree.d.ts +0 -10
  313. package/dist/services/tree.js +0 -128
  314. package/dist/services/tree.js.map +0 -1
  315. package/dist/types/charts.d.ts +0 -9
  316. package/dist/types/charts.js +0 -3
  317. package/dist/types/charts.js.map +0 -1
  318. package/frontend-vue/app/components/ConfigurationView.vue +0 -187
  319. package/frontend-vue/app/components/DocumentationView.vue +0 -224
  320. package/frontend-vue/app/components/LogDetailDrawer.vue +0 -178
  321. package/frontend-vue/app/components/LogsView.vue +0 -347
  322. package/frontend-vue/app/components/RouteDetailTabs.vue +0 -179
  323. package/frontend-vue/app/components/RouteTree.vue +0 -196
  324. package/frontend-vue/app/components/RoutesView.vue +0 -79
  325. package/frontend-vue/app/components/StatsView.vue +0 -268
  326. package/frontend-vue/app/components/SummaryView.vue +0 -657
  327. package/frontend-vue/app/components/TesterPanel.vue +0 -499
  328. package/frontend-vue/app/components/internal/PeriodSelect.vue +0 -58
  329. package/frontend-vue/app/components/internal/RouteTreeNode.vue +0 -168
  330. package/frontend-vue/app/components/internal/StatusBreakdownBars.vue +0 -162
  331. package/frontend-vue/app/components/internal/StatusDonut.vue +0 -84
  332. package/frontend-vue/app/components/internal/UnitAreaChart.vue +0 -73
  333. package/frontend-vue/app/composables/useApiIntrospection.ts +0 -350
  334. package/frontend-vue/app/composables/useLogDetailDrawer.ts +0 -50
  335. package/frontend-vue/app/composables/useSelectedPeriod.ts +0 -107
  336. package/frontend-vue/app/composables/useStatsPeriods.ts +0 -139
  337. package/frontend-vue/app/custom-layouts/.gitkeep +0 -0
  338. package/frontend-vue/app/custom-pages/.gitkeep +0 -0
  339. package/frontend-vue/app/utils/httpMethod.ts +0 -49
  340. package/frontend-vue/app/utils/statusClass.ts +0 -49
  341. package/frontend-vue/i18n/locales/en-GB.json +0 -240
  342. package/frontend-vue/i18n/locales/fr-FR.json +0 -240
  343. package/frontend-vue/public/.gitkeep +0 -0
  344. package/frontend-vue/server/.gitkeep +0 -0
  345. package/frontend-vue/tests/periods.test.ts +0 -145
  346. package/frontend-vue/tests/persistence.test.ts +0 -45
@@ -1,179 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, ref, watch } from 'vue'
3
- import type {
4
- RouteDocPayload,
5
- RouteInspection,
6
- RouteStatsPayload,
7
- } from '../composables/useApiIntrospection'
8
- import ConfigurationView from './ConfigurationView.vue'
9
- import DocumentationView from './DocumentationView.vue'
10
- import ApiMethodBadge from './internal/ApiMethodBadge.vue'
11
- import StatsView from './StatsView.vue'
12
- import TesterPanel from './TesterPanel.vue'
13
-
14
- const props = defineProps<{
15
- routeId: string
16
- /** Stats window ('Nd'), picked in the tree panel. */
17
- period?: string
18
- }>()
19
-
20
- const { getRouteDoc, getRouteConfig, getRouteStats } = useApiIntrospection()
21
-
22
- const doc = ref<RouteDocPayload | null>(null)
23
- const config = ref<RouteInspection | null>(null)
24
- const stats = ref<RouteStatsPayload | null>(null)
25
- const docLoading = ref(false)
26
- const configLoading = ref(false)
27
- const statsLoading = ref(false)
28
- const docError = ref<string | null>(null)
29
- const configError = ref<string | null>(null)
30
- const statsError = ref<string | null>(null)
31
-
32
- // Statistics first + active by default, mirroring the DMS mockup where the
33
- // stats tab is what you land on after picking a route.
34
- const active = ref<'statistics' | 'documentation' | 'tester' | 'configuration'>(
35
- 'statistics',
36
- )
37
-
38
- const TABS = [
39
- { value: 'statistics', label: 'page.api.routes.tabs.statistics', icon: 'i-ph-chart-bar' },
40
- { value: 'documentation', label: 'page.api.routes.tabs.documentation', icon: 'i-ph-book-open' },
41
- { value: 'tester', label: 'page.api.routes.tabs.tester', icon: 'i-ph-play' },
42
- { value: 'configuration', label: 'page.api.routes.tabs.configuration', icon: 'i-ph-sliders' },
43
- ] as const
44
-
45
- // Pathbar method + location: whichever of doc/config has resolved.
46
- const pathMethod = computed(
47
- () => doc.value?.method ?? config.value?.method ?? '',
48
- )
49
- const pathLocation = computed(
50
- () => doc.value?.location ?? config.value?.location ?? '',
51
- )
52
-
53
- async function load<T>(
54
- loader: () => Promise<T>,
55
- store: { value: T | null },
56
- loading: { value: boolean },
57
- error: { value: string | null },
58
- ) {
59
- loading.value = true
60
- error.value = null
61
- try {
62
- store.value = await loader()
63
- } catch (e) {
64
- error.value = e instanceof Error ? e.message : String(e)
65
- } finally {
66
- loading.value = false
67
- }
68
- }
69
-
70
- watch(
71
- () => props.routeId,
72
- (id) => {
73
- doc.value = null
74
- config.value = null
75
- stats.value = null
76
- active.value = 'statistics'
77
- void load(() => getRouteDoc(id), doc, docLoading, docError)
78
- void load(() => getRouteConfig(id), config, configLoading, configError)
79
- void load(() => getRouteStats(id, props.period), stats, statsLoading, statsError)
80
- },
81
- { immediate: true },
82
- )
83
-
84
- // Period only affects the Statistics tab — doc/config are window-agnostic.
85
- watch(
86
- () => props.period,
87
- () => {
88
- stats.value = null
89
- void load(
90
- () => getRouteStats(props.routeId, props.period),
91
- stats,
92
- statsLoading,
93
- statsError,
94
- )
95
- },
96
- )
97
- </script>
98
-
99
- <template>
100
- <div class="flex h-full flex-col">
101
- <!-- route pathbar -->
102
- <div
103
- class="flex items-center gap-3 border-b border-default px-5 py-4 sm:px-6"
104
- >
105
- <ApiMethodBadge v-if="pathMethod" :method="pathMethod" size="md" />
106
- <USkeleton v-else class="h-6 w-14" />
107
- <code class="min-w-0 flex-1 truncate font-mono text-sm text-highlighted">
108
- {{ pathLocation || '—' }}
109
- </code>
110
- <DmsCopyButton v-if="pathLocation" :value="pathLocation" />
111
- </div>
112
-
113
- <!-- tab bar -->
114
- <div class="flex items-center gap-1 border-b border-default px-3 sm:px-4">
115
- <button
116
- v-for="t in TABS"
117
- :key="t.value"
118
- type="button"
119
- class="-mb-px flex items-center gap-2 border-b-2 px-3 py-2.5 text-sm font-medium transition-colors"
120
- :class="
121
- active === t.value
122
- ? 'border-primary text-primary'
123
- : 'border-transparent text-muted hover:text-highlighted'
124
- "
125
- @click="active = t.value"
126
- >
127
- <UIcon :name="t.icon" class="size-4" />
128
- <span>{{ $t(t.label) }}</span>
129
- </button>
130
- </div>
131
-
132
- <!-- panels -->
133
- <div class="flex-1 p-5 sm:p-6">
134
- <!-- Statistics -->
135
- <template v-if="active === 'statistics'">
136
- <div v-if="statsError" class="text-sm text-error">{{ statsError }}</div>
137
- <div v-else-if="statsLoading || !stats" class="flex flex-col gap-4">
138
- <USkeleton class="h-20 w-full" />
139
- <USkeleton class="h-56 w-full" />
140
- </div>
141
- <StatsView v-else :stats="stats" />
142
- </template>
143
-
144
- <!-- Documentation -->
145
- <template v-else-if="active === 'documentation'">
146
- <div v-if="docError" class="text-sm text-error">{{ docError }}</div>
147
- <div v-else-if="docLoading || !doc" class="flex flex-col gap-3">
148
- <USkeleton class="h-8 w-1/2" />
149
- <USkeleton class="h-32 w-full" />
150
- </div>
151
- <DocumentationView v-else :doc="doc" />
152
- </template>
153
-
154
- <!-- Tester -->
155
- <template v-else-if="active === 'tester'">
156
- <div v-if="configError" class="text-sm text-error">{{ configError }}</div>
157
- <div v-else-if="configLoading || !config">
158
- <USkeleton class="h-8 w-1/3" />
159
- </div>
160
- <TesterPanel v-else :route="config" />
161
- </template>
162
-
163
- <!-- Configuration -->
164
- <template v-else>
165
- <div v-if="configError" class="text-sm text-error">{{ configError }}</div>
166
- <div v-else-if="configLoading || !config" class="flex flex-col gap-3">
167
- <USkeleton class="h-8 w-1/3" />
168
- <USkeleton class="h-24 w-full" />
169
- </div>
170
- <ConfigurationView
171
- v-else
172
- :parameters="config.parameters"
173
- :properties="config.properties"
174
- :middleware="config.applicableMiddleware"
175
- />
176
- </template>
177
- </div>
178
- </div>
179
- </template>
@@ -1,196 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, ref, watch } from 'vue'
3
- import type { ApiTreeNode } from '../composables/useApiIntrospection'
4
- import { ANY_FILTER, httpMethodFilterItems } from '../utils/httpMethod'
5
- import RouteTreeNode from './internal/RouteTreeNode.vue'
6
-
7
- // v2 routes tree panel (DMS apiv2-routes): header + filter (search + method
8
- // select, mirroring the Logs page toolbar) + recursive folder/route tree with
9
- // per-route health icons. The backend tree is built one folder per path
10
- // segment; leaves are method nodes whose `value` is the runtime route id used
11
- // by the per-route endpoints.
12
- const props = defineProps<{
13
- /**
14
- * Window ('Nd') the tree health icons are computed over, or null while the
15
- * page's period selector has yet to resolve one. The tree waits on it rather
16
- * than fetching a guessed window and reloading a moment later.
17
- */
18
- period: string | null
19
- }>()
20
-
21
- const emit = defineEmits<{
22
- 'select-route': [routeId: string]
23
- }>()
24
-
25
- const { getTree } = useApiIntrospection()
26
-
27
- const items = ref<ApiTreeNode[]>([])
28
- const loading = ref(true)
29
- const error = ref<string | null>(null)
30
-
31
- const search = ref('')
32
- const expanded = ref<Set<string>>(new Set())
33
- const activeRouteId = ref<string | undefined>()
34
-
35
- // Same method filter as the Logs page toolbar.
36
- const methodFilter = ref(ANY_FILTER)
37
-
38
- const { t } = useI18n()
39
-
40
- const methodOptions = computed(() =>
41
- httpMethodFilterItems(t('page.api.filters.all_methods')),
42
- )
43
-
44
- function methodAllowed(method: string): boolean {
45
- if (methodFilter.value === ANY_FILTER) return true
46
- return method.toUpperCase() === methodFilter.value
47
- }
48
-
49
- // The health stats baked into the tree follow the page-level period selector.
50
- // Immediate, so the first window to arrive is also the first one fetched; the
51
- // panel shows its loading skeleton until then.
52
- watch(() => props.period, () => void load(), { immediate: true })
53
-
54
- // Filter a folder against the search query + active method chips. A leaf is
55
- // kept when its method is allowed and the route path (the folder value) or
56
- // the folder name matches the query. A folder is kept when it still has any
57
- // leaf or sub-folder after filtering.
58
- function filterFolder(folder: ApiTreeNode, q: string): ApiTreeNode | null {
59
- const path = (folder.value ?? '').toLowerCase()
60
- const label = folder.label.toLowerCase()
61
- const pathMatch = !q || path.includes(q) || label.includes(q)
62
-
63
- const leaves = (folder.children ?? [])
64
- .filter((c) => !c.expandable)
65
- .filter((leaf) => methodAllowed(leaf.label) && pathMatch)
66
-
67
- const folders = (folder.children ?? [])
68
- .filter((c) => c.expandable)
69
- .map((f) => filterFolder(f, q))
70
- .filter((f): f is ApiTreeNode => f !== null)
71
-
72
- if (leaves.length === 0 && folders.length === 0) return null
73
- return { ...folder, children: [...leaves, ...folders] }
74
- }
75
-
76
- const query = computed(() => search.value.trim().toLowerCase())
77
- const forceExpand = computed(() => query.value.length > 0)
78
-
79
- const displayTree = computed(() =>
80
- items.value
81
- .map((f) => filterFolder(f, query.value))
82
- .filter((f): f is ApiTreeNode => f !== null),
83
- )
84
-
85
- function firstLeafId(nodes: ApiTreeNode[]): string | undefined {
86
- for (const node of nodes) {
87
- if (!node.expandable && node.value) return node.value
88
- if (node.children) {
89
- const found = firstLeafId(node.children)
90
- if (found) return found
91
- }
92
- }
93
- return undefined
94
- }
95
-
96
- async function load() {
97
- const period = props.period
98
- if (!period) return
99
- loading.value = true
100
- error.value = null
101
- try {
102
- items.value = await getTree(period)
103
- // Open the first top folder and auto-select its first route, like the
104
- // maquette which lands on the first leaf — but only on the first load.
105
- // Reloads come from the page-header period control, and re-seeding here
106
- // would collapse whatever the user had opened every time they change it.
107
- if (!activeRouteId.value) {
108
- const first = items.value[0]
109
- if (first?.value) expanded.value = new Set([first.value])
110
- const id = firstLeafId(items.value)
111
- if (id) selectRoute(id)
112
- }
113
- } catch (e) {
114
- error.value = e instanceof Error ? e.message : String(e)
115
- } finally {
116
- loading.value = false
117
- }
118
- }
119
-
120
- function toggle(path: string) {
121
- const next = new Set(expanded.value)
122
- if (next.has(path)) next.delete(path)
123
- else next.add(path)
124
- expanded.value = next
125
- }
126
-
127
- function selectRoute(routeId: string) {
128
- activeRouteId.value = routeId
129
- emit('select-route', routeId)
130
- }
131
-
132
- </script>
133
-
134
- <template>
135
- <div class="flex h-full w-full flex-col">
136
- <!-- panel head -->
137
- <div
138
- class="flex items-center justify-between gap-2 border-b border-default px-4 py-3"
139
- >
140
- <h2 class="text-sm font-semibold text-highlighted">
141
- {{ $t('page.api.routes.tree_title') }}
142
- </h2>
143
- <UButton
144
- icon="i-ph-arrow-clockwise"
145
- size="xs"
146
- color="neutral"
147
- variant="ghost"
148
- :loading="loading"
149
- :aria-label="$t('page.api.routes.tree_refresh')"
150
- @click="load"
151
- />
152
- </div>
153
-
154
- <!-- filter: search, then the method select below (same controls as the
155
- Logs toolbar, minus status; the period lives in the page header) -->
156
- <div class="flex flex-col gap-2 border-b border-default px-4 py-3">
157
- <UInput
158
- v-model="search"
159
- icon="i-ph-magnifying-glass"
160
- size="sm"
161
- :placeholder="$t('page.api.routes.filter_placeholder')"
162
- />
163
- <USelect v-model="methodFilter" :items="methodOptions" size="sm" class="w-full" />
164
- </div>
165
-
166
- <!-- tree -->
167
- <div class="min-h-0 flex-1 overflow-auto p-2">
168
- <div v-if="error" class="px-2 py-3 text-sm text-error">{{ error }}</div>
169
-
170
- <div v-else-if="loading" class="flex flex-col gap-1.5 p-1">
171
- <USkeleton v-for="i in 8" :key="i" class="h-7 w-full" />
172
- </div>
173
-
174
- <div
175
- v-else-if="displayTree.length === 0"
176
- class="flex flex-col items-center gap-2 px-3 py-8 text-center text-dimmed"
177
- >
178
- <UIcon name="i-ph-funnel-x" class="size-6" />
179
- <small>{{ $t('page.api.routes.no_match') }}</small>
180
- </div>
181
-
182
- <RouteTreeNode
183
- v-for="folder in displayTree"
184
- v-else
185
- :key="folder.value ?? folder.label"
186
- :node="folder"
187
- :depth="0"
188
- :expanded="expanded"
189
- :force-expand="forceExpand"
190
- :active-route-id="activeRouteId"
191
- @toggle="toggle"
192
- @select-route="selectRoute"
193
- />
194
- </div>
195
- </div>
196
- </template>
@@ -1,79 +0,0 @@
1
- <script setup lang="ts">
2
- import { ref } from 'vue'
3
- import PeriodSelect from './internal/PeriodSelect.vue'
4
- import RouteDetailTabs from './RouteDetailTabs.vue'
5
- import RouteTree from './RouteTree.vue'
6
-
7
- // v2 Routes page (DMS apiv2-routes): master-detail. Left a tree panel
8
- // (folders + routes, filter, health dots); right the per-route detail with
9
- // Statistics / Documentation / Tester / Configuration tabs. Composed from dms
10
- // surfaces (DmsCard) so the theme is inherited.
11
- const selectedRouteId = ref<string | null>(null)
12
-
13
- // Stats window, from the period filter shared with the Overview and Logs
14
- // pages. It drives both the tree health icons and the selected route's
15
- // Statistics tab, and stays null until <PeriodSelect> resolves one so nothing
16
- // fetches a window nobody picked.
17
- const period = ref<string | null>(null)
18
-
19
- function onRoute(id: string) {
20
- selectedRouteId.value = id
21
- }
22
- </script>
23
-
24
- <template>
25
- <!-- The page fills the panel (`fillHeight` in src/pages/routes/page.ts):
26
- from `lg` up the tree and the detail share its height and scroll
27
- inside; below, where they stack, the view scrolls as a whole. -->
28
- <div class="flex min-h-0 w-full flex-1 flex-col gap-5 p-6 max-lg:overflow-y-auto">
29
- <!-- page head -->
30
- <header class="flex flex-wrap items-center gap-4">
31
- <div
32
- class="grid size-11 shrink-0 place-items-center rounded-xl bg-primary/10 text-primary"
33
- >
34
- <UIcon name="i-ph-tree-structure" class="size-[22px]" />
35
- </div>
36
- <div class="min-w-0 flex-1">
37
- <h1 class="text-2xl font-semibold tracking-tight text-highlighted">
38
- {{ $t('page.api.routes.title') }}
39
- </h1>
40
- <p class="text-sm text-muted">
41
- {{ $t('page.api.routes.description') }}
42
- </p>
43
- </div>
44
- <PeriodSelect v-model="period" class="w-32" />
45
- </header>
46
-
47
- <!-- master-detail split -->
48
- <div
49
- class="grid grid-cols-1 gap-5 lg:min-h-0 lg:flex-1 lg:grid-cols-[minmax(280px,340px)_1fr]"
50
- >
51
- <!-- left: tree -->
52
- <DmsCard :padded="false" class="flex flex-col overflow-hidden lg:min-h-0">
53
- <RouteTree :period="period" @select-route="onRoute" />
54
- </DmsCard>
55
-
56
- <!-- right: detail -->
57
- <DmsCard :padded="false" class="lg:min-h-0 lg:overflow-auto">
58
- <RouteDetailTabs
59
- v-if="selectedRouteId && period"
60
- :key="selectedRouteId"
61
- :route-id="selectedRouteId"
62
- :period="period"
63
- />
64
- <div
65
- v-else
66
- class="flex h-full min-h-[340px] flex-col items-center justify-center gap-2 px-6 text-center"
67
- >
68
- <UIcon name="i-ph-tree-structure" class="size-8 text-dimmed" />
69
- <p class="text-base font-medium text-highlighted">
70
- {{ $t('page.api.routes.placeholder.title') }}
71
- </p>
72
- <p class="max-w-md text-sm text-muted">
73
- {{ $t('page.api.routes.placeholder.description') }}
74
- </p>
75
- </div>
76
- </DmsCard>
77
- </div>
78
- </div>
79
- </template>