@antelopejs/dms-api 0.1.7 → 0.2.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.
- package/README.md +99 -8
- package/dist/automation/get-api-health.js +4 -3
- package/dist/automation/get-api-health.js.map +1 -1
- package/dist/automation/route-unhealthy.js +2 -2
- package/dist/automation/route-unhealthy.js.map +1 -1
- package/dist/automation/scope.d.ts +0 -1
- package/dist/automation/scope.js +0 -7
- package/dist/automation/scope.js.map +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.js +15 -9
- package/dist/config.js.map +1 -1
- package/dist/db/models/request_log.model.d.ts +37 -2
- package/dist/db/models/request_log.model.js +130 -35
- package/dist/db/models/request_log.model.js.map +1 -1
- package/dist/db/models/request_log.search.d.ts +5 -0
- package/dist/db/models/request_log.search.js +35 -0
- package/dist/db/models/request_log.search.js.map +1 -0
- package/dist/db/models/request_log.status.d.ts +5 -0
- package/dist/db/models/request_log.status.js +9 -0
- package/dist/db/models/request_log.status.js.map +1 -0
- package/dist/db/models/routes.model.d.ts +1 -0
- package/dist/db/models/routes.model.js +5 -1
- package/dist/db/models/routes.model.js.map +1 -1
- package/dist/db/models/routes_statistics.model.js +1 -1
- package/dist/db/models/routes_statistics.model.js.map +1 -1
- package/dist/db/tables/api_settings.table.d.ts +1 -0
- package/dist/db/tables/api_settings.table.js +4 -0
- package/dist/db/tables/api_settings.table.js.map +1 -1
- package/dist/db/tables/request_log.table.d.ts +18 -3
- package/dist/db/tables/request_log.table.js +34 -1
- package/dist/db/tables/request_log.table.js.map +1 -1
- package/dist/db/tables/routes.table.d.ts +1 -2
- package/dist/db/tables/routes.table.js.map +1 -1
- package/dist/db/tables/routes_statistics.table.d.ts +4 -3
- package/dist/db/tables/routes_statistics.table.js +5 -1
- package/dist/db/tables/routes_statistics.table.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/memo.d.ts +5 -0
- package/dist/memo.js +36 -0
- package/dist/memo.js.map +1 -0
- package/dist/pages/blocks.d.ts +3 -0
- package/dist/pages/blocks.js +31 -0
- package/dist/pages/blocks.js.map +1 -0
- package/dist/pages/displays.d.ts +7 -0
- package/dist/pages/displays.js +23 -0
- package/dist/pages/displays.js.map +1 -0
- package/dist/pages/index.d.ts +5 -2
- package/dist/pages/index.js +5 -2
- package/dist/pages/index.js.map +1 -1
- package/dist/pages/logs.d.ts +18 -0
- package/dist/pages/logs.js +112 -0
- package/dist/pages/logs.js.map +1 -0
- package/dist/pages/module.d.ts +3 -0
- package/dist/pages/module.js +102 -6
- package/dist/pages/module.js.map +1 -1
- package/dist/pages/overview.d.ts +14 -0
- package/dist/pages/overview.js +215 -0
- package/dist/pages/overview.js.map +1 -0
- package/dist/pages/period.d.ts +9 -0
- package/dist/pages/period.js +24 -0
- package/dist/pages/period.js.map +1 -0
- package/dist/pages/request-table.d.ts +11 -0
- package/dist/pages/request-table.js +187 -0
- package/dist/pages/request-table.js.map +1 -0
- package/dist/pages/routes.d.ts +15 -0
- package/dist/pages/routes.js +269 -0
- package/dist/pages/routes.js.map +1 -0
- package/dist/pages/scope-chip.d.ts +9 -0
- package/dist/pages/scope-chip.js +28 -0
- package/dist/pages/scope-chip.js.map +1 -0
- package/dist/pages/{logs/page.d.ts → settings.d.ts} +3 -3
- package/dist/pages/settings.js +218 -0
- package/dist/pages/settings.js.map +1 -0
- package/dist/pages/toolbar.d.ts +9 -0
- package/dist/pages/toolbar.js +33 -0
- package/dist/pages/toolbar.js.map +1 -0
- package/dist/realtime.d.ts +2 -0
- package/dist/realtime.js +21 -0
- package/dist/realtime.js.map +1 -0
- package/dist/routes/index.d.ts +2 -2
- package/dist/routes/index.js +2 -2
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/logs.d.ts +173 -2
- package/dist/routes/logs.js +177 -86
- package/dist/routes/logs.js.map +1 -1
- package/dist/routes/overview.d.ts +27 -0
- package/dist/routes/overview.js +131 -0
- package/dist/routes/overview.js.map +1 -0
- package/dist/routes/routes.d.ts +92 -28
- package/dist/routes/routes.js +165 -97
- package/dist/routes/routes.js.map +1 -1
- package/dist/routes/settings.d.ts +16 -11
- package/dist/routes/settings.js +62 -54
- package/dist/routes/settings.js.map +1 -1
- package/dist/routes/tester.d.ts +7 -0
- package/dist/routes/tester.js +34 -0
- package/dist/routes/tester.js.map +1 -0
- package/dist/services/activity.d.ts +49 -0
- package/dist/services/activity.js +207 -0
- package/dist/services/activity.js.map +1 -0
- package/dist/services/aggregate-cache.d.ts +3 -0
- package/dist/services/aggregate-cache.js +16 -0
- package/dist/services/aggregate-cache.js.map +1 -0
- package/dist/services/api-origin.d.ts +1 -0
- package/dist/services/api-origin.js +9 -0
- package/dist/services/api-origin.js.map +1 -0
- package/dist/services/attention.d.ts +45 -0
- package/dist/services/attention.js +203 -0
- package/dist/services/attention.js.map +1 -0
- package/dist/services/composed-text.d.ts +6 -0
- package/dist/services/composed-text.js +23 -0
- package/dist/services/composed-text.js.map +1 -0
- package/dist/services/health-rules.d.ts +49 -0
- package/dist/services/health-rules.js +233 -0
- package/dist/services/health-rules.js.map +1 -0
- package/dist/services/index.d.ts +1 -3
- package/dist/services/index.js +3 -3
- package/dist/services/index.js.map +1 -1
- package/dist/services/introspection/decorators.d.ts +14 -0
- package/dist/services/introspection/decorators.js +192 -0
- package/dist/services/introspection/decorators.js.map +1 -0
- package/dist/services/introspection/errors.js +4 -4
- package/dist/services/introspection/errors.js.map +1 -1
- package/dist/services/introspection/index.d.ts +6 -8
- package/dist/services/introspection/index.js +96 -32
- package/dist/services/introspection/index.js.map +1 -1
- package/dist/services/introspection/probe.d.ts +2 -1
- package/dist/services/introspection/probe.js +11 -0
- package/dist/services/introspection/probe.js.map +1 -1
- package/dist/services/links.d.ts +25 -0
- package/dist/services/links.js +72 -0
- package/dist/services/links.js.map +1 -0
- package/dist/services/live-feed.d.ts +6 -0
- package/dist/services/live-feed.js +18 -0
- package/dist/services/live-feed.js.map +1 -0
- package/dist/services/live.d.ts +16 -0
- package/dist/services/live.js +32 -0
- package/dist/services/live.js.map +1 -0
- package/dist/services/overview.d.ts +122 -0
- package/dist/services/overview.js +324 -0
- package/dist/services/overview.js.map +1 -0
- package/dist/services/period.d.ts +0 -9
- package/dist/services/period.js +5 -52
- package/dist/services/period.js.map +1 -1
- package/dist/services/request-log/access.d.ts +5 -0
- package/dist/services/request-log/access.js +21 -0
- package/dist/services/request-log/access.js.map +1 -0
- package/dist/services/request-log/capture.d.ts +30 -0
- package/dist/services/request-log/capture.js +216 -39
- package/dist/services/request-log/capture.js.map +1 -1
- package/dist/services/request-log/list.d.ts +36 -0
- package/dist/services/request-log/list.js +201 -0
- package/dist/services/request-log/list.js.map +1 -0
- package/dist/services/request-log/read.d.ts +15 -2
- package/dist/services/request-log/read.js +47 -4
- package/dist/services/request-log/read.js.map +1 -1
- package/dist/services/request-log/redaction.d.ts +16 -3
- package/dist/services/request-log/redaction.js +149 -27
- package/dist/services/request-log/redaction.js.map +1 -1
- package/dist/services/request-log/util.d.ts +10 -3
- package/dist/services/request-log/util.js +39 -22
- package/dist/services/request-log/util.js.map +1 -1
- package/dist/services/route-catalog.d.ts +62 -0
- package/dist/services/route-catalog.js +163 -0
- package/dist/services/route-catalog.js.map +1 -0
- package/dist/services/route-contract.d.ts +66 -0
- package/dist/services/route-contract.js +266 -0
- package/dist/services/route-contract.js.map +1 -0
- package/dist/services/route-health.d.ts +35 -0
- package/dist/services/route-health.js +179 -0
- package/dist/services/route-health.js.map +1 -0
- package/dist/services/route-statistics.d.ts +68 -0
- package/dist/services/route-statistics.js +277 -0
- package/dist/services/route-statistics.js.map +1 -0
- package/dist/services/routes-sync.d.ts +7 -3
- package/dist/services/routes-sync.js +96 -20
- package/dist/services/routes-sync.js.map +1 -1
- package/dist/services/scope.d.ts +0 -1
- package/dist/services/scope.js +4 -17
- package/dist/services/scope.js.map +1 -1
- package/dist/services/settings-form.d.ts +131 -0
- package/dist/services/settings-form.js +210 -0
- package/dist/services/settings-form.js.map +1 -0
- package/dist/services/settings.d.ts +2 -0
- package/dist/services/settings.js +5 -0
- package/dist/services/settings.js.map +1 -1
- package/dist/services/statistics-aggregate.d.ts +6 -41
- package/dist/services/statistics-aggregate.js +55 -280
- package/dist/services/statistics-aggregate.js.map +1 -1
- package/dist/services/statistics-utils.d.ts +7 -12
- package/dist/services/statistics-utils.js +36 -51
- package/dist/services/statistics-utils.js.map +1 -1
- package/dist/services/statistics-write.js +64 -22
- package/dist/services/statistics-write.js.map +1 -1
- package/dist/services/tester-source.d.ts +11 -0
- package/dist/services/tester-source.js +48 -0
- package/dist/services/tester-source.js.map +1 -0
- package/dist/services/traffic-samples.d.ts +18 -0
- package/dist/services/traffic-samples.js +134 -0
- package/dist/services/traffic-samples.js.map +1 -0
- package/dist/services/traffic.d.ts +43 -0
- package/dist/services/traffic.js +270 -0
- package/dist/services/traffic.js.map +1 -0
- package/dist/services/window.d.ts +48 -0
- package/dist/services/window.js +179 -0
- package/dist/services/window.js.map +1 -0
- package/dist/types/constants.d.ts +11 -20
- package/dist/types/constants.js +15 -25
- package/dist/types/constants.js.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/statistics.d.ts +5 -3
- package/dist/types/statistics.js +5 -0
- package/dist/types/statistics.js.map +1 -1
- package/frontend-vue/app/components/blocks/BetaBadge.vue +20 -0
- package/frontend-vue/app/components/blocks/HealthHero.vue +708 -0
- package/frontend-vue/app/components/blocks/LiveTraffic.vue +356 -0
- package/frontend-vue/app/components/blocks/LogsEmptyState.vue +228 -0
- package/frontend-vue/app/components/blocks/LogsFilters.vue +279 -0
- package/frontend-vue/app/components/blocks/RequestDetail.vue +722 -0
- package/frontend-vue/app/components/blocks/RetentionInput.vue +227 -0
- package/frontend-vue/app/components/blocks/RouteDocumentation.vue +611 -0
- package/frontend-vue/app/components/blocks/RouteHeader.vue +320 -0
- package/frontend-vue/app/components/blocks/RouteTester.vue +1879 -0
- package/frontend-vue/app/components/blocks/RouteTree.vue +676 -0
- package/frontend-vue/app/components/blocks/ScopeChip.vue +89 -0
- package/frontend-vue/app/components/blocks/SettingNumberInput.vue +65 -0
- package/frontend-vue/app/components/blocks/SplitLayout.vue +41 -0
- package/frontend-vue/app/components/internal/ApiBody.vue +129 -0
- package/frontend-vue/app/components/internal/ApiJsonTree.vue +82 -0
- package/frontend-vue/app/components/internal/ApiKeyValues.vue +41 -0
- package/frontend-vue/app/components/internal/ApiMethodBadge.vue +19 -19
- package/frontend-vue/app/components/internal/ApiPath.vue +33 -0
- package/frontend-vue/app/components/internal/ApiStatusBadge.vue +20 -15
- package/frontend-vue/app/components/internal/ApiTesterBadge.vue +17 -0
- package/frontend-vue/app/composables/useApiOrigin.ts +19 -0
- package/frontend-vue/app/composables/useApiPeriod.ts +19 -0
- package/frontend-vue/app/composables/useApiResource.ts +92 -0
- package/frontend-vue/app/composables/useDateFormat.ts +23 -0
- package/frontend-vue/app/composables/useLiveMissedErrors.ts +33 -0
- package/frontend-vue/app/composables/useRouteDetail.ts +253 -0
- package/frontend-vue/app/composables/useRouteSelection.ts +43 -0
- package/frontend-vue/app/config/shortcuts-registry.ts +30 -0
- package/frontend-vue/app/plugins/displays.ts +92 -0
- package/frontend-vue/app/utils/format.ts +281 -0
- package/frontend-vue/app/utils/http.ts +127 -0
- package/frontend-vue/app/utils/logsQuery.ts +261 -0
- package/frontend-vue/app/utils/minuteHistogram.ts +116 -0
- package/frontend-vue/app/utils/requestDrawer.ts +257 -0
- package/frontend-vue/app/utils/routeExplorer.ts +206 -0
- package/frontend-vue/app/utils/search.ts +45 -0
- package/frontend-vue/app/utils/settingsForm.ts +119 -0
- package/frontend-vue/app/utils/snippets.ts +501 -0
- package/frontend-vue/app/utils/testerHistory.ts +354 -0
- package/frontend-vue/app/utils/testerRequest.ts +632 -11
- package/frontend-vue/dms.frontend.build.ts +7 -0
- package/frontend-vue/dms.frontend.ts +10 -3
- package/frontend-vue/i18n/locales/api-en-GB.json +866 -0
- package/frontend-vue/i18n/locales/api-fr-FR.json +866 -0
- package/frontend-vue/package.json +2 -6
- package/frontend-vue/pnpm-lock.yaml +97 -3375
- package/frontend-vue/tests/format.test.ts +180 -0
- package/frontend-vue/tests/http.test.ts +61 -0
- package/frontend-vue/tests/logsQuery.test.ts +255 -0
- package/frontend-vue/tests/minuteHistogram.test.ts +94 -0
- package/frontend-vue/tests/registration.test.ts +24 -7
- package/frontend-vue/tests/requestDrawer.test.ts +179 -0
- package/frontend-vue/tests/routeExplorer.test.ts +206 -0
- package/frontend-vue/tests/settingsForm.test.ts +155 -0
- package/frontend-vue/tests/snippets.test.ts +285 -0
- package/frontend-vue/tests/testerHistory.test.ts +295 -0
- package/frontend-vue/tests/testerRequest.test.ts +471 -76
- package/frontend-vue/tests/tooltipTriggers.test.ts +51 -0
- package/package.json +8 -8
- package/dist/middlewares/index.d.ts +0 -1
- package/dist/middlewares/index.js +0 -18
- package/dist/middlewares/index.js.map +0 -1
- package/dist/middlewares/request-log-capture.d.ts +0 -1
- package/dist/middlewares/request-log-capture.js +0 -6
- package/dist/middlewares/request-log-capture.js.map +0 -1
- package/dist/pages/all.d.ts +0 -4
- package/dist/pages/all.js +0 -21
- package/dist/pages/all.js.map +0 -1
- package/dist/pages/logs/page.js +0 -29
- package/dist/pages/logs/page.js.map +0 -1
- package/dist/pages/routes/page.d.ts +0 -9
- package/dist/pages/routes/page.js +0 -29
- package/dist/pages/routes/page.js.map +0 -1
- package/dist/pages/settings/form.d.ts +0 -3
- package/dist/pages/settings/form.js +0 -80
- package/dist/pages/settings/form.js.map +0 -1
- package/dist/pages/settings/page.d.ts +0 -9
- package/dist/pages/settings/page.js +0 -26
- package/dist/pages/settings/page.js.map +0 -1
- package/dist/pages/summary/page.d.ts +0 -9
- package/dist/pages/summary/page.js +0 -29
- package/dist/pages/summary/page.js.map +0 -1
- package/dist/routes/monitoring.d.ts +0 -17
- package/dist/routes/monitoring.js +0 -101
- package/dist/routes/monitoring.js.map +0 -1
- package/dist/routes/summary.d.ts +0 -32
- package/dist/routes/summary.js +0 -181
- package/dist/routes/summary.js.map +0 -1
- package/dist/services/request-log/index.d.ts +0 -3
- package/dist/services/request-log/index.js +0 -12
- package/dist/services/request-log/index.js.map +0 -1
- package/dist/services/statistics-read.d.ts +0 -4
- package/dist/services/statistics-read.js +0 -48
- package/dist/services/statistics-read.js.map +0 -1
- package/dist/services/tree.d.ts +0 -10
- package/dist/services/tree.js +0 -128
- package/dist/services/tree.js.map +0 -1
- package/dist/types/charts.d.ts +0 -9
- package/dist/types/charts.js +0 -3
- package/dist/types/charts.js.map +0 -1
- package/frontend-vue/app/components/ConfigurationView.vue +0 -187
- package/frontend-vue/app/components/DocumentationView.vue +0 -224
- package/frontend-vue/app/components/LogDetailDrawer.vue +0 -178
- package/frontend-vue/app/components/LogsView.vue +0 -347
- package/frontend-vue/app/components/RouteDetailTabs.vue +0 -179
- package/frontend-vue/app/components/RouteTree.vue +0 -196
- package/frontend-vue/app/components/RoutesView.vue +0 -79
- package/frontend-vue/app/components/StatsView.vue +0 -268
- package/frontend-vue/app/components/SummaryView.vue +0 -657
- package/frontend-vue/app/components/TesterPanel.vue +0 -499
- package/frontend-vue/app/components/internal/PeriodSelect.vue +0 -58
- package/frontend-vue/app/components/internal/RouteTreeNode.vue +0 -168
- package/frontend-vue/app/components/internal/StatusBreakdownBars.vue +0 -162
- package/frontend-vue/app/components/internal/StatusDonut.vue +0 -84
- package/frontend-vue/app/components/internal/UnitAreaChart.vue +0 -73
- package/frontend-vue/app/composables/useApiIntrospection.ts +0 -350
- package/frontend-vue/app/composables/useLogDetailDrawer.ts +0 -50
- package/frontend-vue/app/composables/useSelectedPeriod.ts +0 -107
- package/frontend-vue/app/composables/useStatsPeriods.ts +0 -139
- package/frontend-vue/app/custom-layouts/.gitkeep +0 -0
- package/frontend-vue/app/custom-pages/.gitkeep +0 -0
- package/frontend-vue/app/utils/httpMethod.ts +0 -49
- package/frontend-vue/app/utils/statusClass.ts +0 -49
- package/frontend-vue/i18n/locales/en-GB.json +0 -240
- package/frontend-vue/i18n/locales/fr-FR.json +0 -240
- package/frontend-vue/public/.gitkeep +0 -0
- package/frontend-vue/server/.gitkeep +0 -0
- package/frontend-vue/tests/periods.test.ts +0 -145
- package/frontend-vue/tests/persistence.test.ts +0 -45
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
import type {
|
|
4
|
-
InferredType,
|
|
5
|
-
ParameterInfo,
|
|
6
|
-
ParameterSource,
|
|
7
|
-
RouteDocPayload,
|
|
8
|
-
} from '../composables/useApiIntrospection'
|
|
9
|
-
|
|
10
|
-
const props = defineProps<{
|
|
11
|
-
doc: RouteDocPayload
|
|
12
|
-
}>()
|
|
13
|
-
|
|
14
|
-
interface ParamGroup {
|
|
15
|
-
source: ParameterSource
|
|
16
|
-
title: string
|
|
17
|
-
description: string
|
|
18
|
-
rows: ParameterInfo[]
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const SOURCE_META: Record<
|
|
22
|
-
ParameterSource,
|
|
23
|
-
{ title: string; description: string; order: number }
|
|
24
|
-
> = {
|
|
25
|
-
param: { title: 'page.api.routes.doc.path_params', description: 'page.api.routes.doc.path_params_description', order: 0 },
|
|
26
|
-
query: { title: 'page.api.routes.doc.query_params', description: 'page.api.routes.doc.query_params_description', order: 1 },
|
|
27
|
-
header: { title: 'page.api.routes.doc.headers', description: 'page.api.routes.doc.headers_description', order: 2 },
|
|
28
|
-
body: { title: 'page.api.routes.doc.body', description: 'page.api.routes.doc.body_description', order: 3 },
|
|
29
|
-
raw: { title: 'page.api.routes.doc.raw_body', description: 'page.api.routes.doc.raw_body_description', order: 4 },
|
|
30
|
-
context: { title: 'page.api.routes.doc.context', description: 'page.api.routes.doc.context_description', order: 5 },
|
|
31
|
-
result: { title: 'page.api.routes.doc.result', description: 'page.api.routes.doc.result_description', order: 6 },
|
|
32
|
-
stream: { title: 'page.api.routes.doc.stream', description: 'page.api.routes.doc.stream_description', order: 7 },
|
|
33
|
-
connection: { title: 'page.api.routes.doc.connection', description: 'page.api.routes.doc.connection_description', order: 8 },
|
|
34
|
-
unknown: { title: 'page.api.routes.doc.unknown_params', description: 'page.api.routes.doc.unknown_params_description', order: 9 },
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const TYPE_COLOR: Record<InferredType, 'neutral' | 'primary' | 'success' | 'warning' | 'info'> = {
|
|
38
|
-
string: 'neutral',
|
|
39
|
-
number: 'primary',
|
|
40
|
-
boolean: 'success',
|
|
41
|
-
object: 'info',
|
|
42
|
-
buffer: 'warning',
|
|
43
|
-
stream: 'warning',
|
|
44
|
-
unknown: 'neutral',
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const groups = computed<ParamGroup[]>(() => {
|
|
48
|
-
const buckets = new Map<ParameterSource, ParameterInfo[]>()
|
|
49
|
-
for (const param of props.doc.parameters) {
|
|
50
|
-
const list = buckets.get(param.source) ?? []
|
|
51
|
-
list.push(param)
|
|
52
|
-
buckets.set(param.source, list)
|
|
53
|
-
}
|
|
54
|
-
return [...buckets.entries()]
|
|
55
|
-
.map(([source, rows]) => ({
|
|
56
|
-
source,
|
|
57
|
-
title: SOURCE_META[source].title,
|
|
58
|
-
description: SOURCE_META[source].description,
|
|
59
|
-
rows,
|
|
60
|
-
}))
|
|
61
|
-
.sort((a, b) => SOURCE_META[a.source].order - SOURCE_META[b.source].order)
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
const authMiddleware = computed(() =>
|
|
65
|
-
props.doc.applicableMiddleware.filter((m) => m.isAuth),
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
const errorCodes = computed(() => props.doc.errorCodes ?? [])
|
|
69
|
-
|
|
70
|
-
function statusColor(s: number): 'warning' | 'error' {
|
|
71
|
-
return s >= 500 ? 'error' : 'warning'
|
|
72
|
-
}
|
|
73
|
-
</script>
|
|
74
|
-
|
|
75
|
-
<template>
|
|
76
|
-
<div class="flex w-full flex-col gap-6">
|
|
77
|
-
<p class="text-sm text-muted">
|
|
78
|
-
{{ $t('page.api.routes.doc.handler_label') }}:
|
|
79
|
-
<code class="font-mono">{{ doc.callbackName }}</code>
|
|
80
|
-
</p>
|
|
81
|
-
|
|
82
|
-
<!-- Authentication summary -->
|
|
83
|
-
<section class="flex flex-col gap-2">
|
|
84
|
-
<h3 class="text-base font-semibold text-highlighted">
|
|
85
|
-
{{ $t('page.api.routes.doc.authentication') }}
|
|
86
|
-
</h3>
|
|
87
|
-
<ul v-if="authMiddleware.length > 0" class="flex flex-col gap-1 text-sm">
|
|
88
|
-
<li
|
|
89
|
-
v-for="m in authMiddleware"
|
|
90
|
-
:key="m.id"
|
|
91
|
-
class="flex flex-wrap items-center gap-2"
|
|
92
|
-
>
|
|
93
|
-
<UBadge color="warning" variant="subtle" size="xs">auth</UBadge>
|
|
94
|
-
<code class="font-mono">{{ m.callbackName }}</code>
|
|
95
|
-
<span class="text-dimmed text-xs">
|
|
96
|
-
{{ m.location }} · {{ m.mode }}
|
|
97
|
-
</span>
|
|
98
|
-
</li>
|
|
99
|
-
</ul>
|
|
100
|
-
<p v-else class="text-sm text-muted">
|
|
101
|
-
{{ $t('page.api.routes.doc.no_authentication') }}
|
|
102
|
-
</p>
|
|
103
|
-
</section>
|
|
104
|
-
|
|
105
|
-
<!-- Parameter groups -->
|
|
106
|
-
<section v-for="group in groups" :key="group.source" class="flex flex-col gap-2">
|
|
107
|
-
<h3 class="text-base font-semibold text-highlighted">
|
|
108
|
-
{{ $t(group.title) }}
|
|
109
|
-
</h3>
|
|
110
|
-
<p class="text-sm text-muted">
|
|
111
|
-
{{ $t(group.description) }}
|
|
112
|
-
</p>
|
|
113
|
-
<table class="w-full border-collapse text-sm">
|
|
114
|
-
<thead>
|
|
115
|
-
<tr class="border-b border-default text-left text-xs uppercase text-dimmed">
|
|
116
|
-
<th class="py-2 pr-4">{{ $t('page.api.routes.doc.col_name') }}</th>
|
|
117
|
-
<th class="py-2 pr-4">{{ $t('page.api.routes.doc.col_type') }}</th>
|
|
118
|
-
<th class="py-2 pr-4">{{ $t('page.api.routes.doc.col_index') }}</th>
|
|
119
|
-
<th class="py-2 pr-4">{{ $t('page.api.routes.doc.col_modifiers') }}</th>
|
|
120
|
-
<th class="py-2">{{ $t('page.api.routes.doc.col_source') }}</th>
|
|
121
|
-
</tr>
|
|
122
|
-
</thead>
|
|
123
|
-
<tbody>
|
|
124
|
-
<tr v-for="row in group.rows" :key="row.index" class="border-b border-muted/40">
|
|
125
|
-
<td class="py-2 pr-4 font-mono">
|
|
126
|
-
{{ row.name ?? $t('page.api.routes.doc.unnamed') }}
|
|
127
|
-
<UBadge v-if="row.multi" color="neutral" variant="subtle" size="xs">multi</UBadge>
|
|
128
|
-
</td>
|
|
129
|
-
<td class="py-2 pr-4">
|
|
130
|
-
<UBadge :color="TYPE_COLOR[row.inferredType]" variant="subtle" size="xs">
|
|
131
|
-
{{ row.inferredType }}
|
|
132
|
-
</UBadge>
|
|
133
|
-
</td>
|
|
134
|
-
<td class="py-2 pr-4 text-dimmed">{{ row.index }}</td>
|
|
135
|
-
<td class="py-2 pr-4 text-dimmed">{{ row.modifierCount }}</td>
|
|
136
|
-
<td class="py-2">
|
|
137
|
-
<code class="font-mono text-xs text-muted">{{ row.source }}</code>
|
|
138
|
-
<UBadge
|
|
139
|
-
v-if="row.hint"
|
|
140
|
-
color="info"
|
|
141
|
-
variant="subtle"
|
|
142
|
-
size="xs"
|
|
143
|
-
class="ml-2"
|
|
144
|
-
>
|
|
145
|
-
{{ row.hint }}
|
|
146
|
-
</UBadge>
|
|
147
|
-
<details v-if="row.rawProviderSource" class="mt-1 text-xs">
|
|
148
|
-
<summary class="cursor-pointer text-dimmed">
|
|
149
|
-
{{ $t('page.api.routes.doc.show_source') }}
|
|
150
|
-
</summary>
|
|
151
|
-
<pre class="mt-1 max-h-32 overflow-auto rounded bg-elevated p-2 text-[10px]">{{ row.rawProviderSource }}</pre>
|
|
152
|
-
</details>
|
|
153
|
-
</td>
|
|
154
|
-
</tr>
|
|
155
|
-
</tbody>
|
|
156
|
-
</table>
|
|
157
|
-
</section>
|
|
158
|
-
|
|
159
|
-
<!-- Narrative documentation placeholder -->
|
|
160
|
-
<section class="flex flex-col gap-2">
|
|
161
|
-
<h3 class="text-base font-semibold text-highlighted">
|
|
162
|
-
{{ $t('page.api.routes.doc.narrative') }}
|
|
163
|
-
</h3>
|
|
164
|
-
<div class="flex flex-col items-center gap-2 rounded border border-dashed border-default p-6 text-center">
|
|
165
|
-
<UIcon name="i-ph-book-open" class="text-2xl text-muted" />
|
|
166
|
-
<p class="text-sm font-medium text-highlighted">
|
|
167
|
-
{{ $t('page.api.routes.doc.narrative_pending_title') }}
|
|
168
|
-
</p>
|
|
169
|
-
<p class="max-w-md text-xs text-muted">
|
|
170
|
-
{{ $t('page.api.routes.doc.narrative_pending_description') }}
|
|
171
|
-
</p>
|
|
172
|
-
</div>
|
|
173
|
-
</section>
|
|
174
|
-
|
|
175
|
-
<!-- Error responses (inferred) -->
|
|
176
|
-
<section v-if="errorCodes.length > 0" class="flex flex-col gap-2">
|
|
177
|
-
<h3 class="text-base font-semibold text-highlighted">
|
|
178
|
-
{{ $t('page.api.routes.doc.error_responses') }}
|
|
179
|
-
</h3>
|
|
180
|
-
<p class="text-sm text-muted">
|
|
181
|
-
{{ $t('page.api.routes.doc.error_responses_description') }}
|
|
182
|
-
</p>
|
|
183
|
-
<table class="w-full border-collapse text-sm">
|
|
184
|
-
<thead>
|
|
185
|
-
<tr class="border-b border-default text-left text-xs uppercase text-dimmed">
|
|
186
|
-
<th class="py-2 pr-4">{{ $t('page.api.routes.doc.col_status') }}</th>
|
|
187
|
-
<th class="py-2 pr-4">{{ $t('page.api.routes.doc.col_reason') }}</th>
|
|
188
|
-
<th class="py-2">{{ $t('page.api.routes.doc.col_source') }}</th>
|
|
189
|
-
</tr>
|
|
190
|
-
</thead>
|
|
191
|
-
<tbody>
|
|
192
|
-
<tr v-for="ec in errorCodes" :key="ec.status" class="border-b border-muted/40">
|
|
193
|
-
<td class="py-2 pr-4">
|
|
194
|
-
<UBadge :color="statusColor(ec.status)" variant="subtle" size="xs">
|
|
195
|
-
{{ ec.status }}
|
|
196
|
-
</UBadge>
|
|
197
|
-
</td>
|
|
198
|
-
<td class="py-2 pr-4 text-sm">
|
|
199
|
-
<span v-if="ec.reason" class="text-highlighted">{{ ec.reason }}</span>
|
|
200
|
-
<span v-else class="text-dimmed">—</span>
|
|
201
|
-
</td>
|
|
202
|
-
<td class="py-2 font-mono text-xs text-muted">{{ ec.source }}</td>
|
|
203
|
-
</tr>
|
|
204
|
-
</tbody>
|
|
205
|
-
</table>
|
|
206
|
-
</section>
|
|
207
|
-
|
|
208
|
-
<!-- Response shape placeholder -->
|
|
209
|
-
<section class="flex flex-col gap-2">
|
|
210
|
-
<h3 class="text-base font-semibold text-highlighted">
|
|
211
|
-
{{ $t('page.api.routes.doc.response') }}
|
|
212
|
-
</h3>
|
|
213
|
-
<div class="flex flex-col items-center gap-2 rounded border border-dashed border-default p-6 text-center">
|
|
214
|
-
<UIcon name="i-ph-arrow-square-out" class="text-2xl text-muted" />
|
|
215
|
-
<p class="text-sm font-medium text-highlighted">
|
|
216
|
-
{{ $t('page.api.routes.doc.response_pending_title') }}
|
|
217
|
-
</p>
|
|
218
|
-
<p class="max-w-md text-xs text-muted">
|
|
219
|
-
{{ $t('page.api.routes.doc.response_pending_description') }}
|
|
220
|
-
</p>
|
|
221
|
-
</div>
|
|
222
|
-
</section>
|
|
223
|
-
</div>
|
|
224
|
-
</template>
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
import type { FullRequestLog } from '../composables/useApiIntrospection'
|
|
4
|
-
import { httpMethodColor } from '../utils/httpMethod'
|
|
5
|
-
|
|
6
|
-
const props = defineProps<{
|
|
7
|
-
log: FullRequestLog
|
|
8
|
-
}>()
|
|
9
|
-
|
|
10
|
-
const statusColor = computed(() => {
|
|
11
|
-
const s = props.log.statusCode
|
|
12
|
-
if (s >= 500) return 'error'
|
|
13
|
-
if (s >= 400) return 'warning'
|
|
14
|
-
if (s >= 300) return 'info'
|
|
15
|
-
return 'success'
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
const methodColor = computed(() => httpMethodColor(props.log.method))
|
|
19
|
-
|
|
20
|
-
const formattedTimestamp = computed(() =>
|
|
21
|
-
new Date(props.log.timestamp).toLocaleString(),
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
const responseTimeMs = computed(
|
|
25
|
-
() => Math.round(props.log.responseTimeMs * 100) / 100,
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
function prettyJson(text?: string): string {
|
|
29
|
-
if (!text) return ''
|
|
30
|
-
try {
|
|
31
|
-
return JSON.stringify(JSON.parse(text), null, 2)
|
|
32
|
-
} catch {
|
|
33
|
-
return text
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function entries(rec?: Record<string, unknown>): Array<[string, string]> {
|
|
38
|
-
if (!rec) return []
|
|
39
|
-
return Object.entries(rec).map(([k, v]) => [
|
|
40
|
-
k,
|
|
41
|
-
Array.isArray(v) ? v.join(', ') : String(v),
|
|
42
|
-
])
|
|
43
|
-
}
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<template>
|
|
47
|
-
<div class="flex flex-col gap-4 p-1">
|
|
48
|
-
<!-- Top: method + uri + timestamp + status + duration -->
|
|
49
|
-
<div class="flex flex-col gap-2">
|
|
50
|
-
<div class="flex flex-wrap items-center gap-2">
|
|
51
|
-
<UBadge :color="methodColor" variant="solid">
|
|
52
|
-
{{ log.method.toUpperCase() }}
|
|
53
|
-
</UBadge>
|
|
54
|
-
<code class="rounded bg-elevated px-2 py-1 text-sm font-mono text-highlighted">
|
|
55
|
-
{{ log.uri }}
|
|
56
|
-
</code>
|
|
57
|
-
</div>
|
|
58
|
-
<div class="flex flex-wrap items-center gap-2">
|
|
59
|
-
<UBadge :color="statusColor" variant="subtle">
|
|
60
|
-
{{ log.statusCode }}
|
|
61
|
-
</UBadge>
|
|
62
|
-
<span class="text-xs text-dimmed">{{ responseTimeMs }} ms</span>
|
|
63
|
-
<span class="text-xs text-dimmed">·</span>
|
|
64
|
-
<span class="text-xs text-dimmed">{{ formattedTimestamp }}</span>
|
|
65
|
-
<span v-if="log.ip" class="text-xs text-dimmed">· {{ log.ip }}</span>
|
|
66
|
-
</div>
|
|
67
|
-
<p
|
|
68
|
-
v-if="log.rawPath && log.rawPath !== log.uri"
|
|
69
|
-
class="text-xs text-muted"
|
|
70
|
-
>
|
|
71
|
-
{{ $t('page.api.routes.stats.raw_path') }}:
|
|
72
|
-
<code class="font-mono">{{ log.rawPath }}</code>
|
|
73
|
-
</p>
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
<USeparator />
|
|
77
|
-
|
|
78
|
-
<!-- Error -->
|
|
79
|
-
<section v-if="log.error" class="flex flex-col gap-2">
|
|
80
|
-
<h4 class="text-sm font-semibold text-error">
|
|
81
|
-
{{ $t('page.api.routes.stats.detail_error') }}
|
|
82
|
-
</h4>
|
|
83
|
-
<p class="text-sm">{{ log.error.message }}</p>
|
|
84
|
-
<pre
|
|
85
|
-
v-if="log.error.stack"
|
|
86
|
-
class="max-h-48 overflow-auto rounded bg-elevated p-2 text-[10px]"
|
|
87
|
-
>{{ log.error.stack }}</pre>
|
|
88
|
-
</section>
|
|
89
|
-
|
|
90
|
-
<!-- Request -->
|
|
91
|
-
<section class="flex flex-col gap-3">
|
|
92
|
-
<h4 class="text-sm font-semibold text-highlighted">
|
|
93
|
-
{{ $t('page.api.routes.stats.detail_request') }}
|
|
94
|
-
</h4>
|
|
95
|
-
|
|
96
|
-
<div v-if="entries(log.pathParams).length > 0" class="flex flex-col gap-1">
|
|
97
|
-
<p class="text-xs uppercase text-dimmed">
|
|
98
|
-
{{ $t('page.api.routes.stats.detail_path_params') }}
|
|
99
|
-
</p>
|
|
100
|
-
<dl class="grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-xs">
|
|
101
|
-
<template v-for="[k, v] in entries(log.pathParams)" :key="k">
|
|
102
|
-
<dt class="font-mono text-muted">{{ k }}</dt>
|
|
103
|
-
<dd class="font-mono">{{ v }}</dd>
|
|
104
|
-
</template>
|
|
105
|
-
</dl>
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
<div v-if="entries(log.query).length > 0" class="flex flex-col gap-1">
|
|
109
|
-
<p class="text-xs uppercase text-dimmed">
|
|
110
|
-
{{ $t('page.api.routes.stats.detail_query') }}
|
|
111
|
-
</p>
|
|
112
|
-
<dl class="grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-xs">
|
|
113
|
-
<template v-for="[k, v] in entries(log.query)" :key="k">
|
|
114
|
-
<dt class="font-mono text-muted">{{ k }}</dt>
|
|
115
|
-
<dd class="font-mono">{{ v }}</dd>
|
|
116
|
-
</template>
|
|
117
|
-
</dl>
|
|
118
|
-
</div>
|
|
119
|
-
|
|
120
|
-
<div v-if="entries(log.requestHeaders).length > 0" class="flex flex-col gap-1">
|
|
121
|
-
<p class="text-xs uppercase text-dimmed">
|
|
122
|
-
{{ $t('page.api.routes.stats.detail_headers') }}
|
|
123
|
-
</p>
|
|
124
|
-
<dl class="grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-xs">
|
|
125
|
-
<template v-for="[k, v] in entries(log.requestHeaders)" :key="k">
|
|
126
|
-
<dt class="font-mono text-muted">{{ k }}</dt>
|
|
127
|
-
<dd class="font-mono break-all">{{ v }}</dd>
|
|
128
|
-
</template>
|
|
129
|
-
</dl>
|
|
130
|
-
</div>
|
|
131
|
-
|
|
132
|
-
<div v-if="log.requestBody" class="flex flex-col gap-1">
|
|
133
|
-
<p class="text-xs uppercase text-dimmed">
|
|
134
|
-
{{ $t('page.api.routes.stats.detail_body') }}
|
|
135
|
-
<span v-if="log.requestBodyTruncated" class="text-warning">
|
|
136
|
-
({{ $t('page.api.routes.stats.truncated') }})
|
|
137
|
-
</span>
|
|
138
|
-
</p>
|
|
139
|
-
<pre class="max-h-48 overflow-auto rounded bg-elevated p-2 text-[10px]">{{ prettyJson(log.requestBody) }}</pre>
|
|
140
|
-
</div>
|
|
141
|
-
</section>
|
|
142
|
-
|
|
143
|
-
<USeparator />
|
|
144
|
-
|
|
145
|
-
<!-- Response -->
|
|
146
|
-
<section class="flex flex-col gap-3">
|
|
147
|
-
<h4 class="text-sm font-semibold text-highlighted">
|
|
148
|
-
{{ $t('page.api.routes.stats.detail_response') }}
|
|
149
|
-
</h4>
|
|
150
|
-
|
|
151
|
-
<div v-if="entries(log.responseHeaders).length > 0" class="flex flex-col gap-1">
|
|
152
|
-
<p class="text-xs uppercase text-dimmed">
|
|
153
|
-
{{ $t('page.api.routes.stats.detail_headers') }}
|
|
154
|
-
</p>
|
|
155
|
-
<dl class="grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-xs">
|
|
156
|
-
<template v-for="[k, v] in entries(log.responseHeaders)" :key="k">
|
|
157
|
-
<dt class="font-mono text-muted">{{ k }}</dt>
|
|
158
|
-
<dd class="font-mono break-all">{{ v }}</dd>
|
|
159
|
-
</template>
|
|
160
|
-
</dl>
|
|
161
|
-
</div>
|
|
162
|
-
|
|
163
|
-
<div v-if="log.responseBody" class="flex flex-col gap-1">
|
|
164
|
-
<p class="text-xs uppercase text-dimmed">
|
|
165
|
-
{{ $t('page.api.routes.stats.detail_body') }}
|
|
166
|
-
<span v-if="log.responseBodyTruncated" class="text-warning">
|
|
167
|
-
({{ $t('page.api.routes.stats.truncated') }})
|
|
168
|
-
</span>
|
|
169
|
-
</p>
|
|
170
|
-
<pre class="max-h-64 overflow-auto rounded bg-elevated p-2 text-[10px]">{{ prettyJson(log.responseBody) }}</pre>
|
|
171
|
-
</div>
|
|
172
|
-
|
|
173
|
-
<p v-if="!log.responseBody" class="text-xs italic text-dimmed">
|
|
174
|
-
{{ $t('page.api.routes.stats.detail_no_body') }}
|
|
175
|
-
</p>
|
|
176
|
-
</section>
|
|
177
|
-
</div>
|
|
178
|
-
</template>
|