@remnawave/backend-contract 2.9.20 → 2.9.22
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/build/backend/api/controllers/remnawave-settings.d.ts +2 -2
- package/build/backend/api/controllers/remnawave-settings.d.ts.map +1 -1
- package/build/backend/api/controllers/remnawave-settings.js +3 -3
- package/build/backend/api/controllers/system.d.ts +1 -0
- package/build/backend/api/controllers/system.d.ts.map +1 -1
- package/build/backend/api/controllers/system.js +1 -0
- package/build/backend/api/controllers/users.d.ts +1 -0
- package/build/backend/api/controllers/users.d.ts.map +1 -1
- package/build/backend/api/controllers/users.js +1 -0
- package/build/backend/api/routes.d.ts +2 -0
- package/build/backend/api/routes.d.ts.map +1 -1
- package/build/backend/api/routes.js +4 -2
- package/build/backend/commands/remnawave-settings/get-remnawave-settings.command.js +1 -1
- package/build/backend/commands/remnawave-settings/update-remnawave-settings.command.js +1 -1
- package/build/backend/commands/system/get-stats-digest.command.d.ts +28 -0
- package/build/backend/commands/system/get-stats-digest.command.d.ts.map +1 -0
- package/build/backend/commands/system/get-stats-digest.command.js +35 -0
- package/build/backend/commands/system/index.d.ts +1 -0
- package/build/backend/commands/system/index.d.ts.map +1 -1
- package/build/backend/commands/system/index.js +1 -0
- package/build/backend/commands/users/actions/extend-user.command.d.ts +64 -0
- package/build/backend/commands/users/actions/extend-user.command.d.ts.map +1 -0
- package/build/backend/commands/users/actions/extend-user.command.js +21 -0
- package/build/backend/commands/users/actions/index.d.ts +1 -0
- package/build/backend/commands/users/actions/index.d.ts.map +1 -1
- package/build/backend/commands/users/actions/index.js +1 -0
- package/build/backend/constants/errors/errors.d.ts +13 -3
- package/build/backend/constants/errors/errors.d.ts.map +1 -1
- package/build/backend/constants/errors/errors.js +13 -3
- package/build/frontend/api/controllers/remnawave-settings.js +3 -3
- package/build/frontend/api/controllers/system.js +1 -0
- package/build/frontend/api/controllers/users.js +1 -0
- package/build/frontend/api/routes.js +4 -2
- package/build/frontend/commands/remnawave-settings/get-remnawave-settings.command.js +1 -1
- package/build/frontend/commands/remnawave-settings/update-remnawave-settings.command.js +1 -1
- package/build/frontend/commands/system/get-stats-digest.command.js +35 -0
- package/build/frontend/commands/system/index.js +1 -0
- package/build/frontend/commands/users/actions/extend-user.command.js +21 -0
- package/build/frontend/commands/users/actions/index.js +1 -0
- package/build/frontend/constants/errors/errors.js +13 -3
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const REMNAWAVE_SETTINGS_CONTROLLER: "remnawave-settings";
|
|
2
|
+
export declare const REMNAWAVE_SETTINGS_ROUTES: {
|
|
3
3
|
readonly GET: "";
|
|
4
4
|
readonly UPDATE: "";
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remnawave-settings.d.ts","sourceRoot":"","sources":["../../../../api/controllers/remnawave-settings.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"remnawave-settings.d.ts","sourceRoot":"","sources":["../../../../api/controllers/remnawave-settings.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,EAAG,oBAA6B,CAAC;AAE3E,eAAO,MAAM,yBAAyB;;;CAG5B,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
3
|
+
exports.REMNAWAVE_SETTINGS_ROUTES = exports.REMNAWAVE_SETTINGS_CONTROLLER = void 0;
|
|
4
|
+
exports.REMNAWAVE_SETTINGS_CONTROLLER = 'remnawave-settings';
|
|
5
|
+
exports.REMNAWAVE_SETTINGS_ROUTES = {
|
|
6
6
|
GET: '', // get
|
|
7
7
|
UPDATE: '', // patch
|
|
8
8
|
};
|
|
@@ -5,6 +5,7 @@ export declare const SYSTEM_ROUTES: {
|
|
|
5
5
|
readonly BANDWIDTH_STATS: "stats/bandwidth";
|
|
6
6
|
readonly NODES_STATS: "stats/nodes";
|
|
7
7
|
readonly RECAP: "stats/recap";
|
|
8
|
+
readonly DIGEST: "stats/digest";
|
|
8
9
|
readonly NODES_METRICS: "nodes/metrics";
|
|
9
10
|
readonly HTTP: "stats/http";
|
|
10
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../api/controllers/system.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,EAAG,QAAiB,CAAC;AAEnD,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../api/controllers/system.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,EAAG,QAAiB,CAAC;AAEnD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;CAkBhB,CAAC"}
|
|
@@ -14,6 +14,7 @@ export declare const USERS_ROUTES: {
|
|
|
14
14
|
readonly DISABLE: (userId: string) => string;
|
|
15
15
|
readonly RESET_TRAFFIC: (userId: string) => string;
|
|
16
16
|
readonly REVOKE_SUBSCRIPTION: (userId: string) => string;
|
|
17
|
+
readonly EXTEND_EXPIRATION_DATE: (userId: string) => string;
|
|
17
18
|
};
|
|
18
19
|
readonly GET_BY: {
|
|
19
20
|
readonly SHORT_UUID: (shortUuid: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../api/controllers/users.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,mBAAmB,EAAG,SAAkB,CAAC;AAEtD,eAAO,MAAM,YAAY;;;;;8BAKJ,MAAM;iCACH,MAAM;wCACC,MAAM;oDACM,MAAM;;kCAExB,MAAM;mCACL,MAAM;yCACA,MAAM;+CACA,MAAM;;;
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../api/controllers/users.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,mBAAmB,EAAG,SAAkB,CAAC;AAEtD,eAAO,MAAM,YAAY;;;;;8BAKJ,MAAM;iCACH,MAAM;wCACC,MAAM;oDACM,MAAM;;kCAExB,MAAM;mCACL,MAAM;yCACA,MAAM;+CACA,MAAM;kDACH,MAAM;;;yCAGf,MAAM;sCACT,MAAM;;;;;;;;;;;;;;;;;;;;CAsBzB,CAAC"}
|
|
@@ -17,6 +17,7 @@ exports.USERS_ROUTES = {
|
|
|
17
17
|
DISABLE: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/disable`,
|
|
18
18
|
RESET_TRAFFIC: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/reset-traffic`,
|
|
19
19
|
REVOKE_SUBSCRIPTION: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/revoke`,
|
|
20
|
+
EXTEND_EXPIRATION_DATE: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/extend`,
|
|
20
21
|
},
|
|
21
22
|
GET_BY: {
|
|
22
23
|
SHORT_UUID: (shortUuid) => `by-short-uuid/${shortUuid}`,
|
|
@@ -74,6 +74,7 @@ export declare const REST_API: {
|
|
|
74
74
|
readonly ENABLE: (userId: string) => string;
|
|
75
75
|
readonly RESET_TRAFFIC: (userId: string) => string;
|
|
76
76
|
readonly REVOKE_SUBSCRIPTION: (userId: string) => string;
|
|
77
|
+
readonly EXTEND_EXPIRATION_DATE: (userId: string) => string;
|
|
77
78
|
};
|
|
78
79
|
readonly GET_BY: {
|
|
79
80
|
readonly SHORT_UUID: (shortUuid: string) => string;
|
|
@@ -130,6 +131,7 @@ export declare const REST_API: {
|
|
|
130
131
|
readonly NODES_STATS: "/api/system/stats/nodes";
|
|
131
132
|
readonly NODES_METRICS: "/api/system/nodes/metrics";
|
|
132
133
|
readonly RECAP: "/api/system/stats/recap";
|
|
134
|
+
readonly DIGEST: "/api/system/stats/digest";
|
|
133
135
|
readonly HTTP: "/api/system/stats/http";
|
|
134
136
|
};
|
|
135
137
|
readonly TOOLS: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,WAAW,EAAG,SAAkB,CAAC;AAE9C,eAAO,MAAM,kBAAkB,EAAG,gBAAyB,CAAC;AAC5D,eAAO,MAAM,cAAc,EAAG,uBAAgC,CAAC;AAC/D,eAAO,MAAM,YAAY,EAAG,wBAAiC,CAAC;AAC9D,eAAO,MAAM,WAAW,EAAG,uBAAgC,CAAC;AAE5D,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;gCAyBE,MAAM;;;;;;;;;;;qCAcD,MAAM;;gCAGX,MAAM;;;;;oCAOF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;2CAKA,MAAM;;;;;;;;;;;;;;kCAkBf,MAAM;qCAGH,MAAM;4CAEC,MAAM;wDAEM,MAAM;;uCAMvB,MAAM;sCAIP,MAAM;6CAIC,MAAM;mDAIA,MAAM;;;
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,WAAW,EAAG,SAAkB,CAAC;AAE9C,eAAO,MAAM,kBAAkB,EAAG,gBAAyB,CAAC;AAC5D,eAAO,MAAM,cAAc,EAAG,uBAAgC,CAAC;AAC/D,eAAO,MAAM,YAAY,EAAG,wBAAiC,CAAC;AAC9D,e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AAM;sCAEH,MAAM;;;CAIzB,CAAC"}
|
|
@@ -111,6 +111,7 @@ exports.REST_API = {
|
|
|
111
111
|
ENABLE: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.ENABLE(userId)}`,
|
|
112
112
|
RESET_TRAFFIC: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.RESET_TRAFFIC(userId)}`,
|
|
113
113
|
REVOKE_SUBSCRIPTION: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.REVOKE_SUBSCRIPTION(userId)}`,
|
|
114
|
+
EXTEND_EXPIRATION_DATE: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.EXTEND_EXPIRATION_DATE(userId)}`,
|
|
114
115
|
},
|
|
115
116
|
GET_BY: {
|
|
116
117
|
SHORT_UUID: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY.SHORT_UUID(shortUuid)}`,
|
|
@@ -167,6 +168,7 @@ exports.REST_API = {
|
|
|
167
168
|
NODES_STATS: `${exports.ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.STATS.NODES_STATS}`,
|
|
168
169
|
NODES_METRICS: `${exports.ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.STATS.NODES_METRICS}`,
|
|
169
170
|
RECAP: `${exports.ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.STATS.RECAP}`,
|
|
171
|
+
DIGEST: `${exports.ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.STATS.DIGEST}`,
|
|
170
172
|
HTTP: `${exports.ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.STATS.HTTP}`,
|
|
171
173
|
},
|
|
172
174
|
TOOLS: {
|
|
@@ -281,8 +283,8 @@ exports.REST_API = {
|
|
|
281
283
|
},
|
|
282
284
|
},
|
|
283
285
|
REMNAAWAVE_SETTINGS: {
|
|
284
|
-
GET: `${exports.ROOT}/${CONTROLLERS.
|
|
285
|
-
UPDATE: `${exports.ROOT}/${CONTROLLERS.
|
|
286
|
+
GET: `${exports.ROOT}/${CONTROLLERS.REMNAWAVE_SETTINGS_CONTROLLER}/${CONTROLLERS.REMNAWAVE_SETTINGS_ROUTES.GET}`,
|
|
287
|
+
UPDATE: `${exports.ROOT}/${CONTROLLERS.REMNAWAVE_SETTINGS_CONTROLLER}/${CONTROLLERS.REMNAWAVE_SETTINGS_ROUTES.UPDATE}`,
|
|
286
288
|
},
|
|
287
289
|
SUBSCRIPTION_PAGE_CONFIGS: {
|
|
288
290
|
GET: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PAGE_CONFIGS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_PAGE_CONFIGS_ROUTES.GET(uuid)}`,
|
|
@@ -9,7 +9,7 @@ var GetRemnawaveSettingsCommand;
|
|
|
9
9
|
(function (GetRemnawaveSettingsCommand) {
|
|
10
10
|
GetRemnawaveSettingsCommand.url = api_1.REST_API.REMNAAWAVE_SETTINGS.GET;
|
|
11
11
|
GetRemnawaveSettingsCommand.TSQ_url = GetRemnawaveSettingsCommand.url;
|
|
12
|
-
GetRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.
|
|
12
|
+
GetRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.REMNAWAVE_SETTINGS_ROUTES.GET, 'get', 'Get Remnawave settings', { scope: 'get', kind: 'read' });
|
|
13
13
|
GetRemnawaveSettingsCommand.ResponseSchema = zod_1.z.object({
|
|
14
14
|
response: models_1.RemnawaveSettingsSchema,
|
|
15
15
|
});
|
|
@@ -9,7 +9,7 @@ var UpdateRemnawaveSettingsCommand;
|
|
|
9
9
|
(function (UpdateRemnawaveSettingsCommand) {
|
|
10
10
|
UpdateRemnawaveSettingsCommand.url = api_1.REST_API.REMNAAWAVE_SETTINGS.UPDATE;
|
|
11
11
|
UpdateRemnawaveSettingsCommand.TSQ_url = UpdateRemnawaveSettingsCommand.url;
|
|
12
|
-
UpdateRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.
|
|
12
|
+
UpdateRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.REMNAWAVE_SETTINGS_ROUTES.UPDATE, 'patch', 'Update Remnawave settings', { scope: 'update', kind: 'write' });
|
|
13
13
|
UpdateRemnawaveSettingsCommand.RequestBodySchema = zod_1.z.object({
|
|
14
14
|
passkeySettings: models_1.PasskeySettingsSchema.optional(),
|
|
15
15
|
oauth2Settings: models_1.Oauth2SettingsSchema.optional(),
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare namespace GetStatsDigestCommand {
|
|
3
|
+
const url: "/api/system/stats/digest";
|
|
4
|
+
const TSQ_url: "/api/system/stats/digest";
|
|
5
|
+
const endpointDetails: import("../../constants").EndpointDetails;
|
|
6
|
+
const RequestQuerySchema: z.ZodObject<{
|
|
7
|
+
start: z.ZodISODateTime;
|
|
8
|
+
end: z.ZodISODateTime;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
const ResponseSchema: z.ZodObject<{
|
|
11
|
+
response: z.ZodObject<{
|
|
12
|
+
users: z.ZodObject<{
|
|
13
|
+
createdCount: z.ZodNumber;
|
|
14
|
+
expiredCount: z.ZodNumber;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
traffic: z.ZodObject<{
|
|
17
|
+
totalBytes: z.ZodString;
|
|
18
|
+
byUsersCreatedInRangeBytes: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
hwidDevices: z.ZodObject<{
|
|
21
|
+
createdCount: z.ZodNumber;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
26
|
+
type Response = z.infer<typeof ResponseSchema>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=get-stats-digest.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-stats-digest.command.d.ts","sourceRoot":"","sources":["../../../../commands/system/get-stats-digest.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,qBAAqB,CAAC;IAC5B,MAAM,GAAG,4BAA+B,CAAC;IACzC,MAAM,OAAO,4BAAM,CAAC;IAEpB,MAAM,eAAe,2CAM3B,CAAC;IAEK,MAAM,kBAAkB;;;qBAW7B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;qBAczB,CAAC;IAEH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC9D,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetStatsDigestCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const api_1 = require("../../api");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
var GetStatsDigestCommand;
|
|
8
|
+
(function (GetStatsDigestCommand) {
|
|
9
|
+
GetStatsDigestCommand.url = api_1.REST_API.SYSTEM.STATS.DIGEST;
|
|
10
|
+
GetStatsDigestCommand.TSQ_url = GetStatsDigestCommand.url;
|
|
11
|
+
GetStatsDigestCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SYSTEM_ROUTES.STATS.DIGEST, 'get', 'Get Stats Digest', { scope: 'digest', kind: 'read' }, 'Aggregated statistics for a datetime range [start, end): created and expired users, total traffic, traffic spent by users created within the range and new HWID devices. Per-user traffic history is stored with daily granularity (UTC), so the "traffic by new users" metric snaps to whole days at the range edges.');
|
|
12
|
+
GetStatsDigestCommand.RequestQuerySchema = zod_1.z.object({
|
|
13
|
+
start: zod_1.z.iso
|
|
14
|
+
.datetime({ offset: true })
|
|
15
|
+
.describe('Start of the range, ISO 8601 datetime with timezone (e.g. 2026-07-15T00:00:00Z). Inclusive.'),
|
|
16
|
+
end: zod_1.z.iso
|
|
17
|
+
.datetime({ offset: true })
|
|
18
|
+
.describe('End of the range, ISO 8601 datetime with timezone (e.g. 2026-07-16T00:00:00Z). Exclusive.'),
|
|
19
|
+
});
|
|
20
|
+
GetStatsDigestCommand.ResponseSchema = zod_1.z.object({
|
|
21
|
+
response: zod_1.z.object({
|
|
22
|
+
users: zod_1.z.object({
|
|
23
|
+
createdCount: zod_1.z.number(),
|
|
24
|
+
expiredCount: zod_1.z.number(),
|
|
25
|
+
}),
|
|
26
|
+
traffic: zod_1.z.object({
|
|
27
|
+
totalBytes: zod_1.z.string(),
|
|
28
|
+
byUsersCreatedInRangeBytes: zod_1.z.string(),
|
|
29
|
+
}),
|
|
30
|
+
hwidDevices: zod_1.z.object({
|
|
31
|
+
createdCount: zod_1.z.number(),
|
|
32
|
+
}),
|
|
33
|
+
}),
|
|
34
|
+
});
|
|
35
|
+
})(GetStatsDigestCommand || (exports.GetStatsDigestCommand = GetStatsDigestCommand = {}));
|
|
@@ -3,6 +3,7 @@ export * from './get-metadata.command';
|
|
|
3
3
|
export * from './get-nodes-metrics.command';
|
|
4
4
|
export * from './get-nodes-statistics';
|
|
5
5
|
export * from './get-recap.command';
|
|
6
|
+
export * from './get-stats-digest.command';
|
|
6
7
|
export * from './get-remnawave-health.command';
|
|
7
8
|
export * from './get-stats.command';
|
|
8
9
|
export * from './testers';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/system/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/system/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,0BAA0B,CAAC"}
|
|
@@ -19,6 +19,7 @@ __exportStar(require("./get-metadata.command"), exports);
|
|
|
19
19
|
__exportStar(require("./get-nodes-metrics.command"), exports);
|
|
20
20
|
__exportStar(require("./get-nodes-statistics"), exports);
|
|
21
21
|
__exportStar(require("./get-recap.command"), exports);
|
|
22
|
+
__exportStar(require("./get-stats-digest.command"), exports);
|
|
22
23
|
__exportStar(require("./get-remnawave-health.command"), exports);
|
|
23
24
|
__exportStar(require("./get-stats.command"), exports);
|
|
24
25
|
__exportStar(require("./testers"), exports);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare namespace ExtendUserCommand {
|
|
3
|
+
const url: (userId: string) => string;
|
|
4
|
+
const TSQ_url: string;
|
|
5
|
+
const endpointDetails: import("../../../constants").EndpointDetails;
|
|
6
|
+
const RequestParamSchema: z.ZodObject<{
|
|
7
|
+
userId: z.ZodCoercedNumber<unknown>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
const RequestBodySchema: z.ZodObject<{
|
|
10
|
+
days: z.ZodNumber;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
const ResponseSchema: z.ZodObject<{
|
|
13
|
+
response: z.ZodObject<{
|
|
14
|
+
id: z.ZodNumber;
|
|
15
|
+
shortUuid: z.ZodString;
|
|
16
|
+
username: z.ZodString;
|
|
17
|
+
status: z.ZodEnum<{
|
|
18
|
+
readonly ACTIVE: "ACTIVE";
|
|
19
|
+
readonly DISABLED: "DISABLED";
|
|
20
|
+
readonly LIMITED: "LIMITED";
|
|
21
|
+
readonly EXPIRED: "EXPIRED";
|
|
22
|
+
}>;
|
|
23
|
+
trafficLimitBytes: z.ZodNumber;
|
|
24
|
+
trafficLimitStrategy: z.ZodEnum<{
|
|
25
|
+
readonly NO_RESET: "NO_RESET";
|
|
26
|
+
readonly DAY: "DAY";
|
|
27
|
+
readonly WEEK: "WEEK";
|
|
28
|
+
readonly MONTH: "MONTH";
|
|
29
|
+
readonly MONTH_ROLLING: "MONTH_ROLLING";
|
|
30
|
+
}>;
|
|
31
|
+
expireAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
|
|
32
|
+
telegramId: z.ZodNullable<z.ZodNumber>;
|
|
33
|
+
email: z.ZodNullable<z.ZodEmail>;
|
|
34
|
+
description: z.ZodNullable<z.ZodString>;
|
|
35
|
+
tag: z.ZodNullable<z.ZodString>;
|
|
36
|
+
hwidDeviceLimit: z.ZodNullable<z.ZodInt>;
|
|
37
|
+
externalSquadUuid: z.ZodNullable<z.ZodUUID>;
|
|
38
|
+
trojanPassword: z.ZodString;
|
|
39
|
+
vlessUuid: z.ZodUUID;
|
|
40
|
+
ssPassword: z.ZodString;
|
|
41
|
+
lastTriggeredThreshold: z.ZodInt;
|
|
42
|
+
subRevokedAt: z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>>;
|
|
43
|
+
lastTrafficResetAt: z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>>;
|
|
44
|
+
createdAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
|
|
45
|
+
updatedAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
|
|
46
|
+
subscriptionUrl: z.ZodString;
|
|
47
|
+
activeInternalSquads: z.ZodArray<z.ZodObject<{
|
|
48
|
+
uuid: z.ZodUUID;
|
|
49
|
+
name: z.ZodString;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
userTraffic: z.ZodObject<{
|
|
52
|
+
usedTrafficBytes: z.ZodNumber;
|
|
53
|
+
lifetimeUsedTrafficBytes: z.ZodNumber;
|
|
54
|
+
onlineAt: z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>>;
|
|
55
|
+
firstConnectedAt: z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>>;
|
|
56
|
+
lastConnectedNodeUuid: z.ZodNullable<z.ZodUUID>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
61
|
+
type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
62
|
+
type Response = z.infer<typeof ResponseSchema>;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=extend-user.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extend-user.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/actions/extend-user.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,yBAAiB,iBAAiB,CAAC;IACxB,MAAM,GAAG,4BAAgD,CAAC;IAC1D,MAAM,OAAO,QAAiB,CAAC;IAE/B,MAAM,eAAe,8CAM3B,CAAC;IAEK,MAAM,kBAAkB;;qBAE7B,CAAC;IAEI,MAAM,iBAAiB;;qBAE5B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAqB,CAAC;IAEjD,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC9D,KAAY,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAC5D,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExtendUserCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const api_1 = require("../../../api");
|
|
6
|
+
const constants_1 = require("../../../constants");
|
|
7
|
+
const models_1 = require("../../../models");
|
|
8
|
+
const user_response_1 = require("../user.response");
|
|
9
|
+
var ExtendUserCommand;
|
|
10
|
+
(function (ExtendUserCommand) {
|
|
11
|
+
ExtendUserCommand.url = api_1.REST_API.USERS.ACTIONS.EXTEND_EXPIRATION_DATE;
|
|
12
|
+
ExtendUserCommand.TSQ_url = ExtendUserCommand.url(':userId');
|
|
13
|
+
ExtendUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACTIONS.EXTEND_EXPIRATION_DATE(':userId'), 'post', 'Extend user expiration date', { scope: 'extend', kind: 'write' }, 'If user status is EXPIRED, the new expiration date is calculated from the current date and the user becomes ACTIVE. If user status is ACTIVE, the given number of days is added to the existing expiration date. DISABLED and LIMITED users will be extended, but their status will not change.');
|
|
14
|
+
ExtendUserCommand.RequestParamSchema = zod_1.z.object({
|
|
15
|
+
userId: models_1.numberParamSchema,
|
|
16
|
+
});
|
|
17
|
+
ExtendUserCommand.RequestBodySchema = zod_1.z.object({
|
|
18
|
+
days: zod_1.z.number().min(1).describe('The number of days to extend the expiration date.'),
|
|
19
|
+
});
|
|
20
|
+
ExtendUserCommand.ResponseSchema = user_response_1.UserResponseSchema;
|
|
21
|
+
})(ExtendUserCommand || (exports.ExtendUserCommand = ExtendUserCommand = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commands/users/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commands/users/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC"}
|
|
@@ -18,3 +18,4 @@ __exportStar(require("./disable-user.command"), exports);
|
|
|
18
18
|
__exportStar(require("./enable-user.command"), exports);
|
|
19
19
|
__exportStar(require("./reset-user-traffic.command"), exports);
|
|
20
20
|
__exportStar(require("./revoke-user-subscription.command"), exports);
|
|
21
|
+
__exportStar(require("./extend-user.command"), exports);
|
|
@@ -964,12 +964,12 @@ export declare const ERRORS: {
|
|
|
964
964
|
readonly message: "Passkey not found";
|
|
965
965
|
readonly httpCode: 404;
|
|
966
966
|
};
|
|
967
|
-
readonly
|
|
967
|
+
readonly GET_REMNAWAVE_SETTINGS_ERROR: {
|
|
968
968
|
readonly code: "A192";
|
|
969
969
|
readonly message: "Get Remnawave settings error";
|
|
970
970
|
readonly httpCode: 500;
|
|
971
971
|
};
|
|
972
|
-
readonly
|
|
972
|
+
readonly UPDATE_REMNAWAVE_SETTINGS_ERROR: {
|
|
973
973
|
readonly code: "A193";
|
|
974
974
|
readonly message: "Update Remnawave settings error";
|
|
975
975
|
readonly httpCode: 500;
|
|
@@ -1004,7 +1004,7 @@ export declare const ERRORS: {
|
|
|
1004
1004
|
readonly message: "Delete passkey error";
|
|
1005
1005
|
readonly httpCode: 500;
|
|
1006
1006
|
};
|
|
1007
|
-
readonly
|
|
1007
|
+
readonly VALIDATE_REMNAWAVE_SETTINGS_ERROR: {
|
|
1008
1008
|
readonly code: "A199";
|
|
1009
1009
|
readonly message: "Validate Remnawave settings error";
|
|
1010
1010
|
readonly httpCode: 500;
|
|
@@ -1199,5 +1199,15 @@ export declare const ERRORS: {
|
|
|
1199
1199
|
readonly message: "Remove many users from internal squad error";
|
|
1200
1200
|
readonly httpCode: 500;
|
|
1201
1201
|
};
|
|
1202
|
+
readonly GET_STATS_DIGEST_INVALID_RANGE: {
|
|
1203
|
+
readonly code: "A235";
|
|
1204
|
+
readonly message: "Start date must be before or equal to end date";
|
|
1205
|
+
readonly httpCode: 400;
|
|
1206
|
+
};
|
|
1207
|
+
readonly GET_STATS_DIGEST_ERROR: {
|
|
1208
|
+
readonly code: "A236";
|
|
1209
|
+
readonly message: "Get stats digest error";
|
|
1210
|
+
readonly httpCode: 500;
|
|
1211
|
+
};
|
|
1202
1212
|
};
|
|
1203
1213
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAsqBN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA0KN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+B3B,CAAC"}
|
|
@@ -935,12 +935,12 @@ exports.ERRORS = {
|
|
|
935
935
|
message: 'Passkey not found',
|
|
936
936
|
httpCode: 404,
|
|
937
937
|
},
|
|
938
|
-
|
|
938
|
+
GET_REMNAWAVE_SETTINGS_ERROR: {
|
|
939
939
|
code: 'A192',
|
|
940
940
|
message: 'Get Remnawave settings error',
|
|
941
941
|
httpCode: 500,
|
|
942
942
|
},
|
|
943
|
-
|
|
943
|
+
UPDATE_REMNAWAVE_SETTINGS_ERROR: {
|
|
944
944
|
code: 'A193',
|
|
945
945
|
message: 'Update Remnawave settings error',
|
|
946
946
|
httpCode: 500,
|
|
@@ -975,7 +975,7 @@ exports.ERRORS = {
|
|
|
975
975
|
message: 'Delete passkey error',
|
|
976
976
|
httpCode: 500,
|
|
977
977
|
},
|
|
978
|
-
|
|
978
|
+
VALIDATE_REMNAWAVE_SETTINGS_ERROR: {
|
|
979
979
|
code: 'A199',
|
|
980
980
|
message: 'Validate Remnawave settings error',
|
|
981
981
|
httpCode: 500,
|
|
@@ -1170,4 +1170,14 @@ exports.ERRORS = {
|
|
|
1170
1170
|
message: 'Remove many users from internal squad error',
|
|
1171
1171
|
httpCode: 500,
|
|
1172
1172
|
},
|
|
1173
|
+
GET_STATS_DIGEST_INVALID_RANGE: {
|
|
1174
|
+
code: 'A235',
|
|
1175
|
+
message: 'Start date must be before or equal to end date',
|
|
1176
|
+
httpCode: 400,
|
|
1177
|
+
},
|
|
1178
|
+
GET_STATS_DIGEST_ERROR: {
|
|
1179
|
+
code: 'A236',
|
|
1180
|
+
message: 'Get stats digest error',
|
|
1181
|
+
httpCode: 500,
|
|
1182
|
+
},
|
|
1173
1183
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
3
|
+
exports.REMNAWAVE_SETTINGS_ROUTES = exports.REMNAWAVE_SETTINGS_CONTROLLER = void 0;
|
|
4
|
+
exports.REMNAWAVE_SETTINGS_CONTROLLER = 'remnawave-settings';
|
|
5
|
+
exports.REMNAWAVE_SETTINGS_ROUTES = {
|
|
6
6
|
GET: '', // get
|
|
7
7
|
UPDATE: '', // patch
|
|
8
8
|
};
|
|
@@ -17,6 +17,7 @@ exports.USERS_ROUTES = {
|
|
|
17
17
|
DISABLE: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/disable`,
|
|
18
18
|
RESET_TRAFFIC: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/reset-traffic`,
|
|
19
19
|
REVOKE_SUBSCRIPTION: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/revoke`,
|
|
20
|
+
EXTEND_EXPIRATION_DATE: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/extend`,
|
|
20
21
|
},
|
|
21
22
|
GET_BY: {
|
|
22
23
|
SHORT_UUID: (shortUuid) => `by-short-uuid/${shortUuid}`,
|
|
@@ -111,6 +111,7 @@ exports.REST_API = {
|
|
|
111
111
|
ENABLE: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.ENABLE(userId)}`,
|
|
112
112
|
RESET_TRAFFIC: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.RESET_TRAFFIC(userId)}`,
|
|
113
113
|
REVOKE_SUBSCRIPTION: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.REVOKE_SUBSCRIPTION(userId)}`,
|
|
114
|
+
EXTEND_EXPIRATION_DATE: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.EXTEND_EXPIRATION_DATE(userId)}`,
|
|
114
115
|
},
|
|
115
116
|
GET_BY: {
|
|
116
117
|
SHORT_UUID: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY.SHORT_UUID(shortUuid)}`,
|
|
@@ -167,6 +168,7 @@ exports.REST_API = {
|
|
|
167
168
|
NODES_STATS: `${exports.ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.STATS.NODES_STATS}`,
|
|
168
169
|
NODES_METRICS: `${exports.ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.STATS.NODES_METRICS}`,
|
|
169
170
|
RECAP: `${exports.ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.STATS.RECAP}`,
|
|
171
|
+
DIGEST: `${exports.ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.STATS.DIGEST}`,
|
|
170
172
|
HTTP: `${exports.ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.STATS.HTTP}`,
|
|
171
173
|
},
|
|
172
174
|
TOOLS: {
|
|
@@ -281,8 +283,8 @@ exports.REST_API = {
|
|
|
281
283
|
},
|
|
282
284
|
},
|
|
283
285
|
REMNAAWAVE_SETTINGS: {
|
|
284
|
-
GET: `${exports.ROOT}/${CONTROLLERS.
|
|
285
|
-
UPDATE: `${exports.ROOT}/${CONTROLLERS.
|
|
286
|
+
GET: `${exports.ROOT}/${CONTROLLERS.REMNAWAVE_SETTINGS_CONTROLLER}/${CONTROLLERS.REMNAWAVE_SETTINGS_ROUTES.GET}`,
|
|
287
|
+
UPDATE: `${exports.ROOT}/${CONTROLLERS.REMNAWAVE_SETTINGS_CONTROLLER}/${CONTROLLERS.REMNAWAVE_SETTINGS_ROUTES.UPDATE}`,
|
|
286
288
|
},
|
|
287
289
|
SUBSCRIPTION_PAGE_CONFIGS: {
|
|
288
290
|
GET: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PAGE_CONFIGS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_PAGE_CONFIGS_ROUTES.GET(uuid)}`,
|
|
@@ -9,7 +9,7 @@ var GetRemnawaveSettingsCommand;
|
|
|
9
9
|
(function (GetRemnawaveSettingsCommand) {
|
|
10
10
|
GetRemnawaveSettingsCommand.url = api_1.REST_API.REMNAAWAVE_SETTINGS.GET;
|
|
11
11
|
GetRemnawaveSettingsCommand.TSQ_url = GetRemnawaveSettingsCommand.url;
|
|
12
|
-
GetRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.
|
|
12
|
+
GetRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.REMNAWAVE_SETTINGS_ROUTES.GET, 'get', 'Get Remnawave settings', { scope: 'get', kind: 'read' });
|
|
13
13
|
GetRemnawaveSettingsCommand.ResponseSchema = zod_1.z.object({
|
|
14
14
|
response: models_1.RemnawaveSettingsSchema,
|
|
15
15
|
});
|
|
@@ -9,7 +9,7 @@ var UpdateRemnawaveSettingsCommand;
|
|
|
9
9
|
(function (UpdateRemnawaveSettingsCommand) {
|
|
10
10
|
UpdateRemnawaveSettingsCommand.url = api_1.REST_API.REMNAAWAVE_SETTINGS.UPDATE;
|
|
11
11
|
UpdateRemnawaveSettingsCommand.TSQ_url = UpdateRemnawaveSettingsCommand.url;
|
|
12
|
-
UpdateRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.
|
|
12
|
+
UpdateRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.REMNAWAVE_SETTINGS_ROUTES.UPDATE, 'patch', 'Update Remnawave settings', { scope: 'update', kind: 'write' });
|
|
13
13
|
UpdateRemnawaveSettingsCommand.RequestBodySchema = zod_1.z.object({
|
|
14
14
|
passkeySettings: models_1.PasskeySettingsSchema.optional(),
|
|
15
15
|
oauth2Settings: models_1.Oauth2SettingsSchema.optional(),
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetStatsDigestCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const api_1 = require("../../api");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
var GetStatsDigestCommand;
|
|
8
|
+
(function (GetStatsDigestCommand) {
|
|
9
|
+
GetStatsDigestCommand.url = api_1.REST_API.SYSTEM.STATS.DIGEST;
|
|
10
|
+
GetStatsDigestCommand.TSQ_url = GetStatsDigestCommand.url;
|
|
11
|
+
GetStatsDigestCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SYSTEM_ROUTES.STATS.DIGEST, 'get', 'Get Stats Digest', { scope: 'digest', kind: 'read' }, 'Aggregated statistics for a datetime range [start, end): created and expired users, total traffic, traffic spent by users created within the range and new HWID devices. Per-user traffic history is stored with daily granularity (UTC), so the "traffic by new users" metric snaps to whole days at the range edges.');
|
|
12
|
+
GetStatsDigestCommand.RequestQuerySchema = zod_1.z.object({
|
|
13
|
+
start: zod_1.z.iso
|
|
14
|
+
.datetime({ offset: true })
|
|
15
|
+
.describe('Start of the range, ISO 8601 datetime with timezone (e.g. 2026-07-15T00:00:00Z). Inclusive.'),
|
|
16
|
+
end: zod_1.z.iso
|
|
17
|
+
.datetime({ offset: true })
|
|
18
|
+
.describe('End of the range, ISO 8601 datetime with timezone (e.g. 2026-07-16T00:00:00Z). Exclusive.'),
|
|
19
|
+
});
|
|
20
|
+
GetStatsDigestCommand.ResponseSchema = zod_1.z.object({
|
|
21
|
+
response: zod_1.z.object({
|
|
22
|
+
users: zod_1.z.object({
|
|
23
|
+
createdCount: zod_1.z.number(),
|
|
24
|
+
expiredCount: zod_1.z.number(),
|
|
25
|
+
}),
|
|
26
|
+
traffic: zod_1.z.object({
|
|
27
|
+
totalBytes: zod_1.z.string(),
|
|
28
|
+
byUsersCreatedInRangeBytes: zod_1.z.string(),
|
|
29
|
+
}),
|
|
30
|
+
hwidDevices: zod_1.z.object({
|
|
31
|
+
createdCount: zod_1.z.number(),
|
|
32
|
+
}),
|
|
33
|
+
}),
|
|
34
|
+
});
|
|
35
|
+
})(GetStatsDigestCommand || (exports.GetStatsDigestCommand = GetStatsDigestCommand = {}));
|
|
@@ -19,6 +19,7 @@ __exportStar(require("./get-metadata.command"), exports);
|
|
|
19
19
|
__exportStar(require("./get-nodes-metrics.command"), exports);
|
|
20
20
|
__exportStar(require("./get-nodes-statistics"), exports);
|
|
21
21
|
__exportStar(require("./get-recap.command"), exports);
|
|
22
|
+
__exportStar(require("./get-stats-digest.command"), exports);
|
|
22
23
|
__exportStar(require("./get-remnawave-health.command"), exports);
|
|
23
24
|
__exportStar(require("./get-stats.command"), exports);
|
|
24
25
|
__exportStar(require("./testers"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExtendUserCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const api_1 = require("../../../api");
|
|
6
|
+
const constants_1 = require("../../../constants");
|
|
7
|
+
const models_1 = require("../../../models");
|
|
8
|
+
const user_response_1 = require("../user.response");
|
|
9
|
+
var ExtendUserCommand;
|
|
10
|
+
(function (ExtendUserCommand) {
|
|
11
|
+
ExtendUserCommand.url = api_1.REST_API.USERS.ACTIONS.EXTEND_EXPIRATION_DATE;
|
|
12
|
+
ExtendUserCommand.TSQ_url = ExtendUserCommand.url(':userId');
|
|
13
|
+
ExtendUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACTIONS.EXTEND_EXPIRATION_DATE(':userId'), 'post', 'Extend user expiration date', { scope: 'extend', kind: 'write' }, 'If user status is EXPIRED, the new expiration date is calculated from the current date and the user becomes ACTIVE. If user status is ACTIVE, the given number of days is added to the existing expiration date. DISABLED and LIMITED users will be extended, but their status will not change.');
|
|
14
|
+
ExtendUserCommand.RequestParamSchema = zod_1.z.object({
|
|
15
|
+
userId: models_1.numberParamSchema,
|
|
16
|
+
});
|
|
17
|
+
ExtendUserCommand.RequestBodySchema = zod_1.z.object({
|
|
18
|
+
days: zod_1.z.number().min(1).describe('The number of days to extend the expiration date.'),
|
|
19
|
+
});
|
|
20
|
+
ExtendUserCommand.ResponseSchema = user_response_1.UserResponseSchema;
|
|
21
|
+
})(ExtendUserCommand || (exports.ExtendUserCommand = ExtendUserCommand = {}));
|
|
@@ -18,3 +18,4 @@ __exportStar(require("./disable-user.command"), exports);
|
|
|
18
18
|
__exportStar(require("./enable-user.command"), exports);
|
|
19
19
|
__exportStar(require("./reset-user-traffic.command"), exports);
|
|
20
20
|
__exportStar(require("./revoke-user-subscription.command"), exports);
|
|
21
|
+
__exportStar(require("./extend-user.command"), exports);
|
|
@@ -935,12 +935,12 @@ exports.ERRORS = {
|
|
|
935
935
|
message: 'Passkey not found',
|
|
936
936
|
httpCode: 404,
|
|
937
937
|
},
|
|
938
|
-
|
|
938
|
+
GET_REMNAWAVE_SETTINGS_ERROR: {
|
|
939
939
|
code: 'A192',
|
|
940
940
|
message: 'Get Remnawave settings error',
|
|
941
941
|
httpCode: 500,
|
|
942
942
|
},
|
|
943
|
-
|
|
943
|
+
UPDATE_REMNAWAVE_SETTINGS_ERROR: {
|
|
944
944
|
code: 'A193',
|
|
945
945
|
message: 'Update Remnawave settings error',
|
|
946
946
|
httpCode: 500,
|
|
@@ -975,7 +975,7 @@ exports.ERRORS = {
|
|
|
975
975
|
message: 'Delete passkey error',
|
|
976
976
|
httpCode: 500,
|
|
977
977
|
},
|
|
978
|
-
|
|
978
|
+
VALIDATE_REMNAWAVE_SETTINGS_ERROR: {
|
|
979
979
|
code: 'A199',
|
|
980
980
|
message: 'Validate Remnawave settings error',
|
|
981
981
|
httpCode: 500,
|
|
@@ -1170,4 +1170,14 @@ exports.ERRORS = {
|
|
|
1170
1170
|
message: 'Remove many users from internal squad error',
|
|
1171
1171
|
httpCode: 500,
|
|
1172
1172
|
},
|
|
1173
|
+
GET_STATS_DIGEST_INVALID_RANGE: {
|
|
1174
|
+
code: 'A235',
|
|
1175
|
+
message: 'Start date must be before or equal to end date',
|
|
1176
|
+
httpCode: 400,
|
|
1177
|
+
},
|
|
1178
|
+
GET_STATS_DIGEST_ERROR: {
|
|
1179
|
+
code: 'A236',
|
|
1180
|
+
message: 'Get stats digest error',
|
|
1181
|
+
httpCode: 500,
|
|
1182
|
+
},
|
|
1173
1183
|
};
|
package/package.json
CHANGED