@antelopejs/dms-api 0.1.4 → 0.1.6
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 +2 -1
- package/dist/db/models/routes.model.d.ts +1 -0
- package/dist/db/models/routes.model.js +9 -0
- package/dist/db/models/routes.model.js.map +1 -1
- package/dist/db/models/routes_statistics.model.d.ts +2 -0
- package/dist/db/models/routes_statistics.model.js +12 -0
- package/dist/db/models/routes_statistics.model.js.map +1 -1
- package/dist/db/tables/request_log.table.js +0 -1
- package/dist/db/tables/request_log.table.js.map +1 -1
- package/dist/db/tables/routes_statistics.table.d.ts +2 -0
- package/dist/db/tables/routes_statistics.table.js +9 -1
- package/dist/db/tables/routes_statistics.table.js.map +1 -1
- package/dist/pages/logs/page.js +1 -1
- package/dist/pages/logs/page.js.map +1 -1
- package/dist/pages/routes/page.js +1 -1
- package/dist/pages/routes/page.js.map +1 -1
- package/dist/routes/routes.js +2 -2
- package/dist/routes/routes.js.map +1 -1
- package/dist/services/request-log/read.d.ts +1 -1
- package/dist/services/request-log/read.js +2 -2
- package/dist/services/request-log/read.js.map +1 -1
- package/dist/services/routes-sync.js +2 -1
- package/dist/services/routes-sync.js.map +1 -1
- package/dist/services/statistics-prune.d.ts +2 -2
- package/dist/services/statistics-prune.js +19 -4
- package/dist/services/statistics-prune.js.map +1 -1
- package/dist/services/statistics-write.d.ts +4 -1
- package/dist/services/statistics-write.js +34 -18
- package/dist/services/statistics-write.js.map +1 -1
- package/frontend-vue/app/components/LogsView.vue +5 -5
- package/frontend-vue/app/components/RoutesView.vue +7 -10
- package/frontend-vue/package.json +0 -2
- package/frontend-vue/pnpm-lock.yaml +0 -111
- package/package.json +10 -9
package/README.md
CHANGED
|
@@ -57,6 +57,7 @@ Use the pnpm version declared in `package.json`. The repository's `dev` script
|
|
|
57
57
|
starts its playground backend; `frontend:dev` starts the published Inertia
|
|
58
58
|
dashboard loader. The playground connects to MongoDB at
|
|
59
59
|
`mongodb://localhost:27017` unless `MONGO_URL` points it elsewhere. `pnpm build`
|
|
60
|
-
compiles the backend, and `pnpm test` runs the
|
|
60
|
+
compiles the backend, and `pnpm test` runs the backend unit tests (`tests/`)
|
|
61
|
+
followed by the frontend test suite. To typecheck
|
|
61
62
|
the complete application, set `DMS_FRONTEND_WORKSPACE` to the workspace
|
|
62
63
|
generated by `ajs dms prepare`, then run `pnpm --dir frontend-vue typecheck`.
|
|
@@ -18,5 +18,6 @@ declare const RouteModel_base: {
|
|
|
18
18
|
validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
|
|
19
19
|
};
|
|
20
20
|
export declare class RouteModel extends RouteModel_base {
|
|
21
|
+
getByRoute(method: string, uri: string): Promise<Route | undefined>;
|
|
21
22
|
}
|
|
22
23
|
export {};
|
|
@@ -3,7 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RouteModel = void 0;
|
|
4
4
|
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
5
5
|
const routes_table_1 = require("../tables/routes.table");
|
|
6
|
+
const routes_statistics_table_1 = require("../tables/routes_statistics.table");
|
|
6
7
|
class RouteModel extends (0, interface_database_decorators_1.BasicDataModel)(routes_table_1.Route, routes_table_1.routesTableName) {
|
|
8
|
+
async getByRoute(method, uri) {
|
|
9
|
+
const normalized = (0, routes_statistics_table_1.normalizeRouteMethod)(method);
|
|
10
|
+
const [route] = await this.table
|
|
11
|
+
.filter((row) => row.key("method").eq(normalized).and(row.key("uri").eq(uri)))
|
|
12
|
+
.slice(0, 1)
|
|
13
|
+
.run();
|
|
14
|
+
return RouteModel.fromDatabase(route);
|
|
15
|
+
}
|
|
7
16
|
}
|
|
8
17
|
exports.RouteModel = RouteModel;
|
|
9
18
|
//# sourceMappingURL=routes.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.model.js","sourceRoot":"","sources":["../../../src/db/models/routes.model.ts"],"names":[],"mappings":";;;AAAA,6FAA2E;AAC3E,yDAAgE;
|
|
1
|
+
{"version":3,"file":"routes.model.js","sourceRoot":"","sources":["../../../src/db/models/routes.model.ts"],"names":[],"mappings":";;;AAAA,6FAA2E;AAC3E,yDAAgE;AAChE,+EAAyE;AAEzE,MAAa,UAAW,SAAQ,IAAA,8CAAc,EAAC,oBAAK,EAAE,8BAAe,CAAC;IAMpE,KAAK,CAAC,UAAU,CAAC,MAAc,EAAE,GAAW;QAC1C,MAAM,UAAU,GAAG,IAAA,8CAAoB,EAAC,MAAM,CAAC,CAAC;QAChD,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC,KAAK;aAC7B,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CACd,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAC7D;aACA,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;aACX,GAAG,EAAE,CAAC;QACT,OAAO,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;CACF;AAhBD,gCAgBC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AtomicMutationOutcome } from "@antelopejs/interface-database/atomic";
|
|
1
2
|
import { RouteStatistics } from "../tables/routes_statistics.table";
|
|
2
3
|
declare const RouteStatisticsModel_base: {
|
|
3
4
|
new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
|
|
@@ -19,5 +20,6 @@ declare const RouteStatisticsModel_base: {
|
|
|
19
20
|
};
|
|
20
21
|
export declare class RouteStatisticsModel extends RouteStatisticsModel_base {
|
|
21
22
|
getByRoute(method: string, uri: string): Promise<RouteStatistics | undefined>;
|
|
23
|
+
replaceStatistics(doc: RouteStatistics): Promise<AtomicMutationOutcome>;
|
|
22
24
|
}
|
|
23
25
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RouteStatisticsModel = void 0;
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
4
5
|
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
5
6
|
const routes_statistics_table_1 = require("../tables/routes_statistics.table");
|
|
6
7
|
class RouteStatisticsModel extends (0, interface_database_decorators_1.BasicDataModel)(routes_statistics_table_1.RouteStatistics, routes_statistics_table_1.routesStatisticsTableName) {
|
|
@@ -8,6 +9,17 @@ class RouteStatisticsModel extends (0, interface_database_decorators_1.BasicData
|
|
|
8
9
|
const id = (0, routes_statistics_table_1.getRouteStatsKey)(method, uri);
|
|
9
10
|
return this.get(id);
|
|
10
11
|
}
|
|
12
|
+
async replaceStatistics(doc) {
|
|
13
|
+
return this.table
|
|
14
|
+
.atomicMutation(doc._id, {
|
|
15
|
+
type: "update",
|
|
16
|
+
revisionField: "revision",
|
|
17
|
+
expectedRevision: doc.revision ?? { kind: "missing" },
|
|
18
|
+
nextRevision: (0, node_crypto_1.randomUUID)(),
|
|
19
|
+
patch: { statistics: doc.statistics },
|
|
20
|
+
})
|
|
21
|
+
.run();
|
|
22
|
+
}
|
|
11
23
|
}
|
|
12
24
|
exports.RouteStatisticsModel = RouteStatisticsModel;
|
|
13
25
|
//# sourceMappingURL=routes_statistics.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes_statistics.model.js","sourceRoot":"","sources":["../../../src/db/models/routes_statistics.model.ts"],"names":[],"mappings":";;;AAAA,6FAA2E;AAC3E,+EAI2C;AAE3C,MAAa,oBAAqB,SAAQ,IAAA,8CAAc,EACtD,yCAAe,EACf,mDAAyB,CAC1B;IAIC,KAAK,CAAC,UAAU,CACd,MAAc,EACd,GAAW;QAEX,MAAM,EAAE,GAAG,IAAA,0CAAgB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACtB,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"routes_statistics.model.js","sourceRoot":"","sources":["../../../src/db/models/routes_statistics.model.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC,6FAA2E;AAC3E,+EAI2C;AAE3C,MAAa,oBAAqB,SAAQ,IAAA,8CAAc,EACtD,yCAAe,EACf,mDAAyB,CAC1B;IAIC,KAAK,CAAC,UAAU,CACd,MAAc,EACd,GAAW;QAEX,MAAM,EAAE,GAAG,IAAA,0CAAgB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACtB,CAAC;IAQD,KAAK,CAAC,iBAAiB,CACrB,GAAoB;QAEpB,OAAO,IAAI,CAAC,KAAK;aACd,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE;YACvB,IAAI,EAAE,QAAQ;YACd,aAAa,EAAE,UAAU;YACzB,gBAAgB,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;YACrD,YAAY,EAAE,IAAA,wBAAU,GAAE;YAC1B,KAAK,EAAE,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE;SACtC,CAAC;aACD,GAAG,EAAE,CAAC;IACX,CAAC;CACF;AAlCD,oDAkCC"}
|
|
@@ -19,7 +19,6 @@ let RequestLog = class RequestLog extends interface_database_decorators_1.Table
|
|
|
19
19
|
exports.RequestLog = RequestLog;
|
|
20
20
|
__decorate([
|
|
21
21
|
(0, interface_database_decorators_1.Index)({ group: exports.REQUEST_LOG_ORDER_INDEX }),
|
|
22
|
-
(0, interface_database_decorators_1.Index)(),
|
|
23
22
|
(0, interface_database_decorators_1.Field)("date"),
|
|
24
23
|
__metadata("design:type", Date)
|
|
25
24
|
], RequestLog.prototype, "timestamp", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request_log.table.js","sourceRoot":"","sources":["../../../src/db/tables/request_log.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FAKmD;AAEnD,qDAAoD;AAEvC,QAAA,mBAAmB,GAAG,aAAa,CAAC;AACpC,QAAA,uBAAuB,GAAG,cAAc,CAAC;AAQ/C,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,qCAAK;
|
|
1
|
+
{"version":3,"file":"request_log.table.js","sourceRoot":"","sources":["../../../src/db/tables/request_log.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FAKmD;AAEnD,qDAAoD;AAEvC,QAAA,mBAAmB,GAAG,aAAa,CAAC;AACpC,QAAA,uBAAuB,GAAG,cAAc,CAAC;AAQ/C,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,qCAAK;CAuEpC,CAAA;AAvEY,gCAAU;AAMb;IAFP,IAAA,qCAAK,EAAC,EAAE,KAAK,EAAE,+BAAuB,EAAE,CAAC;IACzC,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACK,IAAI;6CAAC;AAIhB;IAFP,IAAA,qCAAK,EAAC,EAAE,KAAK,EAAE,+BAAuB,EAAE,CAAC;IACzC,IAAA,qCAAK,EAAC,QAAQ,CAAC;;uCACI;AAIZ;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;0CACW;AAMnB;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;uCACI;AAIZ;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;2CACQ;AAKhB;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;2CACS;AAGjB;IADP,IAAA,qCAAK,EAAC,KAAK,CAAC;;8CAC8B;AAGnC;IADP,IAAA,qCAAK,EAAC,KAAK,CAAC;;yCACoC;AAGzC;IADP,IAAA,qCAAK,EAAC,KAAK,CAAC;;kDACkC;AAGvC;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;+CACa;AAGrB;IADP,IAAA,qCAAK,EAAC,SAAS,CAAC;;wDACqB;AAI9B;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;8CACW;AAInB;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;kDACe;AAGvB;IADP,IAAA,qCAAK,EAAC,KAAK,CAAC;;mDACmC;AAGxC;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;gDACc;AAGtB;IADP,IAAA,qCAAK,EAAC,SAAS,CAAC;;yDACsB;AAG/B;IADP,IAAA,qCAAK,EAAC,KAAK,CAAC;;yCACmB;AAGxB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;sCACI;AAGZ;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;6CACW;qBAtEhB,UAAU;IADtB,IAAA,6CAAa,EAAC,2BAAmB,EAAE,uBAAW,CAAC;GACnC,UAAU,CAuEtB"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Table } from "@antelopejs/interface-database-decorators";
|
|
2
2
|
import type { DayStatistics, HttpMethod } from "@/types";
|
|
3
3
|
export declare const routesStatisticsTableName = "routes_statistics";
|
|
4
|
+
export declare function normalizeRouteMethod(method: string): string;
|
|
4
5
|
export declare function getRouteStatsKey(method: string, uri: string): string;
|
|
5
6
|
export declare class RouteStatistics extends Table {
|
|
6
7
|
method: HttpMethod;
|
|
7
8
|
uri: string;
|
|
8
9
|
statistics: DayStatistics[];
|
|
10
|
+
revision?: string;
|
|
9
11
|
}
|
|
@@ -10,12 +10,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.RouteStatistics = exports.routesStatisticsTableName = void 0;
|
|
13
|
+
exports.normalizeRouteMethod = normalizeRouteMethod;
|
|
13
14
|
exports.getRouteStatsKey = getRouteStatsKey;
|
|
14
15
|
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
15
16
|
const constants_1 = require("../../types/constants");
|
|
16
17
|
exports.routesStatisticsTableName = "routes_statistics";
|
|
18
|
+
function normalizeRouteMethod(method) {
|
|
19
|
+
return method.toUpperCase();
|
|
20
|
+
}
|
|
17
21
|
function getRouteStatsKey(method, uri) {
|
|
18
|
-
return `${method
|
|
22
|
+
return `${normalizeRouteMethod(method)}:${uri}`;
|
|
19
23
|
}
|
|
20
24
|
let RouteStatistics = class RouteStatistics extends interface_database_decorators_1.Table {
|
|
21
25
|
};
|
|
@@ -32,6 +36,10 @@ __decorate([
|
|
|
32
36
|
(0, interface_database_decorators_1.Field)(["any"]),
|
|
33
37
|
__metadata("design:type", Array)
|
|
34
38
|
], RouteStatistics.prototype, "statistics", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], RouteStatistics.prototype, "revision", void 0);
|
|
35
43
|
exports.RouteStatistics = RouteStatistics = __decorate([
|
|
36
44
|
(0, interface_database_decorators_1.RegisterTable)(exports.routesStatisticsTableName, constants_1.SCHEMA_NAME)
|
|
37
45
|
], RouteStatistics);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes_statistics.table.js","sourceRoot":"","sources":["../../../src/db/tables/routes_statistics.table.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"routes_statistics.table.js","sourceRoot":"","sources":["../../../src/db/tables/routes_statistics.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAcA,oDAEC;AAOD,4CAEC;AAzBD,6FAImD;AAEnD,qDAAoD;AAEvC,QAAA,yBAAyB,GAAG,mBAAmB,CAAC;AAM7D,SAAgB,oBAAoB,CAAC,MAAc;IACjD,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC;AAC9B,CAAC;AAOD,SAAgB,gBAAgB,CAAC,MAAc,EAAE,GAAW;IAC1D,OAAO,GAAG,oBAAoB,CAAC,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;AAClD,CAAC;AAGM,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,qCAAK;CAiBzC,CAAA;AAjBY,0CAAe;AAElB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;+CACW;AAGnB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;4CACI;AAGZ;IADP,IAAA,qCAAK,EAAC,CAAC,KAAK,CAAC,CAAC;;mDACqB;AAQ5B;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;iDACU;0BAhBf,eAAe;IAD3B,IAAA,6CAAa,EAAC,iCAAyB,EAAE,uBAAW,CAAC;GACzC,eAAe,CAiB3B"}
|
package/dist/pages/logs/page.js
CHANGED
|
@@ -16,7 +16,7 @@ let LogsPage = class LogsPage extends (0, page_1.PageController)("logs", {
|
|
|
16
16
|
icon: "i-ph-list-magnifying-glass",
|
|
17
17
|
module: "api",
|
|
18
18
|
order: 2,
|
|
19
|
-
}, (0, layouts_1.DefaultLayout)({ hideHeader: true, fullWidth: true })) {
|
|
19
|
+
}, (0, layouts_1.DefaultLayout)({ hideHeader: true, fullWidth: true, fillHeight: true })) {
|
|
20
20
|
static content = (0, custom_1.CustomComponent)("DmsApiLogsView").meta({
|
|
21
21
|
name: "$page.api.logs.title",
|
|
22
22
|
icon: "i-ph-list-magnifying-glass",
|
|
@@ -1 +1 @@
|
|
|
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,CAAC,
|
|
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"}
|
|
@@ -16,7 +16,7 @@ let RoutesPage = class RoutesPage extends (0, page_1.PageController)("routes", {
|
|
|
16
16
|
icon: "i-ph-tree-structure",
|
|
17
17
|
module: "api",
|
|
18
18
|
order: 1,
|
|
19
|
-
}, (0, layouts_1.DefaultLayout)({ hideHeader: true, fullWidth: true })) {
|
|
19
|
+
}, (0, layouts_1.DefaultLayout)({ hideHeader: true, fullWidth: true, fillHeight: true })) {
|
|
20
20
|
static content = (0, custom_1.CustomComponent)("DmsApiRoutesView").meta({
|
|
21
21
|
name: "$page.api.routes.title",
|
|
22
22
|
icon: "i-ph-tree-structure",
|
|
@@ -1 +1 @@
|
|
|
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,CAAC,
|
|
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"}
|
package/dist/routes/routes.js
CHANGED
|
@@ -39,7 +39,7 @@ let RoutesController = class RoutesController extends (0, interface_api_1.Contro
|
|
|
39
39
|
async getRouteDoc(_user, id) {
|
|
40
40
|
const inspection = (0, introspection_1.getRouteInspection)(id);
|
|
41
41
|
(0, interface_api_util_1.assert)(inspection, 404, "Route not found");
|
|
42
|
-
const route = await (0, interface_database_decorators_1.GetModel)(db_1.RouteModel).
|
|
42
|
+
const route = await (0, interface_database_decorators_1.GetModel)(db_1.RouteModel).getByRoute(inspection.method, inspection.location);
|
|
43
43
|
return {
|
|
44
44
|
...inspection,
|
|
45
45
|
registeredAt: route?.createdAt ?? null,
|
|
@@ -61,7 +61,7 @@ let RoutesController = class RoutesController extends (0, interface_api_1.Contro
|
|
|
61
61
|
(0, statistics_read_1.getRouteStatistics)(stats, inspection.method, inspection.location, days),
|
|
62
62
|
(0, statistics_read_1.getResponseTimesStatistics)(stats, inspection.method, inspection.location, days),
|
|
63
63
|
(0, statistics_aggregate_1.getRouteAggregate)(stats, inspection.method, inspection.location, days),
|
|
64
|
-
(0, read_1.getRecentLogsForRoute)(log,
|
|
64
|
+
(0, read_1.getRecentLogsForRoute)(log, inspection.method, inspection.location, RECENT_LOGS_DEFAULT),
|
|
65
65
|
]);
|
|
66
66
|
return {
|
|
67
67
|
route: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../src/routes/routes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAAuE;AACvE,uEAAwD;AACxD,6FAAqE;AACrE,yDAA4E;AAE5E,6BAAyE;AACzE,4DAGkC;AAClC,8CAAuE;AACvE,sDAAoE;AACpE,4CAAsD;AACtD,kDAAqD;AACrD,0EAGyC;AACzC,gEAGoC;AACpC,0CAAuD;AAEvD,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAQxB,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,IAAA,0BAAU,EAAC,wBAAwB,CAAC;IAElE,AAAN,KAAK,CAAC,OA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BAA2B,CAAC;IAE9B,WAAA,IAAA,kBAAW,GAAE,CAAA;IACb,WAAA,IAAA,yBAAS,EAAC,aAAa,EAAE,OAAO,CAAC,CAAA;IACjC,WAAA,IAAA,yBAAS,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;;;;sDAQ9B;2BA9GU,gBAAgB;IAD5B,IAAA,oBAAa,GAAE;GACH,gBAAgB,CA+G5B;AAED,SAAS,UAAU,CAAC,OAAe;IACjC,OAAO,IAAI,kBAAkB,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAChF,CAAC"}
|
|
@@ -3,4 +3,4 @@ import type { RequestLogFilters, RequestLogPage } from "@/db/models/request_log.
|
|
|
3
3
|
import type { RequestLog } from "@/db/tables/request_log.table";
|
|
4
4
|
export declare function queryRequestLogsScoped(model: RequestLogModel, filters: RequestLogFilters, keys: Set<string> | null | undefined): Promise<RequestLogPage>;
|
|
5
5
|
export declare function getRequestLog(model: RequestLogModel, id: string): Promise<RequestLog | undefined>;
|
|
6
|
-
export declare function getRecentLogsForRoute(model: RequestLogModel,
|
|
6
|
+
export declare function getRecentLogsForRoute(model: Pick<RequestLogModel, "query">, method: string, uri: string, limit?: number): Promise<RequestLog[]>;
|
|
@@ -19,8 +19,8 @@ function queryRequestLogsScoped(model, filters, keys) {
|
|
|
19
19
|
async function getRequestLog(model, id) {
|
|
20
20
|
return model.get(id);
|
|
21
21
|
}
|
|
22
|
-
async function getRecentLogsForRoute(model,
|
|
23
|
-
const page = await model.query({
|
|
22
|
+
async function getRecentLogsForRoute(model, method, uri, limit = 20) {
|
|
23
|
+
const page = await model.query({ method, uri, limit });
|
|
24
24
|
return page.results;
|
|
25
25
|
}
|
|
26
26
|
//# sourceMappingURL=read.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../src/services/request-log/read.ts"],"names":[],"mappings":";;AA8BA,wDAsBC;AAED,sCAKC;
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../src/services/request-log/read.ts"],"names":[],"mappings":";;AA8BA,wDAsBC;AAED,sCAKC;AAQD,sDAQC;AArED,mCAAqC;AAQrC,MAAM,uBAAuB,GAAG,EAAE,GAAG,kBAAU,CAAC;AAgBhD,SAAgB,sBAAsB,CACpC,KAAsB,EACtB,OAA0B,EAC1B,IAAoC;IAEpC,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAKvC,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC;QACjB,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,OAAO,KAAK,CAAC,KAAK,CAAC;QAMjB,KAAK,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,uBAAuB,CAAC;QACrD,GAAG,OAAO;QACV,SAAS,EAAE,CAAC,GAAG,IAAI,CAAC;KACrB,CAAC,CAAC;AACL,CAAC;AAEM,KAAK,UAAU,aAAa,CACjC,KAAsB,EACtB,EAAU;IAEV,OAAO,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACvB,CAAC;AAQM,KAAK,UAAU,qBAAqB,CACzC,KAAqC,EACrC,MAAc,EACd,GAAW,EACX,KAAK,GAAG,EAAE;IAEV,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;IACvD,OAAO,IAAI,CAAC,OAAO,CAAC;AACtB,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.syncRoutes = syncRoutes;
|
|
4
|
+
const routes_statistics_table_1 = require("@/db/tables/routes_statistics.table");
|
|
4
5
|
const scope_1 = require("./scope");
|
|
5
6
|
function normalizeMethod(method) {
|
|
6
|
-
return
|
|
7
|
+
return (0, routes_statistics_table_1.normalizeRouteMethod)(method);
|
|
7
8
|
}
|
|
8
9
|
function getRouteKey(method, uri) {
|
|
9
10
|
return `${normalizeMethod(method)}:${uri}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes-sync.js","sourceRoot":"","sources":["../../src/services/routes-sync.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"routes-sync.js","sourceRoot":"","sources":["../../src/services/routes-sync.ts"],"names":[],"mappings":";;AAqFA,gCAmCC;AArHD,iFAA2E;AAE3E,mCAA0C;AAI1C,SAAS,eAAe,CAAC,MAAc;IACrC,OAAO,IAAA,8CAAoB,EAAC,MAAM,CAAe,CAAC;AACpD,CAAC;AAED,SAAS,WAAW,CAAC,MAAc,EAAE,GAAW;IAC9C,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;AAC7C,CAAC;AAaD,SAAS,WAAW,CAClB,KAAsB,EACtB,UAA+B;IAE/B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC;IACpC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;AACpE,CAAC;AAGD,SAAS,cAAc,CACrB,cAAuB,EACvB,eAA6C;IAE7C,OAAO,cAAc;SAClB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SACjE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAG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AAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare function pruneAllStatistics(statsModel:
|
|
1
|
+
import { type RouteStatisticsStore } from "./statistics-write";
|
|
2
|
+
export declare function pruneAllStatistics(statsModel: RouteStatisticsStore): Promise<number>;
|
|
@@ -3,9 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.pruneAllStatistics = pruneAllStatistics;
|
|
4
4
|
const config_1 = require("@/config");
|
|
5
5
|
const statistics_utils_1 = require("./statistics-utils");
|
|
6
|
+
const statistics_write_1 = require("./statistics-write");
|
|
6
7
|
function pruneOldStats(statistics, cutoff) {
|
|
7
8
|
return statistics.filter((stat) => stat.day >= cutoff);
|
|
8
9
|
}
|
|
10
|
+
async function pruneRouteStats(statsModel, initial, cutoff) {
|
|
11
|
+
let routeStats = initial;
|
|
12
|
+
for (let attempt = 0; attempt < statistics_write_1.MAX_STATISTICS_WRITE_ATTEMPTS; attempt++) {
|
|
13
|
+
if (!routeStats)
|
|
14
|
+
return false;
|
|
15
|
+
const pruned = pruneOldStats(routeStats.statistics, cutoff);
|
|
16
|
+
if (pruned.length === routeStats.statistics.length)
|
|
17
|
+
return false;
|
|
18
|
+
routeStats.statistics = pruned;
|
|
19
|
+
const outcome = await statsModel.replaceStatistics(routeStats);
|
|
20
|
+
if (outcome !== "not-applied")
|
|
21
|
+
return outcome === "applied";
|
|
22
|
+
await (0, statistics_write_1.statisticsRetryDelay)(attempt + 1);
|
|
23
|
+
routeStats = await statsModel.get(routeStats._id);
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
9
27
|
async function pruneAllStatistics(statsModel) {
|
|
10
28
|
const { statisticsLifetime } = (0, config_1.getConfig)();
|
|
11
29
|
const today = (0, statistics_utils_1.getTodayTimestamp)();
|
|
@@ -13,10 +31,7 @@ async function pruneAllStatistics(statsModel) {
|
|
|
13
31
|
const allStats = await statsModel.getAll();
|
|
14
32
|
let prunedCount = 0;
|
|
15
33
|
for (const routeStats of allStats) {
|
|
16
|
-
|
|
17
|
-
routeStats.statistics = pruneOldStats(routeStats.statistics, cutoff);
|
|
18
|
-
if (routeStats.statistics.length < originalLength) {
|
|
19
|
-
await statsModel.update(routeStats);
|
|
34
|
+
if (await pruneRouteStats(statsModel, routeStats, cutoff)) {
|
|
20
35
|
prunedCount++;
|
|
21
36
|
}
|
|
22
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statistics-prune.js","sourceRoot":"","sources":["../../src/services/statistics-prune.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"statistics-prune.js","sourceRoot":"","sources":["../../src/services/statistics-prune.ts"],"names":[],"mappings":";;AA+CA,gDAiBC;AAhED,qCAAqC;AAGrC,yDAAuD;AACvD,yDAI4B;AAE5B,SAAS,aAAa,CACpB,UAA2B,EAC3B,MAAc;IAEd,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC;AACzD,CAAC;AAQD,KAAK,UAAU,eAAe,CAC5B,UAAgC,EAChC,OAAwB,EACxB,MAAc;IAEd,IAAI,UAAU,GAAgC,OAAO,CAAC;IACtD,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,gDAA6B,EAAE,OAAO,EAAE,EAAE,CAAC;QACzE,IAAI,CAAC,UAAU;YAAE,OAAO,KAAK,CAAC;QAC9B,MAAM,MAAM,GAAG,aAAa,CAAC,UAAU,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC5D,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU,CAAC,UAAU,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QACjE,UAAU,CAAC,UAAU,GAAG,MAAM,CAAC;QAC/B,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAC/D,IAAI,OAAO,KAAK,aAAa;YAAE,OAAO,OAAO,KAAK,SAAS,CAAC;QAC5D,MAAM,IAAA,uCAAoB,EAAC,OAAO,GAAG,CAAC,CAAC,CAAC;QACxC,UAAU,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAOM,KAAK,UAAU,kBAAkB,CACtC,UAAgC;IAEhC,MAAM,EAAE,kBAAkB,EAAE,GAAG,IAAA,kBAAS,GAAE,CAAC;IAC3C,MAAM,KAAK,GAAG,IAAA,oCAAiB,GAAE,CAAC;IAClC,MAAM,MAAM,GAAG,KAAK,GAAG,kBAAkB,CAAC;IAE1C,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;IAC3C,IAAI,WAAW,GAAG,CAAC,CAAC;IAEpB,KAAK,MAAM,UAAU,IAAI,QAAQ,EAAE,CAAC;QAClC,IAAI,MAAM,eAAe,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC;YAC1D,WAAW,EAAE,CAAC;QAChB,CAAC;IACH,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { RouteStatisticsModel } from "@/db";
|
|
2
2
|
import type { RequestStatistics } from "@/types";
|
|
3
|
-
export
|
|
3
|
+
export type RouteStatisticsStore = Pick<RouteStatisticsModel, "get" | "getAll" | "insert" | "replaceStatistics">;
|
|
4
|
+
export declare const MAX_STATISTICS_WRITE_ATTEMPTS = 10;
|
|
5
|
+
export declare function statisticsRetryDelay(attempt: number): Promise<void>;
|
|
6
|
+
export declare function addRequestStatistics(model: RouteStatisticsStore, request: RequestStatistics): Promise<void>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MAX_STATISTICS_WRITE_ATTEMPTS = void 0;
|
|
4
|
+
exports.statisticsRetryDelay = statisticsRetryDelay;
|
|
3
5
|
exports.addRequestStatistics = addRequestStatistics;
|
|
6
|
+
const node_crypto_1 = require("node:crypto");
|
|
4
7
|
const routes_statistics_table_1 = require("@/db/tables/routes_statistics.table");
|
|
5
8
|
const statistics_utils_1 = require("./statistics-utils");
|
|
6
9
|
function isClientError(statusCode) {
|
|
@@ -51,34 +54,47 @@ function updateRouteStats(existing, request, today) {
|
|
|
51
54
|
existing.statistics.push(createDayStats(request, today));
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
57
|
+
exports.MAX_STATISTICS_WRITE_ATTEMPTS = 10;
|
|
58
|
+
const RETRY_BASE_DELAY_MS = 2;
|
|
59
|
+
const RETRY_MAX_DELAY_MS = 250;
|
|
60
|
+
function statisticsRetryDelay(attempt) {
|
|
61
|
+
const ceiling = Math.min(RETRY_MAX_DELAY_MS, RETRY_BASE_DELAY_MS * 2 ** attempt);
|
|
62
|
+
return new Promise((resolve) => setTimeout(resolve, Math.random() * ceiling));
|
|
63
|
+
}
|
|
64
|
+
async function insertRouteStats(model, id, request, today) {
|
|
63
65
|
try {
|
|
64
66
|
await model.insert({
|
|
65
67
|
_id: id,
|
|
66
68
|
method: request.method.toUpperCase(),
|
|
67
69
|
uri: request.uri,
|
|
68
70
|
statistics: [createDayStats(request, today)],
|
|
71
|
+
revision: (0, node_crypto_1.randomUUID)(),
|
|
69
72
|
});
|
|
73
|
+
return true;
|
|
70
74
|
}
|
|
71
75
|
catch (error) {
|
|
72
|
-
if (isDuplicateKeyError(error))
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
if (isDuplicateKeyError(error))
|
|
77
|
+
return false;
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async function addRequestStatistics(model, request) {
|
|
82
|
+
const id = (0, routes_statistics_table_1.getRouteStatsKey)(request.method, request.uri);
|
|
83
|
+
const today = (0, statistics_utils_1.getTodayTimestamp)();
|
|
84
|
+
for (let attempt = 0; attempt < exports.MAX_STATISTICS_WRITE_ATTEMPTS; attempt++) {
|
|
85
|
+
if (attempt > 0)
|
|
86
|
+
await statisticsRetryDelay(attempt);
|
|
87
|
+
const existing = await model.get(id);
|
|
88
|
+
if (!existing) {
|
|
89
|
+
if (await insertRouteStats(model, id, request, today))
|
|
90
|
+
return;
|
|
91
|
+
continue;
|
|
81
92
|
}
|
|
93
|
+
updateRouteStats(existing, request, today);
|
|
94
|
+
const outcome = await model.replaceStatistics(existing);
|
|
95
|
+
if (outcome !== "not-applied")
|
|
96
|
+
return;
|
|
82
97
|
}
|
|
98
|
+
throw new Error(`Route statistics for ${id} kept changing concurrently; request not recorded`);
|
|
83
99
|
}
|
|
84
100
|
//# sourceMappingURL=statistics-write.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statistics-write.js","sourceRoot":"","sources":["../../src/services/statistics-write.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"statistics-write.js","sourceRoot":"","sources":["../../src/services/statistics-write.ts"],"names":[],"mappings":";;;AAwHA,oDAMC;AAkCD,oDAqBC;AArLD,6CAAyC;AAEzC,iFAG6C;AAE7C,yDAAuD;AAKvD,SAAS,aAAa,CAAC,UAAkB;IACvC,OAAO,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC;AAC/C,CAAC;AAKD,SAAS,aAAa,CAAC,UAAkB;IACvC,OAAO,UAAU,IAAI,GAAG,CAAC;AAC3B,CAAC;AAKD,SAAS,cAAc,CACrB,OAA0B,EAC1B,KAAa;IAEb,OAAO;QACL,GAAG,EAAE,KAAK;QACV,aAAa,EAAE,CAAC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` in src/pages/logs/page.ts): the
|
|
211
|
+
log list takes the height left and scrolls inside the card. -->
|
|
212
|
+
<div class="flex min-h-0 w-full flex-1 flex-col gap-5 p-6">
|
|
211
213
|
<header class="flex flex-wrap items-center gap-4">
|
|
212
214
|
<div
|
|
213
215
|
class="grid size-11 shrink-0 place-items-center rounded-xl bg-primary/10 text-primary"
|
|
@@ -244,7 +246,7 @@ const counts = computed(() => {
|
|
|
244
246
|
</div>
|
|
245
247
|
</header>
|
|
246
248
|
|
|
247
|
-
<DmsCard :padded="false" class="flex flex-col overflow-hidden">
|
|
249
|
+
<DmsCard :padded="false" class="flex min-h-0 flex-1 flex-col overflow-hidden">
|
|
248
250
|
<!-- Filter toolbar -->
|
|
249
251
|
<div
|
|
250
252
|
class="flex flex-wrap items-center gap-2 border-b border-default px-4 py-3"
|
|
@@ -271,9 +273,7 @@ const counts = computed(() => {
|
|
|
271
273
|
|
|
272
274
|
<!-- Console-style log list. The row list scrolls internally so the
|
|
273
275
|
toolbar and footer stay pinned. -->
|
|
274
|
-
<div
|
|
275
|
-
class="flex max-h-[calc(100vh-24rem)] min-h-[360px] flex-col overflow-hidden font-mono text-xs"
|
|
276
|
-
>
|
|
276
|
+
<div class="flex min-h-0 flex-1 flex-col overflow-hidden font-mono text-xs">
|
|
277
277
|
<div v-if="rows.length === 0 && !loading" class="p-8 text-center text-muted">
|
|
278
278
|
{{ $t('page.api.logs.empty') }}
|
|
279
279
|
</div>
|
|
@@ -22,7 +22,10 @@ function onRoute(id: string) {
|
|
|
22
22
|
</script>
|
|
23
23
|
|
|
24
24
|
<template>
|
|
25
|
-
|
|
25
|
+
<!-- The page fills the panel (`fillHeight` in src/pages/routes/page.ts):
|
|
26
|
+
from `lg` up the tree and the detail share its height and scroll
|
|
27
|
+
inside; below, where they stack, the view scrolls as a whole. -->
|
|
28
|
+
<div class="flex min-h-0 w-full flex-1 flex-col gap-5 p-6 max-lg:overflow-y-auto">
|
|
26
29
|
<!-- page head -->
|
|
27
30
|
<header class="flex flex-wrap items-center gap-4">
|
|
28
31
|
<div
|
|
@@ -43,21 +46,15 @@ function onRoute(id: string) {
|
|
|
43
46
|
|
|
44
47
|
<!-- master-detail split -->
|
|
45
48
|
<div
|
|
46
|
-
class="grid
|
|
49
|
+
class="grid grid-cols-1 gap-5 lg:min-h-0 lg:flex-1 lg:grid-cols-[minmax(280px,340px)_1fr]"
|
|
47
50
|
>
|
|
48
51
|
<!-- left: tree -->
|
|
49
|
-
<DmsCard
|
|
50
|
-
:padded="false"
|
|
51
|
-
class="flex max-h-[calc(100vh-13rem)] flex-col overflow-hidden"
|
|
52
|
-
>
|
|
52
|
+
<DmsCard :padded="false" class="flex flex-col overflow-hidden lg:min-h-0">
|
|
53
53
|
<RouteTree :period="period" @select-route="onRoute" />
|
|
54
54
|
</DmsCard>
|
|
55
55
|
|
|
56
56
|
<!-- right: detail -->
|
|
57
|
-
<DmsCard
|
|
58
|
-
:padded="false"
|
|
59
|
-
class="max-h-[calc(100vh-13rem)] overflow-auto"
|
|
60
|
-
>
|
|
57
|
+
<DmsCard :padded="false" class="lg:min-h-0 lg:overflow-auto">
|
|
61
58
|
<RouteDetailTabs
|
|
62
59
|
v-if="selectedRouteId && period"
|
|
63
60
|
:key="selectedRouteId"
|
|
@@ -8,12 +8,6 @@ importers:
|
|
|
8
8
|
|
|
9
9
|
.:
|
|
10
10
|
dependencies:
|
|
11
|
-
'@vueuse/core':
|
|
12
|
-
specifier: ^13.0.0
|
|
13
|
-
version: 13.9.0(vue@3.5.22(typescript@6.0.3))
|
|
14
|
-
'@vueuse/integrations':
|
|
15
|
-
specifier: ^12.5.0
|
|
16
|
-
version: 12.8.2(change-case@5.4.4)(fuse.js@7.5.0)(sortablejs@1.15.6)(typescript@6.0.3)
|
|
17
11
|
json-schema-to-zod:
|
|
18
12
|
specifier: ^2.6.0
|
|
19
13
|
version: 2.6.1
|
|
@@ -1175,60 +1169,11 @@ packages:
|
|
|
1175
1169
|
'@vueuse/core@10.11.1':
|
|
1176
1170
|
resolution: {integrity: sha512-guoy26JQktXPcz+0n3GukWIy/JDNKti9v6VEMu6kV2sYBsWuGiTU8OWdg+ADfUbHg3/3DlqySDe7JmdHrktiww==}
|
|
1177
1171
|
|
|
1178
|
-
'@vueuse/core@12.8.2':
|
|
1179
|
-
resolution: {integrity: sha512-HbvCmZdzAu3VGi/pWYm5Ut+Kd9mn1ZHnn4L5G8kOQTPs/IwIAmJoBrmYk2ckLArgMXZj0AW3n5CAejLUO+PhdQ==}
|
|
1180
|
-
|
|
1181
|
-
'@vueuse/core@13.9.0':
|
|
1182
|
-
resolution: {integrity: sha512-ts3regBQyURfCE2BcytLqzm8+MmLlo5Ln/KLoxDVcsZ2gzIwVNnQpQOL/UKV8alUqjSZOlpFZcRNsLRqj+OzyA==}
|
|
1183
|
-
peerDependencies:
|
|
1184
|
-
vue: ^3.5.0
|
|
1185
|
-
|
|
1186
1172
|
'@vueuse/core@14.4.0':
|
|
1187
1173
|
resolution: {integrity: sha512-X4WHz1HlCzCBoYXesUkifzzWBAcZgXG8Fi5iNPQg/epdzOB3gu8Fawj3hvuwYR1nGcXGnvxwYYcUC/71++svtQ==}
|
|
1188
1174
|
peerDependencies:
|
|
1189
1175
|
vue: ^3.5.0
|
|
1190
1176
|
|
|
1191
|
-
'@vueuse/integrations@12.8.2':
|
|
1192
|
-
resolution: {integrity: sha512-fbGYivgK5uBTRt7p5F3zy6VrETlV9RtZjBqd1/HxGdjdckBgBM4ugP8LHpjolqTj14TXTxSK1ZfgPbHYyGuH7g==}
|
|
1193
|
-
peerDependencies:
|
|
1194
|
-
async-validator: ^4
|
|
1195
|
-
axios: ^1
|
|
1196
|
-
change-case: ^5
|
|
1197
|
-
drauu: ^0.4
|
|
1198
|
-
focus-trap: ^7
|
|
1199
|
-
fuse.js: ^7
|
|
1200
|
-
idb-keyval: ^6
|
|
1201
|
-
jwt-decode: ^4
|
|
1202
|
-
nprogress: ^0.2
|
|
1203
|
-
qrcode: ^1.5
|
|
1204
|
-
sortablejs: ^1
|
|
1205
|
-
universal-cookie: ^7
|
|
1206
|
-
peerDependenciesMeta:
|
|
1207
|
-
async-validator:
|
|
1208
|
-
optional: true
|
|
1209
|
-
axios:
|
|
1210
|
-
optional: true
|
|
1211
|
-
change-case:
|
|
1212
|
-
optional: true
|
|
1213
|
-
drauu:
|
|
1214
|
-
optional: true
|
|
1215
|
-
focus-trap:
|
|
1216
|
-
optional: true
|
|
1217
|
-
fuse.js:
|
|
1218
|
-
optional: true
|
|
1219
|
-
idb-keyval:
|
|
1220
|
-
optional: true
|
|
1221
|
-
jwt-decode:
|
|
1222
|
-
optional: true
|
|
1223
|
-
nprogress:
|
|
1224
|
-
optional: true
|
|
1225
|
-
qrcode:
|
|
1226
|
-
optional: true
|
|
1227
|
-
sortablejs:
|
|
1228
|
-
optional: true
|
|
1229
|
-
universal-cookie:
|
|
1230
|
-
optional: true
|
|
1231
|
-
|
|
1232
1177
|
'@vueuse/integrations@14.4.0':
|
|
1233
1178
|
resolution: {integrity: sha512-oJz9qTgczvA7L1nXQFRU7h8tQbOCoiceqvMMhT9XYMyOGTqLJ2rEa09PON+nD2t48sZUfeOmg4eaWJXV4sZb/w==}
|
|
1234
1179
|
peerDependencies:
|
|
@@ -1274,26 +1219,12 @@ packages:
|
|
|
1274
1219
|
'@vueuse/metadata@10.11.1':
|
|
1275
1220
|
resolution: {integrity: sha512-IGa5FXd003Ug1qAZmyE8wF3sJ81xGLSqTqtQ6jaVfkeZ4i5kS2mwQF61yhVqojRnenVew5PldLyRgvdl4YYuSw==}
|
|
1276
1221
|
|
|
1277
|
-
'@vueuse/metadata@12.8.2':
|
|
1278
|
-
resolution: {integrity: sha512-rAyLGEuoBJ/Il5AmFHiziCPdQzRt88VxR+Y/A/QhJ1EWtWqPBBAxTAFaSkviwEuOEZNtW8pvkPgoCZQ+HxqW1A==}
|
|
1279
|
-
|
|
1280
|
-
'@vueuse/metadata@13.9.0':
|
|
1281
|
-
resolution: {integrity: sha512-1AFRvuiGphfF7yWixZa0KwjYH8ulyjDCC0aFgrGRz8+P4kvDFSdXLVfTk5xAN9wEuD1J6z4/myMoYbnHoX07zg==}
|
|
1282
|
-
|
|
1283
1222
|
'@vueuse/metadata@14.4.0':
|
|
1284
1223
|
resolution: {integrity: sha512-swx/255R6JyHZFJhx845iz5CRWDZdCfvkZOpACWc5+c5WHcG24mv8gUT1WIdFQaHt6dq79rvILd9QnCWiyVm9g==}
|
|
1285
1224
|
|
|
1286
1225
|
'@vueuse/shared@10.11.1':
|
|
1287
1226
|
resolution: {integrity: sha512-LHpC8711VFZlDaYUXEBbFBCQ7GS3dVU9mjOhhMhXP6txTV4EhYQg/KGnQuvt/sPAtoUKq7VVUnL6mVtFoL42sA==}
|
|
1288
1227
|
|
|
1289
|
-
'@vueuse/shared@12.8.2':
|
|
1290
|
-
resolution: {integrity: sha512-dznP38YzxZoNloI0qpEfpkms8knDtaoQ6Y/sfS0L7Yki4zh40LFHEhur0odJC6xTHG5dxWVPiUWBXn+wCG2s5w==}
|
|
1291
|
-
|
|
1292
|
-
'@vueuse/shared@13.9.0':
|
|
1293
|
-
resolution: {integrity: sha512-e89uuTLMh0U5cZ9iDpEI2senqPGfbPRTHM/0AaQkcxnpqjkZqDYP8rpfm7edOz8s+pOCOROEy1PIveSW8+fL5g==}
|
|
1294
|
-
peerDependencies:
|
|
1295
|
-
vue: ^3.5.0
|
|
1296
|
-
|
|
1297
1228
|
'@vueuse/shared@14.4.0':
|
|
1298
1229
|
resolution: {integrity: sha512-JRgY90Sz8DDtPMsaDflvPMp9xYk69JZAmbuDvAquUVXKr2gEjqtzGNTTthLfckH0BzBqvnu31gb4a8TGLRe79g==}
|
|
1299
1230
|
peerDependencies:
|
|
@@ -4120,22 +4051,6 @@ snapshots:
|
|
|
4120
4051
|
- '@vue/composition-api'
|
|
4121
4052
|
- vue
|
|
4122
4053
|
|
|
4123
|
-
'@vueuse/core@12.8.2(typescript@6.0.3)':
|
|
4124
|
-
dependencies:
|
|
4125
|
-
'@types/web-bluetooth': 0.0.21
|
|
4126
|
-
'@vueuse/metadata': 12.8.2
|
|
4127
|
-
'@vueuse/shared': 12.8.2(typescript@6.0.3)
|
|
4128
|
-
vue: 3.5.22(typescript@6.0.3)
|
|
4129
|
-
transitivePeerDependencies:
|
|
4130
|
-
- typescript
|
|
4131
|
-
|
|
4132
|
-
'@vueuse/core@13.9.0(vue@3.5.22(typescript@6.0.3))':
|
|
4133
|
-
dependencies:
|
|
4134
|
-
'@types/web-bluetooth': 0.0.21
|
|
4135
|
-
'@vueuse/metadata': 13.9.0
|
|
4136
|
-
'@vueuse/shared': 13.9.0(vue@3.5.22(typescript@6.0.3))
|
|
4137
|
-
vue: 3.5.22(typescript@6.0.3)
|
|
4138
|
-
|
|
4139
4054
|
'@vueuse/core@14.4.0(vue@3.5.22(typescript@6.0.3))':
|
|
4140
4055
|
dependencies:
|
|
4141
4056
|
'@types/web-bluetooth': 0.0.21
|
|
@@ -4143,18 +4058,6 @@ snapshots:
|
|
|
4143
4058
|
'@vueuse/shared': 14.4.0(vue@3.5.22(typescript@6.0.3))
|
|
4144
4059
|
vue: 3.5.22(typescript@6.0.3)
|
|
4145
4060
|
|
|
4146
|
-
'@vueuse/integrations@12.8.2(change-case@5.4.4)(fuse.js@7.5.0)(sortablejs@1.15.6)(typescript@6.0.3)':
|
|
4147
|
-
dependencies:
|
|
4148
|
-
'@vueuse/core': 12.8.2(typescript@6.0.3)
|
|
4149
|
-
'@vueuse/shared': 12.8.2(typescript@6.0.3)
|
|
4150
|
-
vue: 3.5.22(typescript@6.0.3)
|
|
4151
|
-
optionalDependencies:
|
|
4152
|
-
change-case: 5.4.4
|
|
4153
|
-
fuse.js: 7.5.0
|
|
4154
|
-
sortablejs: 1.15.6
|
|
4155
|
-
transitivePeerDependencies:
|
|
4156
|
-
- typescript
|
|
4157
|
-
|
|
4158
4061
|
'@vueuse/integrations@14.4.0(change-case@5.4.4)(fuse.js@7.5.0)(sortablejs@1.15.6)(vue@3.5.22(typescript@6.0.3))':
|
|
4159
4062
|
dependencies:
|
|
4160
4063
|
'@vueuse/core': 14.4.0(vue@3.5.22(typescript@6.0.3))
|
|
@@ -4167,10 +4070,6 @@ snapshots:
|
|
|
4167
4070
|
|
|
4168
4071
|
'@vueuse/metadata@10.11.1': {}
|
|
4169
4072
|
|
|
4170
|
-
'@vueuse/metadata@12.8.2': {}
|
|
4171
|
-
|
|
4172
|
-
'@vueuse/metadata@13.9.0': {}
|
|
4173
|
-
|
|
4174
4073
|
'@vueuse/metadata@14.4.0': {}
|
|
4175
4074
|
|
|
4176
4075
|
'@vueuse/shared@10.11.1(vue@3.5.22(typescript@6.0.3))':
|
|
@@ -4180,16 +4079,6 @@ snapshots:
|
|
|
4180
4079
|
- '@vue/composition-api'
|
|
4181
4080
|
- vue
|
|
4182
4081
|
|
|
4183
|
-
'@vueuse/shared@12.8.2(typescript@6.0.3)':
|
|
4184
|
-
dependencies:
|
|
4185
|
-
vue: 3.5.22(typescript@6.0.3)
|
|
4186
|
-
transitivePeerDependencies:
|
|
4187
|
-
- typescript
|
|
4188
|
-
|
|
4189
|
-
'@vueuse/shared@13.9.0(vue@3.5.22(typescript@6.0.3))':
|
|
4190
|
-
dependencies:
|
|
4191
|
-
vue: 3.5.22(typescript@6.0.3)
|
|
4192
|
-
|
|
4193
4082
|
'@vueuse/shared@14.4.0(vue@3.5.22(typescript@6.0.3))':
|
|
4194
4083
|
dependencies:
|
|
4195
4084
|
vue: 3.5.22(typescript@6.0.3)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms-api",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"build": "rimraf dist && tsc",
|
|
21
21
|
"dev": "ajs project run -w -p playground",
|
|
22
22
|
"lint:fix": "oxlint --fix --max-warnings=1000000 && oxfmt . && pnpm --dir frontend-vue lint:fix",
|
|
23
|
-
"lint": "oxlint && oxfmt --check . && pnpm --dir frontend-vue lint",
|
|
24
|
-
"typecheck": "tsc --noEmit",
|
|
25
|
-
"test": "pnpm --dir frontend-vue test",
|
|
23
|
+
"lint": "oxlint && oxfmt --check . && pnpm --dir frontend-vue lint && antelopejs-check-interface-ranges",
|
|
24
|
+
"typecheck": "tsc --noEmit && tsc -p tests",
|
|
25
|
+
"test": "vitest run && pnpm --dir frontend-vue test",
|
|
26
26
|
"format": "oxfmt . && pnpm --dir frontend-vue format",
|
|
27
27
|
"frontend:dev": "cd playground && pnpm frontend:dev",
|
|
28
28
|
"release": "pnpm --dir frontend-vue install --frozen-lockfile && release-it",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"@antelopejs/interface-api": ">=0.0.13 <1.0.0",
|
|
35
35
|
"@antelopejs/interface-api-util": ">=0.1.2 <1.0.0",
|
|
36
36
|
"@antelopejs/interface-core": ">=0.1.1 <1.0.0",
|
|
37
|
-
"@antelopejs/interface-database": ">=0.1.
|
|
38
|
-
"@antelopejs/interface-database-decorators": ">=0.1.
|
|
39
|
-
"@antelopejs/interface-dms": ">=0.2.
|
|
37
|
+
"@antelopejs/interface-database": ">=0.1.8 <1.0.0",
|
|
38
|
+
"@antelopejs/interface-database-decorators": ">=0.1.7 <1.0.0",
|
|
39
|
+
"@antelopejs/interface-dms": ">=0.2.8 <1.0.0",
|
|
40
40
|
"defu": "^6.1.4",
|
|
41
41
|
"node-cron": "^4.2.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@antelopejs/core": "1.9.1",
|
|
45
|
-
"@antelopejs/tooling-configs": ">=0.0.
|
|
45
|
+
"@antelopejs/tooling-configs": ">=0.0.7 <1.0.0",
|
|
46
46
|
"@types/node": "^24.0.0",
|
|
47
47
|
"@types/node-cron": "^3.0.11",
|
|
48
48
|
"knip": "^6.34.0",
|
|
@@ -52,7 +52,8 @@
|
|
|
52
52
|
"release-it": "^19.2.4",
|
|
53
53
|
"release-it-changelogen": "^0.1.0",
|
|
54
54
|
"rimraf": "^6.1.3",
|
|
55
|
-
"typescript": "^6.0.3"
|
|
55
|
+
"typescript": "^6.0.3",
|
|
56
|
+
"vitest": "^3.2.4"
|
|
56
57
|
},
|
|
57
58
|
"optionalDependencies": {
|
|
58
59
|
"@antelopejs/interface-dms-automation": ">=0.1.0 <1.0.0"
|