@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/pages/all.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
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("./logs/page"), exports);
|
|
18
|
-
__exportStar(require("./routes/page"), exports);
|
|
19
|
-
__exportStar(require("./settings/page"), exports);
|
|
20
|
-
__exportStar(require("./summary/page"), exports);
|
|
21
|
-
//# sourceMappingURL=all.js.map
|
package/dist/pages/all.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"all.js","sourceRoot":"","sources":["../../src/pages/all.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,gDAA8B;AAC9B,kDAAgC;AAChC,iDAA+B"}
|
package/dist/pages/logs/page.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.LogsPage = void 0;
|
|
10
|
-
const page_1 = require("@antelopejs/interface-dms/page");
|
|
11
|
-
const custom_1 = require("@antelopejs/interface-dms/base/custom");
|
|
12
|
-
const layouts_1 = require("@antelopejs/interface-dms/base/layouts");
|
|
13
|
-
let LogsPage = class LogsPage extends (0, page_1.PageController)("logs", {
|
|
14
|
-
displayName: "$page.api.logs.title",
|
|
15
|
-
description: "$page.api.logs.description",
|
|
16
|
-
icon: "i-ph-list-magnifying-glass",
|
|
17
|
-
module: "api",
|
|
18
|
-
order: 2,
|
|
19
|
-
}, (0, layouts_1.DefaultLayout)({ hideHeader: true, fullWidth: true, fillHeight: true })) {
|
|
20
|
-
static content = (0, custom_1.CustomComponent)("DmsApiLogsView").meta({
|
|
21
|
-
name: "$page.api.logs.title",
|
|
22
|
-
icon: "i-ph-list-magnifying-glass",
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
exports.LogsPage = LogsPage;
|
|
26
|
-
exports.LogsPage = LogsPage = __decorate([
|
|
27
|
-
(0, page_1.RegisterPage)()
|
|
28
|
-
], LogsPage);
|
|
29
|
-
//# sourceMappingURL=page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/pages/logs/page.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8E;AAC9E,kEAAwE;AACxE,oEAAuE;AAYhE,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,IAAA,qBAAc,EAC1C,MAAM,EACN;IACE,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,4BAA4B;IACzC,IAAI,EAAE,4BAA4B;IAClC,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,CAAC;CACT,EACD,IAAA,uBAAa,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CACvE;IACC,MAAM,CAAC,OAAO,GAAG,IAAA,wBAAe,EAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC;QACtD,IAAI,EAAE,sBAAsB;QAC5B,IAAI,EAAE,4BAA4B;KACnC,CAAC,CAAC;;AAdQ,4BAAQ;mBAAR,QAAQ;IADpB,IAAA,mBAAY,GAAE;GACF,QAAQ,CAepB"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
declare const RoutesPage_base: {
|
|
2
|
-
new (...args: any[]): {};
|
|
3
|
-
extend: <T extends import("@antelopejs/interface-api").ControllerClass>(this: T, location: string) => T;
|
|
4
|
-
location: string;
|
|
5
|
-
};
|
|
6
|
-
export declare class RoutesPage extends RoutesPage_base {
|
|
7
|
-
static content: import("@antelopejs/interface-dms").ComponentBuilder<unknown>;
|
|
8
|
-
}
|
|
9
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.RoutesPage = void 0;
|
|
10
|
-
const page_1 = require("@antelopejs/interface-dms/page");
|
|
11
|
-
const custom_1 = require("@antelopejs/interface-dms/base/custom");
|
|
12
|
-
const layouts_1 = require("@antelopejs/interface-dms/base/layouts");
|
|
13
|
-
let RoutesPage = class RoutesPage extends (0, page_1.PageController)("routes", {
|
|
14
|
-
displayName: "$page.api.routes.title",
|
|
15
|
-
description: "$page.api.routes.description",
|
|
16
|
-
icon: "i-ph-tree-structure",
|
|
17
|
-
module: "api",
|
|
18
|
-
order: 1,
|
|
19
|
-
}, (0, layouts_1.DefaultLayout)({ hideHeader: true, fullWidth: true, fillHeight: true })) {
|
|
20
|
-
static content = (0, custom_1.CustomComponent)("DmsApiRoutesView").meta({
|
|
21
|
-
name: "$page.api.routes.title",
|
|
22
|
-
icon: "i-ph-tree-structure",
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
exports.RoutesPage = RoutesPage;
|
|
26
|
-
exports.RoutesPage = RoutesPage = __decorate([
|
|
27
|
-
(0, page_1.RegisterPage)()
|
|
28
|
-
], RoutesPage);
|
|
29
|
-
//# sourceMappingURL=page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/pages/routes/page.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8E;AAC9E,kEAAwE;AACxE,oEAAuE;AAYhE,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,IAAA,qBAAc,EAC5C,QAAQ,EACR;IACE,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,8BAA8B;IAC3C,IAAI,EAAE,qBAAqB;IAC3B,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,CAAC;CACT,EACD,IAAA,uBAAa,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CACvE;IACC,MAAM,CAAC,OAAO,GAAG,IAAA,wBAAe,EAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC;QACxD,IAAI,EAAE,wBAAwB;QAC9B,IAAI,EAAE,qBAAqB;KAC5B,CAAC,CAAC;;AAdQ,gCAAU;qBAAV,UAAU;IADtB,IAAA,mBAAY,GAAE;GACF,UAAU,CAetB"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.apiSettingsFormSchema = exports.apiSettingsForm = void 0;
|
|
4
|
-
const base_1 = require("@antelopejs/interface-dms/base");
|
|
5
|
-
const default_types_1 = require("@antelopejs/interface-dms/base/data-types/default-types");
|
|
6
|
-
const types_1 = require("@antelopejs/interface-dms/base/types");
|
|
7
|
-
exports.apiSettingsForm = (0, base_1.Form)({
|
|
8
|
-
fields: [
|
|
9
|
-
{
|
|
10
|
-
id: "scope-group",
|
|
11
|
-
label: "$page.api.settings.scope.title",
|
|
12
|
-
description: "$page.api.settings.scope.subtitle",
|
|
13
|
-
fields: [
|
|
14
|
-
{
|
|
15
|
-
id: "scope",
|
|
16
|
-
label: "$page.api.settings.scope.label",
|
|
17
|
-
description: "$page.api.settings.scope.description",
|
|
18
|
-
type: new default_types_1.DefaultDataTypes.SelectType({
|
|
19
|
-
items: [
|
|
20
|
-
{ value: "own", label: "Own routes" },
|
|
21
|
-
{ value: "modules", label: "Module routes" },
|
|
22
|
-
{ value: "all", label: "All routes" },
|
|
23
|
-
],
|
|
24
|
-
deselectable: false,
|
|
25
|
-
}),
|
|
26
|
-
required: true,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
id: "requestLogRetentionDays",
|
|
32
|
-
label: "$page.api.settings.retention.log_retention",
|
|
33
|
-
description: "$page.api.settings.retention.log_retention_description",
|
|
34
|
-
type: new default_types_1.DefaultDataTypes.NumberType({
|
|
35
|
-
min: 1,
|
|
36
|
-
max: 366,
|
|
37
|
-
step: 1,
|
|
38
|
-
placeholder: "30",
|
|
39
|
-
}),
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
id: "statisticsLifetimeDays",
|
|
43
|
-
label: "$page.api.settings.retention.stats_retention",
|
|
44
|
-
description: "$page.api.settings.retention.stats_retention_description",
|
|
45
|
-
type: new default_types_1.DefaultDataTypes.NumberType({
|
|
46
|
-
min: 1,
|
|
47
|
-
max: 366,
|
|
48
|
-
step: 1,
|
|
49
|
-
placeholder: "30",
|
|
50
|
-
}),
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
id: "requestSlownessThresholdMs",
|
|
54
|
-
label: "$page.api.settings.retention.slowness",
|
|
55
|
-
description: "$page.api.settings.retention.slowness_description",
|
|
56
|
-
type: new default_types_1.DefaultDataTypes.NumberType({
|
|
57
|
-
min: 1,
|
|
58
|
-
max: 600_000,
|
|
59
|
-
step: 50,
|
|
60
|
-
placeholder: "1000",
|
|
61
|
-
}),
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: "requestLogMaxBodyKb",
|
|
65
|
-
label: "$page.api.settings.retention.max_body",
|
|
66
|
-
description: "$page.api.settings.retention.max_body_description",
|
|
67
|
-
type: new default_types_1.DefaultDataTypes.NumberType({
|
|
68
|
-
min: 0,
|
|
69
|
-
max: 10_240,
|
|
70
|
-
step: 1,
|
|
71
|
-
placeholder: "64",
|
|
72
|
-
}),
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
fetchUrl: "/api/monitoring/settings",
|
|
76
|
-
submitUrl: "/api/monitoring/settings",
|
|
77
|
-
submitUrlMethod: types_1.HttpMethod.post,
|
|
78
|
-
});
|
|
79
|
-
exports.apiSettingsFormSchema = (0, base_1.formSchema)(exports.apiSettingsForm);
|
|
80
|
-
//# sourceMappingURL=form.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../../src/pages/settings/form.ts"],"names":[],"mappings":";;;AAAA,yDAAkE;AAClE,2FAA2F;AAC3F,gEAAkE;AAarD,QAAA,eAAe,GAAG,IAAA,WAAI,EAAC;IAClC,MAAM,EAAE;QACN;YACE,EAAE,EAAE,aAAa;YACjB,KAAK,EAAE,gCAAgC;YACvC,WAAW,EAAE,mCAAmC;YAChD,MAAM,EAAE;gBACN;oBACE,EAAE,EAAE,OAAO;oBACX,KAAK,EAAE,gCAAgC;oBACvC,WAAW,EAAE,sCAAsC;oBACnD,IAAI,EAAE,IAAI,gCAAgB,CAAC,UAAU,CAAC;wBACpC,KAAK,EAAE;4BACL,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE;4BACrC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE;4BAC5C,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE;yBACtC;wBACD,YAAY,EAAE,KAAK;qBACpB,CAAC;oBACF,QAAQ,EAAE,IAAI;iBACf;aACF;SACF;QACD;YACE,EAAE,EAAE,yBAAyB;YAC7B,KAAK,EAAE,4CAA4C;YACnD,WAAW,EAAE,wDAAwD;YACrE,IAAI,EAAE,IAAI,gCAAgB,CAAC,UAAU,CAAC;gBACpC,GAAG,EAAE,CAAC;gBACN,GAAG,EAAE,GAAG;gBACR,IAAI,EAAE,CAAC;gBACP,WAAW,EAAE,IAAI;aAClB,CAAC;SACH;QACD;YACE,EAAE,EAAE,wBAAwB;YAC5B,KAAK,EAAE,8CAA8C;YACrD,WAAW,EAAE,0DAA0D;YACvE,IAAI,EAAE,IAAI,gCAAgB,CAAC,UAAU,CAAC;gBACpC,GAAG,EAAE,CAAC;gBACN,GAAG,EAAE,GAAG;gBACR,IAAI,EAAE,CAAC;gBACP,WAAW,EAAE,IAAI;aAClB,CAAC;SACH;QACD;YACE,EAAE,EAAE,4BAA4B;YAChC,KAAK,EAAE,uCAAuC;YAC9C,WAAW,EAAE,mDAAmD;YAChE,IAAI,EAAE,IAAI,gCAAgB,CAAC,UAAU,CAAC;gBACpC,GAAG,EAAE,CAAC;gBACN,GAAG,EAAE,OAAO;gBACZ,IAAI,EAAE,EAAE;gBACR,WAAW,EAAE,MAAM;aACpB,CAAC;SACH;QACD;YACE,EAAE,EAAE,qBAAqB;YACzB,KAAK,EAAE,uCAAuC;YAC9C,WAAW,EAAE,mDAAmD;YAChE,IAAI,EAAE,IAAI,gCAAgB,CAAC,UAAU,CAAC;gBACpC,GAAG,EAAE,CAAC;gBACN,GAAG,EAAE,MAAM;gBACX,IAAI,EAAE,CAAC;gBACP,WAAW,EAAE,IAAI;aAClB,CAAC;SACH;KACF;IACD,QAAQ,EAAE,0BAA0B;IACpC,SAAS,EAAE,0BAA0B;IACrC,eAAe,EAAE,kBAAU,CAAC,IAAI;CACjC,CAAC,CAAC;AAEU,QAAA,qBAAqB,GAChC,IAAA,iBAAU,EAAC,uBAAe,CAAC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
declare const ApiSettingsPage_base: {
|
|
2
|
-
new (...args: any[]): {};
|
|
3
|
-
extend: <T extends import("@antelopejs/interface-api").ControllerClass>(this: T, location: string) => T;
|
|
4
|
-
location: string;
|
|
5
|
-
};
|
|
6
|
-
export declare class ApiSettingsPage extends ApiSettingsPage_base {
|
|
7
|
-
static content: import("@antelopejs/interface-dms/base").FormBuilder;
|
|
8
|
-
}
|
|
9
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.ApiSettingsPage = void 0;
|
|
10
|
-
const page_1 = require("@antelopejs/interface-dms/page");
|
|
11
|
-
const layouts_1 = require("@antelopejs/interface-dms/base/layouts");
|
|
12
|
-
const form_1 = require("./form");
|
|
13
|
-
let ApiSettingsPage = class ApiSettingsPage extends (0, page_1.PageController)("settings", {
|
|
14
|
-
displayName: "$page.api.settings.title",
|
|
15
|
-
description: "$page.api.settings.description",
|
|
16
|
-
icon: "i-ph-gear",
|
|
17
|
-
module: "api",
|
|
18
|
-
order: 3,
|
|
19
|
-
}, (0, layouts_1.DefaultLayout)()) {
|
|
20
|
-
static content = form_1.apiSettingsForm;
|
|
21
|
-
};
|
|
22
|
-
exports.ApiSettingsPage = ApiSettingsPage;
|
|
23
|
-
exports.ApiSettingsPage = ApiSettingsPage = __decorate([
|
|
24
|
-
(0, page_1.RegisterPage)()
|
|
25
|
-
], ApiSettingsPage);
|
|
26
|
-
//# sourceMappingURL=page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/pages/settings/page.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8E;AAC9E,oEAAuE;AACvE,iCAAyC;AAWlC,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,IAAA,qBAAc,EACjD,UAAU,EACV;IACE,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,gCAAgC;IAC7C,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,CAAC;CACT,EACD,IAAA,uBAAa,GAAE,CAChB;IACC,MAAM,CAAC,OAAO,GAAG,sBAAe,CAAC;;AAXtB,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAY,GAAE;GACF,eAAe,CAY3B"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
declare const SummaryPage_base: {
|
|
2
|
-
new (...args: any[]): {};
|
|
3
|
-
extend: <T extends import("@antelopejs/interface-api").ControllerClass>(this: T, location: string) => T;
|
|
4
|
-
location: string;
|
|
5
|
-
};
|
|
6
|
-
export declare class SummaryPage extends SummaryPage_base {
|
|
7
|
-
static content: import("@antelopejs/interface-dms").ComponentBuilder<unknown>;
|
|
8
|
-
}
|
|
9
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.SummaryPage = void 0;
|
|
10
|
-
const page_1 = require("@antelopejs/interface-dms/page");
|
|
11
|
-
const custom_1 = require("@antelopejs/interface-dms/base/custom");
|
|
12
|
-
const layouts_1 = require("@antelopejs/interface-dms/base/layouts");
|
|
13
|
-
let SummaryPage = class SummaryPage extends (0, page_1.PageController)("summary", {
|
|
14
|
-
displayName: "$page.api.summary.title",
|
|
15
|
-
description: "$page.api.summary.description",
|
|
16
|
-
icon: "i-ph-chart-line",
|
|
17
|
-
module: "api",
|
|
18
|
-
order: 0,
|
|
19
|
-
}, (0, layouts_1.DefaultLayout)({ hideHeader: true, fullWidth: true })) {
|
|
20
|
-
static content = (0, custom_1.CustomComponent)("DmsApiSummaryView").meta({
|
|
21
|
-
name: "$page.api.summary.title",
|
|
22
|
-
icon: "i-ph-chart-line",
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
exports.SummaryPage = SummaryPage;
|
|
26
|
-
exports.SummaryPage = SummaryPage = __decorate([
|
|
27
|
-
(0, page_1.RegisterPage)()
|
|
28
|
-
], SummaryPage);
|
|
29
|
-
//# sourceMappingURL=page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/pages/summary/page.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8E;AAC9E,kEAAwE;AACxE,oEAAuE;AAYhE,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,IAAA,qBAAc,EAC7C,SAAS,EACT;IACE,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,+BAA+B;IAC5C,IAAI,EAAE,iBAAiB;IACvB,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,CAAC;CACT,EACD,IAAA,uBAAa,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CACrD;IACC,MAAM,CAAC,OAAO,GAAG,IAAA,wBAAe,EAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC;QACzD,IAAI,EAAE,yBAAyB;QAC/B,IAAI,EAAE,iBAAiB;KACxB,CAAC,CAAC;;AAdQ,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAY,GAAE;GACF,WAAW,CAevB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { User } from "@antelopejs/interface-dms/auth/db";
|
|
2
|
-
import { type HistoryPoint, type RouteAggregate } from "@/services/statistics-aggregate";
|
|
3
|
-
declare const MonitoringController_base: import("@antelopejs/interface-api").ControllerClass<object>;
|
|
4
|
-
export declare class MonitoringController extends MonitoringController_base {
|
|
5
|
-
getMonitoring(_user: User, period?: string, route?: string): Promise<{
|
|
6
|
-
period: {
|
|
7
|
-
granularity: "day" | "hour" | "minute";
|
|
8
|
-
count: number;
|
|
9
|
-
};
|
|
10
|
-
kpis: import("@/services/statistics-aggregate").SummaryKpis;
|
|
11
|
-
history: HistoryPoint[];
|
|
12
|
-
slowest: RouteAggregate[];
|
|
13
|
-
mostErroring: RouteAggregate[];
|
|
14
|
-
recent: import("@/db").RequestLog[];
|
|
15
|
-
}>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,101 +0,0 @@
|
|
|
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.MonitoringController = void 0;
|
|
16
|
-
const interface_api_1 = require("@antelopejs/interface-api");
|
|
17
|
-
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
18
|
-
const auth_1 = require("@antelopejs/interface-dms/auth");
|
|
19
|
-
const db_1 = require("@/db");
|
|
20
|
-
const period_1 = require("@/services/period");
|
|
21
|
-
const read_1 = require("@/services/request-log/read");
|
|
22
|
-
const scope_1 = require("@/services/scope");
|
|
23
|
-
const settings_1 = require("@/services/settings");
|
|
24
|
-
const statistics_aggregate_1 = require("@/services/statistics-aggregate");
|
|
25
|
-
const DEFAULT_DAYS = 7;
|
|
26
|
-
const SLOW_ROUTES_LIMIT = 5;
|
|
27
|
-
const ERROR_ROUTES_LIMIT = 5;
|
|
28
|
-
const RECENT_REQUESTS_LIMIT = 10;
|
|
29
|
-
let MonitoringController = class MonitoringController extends (0, interface_api_1.Controller)("/api/monitoring/metrics") {
|
|
30
|
-
async getMonitoring(_user, period, route) {
|
|
31
|
-
const parsed = resolvePeriod(period);
|
|
32
|
-
const aggregateDays = parsed.granularity === "day" ? parsed.count : 1;
|
|
33
|
-
const routesModel = (0, interface_database_decorators_1.GetModel)(db_1.RouteModel);
|
|
34
|
-
const statsModel = (0, interface_database_decorators_1.GetModel)(db_1.RouteStatisticsModel);
|
|
35
|
-
const logModel = (0, interface_database_decorators_1.GetModel)(db_1.RequestLogModel);
|
|
36
|
-
const keys = await (0, scope_1.getScopedRouteKeys)(routesModel, (0, settings_1.getActiveScope)());
|
|
37
|
-
const [routes, history, aggregates, recentPage] = await Promise.all([
|
|
38
|
-
routesModel.getAll(),
|
|
39
|
-
loadHistory(parsed, logModel, statsModel, keys),
|
|
40
|
-
(0, statistics_aggregate_1.getRouteAggregates)(statsModel, aggregateDays, keys),
|
|
41
|
-
(0, read_1.queryRequestLogsScoped)(logModel, { limit: RECENT_REQUESTS_LIMIT }, keys),
|
|
42
|
-
]);
|
|
43
|
-
const filtered = route
|
|
44
|
-
? aggregates.filter((a) => a.uri === route)
|
|
45
|
-
: aggregates;
|
|
46
|
-
const totalRoutes = keys ? keys.size : routes.length;
|
|
47
|
-
const kpis = await (0, statistics_aggregate_1.getSummaryKpis)(statsModel, totalRoutes, keys);
|
|
48
|
-
return {
|
|
49
|
-
period: {
|
|
50
|
-
granularity: parsed.granularity,
|
|
51
|
-
count: parsed.count,
|
|
52
|
-
},
|
|
53
|
-
kpis,
|
|
54
|
-
history,
|
|
55
|
-
slowest: rankSlowest(filtered),
|
|
56
|
-
mostErroring: rankMostErroring(filtered),
|
|
57
|
-
recent: recentPage.results,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
exports.MonitoringController = MonitoringController;
|
|
62
|
-
__decorate([
|
|
63
|
-
(0, interface_api_1.Get)(""),
|
|
64
|
-
__param(0, (0, auth_1.AuthRawUser)()),
|
|
65
|
-
__param(1, (0, interface_api_1.Parameter)("period", "query")),
|
|
66
|
-
__param(2, (0, interface_api_1.Parameter)("route", "query")),
|
|
67
|
-
__metadata("design:type", Function),
|
|
68
|
-
__metadata("design:paramtypes", [Function, String, String]),
|
|
69
|
-
__metadata("design:returntype", Promise)
|
|
70
|
-
], MonitoringController.prototype, "getMonitoring", null);
|
|
71
|
-
exports.MonitoringController = MonitoringController = __decorate([
|
|
72
|
-
(0, auth_1.AuthOwnerOnly)()
|
|
73
|
-
], MonitoringController);
|
|
74
|
-
function resolvePeriod(period) {
|
|
75
|
-
return ((0, period_1.parsePeriod)(period) ?? {
|
|
76
|
-
granularity: "day",
|
|
77
|
-
count: (0, period_1.resolvePeriodDays)(undefined, DEFAULT_DAYS),
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function loadHistory(parsed, logModel, statsModel, keys) {
|
|
81
|
-
const byGranularity = {
|
|
82
|
-
minute: () => (0, statistics_aggregate_1.getRequestHistoryMinutely)(logModel, parsed.count, keys),
|
|
83
|
-
hour: () => (0, statistics_aggregate_1.getRequestHistoryHourly)(logModel, parsed.count, keys),
|
|
84
|
-
day: () => (0, statistics_aggregate_1.getRequestHistory)(statsModel, parsed.count, keys),
|
|
85
|
-
};
|
|
86
|
-
return byGranularity[parsed.granularity]();
|
|
87
|
-
}
|
|
88
|
-
function rankSlowest(aggregates) {
|
|
89
|
-
return aggregates
|
|
90
|
-
.slice()
|
|
91
|
-
.sort((a, b) => b.averageLatencyMs - a.averageLatencyMs)
|
|
92
|
-
.slice(0, SLOW_ROUTES_LIMIT);
|
|
93
|
-
}
|
|
94
|
-
function rankMostErroring(aggregates) {
|
|
95
|
-
return aggregates
|
|
96
|
-
.slice()
|
|
97
|
-
.filter((a) => a.errorsClient + a.errorsServer > 0)
|
|
98
|
-
.sort((a, b) => b.errorsClient + b.errorsServer - (a.errorsClient + a.errorsServer))
|
|
99
|
-
.slice(0, ERROR_ROUTES_LIMIT);
|
|
100
|
-
}
|
|
101
|
-
//# sourceMappingURL=monitoring.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"monitoring.js","sourceRoot":"","sources":["../../src/routes/monitoring.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAAuE;AACvE,6FAAqE;AACrE,yDAA4E;AAE5E,6BAAyE;AACzE,8CAI2B;AAC3B,sDAAqE;AACrE,4CAAsD;AACtD,kDAAqD;AACrD,0EAQyC;AAEzC,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAG1B,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,IAAA,0BAAU,EAClD,yBAAyB,CAC1B;IAEO,AAAN,KAAK,CAAC,aAAa,CACF,KAAW,EACI,MAAe,EAChB,KAAc;QAE3C,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACtE,MAAM,WAAW,GAAG,IAAA,wCAAQ,EAAC,eAAU,CAAC,CAAC;QACzC,MAAM,UAAU,GAAG,IAAA,wCAAQ,EAAC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gB,CAAC,UAA4B;IACpD,OAAO,UAAU;SACd,KAAK,EAAE;SACP,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC;SAClD,IAAI,CACH,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACP,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,YAAY,CAAC,CACtE;SACA,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC;AAClC,CAAC"}
|
package/dist/routes/summary.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { User } from "@antelopejs/interface-dms/auth/db";
|
|
2
|
-
declare const SummaryController_base: import("@antelopejs/interface-api").ControllerClass<object>;
|
|
3
|
-
export declare class SummaryController extends SummaryController_base {
|
|
4
|
-
getSummary(_user: User): Promise<{
|
|
5
|
-
kpis: import("@/services/statistics-aggregate").SummaryKpis;
|
|
6
|
-
autoGeneratedCount: number;
|
|
7
|
-
customCount: number;
|
|
8
|
-
}>;
|
|
9
|
-
getHealth(_user: User): Promise<{
|
|
10
|
-
status: "healthy" | "degraded" | "down";
|
|
11
|
-
errorRate: number;
|
|
12
|
-
averageLatencyMs: number;
|
|
13
|
-
uptime: null;
|
|
14
|
-
lastIncidentAt: Date;
|
|
15
|
-
}>;
|
|
16
|
-
getHistory(_user: User, period?: string): Promise<import("@/services/statistics-aggregate").HistoryPoint[]>;
|
|
17
|
-
getStatusBreakdown(_user: User, period?: string): Promise<import("@/services/statistics-aggregate").StatusBreakdown>;
|
|
18
|
-
getWatchList(_user: User, limit?: string): Promise<import("@/services/statistics-aggregate").WatchListItem[]>;
|
|
19
|
-
getActivity(_user: User): Promise<({
|
|
20
|
-
kind: "route-created";
|
|
21
|
-
timestamp: Date;
|
|
22
|
-
method: import("@/types").HttpMethod;
|
|
23
|
-
uri: string;
|
|
24
|
-
} | {
|
|
25
|
-
kind: "error";
|
|
26
|
-
timestamp: Date;
|
|
27
|
-
method: import("@/types").HttpMethod;
|
|
28
|
-
uri: string;
|
|
29
|
-
statusCode: number;
|
|
30
|
-
})[]>;
|
|
31
|
-
}
|
|
32
|
-
export {};
|
package/dist/routes/summary.js
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
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.SummaryController = void 0;
|
|
16
|
-
const interface_api_1 = require("@antelopejs/interface-api");
|
|
17
|
-
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
18
|
-
const auth_1 = require("@antelopejs/interface-dms/auth");
|
|
19
|
-
const db_1 = require("@/db");
|
|
20
|
-
const period_1 = require("@/services/period");
|
|
21
|
-
const read_1 = require("@/services/request-log/read");
|
|
22
|
-
const scope_1 = require("@/services/scope");
|
|
23
|
-
const settings_1 = require("@/services/settings");
|
|
24
|
-
const statistics_aggregate_1 = require("@/services/statistics-aggregate");
|
|
25
|
-
const types_1 = require("@/types");
|
|
26
|
-
const DEFAULT_HISTORY_DAYS = 7;
|
|
27
|
-
const ACTIVITY_LIMIT = 10;
|
|
28
|
-
const WATCH_LIMIT = 4;
|
|
29
|
-
let SummaryController = class SummaryController extends (0, interface_api_1.Controller)("/api/monitoring/summary") {
|
|
30
|
-
async getSummary(_user) {
|
|
31
|
-
const [routes, stats] = models();
|
|
32
|
-
const keys = await (0, scope_1.getScopedRouteKeys)(routes, (0, settings_1.getActiveScope)());
|
|
33
|
-
const total = await countScopedRoutes(routes, keys);
|
|
34
|
-
const kpis = await (0, statistics_aggregate_1.getSummaryKpis)(stats, total, keys);
|
|
35
|
-
return {
|
|
36
|
-
kpis,
|
|
37
|
-
autoGeneratedCount: 0,
|
|
38
|
-
customCount: total,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
async getHealth(_user) {
|
|
42
|
-
const [routes, stats] = models();
|
|
43
|
-
const keys = await (0, scope_1.getScopedRouteKeys)(routes, (0, settings_1.getActiveScope)());
|
|
44
|
-
const total = await countScopedRoutes(routes, keys);
|
|
45
|
-
const kpis = await (0, statistics_aggregate_1.getSummaryKpis)(stats, total, keys);
|
|
46
|
-
const errorRate = kpis.callsToday > 0 ? kpis.errors24h / kpis.callsToday : 0;
|
|
47
|
-
const lastIncident = await findLastIncident(keys);
|
|
48
|
-
return {
|
|
49
|
-
status: pickStatus(errorRate, kpis.slowRoutesCount),
|
|
50
|
-
errorRate,
|
|
51
|
-
averageLatencyMs: kpis.averageLatencyMs,
|
|
52
|
-
uptime: null,
|
|
53
|
-
lastIncidentAt: lastIncident?.timestamp ?? null,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
async getHistory(_user, period) {
|
|
57
|
-
const days = (0, period_1.resolvePeriodDays)(period, DEFAULT_HISTORY_DAYS);
|
|
58
|
-
const keys = await (0, scope_1.getScopedRouteKeys)((0, interface_database_decorators_1.GetModel)(db_1.RouteModel), (0, settings_1.getActiveScope)());
|
|
59
|
-
return (0, statistics_aggregate_1.getRequestHistory)((0, interface_database_decorators_1.GetModel)(db_1.RouteStatisticsModel), days, keys);
|
|
60
|
-
}
|
|
61
|
-
async getStatusBreakdown(_user, period) {
|
|
62
|
-
const days = (0, period_1.parsePeriodDays)(period);
|
|
63
|
-
const keys = await (0, scope_1.getScopedRouteKeys)((0, interface_database_decorators_1.GetModel)(db_1.RouteModel), (0, settings_1.getActiveScope)());
|
|
64
|
-
return (0, statistics_aggregate_1.getStatusBreakdown)((0, interface_database_decorators_1.GetModel)(db_1.RouteStatisticsModel), days, keys);
|
|
65
|
-
}
|
|
66
|
-
async getWatchList(_user, limit) {
|
|
67
|
-
const lim = clampInt(limit, 1, 20, WATCH_LIMIT);
|
|
68
|
-
const keys = await (0, scope_1.getScopedRouteKeys)((0, interface_database_decorators_1.GetModel)(db_1.RouteModel), (0, settings_1.getActiveScope)());
|
|
69
|
-
return (0, statistics_aggregate_1.getWatchList)((0, interface_database_decorators_1.GetModel)(db_1.RouteStatisticsModel), lim, keys);
|
|
70
|
-
}
|
|
71
|
-
async getActivity(_user) {
|
|
72
|
-
const routesModel = (0, interface_database_decorators_1.GetModel)(db_1.RouteModel);
|
|
73
|
-
const keys = await (0, scope_1.getScopedRouteKeys)(routesModel, (0, settings_1.getActiveScope)());
|
|
74
|
-
const errorPage = await (0, read_1.queryRequestLogsScoped)((0, interface_database_decorators_1.GetModel)(db_1.RequestLogModel), {
|
|
75
|
-
statusClass: "server-error",
|
|
76
|
-
limit: ACTIVITY_LIMIT,
|
|
77
|
-
}, keys);
|
|
78
|
-
const routes = await routesModel.getAll();
|
|
79
|
-
const recentRoutes = routes
|
|
80
|
-
.filter((r) => !keys || keys.has(`${r.method.toUpperCase()}:${r.uri}`))
|
|
81
|
-
.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime())
|
|
82
|
-
.slice(0, ACTIVITY_LIMIT)
|
|
83
|
-
.map((r) => ({
|
|
84
|
-
kind: "route-created",
|
|
85
|
-
timestamp: r.createdAt,
|
|
86
|
-
method: r.method,
|
|
87
|
-
uri: r.uri,
|
|
88
|
-
}));
|
|
89
|
-
const errors = errorPage.results.map((l) => ({
|
|
90
|
-
kind: "error",
|
|
91
|
-
timestamp: l.timestamp,
|
|
92
|
-
method: l.method,
|
|
93
|
-
uri: l.uri,
|
|
94
|
-
statusCode: l.statusCode,
|
|
95
|
-
}));
|
|
96
|
-
return [...recentRoutes, ...errors]
|
|
97
|
-
.sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime())
|
|
98
|
-
.slice(0, ACTIVITY_LIMIT);
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
exports.SummaryController = SummaryController;
|
|
102
|
-
__decorate([
|
|
103
|
-
(0, interface_api_1.Get)(""),
|
|
104
|
-
__param(0, (0, auth_1.AuthRawUser)()),
|
|
105
|
-
__metadata("design:type", Function),
|
|
106
|
-
__metadata("design:paramtypes", [Function]),
|
|
107
|
-
__metadata("design:returntype", Promise)
|
|
108
|
-
], SummaryController.prototype, "getSummary", null);
|
|
109
|
-
__decorate([
|
|
110
|
-
(0, interface_api_1.Get)("health"),
|
|
111
|
-
__param(0, (0, auth_1.AuthRawUser)()),
|
|
112
|
-
__metadata("design:type", Function),
|
|
113
|
-
__metadata("design:paramtypes", [Function]),
|
|
114
|
-
__metadata("design:returntype", Promise)
|
|
115
|
-
], SummaryController.prototype, "getHealth", null);
|
|
116
|
-
__decorate([
|
|
117
|
-
(0, interface_api_1.Get)("history"),
|
|
118
|
-
__param(0, (0, auth_1.AuthRawUser)()),
|
|
119
|
-
__param(1, (0, interface_api_1.Parameter)("period", "query")),
|
|
120
|
-
__metadata("design:type", Function),
|
|
121
|
-
__metadata("design:paramtypes", [Function, String]),
|
|
122
|
-
__metadata("design:returntype", Promise)
|
|
123
|
-
], SummaryController.prototype, "getHistory", null);
|
|
124
|
-
__decorate([
|
|
125
|
-
(0, interface_api_1.Get)("status-breakdown"),
|
|
126
|
-
__param(0, (0, auth_1.AuthRawUser)()),
|
|
127
|
-
__param(1, (0, interface_api_1.Parameter)("period", "query")),
|
|
128
|
-
__metadata("design:type", Function),
|
|
129
|
-
__metadata("design:paramtypes", [Function, String]),
|
|
130
|
-
__metadata("design:returntype", Promise)
|
|
131
|
-
], SummaryController.prototype, "getStatusBreakdown", null);
|
|
132
|
-
__decorate([
|
|
133
|
-
(0, interface_api_1.Get)("watch-list"),
|
|
134
|
-
__param(0, (0, auth_1.AuthRawUser)()),
|
|
135
|
-
__param(1, (0, interface_api_1.Parameter)("limit", "query")),
|
|
136
|
-
__metadata("design:type", Function),
|
|
137
|
-
__metadata("design:paramtypes", [Function, String]),
|
|
138
|
-
__metadata("design:returntype", Promise)
|
|
139
|
-
], SummaryController.prototype, "getWatchList", null);
|
|
140
|
-
__decorate([
|
|
141
|
-
(0, interface_api_1.Get)("activity"),
|
|
142
|
-
__param(0, (0, auth_1.AuthRawUser)()),
|
|
143
|
-
__metadata("design:type", Function),
|
|
144
|
-
__metadata("design:paramtypes", [Function]),
|
|
145
|
-
__metadata("design:returntype", Promise)
|
|
146
|
-
], SummaryController.prototype, "getActivity", null);
|
|
147
|
-
exports.SummaryController = SummaryController = __decorate([
|
|
148
|
-
(0, auth_1.AuthOwnerOnly)()
|
|
149
|
-
], SummaryController);
|
|
150
|
-
function models() {
|
|
151
|
-
return [(0, interface_database_decorators_1.GetModel)(db_1.RouteModel), (0, interface_database_decorators_1.GetModel)(db_1.RouteStatisticsModel)];
|
|
152
|
-
}
|
|
153
|
-
async function countScopedRoutes(routes, keys) {
|
|
154
|
-
if (keys)
|
|
155
|
-
return keys.size;
|
|
156
|
-
return routes.table.count().run();
|
|
157
|
-
}
|
|
158
|
-
async function findLastIncident(keys) {
|
|
159
|
-
const page = await (0, read_1.queryRequestLogsScoped)((0, interface_database_decorators_1.GetModel)(db_1.RequestLogModel), {
|
|
160
|
-
statusClass: "server-error",
|
|
161
|
-
limit: 1,
|
|
162
|
-
}, keys);
|
|
163
|
-
return page.results[0];
|
|
164
|
-
}
|
|
165
|
-
function pickStatus(errorRate, slowCount) {
|
|
166
|
-
if (errorRate > types_1.CRITICAL_ERROR_RATE)
|
|
167
|
-
return "down";
|
|
168
|
-
if (errorRate > types_1.ELEVATED_ERROR_RATE || slowCount > types_1.DEGRADED_SLOW_ROUTES) {
|
|
169
|
-
return "degraded";
|
|
170
|
-
}
|
|
171
|
-
return "healthy";
|
|
172
|
-
}
|
|
173
|
-
function clampInt(raw, min, max, fallback) {
|
|
174
|
-
if (!raw)
|
|
175
|
-
return fallback;
|
|
176
|
-
const n = parseInt(raw, 10);
|
|
177
|
-
if (Number.isNaN(n))
|
|
178
|
-
return fallback;
|
|
179
|
-
return Math.max(min, Math.min(max, n));
|
|
180
|
-
}
|
|
181
|
-
//# sourceMappingURL=summary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"summary.js","sourceRoot":"","sources":["../../src/routes/summary.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAAuE;AACvE,6FAAqE;AACrE,yDAA4E;AAE5E,6BAMc;AACd,8CAAuE;AACvE,sDAAqE;AACrE,4CAAsD;AACtD,kDAAqD;AACrD,0EAKyC;AACzC,mCAIiB;AAEjB,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,WAAW,GAAG,CAAC,CAAC;AAGf,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,IAAA,0BAAU,EAAC,yBAAyB,CAAC;IAEpE,AAAN,KAAK,CAAC,UAAU,CAAgB,KAAW;QACzC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,MAAM,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,IAAA,0BAAkB,EAAC,MAAM,EAAE,IAAA,yBAAc,GAAE,CAAC,CAAC;QAChE,MAAM,KAAK,GAAG,MAAM,iBAAiB,CAAC,MAAM,EAAE,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