@antelopejs/dms-api 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +61 -0
- package/dist/automation/get-api-health.d.ts +10 -0
- package/dist/automation/get-api-health.js +53 -0
- package/dist/automation/get-api-health.js.map +1 -0
- package/dist/automation/index.d.ts +2 -0
- package/dist/automation/index.js +19 -0
- package/dist/automation/index.js.map +1 -0
- package/dist/automation/query-request-logs.d.ts +18 -0
- package/dist/automation/query-request-logs.js +50 -0
- package/dist/automation/query-request-logs.js.map +1 -0
- package/dist/automation/route-unhealthy.d.ts +9 -0
- package/dist/automation/route-unhealthy.js +102 -0
- package/dist/automation/route-unhealthy.js.map +1 -0
- package/dist/automation/scope.d.ts +2 -0
- package/dist/automation/scope.js +18 -0
- package/dist/automation/scope.js.map +1 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.js +38 -0
- package/dist/config.js.map +1 -0
- package/dist/db/index.d.ts +2 -0
- package/dist/db/index.js +19 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/models/api_settings.model.d.ts +23 -0
- package/dist/db/models/api_settings.model.js +13 -0
- package/dist/db/models/api_settings.model.js.map +1 -0
- package/dist/db/models/index.d.ts +4 -0
- package/dist/db/models/index.js +21 -0
- package/dist/db/models/index.js.map +1 -0
- package/dist/db/models/request_log.model.d.ts +47 -0
- package/dist/db/models/request_log.model.js +127 -0
- package/dist/db/models/request_log.model.js.map +1 -0
- package/dist/db/models/routes.model.d.ts +22 -0
- package/dist/db/models/routes.model.js +9 -0
- package/dist/db/models/routes.model.js.map +1 -0
- package/dist/db/models/routes_statistics.model.d.ts +23 -0
- package/dist/db/models/routes_statistics.model.js +13 -0
- package/dist/db/models/routes_statistics.model.js.map +1 -0
- package/dist/db/tables/api_settings.table.d.ts +10 -0
- package/dist/db/tables/api_settings.table.js +47 -0
- package/dist/db/tables/api_settings.table.js.map +1 -0
- package/dist/db/tables/index.d.ts +4 -0
- package/dist/db/tables/index.js +21 -0
- package/dist/db/tables/index.js.map +1 -0
- package/dist/db/tables/request_log.table.d.ts +29 -0
- package/dist/db/tables/request_log.table.js +107 -0
- package/dist/db/tables/request_log.table.js.map +1 -0
- package/dist/db/tables/routes.table.d.ts +11 -0
- package/dist/db/tables/routes.table.js +50 -0
- package/dist/db/tables/routes.table.js.map +1 -0
- package/dist/db/tables/routes_statistics.table.d.ts +9 -0
- package/dist/db/tables/routes_statistics.table.js +38 -0
- package/dist/db/tables/routes_statistics.table.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -0
- package/dist/middlewares/index.d.ts +1 -0
- package/dist/middlewares/index.js +18 -0
- package/dist/middlewares/index.js.map +1 -0
- package/dist/middlewares/request-log-capture.d.ts +1 -0
- package/dist/middlewares/request-log-capture.js +6 -0
- package/dist/middlewares/request-log-capture.js.map +1 -0
- package/dist/pages/all.d.ts +4 -0
- package/dist/pages/all.js +21 -0
- package/dist/pages/all.js.map +1 -0
- package/dist/pages/index.d.ts +4 -0
- package/dist/pages/index.js +21 -0
- package/dist/pages/index.js.map +1 -0
- package/dist/pages/logs/page.d.ts +9 -0
- package/dist/pages/logs/page.js +29 -0
- package/dist/pages/logs/page.js.map +1 -0
- package/dist/pages/module.d.ts +1 -0
- package/dist/pages/module.js +12 -0
- package/dist/pages/module.js.map +1 -0
- package/dist/pages/routes/page.d.ts +9 -0
- package/dist/pages/routes/page.js +29 -0
- package/dist/pages/routes/page.js.map +1 -0
- package/dist/pages/settings/form.d.ts +3 -0
- package/dist/pages/settings/form.js +80 -0
- package/dist/pages/settings/form.js.map +1 -0
- package/dist/pages/settings/page.d.ts +9 -0
- package/dist/pages/settings/page.js +26 -0
- package/dist/pages/settings/page.js.map +1 -0
- package/dist/pages/summary/page.d.ts +9 -0
- package/dist/pages/summary/page.js +29 -0
- package/dist/pages/summary/page.js.map +1 -0
- package/dist/routes/index.d.ts +5 -0
- package/dist/routes/index.js +22 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/logs.d.ts +7 -0
- package/dist/routes/logs.js +128 -0
- package/dist/routes/logs.js.map +1 -0
- package/dist/routes/monitoring.d.ts +17 -0
- package/dist/routes/monitoring.js +101 -0
- package/dist/routes/monitoring.js.map +1 -0
- package/dist/routes/routes.d.ts +37 -0
- package/dist/routes/routes.js +153 -0
- package/dist/routes/routes.js.map +1 -0
- package/dist/routes/settings.d.ts +24 -0
- package/dist/routes/settings.js +92 -0
- package/dist/routes/settings.js.map +1 -0
- package/dist/routes/summary.d.ts +32 -0
- package/dist/routes/summary.js +181 -0
- package/dist/routes/summary.js.map +1 -0
- package/dist/services/index.d.ts +11 -0
- package/dist/services/index.js +28 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/introspection/auth.d.ts +4 -0
- package/dist/services/introspection/auth.js +33 -0
- package/dist/services/introspection/auth.js.map +1 -0
- package/dist/services/introspection/errors.d.ts +6 -0
- package/dist/services/introspection/errors.js +50 -0
- package/dist/services/introspection/errors.js.map +1 -0
- package/dist/services/introspection/index.d.ts +53 -0
- package/dist/services/introspection/index.js +141 -0
- package/dist/services/introspection/index.js.map +1 -0
- package/dist/services/introspection/probe.d.ts +18 -0
- package/dist/services/introspection/probe.js +155 -0
- package/dist/services/introspection/probe.js.map +1 -0
- package/dist/services/period.d.ts +11 -0
- package/dist/services/period.js +68 -0
- package/dist/services/period.js.map +1 -0
- package/dist/services/request-log/capture.d.ts +10 -0
- package/dist/services/request-log/capture.js +189 -0
- package/dist/services/request-log/capture.js.map +1 -0
- package/dist/services/request-log/index.d.ts +3 -0
- package/dist/services/request-log/index.js +12 -0
- package/dist/services/request-log/index.js.map +1 -0
- package/dist/services/request-log/prune.d.ts +2 -0
- package/dist/services/request-log/prune.js +10 -0
- package/dist/services/request-log/prune.js.map +1 -0
- package/dist/services/request-log/read.d.ts +6 -0
- package/dist/services/request-log/read.js +26 -0
- package/dist/services/request-log/read.js.map +1 -0
- package/dist/services/request-log/redaction.d.ts +4 -0
- package/dist/services/request-log/redaction.js +53 -0
- package/dist/services/request-log/redaction.js.map +1 -0
- package/dist/services/request-log/util.d.ts +13 -0
- package/dist/services/request-log/util.js +114 -0
- package/dist/services/request-log/util.js.map +1 -0
- package/dist/services/routes-sync.d.ts +5 -0
- package/dist/services/routes-sync.js +63 -0
- package/dist/services/routes-sync.js.map +1 -0
- package/dist/services/scope.d.ts +7 -0
- package/dist/services/scope.js +40 -0
- package/dist/services/scope.js.map +1 -0
- package/dist/services/settings.d.ts +20 -0
- package/dist/services/settings.js +86 -0
- package/dist/services/settings.js.map +1 -0
- package/dist/services/statistics-aggregate.d.ts +67 -0
- package/dist/services/statistics-aggregate.js +340 -0
- package/dist/services/statistics-aggregate.js.map +1 -0
- package/dist/services/statistics-prune.d.ts +2 -0
- package/dist/services/statistics-prune.js +25 -0
- package/dist/services/statistics-prune.js.map +1 -0
- package/dist/services/statistics-read.d.ts +4 -0
- package/dist/services/statistics-read.js +48 -0
- package/dist/services/statistics-read.js.map +1 -0
- package/dist/services/statistics-utils.d.ts +14 -0
- package/dist/services/statistics-utils.js +65 -0
- package/dist/services/statistics-utils.js.map +1 -0
- package/dist/services/statistics-write.d.ts +3 -0
- package/dist/services/statistics-write.js +84 -0
- package/dist/services/statistics-write.js.map +1 -0
- package/dist/services/tree.d.ts +10 -0
- package/dist/services/tree.js +128 -0
- package/dist/services/tree.js.map +1 -0
- package/dist/types/charts.d.ts +9 -0
- package/dist/types/charts.js +3 -0
- package/dist/types/charts.js.map +1 -0
- package/dist/types/constants.d.ts +31 -0
- package/dist/types/constants.js +49 -0
- package/dist/types/constants.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +20 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/statistics.d.ts +17 -0
- package/dist/types/statistics.js +3 -0
- package/dist/types/statistics.js.map +1 -0
- package/frontend-vue/.editorconfig +12 -0
- package/frontend-vue/.prettierrc +12 -0
- package/frontend-vue/.vscode/settings.json +26 -0
- package/frontend-vue/app/components/ConfigurationView.vue +187 -0
- package/frontend-vue/app/components/DocumentationView.vue +224 -0
- package/frontend-vue/app/components/LogDetailDrawer.vue +178 -0
- package/frontend-vue/app/components/LogsView.vue +347 -0
- package/frontend-vue/app/components/RouteDetailTabs.vue +179 -0
- package/frontend-vue/app/components/RouteTree.vue +196 -0
- package/frontend-vue/app/components/RoutesView.vue +82 -0
- package/frontend-vue/app/components/StatsView.vue +268 -0
- package/frontend-vue/app/components/SummaryView.vue +657 -0
- package/frontend-vue/app/components/TesterPanel.vue +499 -0
- package/frontend-vue/app/components/internal/ApiMethodBadge.vue +33 -0
- package/frontend-vue/app/components/internal/ApiStatusBadge.vue +28 -0
- package/frontend-vue/app/components/internal/PeriodSelect.vue +58 -0
- package/frontend-vue/app/components/internal/RouteTreeNode.vue +168 -0
- package/frontend-vue/app/components/internal/StatusBreakdownBars.vue +162 -0
- package/frontend-vue/app/components/internal/StatusDonut.vue +84 -0
- package/frontend-vue/app/components/internal/UnitAreaChart.vue +73 -0
- package/frontend-vue/app/composables/useApiIntrospection.ts +344 -0
- package/frontend-vue/app/composables/useLogDetailDrawer.ts +50 -0
- package/frontend-vue/app/composables/useSelectedPeriod.ts +107 -0
- package/frontend-vue/app/composables/useStatsPeriods.ts +139 -0
- 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 +49 -0
- package/frontend-vue/app/utils/statusClass.ts +49 -0
- package/frontend-vue/app/utils/testerRequest.ts +50 -0
- package/frontend-vue/dms.frontend.ts +25 -0
- package/frontend-vue/eslint.config.mjs +16 -0
- package/frontend-vue/i18n/locales/en-GB.json +240 -0
- package/frontend-vue/i18n/locales/fr-FR.json +240 -0
- package/frontend-vue/package.json +35 -0
- package/frontend-vue/pnpm-lock.yaml +5796 -0
- package/frontend-vue/pnpm-workspace.yaml +2 -0
- package/frontend-vue/public/.gitkeep +0 -0
- package/frontend-vue/server/.gitkeep +0 -0
- package/frontend-vue/tests/periods.test.ts +145 -0
- package/frontend-vue/tests/persistence.test.ts +45 -0
- package/frontend-vue/tests/registration.test.ts +28 -0
- package/frontend-vue/tests/testerRequest.test.ts +95 -0
- package/frontend-vue/tsconfig.json +13 -0
- package/frontend-vue/vitest.config.ts +8 -0
- package/package.json +67 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildRoutesTreeNodes = buildRoutesTreeNodes;
|
|
4
|
+
const interface_api_1 = require("@antelopejs/interface-api");
|
|
5
|
+
const config_1 = require("@/config");
|
|
6
|
+
const types_1 = require("@/types");
|
|
7
|
+
const statistics_utils_1 = require("./statistics-utils");
|
|
8
|
+
function createBuildNode() {
|
|
9
|
+
return { methods: new Map(), children: new Map() };
|
|
10
|
+
}
|
|
11
|
+
function getMethodIcon(method) {
|
|
12
|
+
return (types_1.HTTP_METHOD_ICONS[method] ?? "i-ph-file");
|
|
13
|
+
}
|
|
14
|
+
function insertRoute(root, route) {
|
|
15
|
+
const segments = route.uri.split("/").filter(Boolean);
|
|
16
|
+
let current = root;
|
|
17
|
+
for (const segment of segments) {
|
|
18
|
+
let child = current.children.get(segment);
|
|
19
|
+
if (!child) {
|
|
20
|
+
child = createBuildNode();
|
|
21
|
+
current.children.set(segment, child);
|
|
22
|
+
}
|
|
23
|
+
current = child;
|
|
24
|
+
}
|
|
25
|
+
const method = route.method.toUpperCase();
|
|
26
|
+
current.methods.set(method, {
|
|
27
|
+
routeId: route.id,
|
|
28
|
+
statsKey: `${method}:${route.uri}`,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function statsForRoute(stats, sinceDay) {
|
|
32
|
+
if (!stats || stats.statistics.length === 0) {
|
|
33
|
+
return { requestsCount: 0, errorRate: 0, slow: false };
|
|
34
|
+
}
|
|
35
|
+
const threshold = (0, config_1.getConfig)().requestSlownessThreshold;
|
|
36
|
+
let count = 0;
|
|
37
|
+
let errors = 0;
|
|
38
|
+
let slow = false;
|
|
39
|
+
for (const day of stats.statistics) {
|
|
40
|
+
if (day.day < sinceDay)
|
|
41
|
+
continue;
|
|
42
|
+
count += day.requestsCount;
|
|
43
|
+
errors += day.clientErrorsCount + day.serverErrorsCount;
|
|
44
|
+
if (day.maxResponseTime >= threshold)
|
|
45
|
+
slow = true;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
requestsCount: count,
|
|
49
|
+
errorRate: count > 0 ? errors / count : 0,
|
|
50
|
+
slow,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function aggregateChildStats(stats) {
|
|
54
|
+
let totalCount = 0;
|
|
55
|
+
let weightedErrors = 0;
|
|
56
|
+
let slow = false;
|
|
57
|
+
for (const s of stats) {
|
|
58
|
+
totalCount += s.requestsCount;
|
|
59
|
+
weightedErrors += s.errorRate * s.requestsCount;
|
|
60
|
+
if (s.slow)
|
|
61
|
+
slow = true;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
requestsCount: totalCount,
|
|
65
|
+
errorRate: totalCount > 0 ? weightedErrors / totalCount : 0,
|
|
66
|
+
slow,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function buildFolderNode(segment, child, path, statsByKey, sinceDay) {
|
|
70
|
+
const currentPath = path ? `${path}/${segment}` : segment;
|
|
71
|
+
const contributed = [];
|
|
72
|
+
const methodStats = [];
|
|
73
|
+
const methodNodes = [];
|
|
74
|
+
for (const [method, { routeId, statsKey }] of child.methods) {
|
|
75
|
+
const stats = statsForRoute(statsByKey.get(statsKey), sinceDay);
|
|
76
|
+
methodStats.push(stats);
|
|
77
|
+
contributed.push(stats);
|
|
78
|
+
methodNodes.push({
|
|
79
|
+
label: method,
|
|
80
|
+
value: routeId,
|
|
81
|
+
icon: getMethodIcon(method),
|
|
82
|
+
selectable: true,
|
|
83
|
+
expandable: false,
|
|
84
|
+
customData: stats,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
const childResult = toTreeNodes(child, currentPath, statsByKey, sinceDay);
|
|
88
|
+
contributed.push(childResult.aggregate);
|
|
89
|
+
const node = {
|
|
90
|
+
label: segment,
|
|
91
|
+
value: currentPath,
|
|
92
|
+
icon: "i-ph-folder",
|
|
93
|
+
expandable: true,
|
|
94
|
+
children: [...methodNodes, ...childResult.nodes],
|
|
95
|
+
customData: aggregateChildStats([...methodStats, childResult.aggregate]),
|
|
96
|
+
};
|
|
97
|
+
return { node, contributed };
|
|
98
|
+
}
|
|
99
|
+
function toTreeNodes(node, path, statsByKey, sinceDay) {
|
|
100
|
+
const nodes = [];
|
|
101
|
+
const collected = [];
|
|
102
|
+
for (const [segment, child] of node.children) {
|
|
103
|
+
const { node: folderNode, contributed } = buildFolderNode(segment, child, path, statsByKey, sinceDay);
|
|
104
|
+
nodes.push(folderNode);
|
|
105
|
+
collected.push(...contributed);
|
|
106
|
+
}
|
|
107
|
+
return { nodes, aggregate: aggregateChildStats(collected) };
|
|
108
|
+
}
|
|
109
|
+
function buildRoutesTreeNodes(stats = [], scopeKeys, days) {
|
|
110
|
+
const root = createBuildNode();
|
|
111
|
+
for (const { id, handler } of (0, interface_api_1.getRegisteredRouteHandlers)()) {
|
|
112
|
+
if (handler.mode !== "handler")
|
|
113
|
+
continue;
|
|
114
|
+
if (scopeKeys &&
|
|
115
|
+
!scopeKeys.has(`${handler.method.toUpperCase()}:${handler.location}`)) {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
insertRoute(root, {
|
|
119
|
+
id,
|
|
120
|
+
uri: handler.location,
|
|
121
|
+
method: handler.method,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
const statsByKey = new Map(stats.map((s) => [`${s.method.toUpperCase()}:${s.uri}`, s]));
|
|
125
|
+
const sinceDay = days === undefined ? 0 : (0, statistics_utils_1.getWindowStartTimestamp)(days);
|
|
126
|
+
return toTreeNodes(root, "", statsByKey, sinceDay).nodes;
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/services/tree.ts"],"names":[],"mappings":";;AAuLA,oDAyBC;AAhND,6DAAuE;AAEvE,qCAAqC;AAGrC,mCAA4C;AAC5C,yDAA6D;AA2B7D,SAAS,eAAe;IACtB,OAAO,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AACrD,CAAC;AAED,SAAS,aAAa,CAAC,MAAc;IACnC,OAAO,CACL,yBAAiB,CAAC,MAAwC,CAAC,IAAI,WAAW,CAC3E,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,IAAe,EAAE,KAAe;IACnD,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACtD,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,KAAK,GAAG,eAAe,EAAE,CAAC;YAC1B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,GAAG,KAAK,CAAC;IAClB,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;IAC1C,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE;QAC1B,OAAO,EAAE,KAAK,CAAC,EAAE;QACjB,QAAQ,EAAE,GAAG,MAAM,IAAI,KAAK,CAAC,GAAG,EAAE;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AAE,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC,EACrE,CAAC;YACD,SAAS;QACX,CAAC;QACD,WAAW,CAAC,IAAI,EAAE;YAChB,EAAE;YACF,GAAG,EAAE,OAAO,CAAC,QAAQ;YACrB,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAC;IACL,CAAC;IACD,MAAM,UAAU,GAAG,IAAI,GAAG,CACxB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAC5D,CAAC;IACF,MAAM,QAAQ,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,0CAAuB,EAAC,IAAI,CAAC,CAAC;IACxE,OAAO,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,KAAK,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"charts.js","sourceRoot":"","sources":["../../src/types/charts.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const SCHEMA_NAME = "dms-api";
|
|
2
|
+
export declare const MS_PER_SECOND = 1000;
|
|
3
|
+
export declare const MS_PER_MINUTE = 60000;
|
|
4
|
+
export declare const MS_PER_HOUR = 3600000;
|
|
5
|
+
export declare const MS_PER_DAY = 86400000;
|
|
6
|
+
export declare const MAX_PERIOD_DAYS = 90;
|
|
7
|
+
export declare const MAX_MINUTELY_MINUTES: number;
|
|
8
|
+
export declare const MAX_HOURLY_HOURS: number;
|
|
9
|
+
export declare const ELEVATED_ERROR_RATE = 0.05;
|
|
10
|
+
export declare const CRITICAL_ERROR_RATE = 0.2;
|
|
11
|
+
export declare const DEGRADED_SLOW_ROUTES = 5;
|
|
12
|
+
export declare const STATISTICS_RETENTION_MS = 2592000000;
|
|
13
|
+
export declare const STATISTICS_CHART_DAYS = 7;
|
|
14
|
+
export declare const MAX_CHART_BUCKETS = 14;
|
|
15
|
+
export declare const SLOW_REQUEST_THRESHOLD_MS = 1000;
|
|
16
|
+
export declare const NS_TO_MS = 1000000;
|
|
17
|
+
export declare const HTTP_STATUS_OK = 200;
|
|
18
|
+
export declare const REQUEST_LOG_MAX_BODY_BYTES = 65536;
|
|
19
|
+
export declare const REQUEST_LOG_DEFAULT_HEADERS: readonly ["content-type", "content-length", "user-agent", "accept", "accept-encoding", "host", "referer", "origin"];
|
|
20
|
+
export declare const REQUEST_LOG_TEXT_CONTENT_TYPE_PREFIXES: readonly ["application/json", "application/xml", "application/x-www-form-urlencoded", "text/"];
|
|
21
|
+
export declare const HTTP_METHOD_ICONS: {
|
|
22
|
+
readonly GET: "i-ph-download-simple";
|
|
23
|
+
readonly POST: "i-ph-plus-circle";
|
|
24
|
+
readonly PUT: "i-ph-pencil-simple";
|
|
25
|
+
readonly DELETE: "i-ph-trash";
|
|
26
|
+
readonly PATCH: "i-ph-note-pencil";
|
|
27
|
+
readonly HEAD: "i-ph-link";
|
|
28
|
+
readonly OPTIONS: "i-ph-link";
|
|
29
|
+
readonly CONNECT: "i-ph-link";
|
|
30
|
+
readonly TRACE: "i-ph-link";
|
|
31
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HTTP_METHOD_ICONS = exports.REQUEST_LOG_TEXT_CONTENT_TYPE_PREFIXES = exports.REQUEST_LOG_DEFAULT_HEADERS = exports.REQUEST_LOG_MAX_BODY_BYTES = exports.HTTP_STATUS_OK = exports.NS_TO_MS = exports.SLOW_REQUEST_THRESHOLD_MS = exports.MAX_CHART_BUCKETS = exports.STATISTICS_CHART_DAYS = exports.STATISTICS_RETENTION_MS = exports.DEGRADED_SLOW_ROUTES = exports.CRITICAL_ERROR_RATE = exports.ELEVATED_ERROR_RATE = exports.MAX_HOURLY_HOURS = exports.MAX_MINUTELY_MINUTES = exports.MAX_PERIOD_DAYS = exports.MS_PER_DAY = exports.MS_PER_HOUR = exports.MS_PER_MINUTE = exports.MS_PER_SECOND = exports.SCHEMA_NAME = void 0;
|
|
4
|
+
exports.SCHEMA_NAME = "dms-api";
|
|
5
|
+
exports.MS_PER_SECOND = 1000;
|
|
6
|
+
exports.MS_PER_MINUTE = 60_000;
|
|
7
|
+
exports.MS_PER_HOUR = 3_600_000;
|
|
8
|
+
exports.MS_PER_DAY = 86_400_000;
|
|
9
|
+
exports.MAX_PERIOD_DAYS = 90;
|
|
10
|
+
exports.MAX_MINUTELY_MINUTES = 6 * 60;
|
|
11
|
+
exports.MAX_HOURLY_HOURS = 14 * 24;
|
|
12
|
+
exports.ELEVATED_ERROR_RATE = 0.05;
|
|
13
|
+
exports.CRITICAL_ERROR_RATE = 0.2;
|
|
14
|
+
exports.DEGRADED_SLOW_ROUTES = 5;
|
|
15
|
+
exports.STATISTICS_RETENTION_MS = 2_592_000_000;
|
|
16
|
+
exports.STATISTICS_CHART_DAYS = 7;
|
|
17
|
+
exports.MAX_CHART_BUCKETS = 14;
|
|
18
|
+
exports.SLOW_REQUEST_THRESHOLD_MS = 1000;
|
|
19
|
+
exports.NS_TO_MS = 1_000_000;
|
|
20
|
+
exports.HTTP_STATUS_OK = 200;
|
|
21
|
+
exports.REQUEST_LOG_MAX_BODY_BYTES = 65_536;
|
|
22
|
+
exports.REQUEST_LOG_DEFAULT_HEADERS = [
|
|
23
|
+
"content-type",
|
|
24
|
+
"content-length",
|
|
25
|
+
"user-agent",
|
|
26
|
+
"accept",
|
|
27
|
+
"accept-encoding",
|
|
28
|
+
"host",
|
|
29
|
+
"referer",
|
|
30
|
+
"origin",
|
|
31
|
+
];
|
|
32
|
+
exports.REQUEST_LOG_TEXT_CONTENT_TYPE_PREFIXES = [
|
|
33
|
+
"application/json",
|
|
34
|
+
"application/xml",
|
|
35
|
+
"application/x-www-form-urlencoded",
|
|
36
|
+
"text/",
|
|
37
|
+
];
|
|
38
|
+
exports.HTTP_METHOD_ICONS = {
|
|
39
|
+
GET: "i-ph-download-simple",
|
|
40
|
+
POST: "i-ph-plus-circle",
|
|
41
|
+
PUT: "i-ph-pencil-simple",
|
|
42
|
+
DELETE: "i-ph-trash",
|
|
43
|
+
PATCH: "i-ph-note-pencil",
|
|
44
|
+
HEAD: "i-ph-link",
|
|
45
|
+
OPTIONS: "i-ph-link",
|
|
46
|
+
CONNECT: "i-ph-link",
|
|
47
|
+
TRACE: "i-ph-link",
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/types/constants.ts"],"names":[],"mappings":";;;AAKa,QAAA,WAAW,GAAG,SAAS,CAAC;AAOxB,QAAA,aAAa,GAAG,IAAI,CAAC;AAGrB,QAAA,aAAa,GAAG,MAAM,CAAC;AAGvB,QAAA,WAAW,GAAG,SAAS,CAAC;AAGxB,QAAA,UAAU,GAAG,UAAU,CAAC;AAGxB,QAAA,eAAe,GAAG,EAAE,CAAC;AAGrB,QAAA,oBAAoB,GAAG,CAAC,GAAG,EAAE,CAAC;AAG9B,QAAA,gBAAgB,GAAG,EAAE,GAAG,EAAE,CAAC;AAG3B,QAAA,mBAAmB,GAAG,IAAI,CAAC;AAG3B,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAG1B,QAAA,oBAAoB,GAAG,CAAC,CAAC;AAGzB,QAAA,uBAAuB,GAAG,aAAa,CAAC;AAGxC,QAAA,qBAAqB,GAAG,CAAC,CAAC;AAO1B,QAAA,iBAAiB,GAAG,EAAE,CAAC;AAGvB,QAAA,yBAAyB,GAAG,IAAI,CAAC;AAGjC,QAAA,QAAQ,GAAG,SAAS,CAAC;AAGrB,QAAA,cAAc,GAAG,GAAG,CAAC;AAOrB,QAAA,0BAA0B,GAAG,MAAM,CAAC;AAGpC,QAAA,2BAA2B,GAAG;IACzC,cAAc;IACd,gBAAgB;IAChB,YAAY;IACZ,QAAQ;IACR,iBAAiB;IACjB,MAAM;IACN,SAAS;IACT,QAAQ;CACA,CAAC;AAGE,QAAA,sCAAsC,GAAG;IACpD,kBAAkB;IAClB,iBAAiB;IACjB,mCAAmC;IACnC,OAAO;CACC,CAAC;AAOE,QAAA,iBAAiB,GAAG;IAC/B,GAAG,EAAE,sBAAsB;IAC3B,IAAI,EAAE,kBAAkB;IACxB,GAAG,EAAE,oBAAoB;IACzB,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE,kBAAkB;IACzB,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,WAAW;IACpB,KAAK,EAAE,WAAW;CACV,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./charts"), exports);
|
|
18
|
+
__exportStar(require("./constants"), exports);
|
|
19
|
+
__exportStar(require("./statistics"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,8CAA4B;AAC5B,+CAA6B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
2
|
+
export interface RequestStatistics {
|
|
3
|
+
responseTime: number;
|
|
4
|
+
method: HttpMethod;
|
|
5
|
+
uri: string;
|
|
6
|
+
statusCode: number;
|
|
7
|
+
}
|
|
8
|
+
export interface DayStatistics {
|
|
9
|
+
day: number;
|
|
10
|
+
requestsCount: number;
|
|
11
|
+
averageResponseTime: number;
|
|
12
|
+
minResponseTime: number;
|
|
13
|
+
maxResponseTime: number;
|
|
14
|
+
totalResponseTime: number;
|
|
15
|
+
clientErrorsCount: number;
|
|
16
|
+
serverErrorsCount: number;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statistics.js","sourceRoot":"","sources":["../../src/types/statistics.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"semi": false,
|
|
3
|
+
"singleQuote": true,
|
|
4
|
+
"trailingComma": "all",
|
|
5
|
+
"endOfLine": "auto",
|
|
6
|
+
"useTabs": false,
|
|
7
|
+
"tabWidth": 2,
|
|
8
|
+
"plugins": ["prettier-plugin-tailwindcss"],
|
|
9
|
+
|
|
10
|
+
"htmlWhitespaceSensitivity": "ignore",
|
|
11
|
+
"tailwindStylesheet": "~/assets/css/main.css"
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"eslint.useFlatConfig": true,
|
|
3
|
+
"editor.codeActionsOnSave": {
|
|
4
|
+
"source.fixAll.eslint": "always"
|
|
5
|
+
},
|
|
6
|
+
|
|
7
|
+
"tailwindCSS.experimental.classRegex": [
|
|
8
|
+
"tw`(.*?)`",
|
|
9
|
+
"tw\\('(.*?)'\\)",
|
|
10
|
+
"tw\\(\\s*('(.*?)'|\"(.*?)\")\\s*\\)",
|
|
11
|
+
["([\"'`][^\"'`]*.*?[\"'`])", "[\"'`]([^\"'`]*).*?[\"'`]"]
|
|
12
|
+
],
|
|
13
|
+
|
|
14
|
+
"files.associations": {
|
|
15
|
+
"*.css": "tailwindcss"
|
|
16
|
+
},
|
|
17
|
+
"editor.quickSuggestions": {
|
|
18
|
+
"strings": "on"
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
"i18n-ally.localesPaths": ["i18n/locales"],
|
|
22
|
+
"i18n-ally.keystyle": "nested",
|
|
23
|
+
"i18n-ally.sourceLanguage": "fr-FR",
|
|
24
|
+
"i18n-ally.displayLanguage": "fr-FR",
|
|
25
|
+
"i18n-ally.extract.autoDetect": false
|
|
26
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import type {
|
|
4
|
+
MiddlewareInfo,
|
|
5
|
+
ParameterInfo,
|
|
6
|
+
PropertyInfo,
|
|
7
|
+
} from '../composables/useApiIntrospection'
|
|
8
|
+
|
|
9
|
+
const props = defineProps<{
|
|
10
|
+
parameters?: ParameterInfo[]
|
|
11
|
+
properties?: PropertyInfo[]
|
|
12
|
+
middleware: MiddlewareInfo[]
|
|
13
|
+
}>()
|
|
14
|
+
|
|
15
|
+
const displayProperties = computed<PropertyInfo[]>(() => props.properties ?? [])
|
|
16
|
+
|
|
17
|
+
function priorityLabel(p?: number): string {
|
|
18
|
+
if (p === undefined) return ''
|
|
19
|
+
return ['HIGHEST', 'HIGH', 'NORMAL', 'LOW', 'LOWEST'][p] ?? String(p)
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div class="flex w-full flex-col gap-6">
|
|
25
|
+
<!-- Parameters -->
|
|
26
|
+
<section class="flex flex-col gap-2">
|
|
27
|
+
<h3 class="text-base font-semibold text-highlighted">
|
|
28
|
+
{{ $t('page.api.routes.config.parameters') }}
|
|
29
|
+
</h3>
|
|
30
|
+
<p class="text-sm text-muted">
|
|
31
|
+
{{ $t('page.api.routes.config.parameters_description') }}
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
<div
|
|
35
|
+
v-if="!parameters || parameters.length === 0"
|
|
36
|
+
class="flex flex-col items-center gap-2 rounded border border-dashed border-default p-4 text-center"
|
|
37
|
+
>
|
|
38
|
+
<UIcon name="i-ph-list-dashes" class="text-2xl text-muted" />
|
|
39
|
+
<p class="text-sm font-medium text-highlighted">
|
|
40
|
+
{{ $t('page.api.routes.config.no_parameters_title') }}
|
|
41
|
+
</p>
|
|
42
|
+
<p class="text-xs text-muted">
|
|
43
|
+
{{ $t('page.api.routes.config.no_parameters_description') }}
|
|
44
|
+
</p>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div v-else class="space-y-2">
|
|
48
|
+
<div
|
|
49
|
+
v-for="p in parameters"
|
|
50
|
+
:key="p.index"
|
|
51
|
+
class="rounded border border-default bg-elevated/40 p-3"
|
|
52
|
+
>
|
|
53
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
54
|
+
<UBadge color="primary" variant="subtle">#{{ p.index }}</UBadge>
|
|
55
|
+
<UBadge color="neutral" variant="outline">{{ p.source }}</UBadge>
|
|
56
|
+
<UBadge color="info" variant="subtle" size="xs">{{ p.inferredType }}</UBadge>
|
|
57
|
+
<UBadge v-if="p.multi" color="warning" variant="subtle" size="xs">multi</UBadge>
|
|
58
|
+
<code class="font-mono text-sm">
|
|
59
|
+
{{ p.name ?? $t('page.api.routes.doc.unnamed') }}
|
|
60
|
+
</code>
|
|
61
|
+
<UBadge v-if="p.hint" color="neutral" variant="subtle" size="xs" class="font-mono">
|
|
62
|
+
{{ p.hint }}
|
|
63
|
+
</UBadge>
|
|
64
|
+
<span class="ml-auto text-xs text-dimmed">
|
|
65
|
+
{{ p.modifierCount }} {{ $t('page.api.routes.config.modifiers') }}
|
|
66
|
+
</span>
|
|
67
|
+
</div>
|
|
68
|
+
<details v-if="p.rawProviderSource" class="mt-2 text-xs">
|
|
69
|
+
<summary class="cursor-pointer text-dimmed">
|
|
70
|
+
{{ $t('page.api.routes.doc.show_source') }}
|
|
71
|
+
</summary>
|
|
72
|
+
<pre class="mt-1 max-h-32 overflow-auto rounded bg-default p-2 text-[10px]">{{ p.rawProviderSource }}</pre>
|
|
73
|
+
</details>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</section>
|
|
77
|
+
|
|
78
|
+
<!-- Class-member properties / "middleware" per spec -->
|
|
79
|
+
<section class="flex flex-col gap-2">
|
|
80
|
+
<h3 class="text-base font-semibold text-highlighted">
|
|
81
|
+
{{ $t('page.api.routes.config.properties') }}
|
|
82
|
+
</h3>
|
|
83
|
+
<p class="text-sm text-muted">
|
|
84
|
+
{{ $t('page.api.routes.config.properties_description') }}
|
|
85
|
+
</p>
|
|
86
|
+
|
|
87
|
+
<div
|
|
88
|
+
v-if="displayProperties.length === 0"
|
|
89
|
+
class="flex flex-col items-center gap-2 rounded border border-dashed border-default p-4 text-center"
|
|
90
|
+
>
|
|
91
|
+
<UIcon name="i-ph-cube" class="text-2xl text-muted" />
|
|
92
|
+
<p class="text-sm font-medium text-highlighted">
|
|
93
|
+
{{ $t('page.api.routes.config.no_properties_title') }}
|
|
94
|
+
</p>
|
|
95
|
+
<p class="text-xs text-muted">
|
|
96
|
+
{{ $t('page.api.routes.config.no_properties_description') }}
|
|
97
|
+
</p>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div v-else class="space-y-2">
|
|
101
|
+
<div
|
|
102
|
+
v-for="prop in displayProperties"
|
|
103
|
+
:key="prop.key"
|
|
104
|
+
class="rounded border border-default bg-elevated/40 p-3"
|
|
105
|
+
>
|
|
106
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
107
|
+
<UBadge color="info" variant="subtle">{{ prop.decorator }}</UBadge>
|
|
108
|
+
<code class="font-mono text-sm">{{ prop.key }}</code>
|
|
109
|
+
<UBadge
|
|
110
|
+
v-if="prop.hint"
|
|
111
|
+
color="neutral"
|
|
112
|
+
variant="subtle"
|
|
113
|
+
size="xs"
|
|
114
|
+
class="font-mono"
|
|
115
|
+
>
|
|
116
|
+
{{ prop.hint }}
|
|
117
|
+
</UBadge>
|
|
118
|
+
<span class="ml-auto text-xs text-dimmed">
|
|
119
|
+
{{ prop.modifierCount }} {{ $t('page.api.routes.config.modifiers') }}
|
|
120
|
+
</span>
|
|
121
|
+
</div>
|
|
122
|
+
<details v-if="prop.rawProviderSource" class="mt-2 text-xs">
|
|
123
|
+
<summary class="cursor-pointer text-dimmed">
|
|
124
|
+
{{ $t('page.api.routes.doc.show_source') }}
|
|
125
|
+
</summary>
|
|
126
|
+
<pre class="mt-1 max-h-32 overflow-auto rounded bg-default p-2 text-[10px]">{{ prop.rawProviderSource }}</pre>
|
|
127
|
+
</details>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</section>
|
|
131
|
+
|
|
132
|
+
<!-- Applicable middleware -->
|
|
133
|
+
<section class="flex flex-col gap-2">
|
|
134
|
+
<h3 class="text-base font-semibold text-highlighted">
|
|
135
|
+
{{ $t('page.api.routes.config.middleware') }}
|
|
136
|
+
</h3>
|
|
137
|
+
<p class="text-sm text-muted">
|
|
138
|
+
{{ $t('page.api.routes.config.middleware_route_description') }}
|
|
139
|
+
</p>
|
|
140
|
+
|
|
141
|
+
<div
|
|
142
|
+
v-if="middleware.length === 0"
|
|
143
|
+
class="flex flex-col items-center gap-2 rounded border border-dashed border-default p-4 text-center"
|
|
144
|
+
>
|
|
145
|
+
<UIcon name="i-ph-stack" class="text-2xl text-muted" />
|
|
146
|
+
<p class="text-sm font-medium text-highlighted">
|
|
147
|
+
{{ $t('page.api.routes.config.no_middleware_title') }}
|
|
148
|
+
</p>
|
|
149
|
+
<p class="text-xs text-muted">
|
|
150
|
+
{{ $t('page.api.routes.config.no_middleware_description') }}
|
|
151
|
+
</p>
|
|
152
|
+
</div>
|
|
153
|
+
|
|
154
|
+
<div v-else class="space-y-2">
|
|
155
|
+
<div
|
|
156
|
+
v-for="m in middleware"
|
|
157
|
+
:key="m.id"
|
|
158
|
+
class="rounded border border-default bg-elevated/40 p-3"
|
|
159
|
+
>
|
|
160
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
161
|
+
<UBadge
|
|
162
|
+
:color="m.mode === 'prefix' ? 'success' : m.mode === 'postfix' ? 'warning' : 'info'"
|
|
163
|
+
variant="subtle"
|
|
164
|
+
>
|
|
165
|
+
{{ m.mode }}
|
|
166
|
+
</UBadge>
|
|
167
|
+
<UBadge v-if="m.isAuth" color="warning" variant="subtle" size="xs">
|
|
168
|
+
{{ $t('page.api.routes.config.auth_badge') }}
|
|
169
|
+
</UBadge>
|
|
170
|
+
<code class="font-mono text-sm">{{ m.callbackName }}</code>
|
|
171
|
+
<code class="font-mono text-xs text-muted">{{ m.location }}</code>
|
|
172
|
+
<UBadge color="neutral" variant="outline" size="xs">{{ m.method }}</UBadge>
|
|
173
|
+
<UBadge
|
|
174
|
+
v-if="m.priority !== undefined"
|
|
175
|
+
color="neutral"
|
|
176
|
+
variant="subtle"
|
|
177
|
+
size="xs"
|
|
178
|
+
class="ml-auto"
|
|
179
|
+
>
|
|
180
|
+
{{ priorityLabel(m.priority) }}
|
|
181
|
+
</UBadge>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
</section>
|
|
186
|
+
</div>
|
|
187
|
+
</template>
|