@remnawave/backend-contract 0.0.32 → 0.0.34
Sign up to get free protection for your applications and to get access to all the features.
- package/api/controllers/system.ts +1 -0
- package/api/routes.ts +1 -0
- package/build/api/controllers/system.js +1 -0
- package/build/api/routes.js +1 -0
- package/build/commands/system/get-bandwidth-stats.command.js +22 -0
- package/build/commands/system/index.js +1 -0
- package/build/models/base-stat.schema.js +9 -0
- package/build/models/index.js +1 -0
- package/commands/system/get-bandwidth-stats.command.ts +25 -0
- package/commands/system/index.ts +1 -0
- package/models/base-stat.schema.ts +7 -0
- package/models/index.ts +1 -0
- package/package.json +1 -1
package/api/routes.ts
CHANGED
package/build/api/routes.js
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GetBandwidthStatsCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const api_1 = require("../../api");
|
6
|
+
const base_stat_schema_1 = require("../../models/base-stat.schema");
|
7
|
+
var GetBandwidthStatsCommand;
|
8
|
+
(function (GetBandwidthStatsCommand) {
|
9
|
+
GetBandwidthStatsCommand.url = api_1.REST_API.SYSTEM.BANDWIDTH;
|
10
|
+
GetBandwidthStatsCommand.RequestQuerySchema = zod_1.z.object({
|
11
|
+
tz: zod_1.z.string().optional(),
|
12
|
+
});
|
13
|
+
GetBandwidthStatsCommand.ResponseSchema = zod_1.z.object({
|
14
|
+
response: zod_1.z.object({
|
15
|
+
bandwidthLastTwoDays: base_stat_schema_1.BaseStatSchema,
|
16
|
+
bandwidthLastSevenDays: base_stat_schema_1.BaseStatSchema,
|
17
|
+
bandwidthLast30Days: base_stat_schema_1.BaseStatSchema,
|
18
|
+
bandwidthCalendarMonth: base_stat_schema_1.BaseStatSchema,
|
19
|
+
bandwidthCurrentYear: base_stat_schema_1.BaseStatSchema,
|
20
|
+
}),
|
21
|
+
});
|
22
|
+
})(GetBandwidthStatsCommand || (exports.GetBandwidthStatsCommand = GetBandwidthStatsCommand = {}));
|
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./get-bandwidth-stats.command"), exports);
|
17
18
|
__exportStar(require("./get-stats.command"), exports);
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.BaseStatSchema = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
exports.BaseStatSchema = zod_1.z.object({
|
6
|
+
current: zod_1.z.string(),
|
7
|
+
previous: zod_1.z.string(),
|
8
|
+
difference: zod_1.z.string(),
|
9
|
+
});
|
package/build/models/index.js
CHANGED
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
__exportStar(require("./api-tokens.schema"), exports);
|
18
18
|
__exportStar(require("./auth.schema"), exports);
|
19
|
+
__exportStar(require("./base-stat.schema"), exports);
|
19
20
|
__exportStar(require("./hosts.schema"), exports);
|
20
21
|
__exportStar(require("./inbounds.schema"), exports);
|
21
22
|
__exportStar(require("./nodes.schema"), exports);
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
import { REST_API } from '../../api';
|
3
|
+
import { BaseStatSchema } from '../../models/base-stat.schema';
|
4
|
+
|
5
|
+
export namespace GetBandwidthStatsCommand {
|
6
|
+
export const url = REST_API.SYSTEM.BANDWIDTH;
|
7
|
+
|
8
|
+
export const RequestQuerySchema = z.object({
|
9
|
+
tz: z.string().optional(),
|
10
|
+
});
|
11
|
+
|
12
|
+
export type Request = z.infer<typeof RequestQuerySchema>;
|
13
|
+
|
14
|
+
export const ResponseSchema = z.object({
|
15
|
+
response: z.object({
|
16
|
+
bandwidthLastTwoDays: BaseStatSchema,
|
17
|
+
bandwidthLastSevenDays: BaseStatSchema,
|
18
|
+
bandwidthLast30Days: BaseStatSchema,
|
19
|
+
bandwidthCalendarMonth: BaseStatSchema,
|
20
|
+
bandwidthCurrentYear: BaseStatSchema,
|
21
|
+
}),
|
22
|
+
});
|
23
|
+
|
24
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
25
|
+
}
|
package/commands/system/index.ts
CHANGED
package/models/index.ts
CHANGED