@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.
- 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/package.json +9 -9
- 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
package/dist/routes/logs.js
CHANGED
|
@@ -16,113 +16,204 @@ exports.LogsController = void 0;
|
|
|
16
16
|
const interface_api_1 = require("@antelopejs/interface-api");
|
|
17
17
|
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
18
18
|
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
19
|
-
const
|
|
19
|
+
const guards_1 = require("@antelopejs/interface-dms/guards");
|
|
20
20
|
const config_1 = require("@/config");
|
|
21
21
|
const db_1 = require("@/db");
|
|
22
|
+
const routes_statistics_table_1 = require("@/db/tables/routes_statistics.table");
|
|
23
|
+
const logs_1 = require("@/pages/logs");
|
|
24
|
+
const overview_1 = require("@/pages/overview");
|
|
25
|
+
const routes_1 = require("@/pages/routes");
|
|
26
|
+
const api_origin_1 = require("@/services/api-origin");
|
|
27
|
+
const links_1 = require("@/services/links");
|
|
28
|
+
const period_1 = require("@/services/period");
|
|
29
|
+
const access_1 = require("@/services/request-log/access");
|
|
22
30
|
const read_1 = require("@/services/request-log/read");
|
|
31
|
+
const list_1 = require("@/services/request-log/list");
|
|
23
32
|
const scope_1 = require("@/services/scope");
|
|
24
33
|
const settings_1 = require("@/services/settings");
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
const tester_1 = require("./tester");
|
|
35
|
+
const live_1 = require("@/services/live");
|
|
36
|
+
const route_catalog_1 = require("@/services/route-catalog");
|
|
37
|
+
function sourceQuery(context) {
|
|
38
|
+
return Object.fromEntries(context.url.searchParams.entries());
|
|
39
|
+
}
|
|
40
|
+
async function scopeKeys() {
|
|
41
|
+
return (0, scope_1.getScopedRouteKeys)((0, interface_database_decorators_1.GetModel)(db_1.RouteModel), (0, settings_1.getActiveScope)());
|
|
42
|
+
}
|
|
43
|
+
async function listOf(context, query = sourceQuery(context), options = {}) {
|
|
44
|
+
return (0, list_1.listRequestLogs)((0, interface_database_decorators_1.GetModel)(db_1.RequestLogModel), query, await scopeKeys(), options);
|
|
45
|
+
}
|
|
46
|
+
const ROUTE_TABLE = {
|
|
47
|
+
requireRoute: true,
|
|
30
48
|
};
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
"client-error",
|
|
34
|
-
"server-error",
|
|
35
|
-
]);
|
|
36
|
-
const PERIOD_UNIT_MS = {
|
|
37
|
-
s: types_1.MS_PER_SECOND,
|
|
38
|
-
m: types_1.MS_PER_MINUTE,
|
|
39
|
-
h: types_1.MS_PER_HOUR,
|
|
40
|
-
d: types_1.MS_PER_DAY,
|
|
49
|
+
const LOGS_TABLE = {
|
|
50
|
+
findOutsideScope: true,
|
|
41
51
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
const overviewTable = overview_1.OverviewPage.dashboard.targetChild("recent", "requests", "table");
|
|
53
|
+
const routesTable = routes_1.RoutesPage.explorer.targetChild("tabs", "statistics", "recent", "requests", "table");
|
|
54
|
+
async function logDetail(id, table) {
|
|
55
|
+
const model = (0, interface_database_decorators_1.GetModel)(db_1.RequestLogModel);
|
|
56
|
+
const log = await (0, read_1.getRequestLog)(model, id);
|
|
57
|
+
(0, interface_api_util_1.assert)(log, 404, "Log not found");
|
|
58
|
+
const method = log.routeMethod ?? log.method;
|
|
59
|
+
const ref = (0, links_1.routeRef)(method, log.uri);
|
|
60
|
+
const route = (0, route_catalog_1.findRoute)(ref);
|
|
61
|
+
const keys = table === "logs" ? null : await scopeKeys();
|
|
62
|
+
(0, interface_api_util_1.assert)((0, access_1.canReadLog)(table, log, route !== undefined, keys), 404, "Log not found");
|
|
63
|
+
const slowThresholdMs = (0, config_1.getConfig)().requestSlownessThreshold;
|
|
64
|
+
return {
|
|
65
|
+
_id: log._id,
|
|
66
|
+
timestamp: log.timestamp,
|
|
67
|
+
method: log.method,
|
|
68
|
+
routeMethod: log.routeMethod ?? null,
|
|
69
|
+
uri: log.uri,
|
|
70
|
+
rawPath: log.rawPath,
|
|
71
|
+
statusCode: log.statusCode,
|
|
72
|
+
responseTimeMs: log.responseTimeMs ?? null,
|
|
73
|
+
source: log.source ?? null,
|
|
74
|
+
requestId: log.requestId ?? null,
|
|
75
|
+
ip: log.ip,
|
|
76
|
+
userAgent: log.userAgent,
|
|
77
|
+
pathParams: log.pathParams,
|
|
78
|
+
query: log.query,
|
|
79
|
+
requestHeaders: log.requestHeaders,
|
|
80
|
+
requestBody: log.requestBody,
|
|
81
|
+
requestBodyTruncated: log.requestBodyTruncated,
|
|
82
|
+
requestBodyOmitted: log.requestBodyOmitted ?? null,
|
|
83
|
+
requestBodySize: log.requestBodySize ?? null,
|
|
84
|
+
responseHeaders: log.responseHeaders,
|
|
85
|
+
responseBody: log.responseBody,
|
|
86
|
+
responseBodyTruncated: log.responseBodyTruncated,
|
|
87
|
+
responseBodyOmitted: log.responseBodyOmitted ?? null,
|
|
88
|
+
responseBodySize: log.responseBodySize ?? null,
|
|
89
|
+
redactions: log.redactions,
|
|
90
|
+
error: log.error,
|
|
91
|
+
route: ref,
|
|
92
|
+
routeRegistered: route !== undefined,
|
|
93
|
+
slowThresholdMs,
|
|
94
|
+
routeLatency: route
|
|
95
|
+
? await (0, read_1.getRouteLatency)({ stats: (0, interface_database_decorators_1.GetModel)(db_1.RouteStatisticsModel), logs: model }, { method, uri: log.uri }, slowThresholdMs)
|
|
96
|
+
: null,
|
|
97
|
+
apiOrigin: await (0, api_origin_1.apiOrigin)(),
|
|
98
|
+
links: {
|
|
99
|
+
route: route ? (0, links_1.routeLink)(ref) : null,
|
|
100
|
+
tester: route ? (0, links_1.testerLink)(ref) : null,
|
|
101
|
+
sameError: log.error?.message
|
|
102
|
+
? (0, links_1.logsLink)({ route: ref, error: log.error.message })
|
|
103
|
+
: null,
|
|
104
|
+
sameRoute: route ? (0, links_1.logsLink)({ route: ref }) : null,
|
|
105
|
+
samePath: (0, routes_statistics_table_1.normalizeRoutePath)(log.rawPath) !== log.uri
|
|
106
|
+
? (0, links_1.logsLink)({ path: log.rawPath })
|
|
107
|
+
: null,
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
class LogsController extends (0, interface_api_1.Controller)("/api/monitoring/logs") {
|
|
112
|
+
async listLogs(_user, context) {
|
|
113
|
+
return listOf(context, sourceQuery(context), LOGS_TABLE);
|
|
114
|
+
}
|
|
115
|
+
async listRecent(_user, context) {
|
|
116
|
+
return listOf(context);
|
|
117
|
+
}
|
|
118
|
+
async listForRoutes(_user, context) {
|
|
119
|
+
return listOf(context, sourceQuery(context), ROUTE_TABLE);
|
|
120
|
+
}
|
|
121
|
+
async listForTester(_user, context) {
|
|
122
|
+
const { requestId } = sourceQuery(context);
|
|
123
|
+
(0, interface_api_util_1.assert)(requestId?.trim(), 400, "requestId is required");
|
|
124
|
+
return (0, list_1.listRequestLogs)((0, interface_database_decorators_1.GetModel)(db_1.RequestLogModel), { requestId }, null, {
|
|
125
|
+
testerOnly: true,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
async getLive(_user) {
|
|
129
|
+
return {
|
|
130
|
+
...(await (0, live_1.getLiveTraffic)((0, interface_database_decorators_1.GetModel)(db_1.RequestLogModel), await scopeKeys())),
|
|
131
|
+
retentionDays: (0, period_1.getMaxLogDays)(),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
async getRecentLog(_user, id) {
|
|
135
|
+
return logDetail(id, "overview");
|
|
136
|
+
}
|
|
137
|
+
async getTesterLog(_user, id) {
|
|
138
|
+
return logDetail(id, "tester");
|
|
139
|
+
}
|
|
140
|
+
async getRoutesLog(_user, id) {
|
|
141
|
+
return logDetail(id, "routes");
|
|
47
142
|
}
|
|
48
143
|
async getLog(_user, id) {
|
|
49
|
-
|
|
50
|
-
(0, interface_api_util_1.assert)(log, 404, "Log not found");
|
|
51
|
-
return log;
|
|
144
|
+
return logDetail(id, "logs");
|
|
52
145
|
}
|
|
53
|
-
}
|
|
146
|
+
}
|
|
54
147
|
exports.LogsController = LogsController;
|
|
55
148
|
__decorate([
|
|
56
149
|
(0, interface_api_1.Get)(""),
|
|
57
|
-
__param(0, (0,
|
|
58
|
-
__param(1, (0, interface_api_1.
|
|
59
|
-
__param(2, (0, interface_api_1.Parameter)("period", "query")),
|
|
60
|
-
__param(3, (0, interface_api_1.Parameter)("method", "query")),
|
|
61
|
-
__param(4, (0, interface_api_1.Parameter)("status", "query")),
|
|
62
|
-
__param(5, (0, interface_api_1.Parameter)("search", "query")),
|
|
63
|
-
__param(6, (0, interface_api_1.Parameter)("cursor", "query")),
|
|
64
|
-
__param(7, (0, interface_api_1.Parameter)("limit", "query")),
|
|
150
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(logs_1.LogsPage.requests)),
|
|
151
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
65
152
|
__metadata("design:type", Function),
|
|
66
|
-
__metadata("design:paramtypes", [Function,
|
|
153
|
+
__metadata("design:paramtypes", [Function, Object]),
|
|
67
154
|
__metadata("design:returntype", Promise)
|
|
68
155
|
], LogsController.prototype, "listLogs", null);
|
|
156
|
+
__decorate([
|
|
157
|
+
(0, interface_api_1.Get)("recent"),
|
|
158
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(overviewTable)),
|
|
159
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
160
|
+
__metadata("design:type", Function),
|
|
161
|
+
__metadata("design:paramtypes", [Function, Object]),
|
|
162
|
+
__metadata("design:returntype", Promise)
|
|
163
|
+
], LogsController.prototype, "listRecent", null);
|
|
164
|
+
__decorate([
|
|
165
|
+
(0, interface_api_1.Get)("routes"),
|
|
166
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(routesTable)),
|
|
167
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
168
|
+
__metadata("design:type", Function),
|
|
169
|
+
__metadata("design:paramtypes", [Function, Object]),
|
|
170
|
+
__metadata("design:returntype", Promise)
|
|
171
|
+
], LogsController.prototype, "listForRoutes", null);
|
|
172
|
+
__decorate([
|
|
173
|
+
(0, interface_api_1.Get)("tester"),
|
|
174
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(tester_1.testerBlock)),
|
|
175
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
176
|
+
__metadata("design:type", Function),
|
|
177
|
+
__metadata("design:paramtypes", [Function, Object]),
|
|
178
|
+
__metadata("design:returntype", Promise)
|
|
179
|
+
], LogsController.prototype, "listForTester", null);
|
|
180
|
+
__decorate([
|
|
181
|
+
(0, interface_api_1.Get)("live"),
|
|
182
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(logs_1.LogsPage.live)),
|
|
183
|
+
__metadata("design:type", Function),
|
|
184
|
+
__metadata("design:paramtypes", [Function]),
|
|
185
|
+
__metadata("design:returntype", Promise)
|
|
186
|
+
], LogsController.prototype, "getLive", null);
|
|
187
|
+
__decorate([
|
|
188
|
+
(0, interface_api_1.Get)("recent/:id"),
|
|
189
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(overviewTable)),
|
|
190
|
+
__param(1, (0, interface_api_1.Parameter)("id", "param")),
|
|
191
|
+
__metadata("design:type", Function),
|
|
192
|
+
__metadata("design:paramtypes", [Function, String]),
|
|
193
|
+
__metadata("design:returntype", Promise)
|
|
194
|
+
], LogsController.prototype, "getRecentLog", null);
|
|
195
|
+
__decorate([
|
|
196
|
+
(0, interface_api_1.Get)("tester/:id"),
|
|
197
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(tester_1.testerBlock)),
|
|
198
|
+
__param(1, (0, interface_api_1.Parameter)("id", "param")),
|
|
199
|
+
__metadata("design:type", Function),
|
|
200
|
+
__metadata("design:paramtypes", [Function, String]),
|
|
201
|
+
__metadata("design:returntype", Promise)
|
|
202
|
+
], LogsController.prototype, "getTesterLog", null);
|
|
203
|
+
__decorate([
|
|
204
|
+
(0, interface_api_1.Get)("routes/:id"),
|
|
205
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(routesTable)),
|
|
206
|
+
__param(1, (0, interface_api_1.Parameter)("id", "param")),
|
|
207
|
+
__metadata("design:type", Function),
|
|
208
|
+
__metadata("design:paramtypes", [Function, String]),
|
|
209
|
+
__metadata("design:returntype", Promise)
|
|
210
|
+
], LogsController.prototype, "getRoutesLog", null);
|
|
69
211
|
__decorate([
|
|
70
212
|
(0, interface_api_1.Get)(":id"),
|
|
71
|
-
__param(0, (0,
|
|
213
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(logs_1.LogsPage.requests)),
|
|
72
214
|
__param(1, (0, interface_api_1.Parameter)("id", "param")),
|
|
73
215
|
__metadata("design:type", Function),
|
|
74
216
|
__metadata("design:paramtypes", [Function, String]),
|
|
75
217
|
__metadata("design:returntype", Promise)
|
|
76
218
|
], LogsController.prototype, "getLog", null);
|
|
77
|
-
exports.LogsController = LogsController = __decorate([
|
|
78
|
-
(0, auth_1.AuthOwnerOnly)()
|
|
79
|
-
], LogsController);
|
|
80
|
-
function buildLogFilters(params, slowThresholdMs) {
|
|
81
|
-
const resolvedTab = params.tab in TAB_FILTERS ? params.tab : "requests";
|
|
82
|
-
const filters = {
|
|
83
|
-
...TAB_FILTERS[resolvedTab],
|
|
84
|
-
method: params.method,
|
|
85
|
-
search: params.search,
|
|
86
|
-
cursor: params.cursor,
|
|
87
|
-
limit: parseLimit(params.limit),
|
|
88
|
-
};
|
|
89
|
-
if (params.status) {
|
|
90
|
-
if (STATUS_CLASSES.has(params.status)) {
|
|
91
|
-
filters.statusClass = params.status;
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
const n = parseInt(params.status, 10);
|
|
95
|
-
if (!Number.isNaN(n)) {
|
|
96
|
-
filters.statusMin = n;
|
|
97
|
-
filters.statusMax = n;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
if (params.period) {
|
|
102
|
-
const ms = periodToMs(params.period);
|
|
103
|
-
if (ms !== undefined)
|
|
104
|
-
filters.since = new Date(Date.now() - ms);
|
|
105
|
-
}
|
|
106
|
-
if (resolvedTab === "slow") {
|
|
107
|
-
filters.slowThresholdMs = slowThresholdMs;
|
|
108
|
-
}
|
|
109
|
-
return filters;
|
|
110
|
-
}
|
|
111
|
-
function parseLimit(raw) {
|
|
112
|
-
if (!raw)
|
|
113
|
-
return undefined;
|
|
114
|
-
const n = parseInt(raw, 10);
|
|
115
|
-
if (Number.isNaN(n) || n <= 0)
|
|
116
|
-
return undefined;
|
|
117
|
-
return n;
|
|
118
|
-
}
|
|
119
|
-
function periodToMs(period) {
|
|
120
|
-
const m = period.match(/^(\d+)([smhd])$/);
|
|
121
|
-
if (!m)
|
|
122
|
-
return undefined;
|
|
123
|
-
const n = parseInt(m[1], 10);
|
|
124
|
-
if (n <= 0)
|
|
125
|
-
return undefined;
|
|
126
|
-
return n * PERIOD_UNIT_MS[m[2]];
|
|
127
|
-
}
|
|
128
219
|
//# sourceMappingURL=logs.js.map
|
package/dist/routes/logs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../src/routes/logs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../src/routes/logs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAMmC;AACnC,uEAAwD;AACxD,6FAAqE;AAErE,6DAA0E;AAC1E,qCAAqC;AACrC,6BAAyE;AACzE,iFAAyE;AACzE,uCAAwC;AACxC,+CAAgD;AAChD,2CAA4C;AAC5C,sDAAkD;AAClD,4CAA6E;AAC7E,8CAAkD;AAClD,0DAA0E;AAC1E,sDAA6E;AAC7E,sDAIqC;AACrC,4CAAsD;AACtD,kDAAqD;AACrD,qCAAiD;AACjD,0CAAiD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;6CAKnD;AAOK;IADL,IAAA,mBAAG,EAAC,YAAY,CAAC;IAEf,WAAA,IAAA,+BAAsB,EAAC,aAAa,CAAC,CAAA;IACrC,WAAA,IAAA,yBAAS,EAAC,IAAI,EAAE,OAAO,CAAC,CAAA;;;;kDAG1B;AAIK;IADL,IAAA,mBAAG,EAAC,YAAY,CAAC;IAEf,WAAA,IAAA,+BAAsB,EAAC,oBAAM,CAAC,CAAA;IAC9B,WAAA,IAAA,yBAAS,EAAC,IAAI,EAAE,OAAO,CAAC,CAAA;;;;kDAG1B;AAIK;IADL,IAAA,mBAAG,EAAC,YAAY,CAAC;IAEf,WAAA,IAAA,+BAAsB,EAAC,WAAW,CAAC,CAAA;IACnC,WAAA,IAAA,yBAAS,EAAC,IAAI,EAAE,OAAO,CAAC,CAAA;;;;kDAG1B;AAGK;IADL,IAAA,mBAAG,EAAC,KAAK,CAAC;IAER,WAAA,IAAA,+BAAsB,EAAC,eAAQ,CAAC,QAAQ,CAAC,CAAA;IACzC,WAAA,IAAA,yBAAS,EAAC,IAAI,EAAE,OAAO,CAAC,CAAA;;;;4CAG1B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type RequestContext } from "@antelopejs/interface-api";
|
|
2
|
+
import type { User } from "@antelopejs/interface-dms/auth/db";
|
|
3
|
+
declare const OverviewController_base: import("@antelopejs/interface-api").ControllerClass<object>;
|
|
4
|
+
export declare class OverviewController extends OverviewController_base {
|
|
5
|
+
getHealth(_user: User): Promise<import("@/services/overview").HealthPayload>;
|
|
6
|
+
getTraffic(_user: User, context: RequestContext): Promise<import("@/services/overview").ChartCardPayload>;
|
|
7
|
+
getClasses(_user: User, context: RequestContext): Promise<{
|
|
8
|
+
items: import("@/services/overview").StatusClassItem[];
|
|
9
|
+
total: number;
|
|
10
|
+
window: import("@/services/window").WindowInfo;
|
|
11
|
+
}>;
|
|
12
|
+
getErrorShare(_user: User, context: RequestContext): Promise<import("@/services/overview").ChartCardPayload>;
|
|
13
|
+
getAttention(_user: User, context: RequestContext): Promise<import("@/services/attention").AttentionPayload>;
|
|
14
|
+
getSlowest(_user: User, context: RequestContext): Promise<{
|
|
15
|
+
items: import("@/services/overview").SlowRouteItem[];
|
|
16
|
+
window: import("@/services/window").WindowInfo;
|
|
17
|
+
}>;
|
|
18
|
+
getActivity(_user: User): Promise<{
|
|
19
|
+
items: import("@/services/overview").FeedItemPayload[];
|
|
20
|
+
window: {
|
|
21
|
+
preset: import("@/services/window").WindowPreset;
|
|
22
|
+
from: string;
|
|
23
|
+
to: string;
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.OverviewController = void 0;
|
|
16
|
+
const interface_api_1 = require("@antelopejs/interface-api");
|
|
17
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
18
|
+
const guards_1 = require("@antelopejs/interface-dms/guards");
|
|
19
|
+
const db_1 = require("@/db");
|
|
20
|
+
const overview_1 = require("@/pages/overview");
|
|
21
|
+
const activity_1 = require("@/services/activity");
|
|
22
|
+
const attention_1 = require("@/services/attention");
|
|
23
|
+
const overview_2 = require("@/services/overview");
|
|
24
|
+
const route_catalog_1 = require("@/services/route-catalog");
|
|
25
|
+
const scope_1 = require("@/services/scope");
|
|
26
|
+
const settings_1 = require("@/services/settings");
|
|
27
|
+
const window_1 = require("@/services/window");
|
|
28
|
+
const MAX_ATTENTION_LIMIT = 100;
|
|
29
|
+
function models() {
|
|
30
|
+
return {
|
|
31
|
+
logs: (0, interface_database_decorators_1.GetModel)(db_1.RequestLogModel),
|
|
32
|
+
stats: (0, interface_database_decorators_1.GetModel)(db_1.RouteStatisticsModel),
|
|
33
|
+
routes: (0, interface_database_decorators_1.GetModel)(db_1.RouteModel),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function scopeKeys() {
|
|
37
|
+
return (0, scope_1.getScopedRouteKeys)((0, interface_database_decorators_1.GetModel)(db_1.RouteModel), (0, settings_1.getActiveScope)());
|
|
38
|
+
}
|
|
39
|
+
async function currentHealth() {
|
|
40
|
+
const keys = await scopeKeys();
|
|
41
|
+
return (0, overview_2.getHealth)(models(), keys, (0, route_catalog_1.countRoutes)(keys));
|
|
42
|
+
}
|
|
43
|
+
function windowOf(context) {
|
|
44
|
+
return (0, window_1.resolveWindow)((0, window_1.windowQueryFrom)(context.url.searchParams), window_1.DEFAULT_WINDOW);
|
|
45
|
+
}
|
|
46
|
+
function attentionLimit(context) {
|
|
47
|
+
const raw = Number(context.url.searchParams.get("limit"));
|
|
48
|
+
return Number.isInteger(raw) && raw > 0
|
|
49
|
+
? Math.min(raw, MAX_ATTENTION_LIMIT)
|
|
50
|
+
: attention_1.ATTENTION_LIMIT;
|
|
51
|
+
}
|
|
52
|
+
const grid = overview_1.OverviewPage.dashboard;
|
|
53
|
+
class OverviewController extends (0, interface_api_1.Controller)("/api/monitoring/overview") {
|
|
54
|
+
async getHealth(_user) {
|
|
55
|
+
return currentHealth();
|
|
56
|
+
}
|
|
57
|
+
async getTraffic(_user, context) {
|
|
58
|
+
return (0, overview_2.getTrafficChart)(models(), windowOf(context), await scopeKeys());
|
|
59
|
+
}
|
|
60
|
+
async getClasses(_user, context) {
|
|
61
|
+
return (0, overview_2.getStatusClasses)(models(), windowOf(context), await scopeKeys());
|
|
62
|
+
}
|
|
63
|
+
async getErrorShare(_user, context) {
|
|
64
|
+
return (0, overview_2.getErrorShareChart)(models(), windowOf(context), await scopeKeys());
|
|
65
|
+
}
|
|
66
|
+
async getAttention(_user, context) {
|
|
67
|
+
return (0, attention_1.getAttention)(models(), await scopeKeys(), attentionLimit(context));
|
|
68
|
+
}
|
|
69
|
+
async getSlowest(_user, context) {
|
|
70
|
+
return (0, overview_2.getSlowestRoutes)(models(), windowOf(context), await scopeKeys());
|
|
71
|
+
}
|
|
72
|
+
async getActivity(_user) {
|
|
73
|
+
return (0, activity_1.getActivity)(models(), await scopeKeys());
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.OverviewController = OverviewController;
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, interface_api_1.Get)("health"),
|
|
79
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(overview_1.OverviewPage.health)),
|
|
80
|
+
__metadata("design:type", Function),
|
|
81
|
+
__metadata("design:paramtypes", [Function]),
|
|
82
|
+
__metadata("design:returntype", Promise)
|
|
83
|
+
], OverviewController.prototype, "getHealth", null);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, interface_api_1.Get)("traffic"),
|
|
86
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(grid.targetChild("traffic", "chart"))),
|
|
87
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
88
|
+
__metadata("design:type", Function),
|
|
89
|
+
__metadata("design:paramtypes", [Function, Object]),
|
|
90
|
+
__metadata("design:returntype", Promise)
|
|
91
|
+
], OverviewController.prototype, "getTraffic", null);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, interface_api_1.Get)("classes"),
|
|
94
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(grid.targetChild("traffic", "classes"))),
|
|
95
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
96
|
+
__metadata("design:type", Function),
|
|
97
|
+
__metadata("design:paramtypes", [Function, Object]),
|
|
98
|
+
__metadata("design:returntype", Promise)
|
|
99
|
+
], OverviewController.prototype, "getClasses", null);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, interface_api_1.Get)("error-share"),
|
|
102
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(grid.targetChild("health", "errorShare"))),
|
|
103
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
104
|
+
__metadata("design:type", Function),
|
|
105
|
+
__metadata("design:paramtypes", [Function, Object]),
|
|
106
|
+
__metadata("design:returntype", Promise)
|
|
107
|
+
], OverviewController.prototype, "getErrorShare", null);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, interface_api_1.Get)("attention"),
|
|
110
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(grid.targetChild("health", "attention"))),
|
|
111
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
112
|
+
__metadata("design:type", Function),
|
|
113
|
+
__metadata("design:paramtypes", [Function, Object]),
|
|
114
|
+
__metadata("design:returntype", Promise)
|
|
115
|
+
], OverviewController.prototype, "getAttention", null);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, interface_api_1.Get)("slowest"),
|
|
118
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(grid.targetChild("health", "slowest"))),
|
|
119
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
120
|
+
__metadata("design:type", Function),
|
|
121
|
+
__metadata("design:paramtypes", [Function, Object]),
|
|
122
|
+
__metadata("design:returntype", Promise)
|
|
123
|
+
], OverviewController.prototype, "getSlowest", null);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, interface_api_1.Get)("activity"),
|
|
126
|
+
__param(0, (0, guards_1.AuthUserWithPermission)(grid.targetChild("recent", "activity"))),
|
|
127
|
+
__metadata("design:type", Function),
|
|
128
|
+
__metadata("design:paramtypes", [Function]),
|
|
129
|
+
__metadata("design:returntype", Promise)
|
|
130
|
+
], OverviewController.prototype, "getActivity", null);
|
|
131
|
+
//# sourceMappingURL=overview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overview.js","sourceRoot":"","sources":["../../src/routes/overview.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAKmC;AACnC,6FAAqE;AAErE,6DAA0E;AAC1E,6BAAyE;AACzE,+CAAgD;AAChD,kDAAkD;AAClD,oDAAqE;AACrE,kDAO6B;AAC7B,4DAAuD;AACvD,4CAAsD;AACtD,kDAAqD;AACrD,8CAK2B;AAG3B,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC,SAAS,MAAM;IACb,OAAO;QACL,IAAI,EAAE,IAAA,wCAAQ,EAAC,oBAAe,CAAC;QAC/B,KAAK,EAAE,IAAA,wCAAQ,EAAC,yBAAoB,CAAC;QACrC,MAAM,EAAE,IAAA,wCAAQ,EAAC,eAAU,CAAC;KAC7B,CAAC;AACJ,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,IAAA,0BAAkB,EAAC,IAAA,wCAAQ,EAAC,eAAU,CAAC,EAAE,IAAA,yBAAc,GAAE,CAAC,CAAC;AACpE,CAAC;AAED,KAAK,UAAU,aAAa;IAC1B,MAAM,IAAI,GAAG,MAAM,SAAS,EAAE,CAAC;IAC/B,OAAO,IAAA,oBAAS,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAA,2BAAW,EAAC,IAAI,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,QAAQ,CAAC,OAAuB;IACvC,OAAO,IAAA,sBAAa,EAClB,IAAA,wBAAe,EAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EACzC,uBAAc,CACf,CAAC;AACJ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AG,EAAC,SAAS,CAAC;IAEZ,WAAA,IAAA,+BAAsB,EAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAA;IAC7D,WAAA,IAAA,uBAAO,GAAE,CAAA;;;;oDAGX;AAGK;IADL,IAAA,mBAAG,EAAC,UAAU,CAAC;IAEb,WAAA,IAAA,+BAAsB,EAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAA;;;;qDAIhE"}
|
package/dist/routes/routes.d.ts
CHANGED
|
@@ -1,37 +1,101 @@
|
|
|
1
|
+
import { type RequestContext } from "@antelopejs/interface-api";
|
|
1
2
|
import type { User } from "@antelopejs/interface-dms/auth/db";
|
|
3
|
+
import { type EmptyChartPayload, type LatencyChartPayload, type RouteActivityPayload, type RouteChartPayload, type RouteSummaryPayload } from "@/services/route-statistics";
|
|
2
4
|
declare const RoutesController_base: import("@antelopejs/interface-api").ControllerClass<object>;
|
|
3
5
|
export declare class RoutesController extends RoutesController_base {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
errorCodes: import("@/services/introspection").InferredErrorCode[];
|
|
18
|
-
}>;
|
|
19
|
-
getRouteConfig(_user: User, id: string): Promise<import("@/services/introspection").RouteInspection>;
|
|
20
|
-
getRouteStats(_user: User, id: string, period?: string): Promise<{
|
|
21
|
-
route: {
|
|
22
|
-
id: string;
|
|
23
|
-
location: string;
|
|
6
|
+
listRoutes(_user: User): Promise<{
|
|
7
|
+
routes: {
|
|
8
|
+
requests: number;
|
|
9
|
+
state: import("../services/route-health").RouteState;
|
|
10
|
+
verdict: import("@/services/health-rules").HealthVerdict;
|
|
11
|
+
incident: {
|
|
12
|
+
start: string | null;
|
|
13
|
+
end: string | null;
|
|
14
|
+
} | null;
|
|
15
|
+
p95Ms: number | null;
|
|
16
|
+
firstCallAt: string | null;
|
|
17
|
+
lastCallAt: string | null;
|
|
18
|
+
ref: string;
|
|
24
19
|
method: string;
|
|
20
|
+
path: string;
|
|
21
|
+
folder: string;
|
|
22
|
+
controller: string | null;
|
|
23
|
+
handler: string;
|
|
24
|
+
}[];
|
|
25
|
+
healthWindowMinutes: number;
|
|
26
|
+
requestsWindowMinutes: number;
|
|
27
|
+
healthWindow: {
|
|
28
|
+
from: string;
|
|
29
|
+
to: string;
|
|
30
|
+
minutes: number;
|
|
25
31
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
thresholds: {
|
|
33
|
+
readonly degradedServerErrorRate: 1;
|
|
34
|
+
readonly downServerErrorRate: number;
|
|
35
|
+
readonly windowMinutes: 15;
|
|
36
|
+
readonly downWindowMinutes: 5;
|
|
37
|
+
readonly minRequests: 20;
|
|
38
|
+
readonly recoveryMinutes: 15;
|
|
39
|
+
readonly lookbackMinutes: number;
|
|
40
|
+
readonly clientErrorRate: number;
|
|
41
|
+
readonly slowCallRate: 5;
|
|
42
|
+
};
|
|
43
|
+
}>;
|
|
44
|
+
getDetail(_user: User, route?: string): Promise<{
|
|
45
|
+
lastCallAt: string;
|
|
46
|
+
inScope: boolean;
|
|
47
|
+
captured: boolean;
|
|
48
|
+
requests24h: number;
|
|
49
|
+
healthWindowMinutes: number;
|
|
50
|
+
healthWindow: {
|
|
51
|
+
from: string;
|
|
52
|
+
to: string;
|
|
53
|
+
minutes: number;
|
|
30
54
|
};
|
|
31
|
-
|
|
55
|
+
thresholds: {
|
|
56
|
+
readonly degradedServerErrorRate: 1;
|
|
57
|
+
readonly downServerErrorRate: number;
|
|
58
|
+
readonly windowMinutes: 15;
|
|
59
|
+
readonly downWindowMinutes: 5;
|
|
60
|
+
readonly minRequests: 20;
|
|
61
|
+
readonly recoveryMinutes: 15;
|
|
62
|
+
readonly lookbackMinutes: number;
|
|
63
|
+
readonly clientErrorRate: number;
|
|
64
|
+
readonly slowCallRate: 5;
|
|
65
|
+
};
|
|
66
|
+
state: import("../services/route-health").RouteState;
|
|
67
|
+
verdict: import("@/services/health-rules").HealthVerdict;
|
|
68
|
+
incident: {
|
|
69
|
+
start: string | null;
|
|
70
|
+
end: string | null;
|
|
71
|
+
} | null;
|
|
72
|
+
p95Ms: number | null;
|
|
73
|
+
firstCallAt: string | null;
|
|
74
|
+
ref: string;
|
|
75
|
+
method: string;
|
|
76
|
+
path: string;
|
|
77
|
+
folder: string;
|
|
78
|
+
controller: string | null;
|
|
79
|
+
handler: string;
|
|
80
|
+
module: string | null;
|
|
81
|
+
own: boolean | null;
|
|
82
|
+
requiresAuth: boolean;
|
|
83
|
+
auth: import("@/services/route-catalog").RouteAuth;
|
|
84
|
+
registeredAt: string | null;
|
|
85
|
+
pathParams: string[];
|
|
86
|
+
parameters: import("../services/route-contract").DocumentedParameter[];
|
|
87
|
+
pipeline: import("@/services/route-catalog").PipelineStep[];
|
|
88
|
+
inspection: import("../services").RouteInspection;
|
|
89
|
+
contract: import("../services/route-contract").ObservedContract;
|
|
90
|
+
apiOrigin: string | null;
|
|
91
|
+
}>;
|
|
92
|
+
getActivity(_user: User, context: RequestContext): Promise<RouteActivityPayload>;
|
|
93
|
+
getSummary(_user: User, context: RequestContext): Promise<RouteSummaryPayload>;
|
|
94
|
+
getStatusChart(_user: User, context: RequestContext): Promise<RouteChartPayload | EmptyChartPayload>;
|
|
95
|
+
getLatencyChart(_user: User, context: RequestContext): Promise<LatencyChartPayload | EmptyChartPayload>;
|
|
96
|
+
getErrors(_user: User, context: RequestContext): Promise<{
|
|
97
|
+
items: import("@/services/route-statistics").RouteErrorItem[];
|
|
98
|
+
window: import("@/services/window").WindowInfo;
|
|
32
99
|
}>;
|
|
33
|
-
getFolderDoc(_user: User, encodedPath: string): Promise<import("@/services/introspection").FolderInspection>;
|
|
34
|
-
getFolderConfig(_user: User, encodedPath: string): Promise<import("@/services/introspection").FolderInspection>;
|
|
35
|
-
getFolderStats(_user: User, encodedPath: string, period?: string): Promise<import("@/services/statistics-aggregate").FolderAggregate>;
|
|
36
100
|
}
|
|
37
101
|
export {};
|