@remnawave/backend-contract 0.5.7 → 0.6.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/build/backend/api/controllers/index.d.ts +1 -0
- package/build/backend/api/controllers/index.d.ts.map +1 -1
- package/build/backend/api/controllers/index.js +1 -0
- package/build/backend/api/controllers/subscriptions.d.ts +8 -0
- package/build/backend/api/controllers/subscriptions.d.ts.map +1 -0
- package/build/backend/api/controllers/subscriptions.js +10 -0
- package/build/backend/api/controllers/users.d.ts +4 -0
- package/build/backend/api/controllers/users.d.ts.map +1 -1
- package/build/backend/api/controllers/users.js +4 -0
- package/build/backend/api/routes.d.ts +10 -0
- package/build/backend/api/routes.d.ts.map +1 -1
- package/build/backend/api/routes.js +10 -0
- package/build/backend/commands/index.d.ts +1 -0
- package/build/backend/commands/index.d.ts.map +1 -1
- package/build/backend/commands/index.js +1 -0
- package/build/backend/commands/subscriptions/get-all-subscriptions.command.d.ts +183 -0
- package/build/backend/commands/subscriptions/get-all-subscriptions.command.d.ts.map +1 -0
- package/build/backend/commands/subscriptions/get-all-subscriptions.command.js +49 -0
- package/build/backend/commands/subscriptions/get-by/get-subscription-by-username.command.d.ts +133 -0
- package/build/backend/commands/subscriptions/get-by/get-subscription-by-username.command.d.ts.map +1 -0
- package/build/backend/commands/subscriptions/get-by/get-subscription-by-username.command.js +37 -0
- package/build/backend/commands/subscriptions/get-by/index.d.ts +2 -0
- package/build/backend/commands/subscriptions/get-by/index.d.ts.map +1 -0
- package/build/backend/commands/subscriptions/get-by/index.js +17 -0
- package/build/backend/commands/subscriptions/index.d.ts +3 -0
- package/build/backend/commands/subscriptions/index.d.ts.map +1 -0
- package/build/backend/commands/subscriptions/index.js +18 -0
- package/build/backend/commands/users/actions/activate-all-inbounds.command.d.ts +5 -0
- package/build/backend/commands/users/actions/activate-all-inbounds.command.d.ts.map +1 -1
- package/build/backend/commands/users/actions/disable-user.command.d.ts +5 -0
- package/build/backend/commands/users/actions/disable-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/actions/enable-user.command.d.ts +5 -0
- package/build/backend/commands/users/actions/enable-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/actions/reset-user-traffic.command.d.ts +5 -0
- package/build/backend/commands/users/actions/reset-user-traffic.command.d.ts.map +1 -1
- package/build/backend/commands/users/actions/revoke-user-subscription.command.d.ts +5 -0
- package/build/backend/commands/users/actions/revoke-user-subscription.command.d.ts.map +1 -1
- package/build/backend/commands/users/bulk/bulk-update-users.command.d.ts +5 -0
- package/build/backend/commands/users/bulk/bulk-update-users.command.d.ts.map +1 -1
- package/build/backend/commands/users/bulk/bulk-update-users.command.js +5 -0
- package/build/backend/commands/users/bulk-all/bulk-all-update-users.command.d.ts +3 -0
- package/build/backend/commands/users/bulk-all/bulk-all-update-users.command.d.ts.map +1 -1
- package/build/backend/commands/users/bulk-all/bulk-all-update-users.command.js +5 -0
- package/build/backend/commands/users/create-user.command.d.ts +8 -0
- package/build/backend/commands/users/create-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/create-user.command.js +5 -0
- package/build/backend/commands/users/get-all-users.command.d.ts +7 -0
- package/build/backend/commands/users/get-all-users.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-by/get-user-by-email.command.d.ts +5 -0
- package/build/backend/commands/users/get-by/get-user-by-email.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-by/get-user-by-short-uuid.command.d.ts +5 -0
- package/build/backend/commands/users/get-by/get-user-by-short-uuid.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-by/get-user-by-subscription-uuid.command.d.ts +5 -0
- package/build/backend/commands/users/get-by/get-user-by-subscription-uuid.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-by/get-user-by-tag.command.d.ts +261 -0
- package/build/backend/commands/users/get-by/get-user-by-tag.command.d.ts.map +1 -0
- package/build/backend/commands/users/get-by/get-user-by-tag.command.js +22 -0
- package/build/backend/commands/users/get-by/get-user-by-telegram-id.command.d.ts +5 -0
- package/build/backend/commands/users/get-by/get-user-by-telegram-id.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-by/get-user-by-username.command.d.ts +5 -0
- package/build/backend/commands/users/get-by/get-user-by-username.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-by/index.d.ts +1 -0
- package/build/backend/commands/users/get-by/index.d.ts.map +1 -1
- package/build/backend/commands/users/get-by/index.js +1 -0
- package/build/backend/commands/users/get-user-by-uuid.command.d.ts +5 -0
- package/build/backend/commands/users/get-user-by-uuid.command.d.ts.map +1 -1
- package/build/backend/commands/users/index.d.ts +1 -0
- package/build/backend/commands/users/index.d.ts.map +1 -1
- package/build/backend/commands/users/index.js +1 -0
- package/build/backend/commands/users/tags/get-all-tags.command.d.ts +25 -0
- package/build/backend/commands/users/tags/get-all-tags.command.d.ts.map +1 -0
- package/build/backend/commands/users/tags/get-all-tags.command.js +17 -0
- package/build/backend/commands/users/tags/index.d.ts +2 -0
- package/build/backend/commands/users/tags/index.d.ts.map +1 -0
- package/build/backend/commands/users/tags/index.js +17 -0
- package/build/backend/commands/users/update-user.command.d.ts +9 -0
- package/build/backend/commands/users/update-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/update-user.command.js +5 -0
- package/build/backend/constants/errors/errors.d.ts +5 -0
- package/build/backend/constants/errors/errors.d.ts.map +1 -1
- package/build/backend/constants/errors/errors.js +5 -0
- package/build/backend/models/extented-users.schema.d.ts +3 -0
- package/build/backend/models/extented-users.schema.d.ts.map +1 -1
- package/build/backend/models/users.schema.d.ts +3 -0
- package/build/backend/models/users.schema.d.ts.map +1 -1
- package/build/backend/models/users.schema.js +1 -0
- package/build/frontend/api/controllers/index.js +1 -0
- package/build/frontend/api/controllers/subscriptions.js +10 -0
- package/build/frontend/api/controllers/users.js +4 -0
- package/build/frontend/api/routes.js +10 -0
- package/build/frontend/commands/index.js +1 -0
- package/build/frontend/commands/subscriptions/get-all-subscriptions.command.js +49 -0
- package/build/frontend/commands/subscriptions/get-by/get-subscription-by-username.command.js +37 -0
- package/build/frontend/commands/subscriptions/get-by/index.js +17 -0
- package/build/frontend/commands/subscriptions/index.js +18 -0
- package/build/frontend/commands/users/bulk/bulk-update-users.command.js +5 -0
- package/build/frontend/commands/users/bulk-all/bulk-all-update-users.command.js +5 -0
- package/build/frontend/commands/users/create-user.command.js +5 -0
- package/build/frontend/commands/users/get-by/get-user-by-tag.command.js +22 -0
- package/build/frontend/commands/users/get-by/index.js +1 -0
- package/build/frontend/commands/users/index.js +1 -0
- package/build/frontend/commands/users/tags/get-all-tags.command.js +17 -0
- package/build/frontend/commands/users/tags/index.js +17 -0
- package/build/frontend/commands/users/update-user.command.js +5 -0
- package/build/frontend/constants/errors/errors.js +5 -0
- package/build/frontend/models/users.schema.js +1 -0
- package/package.json +1 -1
@@ -29,6 +29,7 @@ export declare const ExtendedUsersSchema: z.ZodObject<{
|
|
29
29
|
vlessUuid: z.ZodString;
|
30
30
|
ssPassword: z.ZodString;
|
31
31
|
description: z.ZodNullable<z.ZodString>;
|
32
|
+
tag: z.ZodNullable<z.ZodString>;
|
32
33
|
telegramId: z.ZodNullable<z.ZodNumber>;
|
33
34
|
email: z.ZodNullable<z.ZodString>;
|
34
35
|
hwidDeviceLimit: z.ZodNullable<z.ZodNumber>;
|
@@ -78,6 +79,7 @@ export declare const ExtendedUsersSchema: z.ZodObject<{
|
|
78
79
|
createdAt: Date;
|
79
80
|
updatedAt: Date;
|
80
81
|
username: string;
|
82
|
+
tag: string | null;
|
81
83
|
subscriptionUuid: string;
|
82
84
|
shortUuid: string;
|
83
85
|
usedTrafficBytes: number;
|
@@ -117,6 +119,7 @@ export declare const ExtendedUsersSchema: z.ZodObject<{
|
|
117
119
|
createdAt: string;
|
118
120
|
updatedAt: string;
|
119
121
|
username: string;
|
122
|
+
tag: string | null;
|
120
123
|
subscriptionUuid: string;
|
121
124
|
shortUuid: string;
|
122
125
|
usedTrafficBytes: number;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"extented-users.schema.d.ts","sourceRoot":"","sources":["../../../models/extented-users.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,mBAAmB
|
1
|
+
{"version":3,"file":"extented-users.schema.d.ts","sourceRoot":"","sources":["../../../models/extented-users.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI9B,CAAC"}
|
@@ -29,6 +29,7 @@ export declare const UsersSchema: z.ZodObject<{
|
|
29
29
|
vlessUuid: z.ZodString;
|
30
30
|
ssPassword: z.ZodString;
|
31
31
|
description: z.ZodNullable<z.ZodString>;
|
32
|
+
tag: z.ZodNullable<z.ZodString>;
|
32
33
|
telegramId: z.ZodNullable<z.ZodNumber>;
|
33
34
|
email: z.ZodNullable<z.ZodString>;
|
34
35
|
hwidDeviceLimit: z.ZodNullable<z.ZodNumber>;
|
@@ -59,6 +60,7 @@ export declare const UsersSchema: z.ZodObject<{
|
|
59
60
|
createdAt: Date;
|
60
61
|
updatedAt: Date;
|
61
62
|
username: string;
|
63
|
+
tag: string | null;
|
62
64
|
subscriptionUuid: string;
|
63
65
|
shortUuid: string;
|
64
66
|
usedTrafficBytes: number;
|
@@ -90,6 +92,7 @@ export declare const UsersSchema: z.ZodObject<{
|
|
90
92
|
createdAt: string;
|
91
93
|
updatedAt: string;
|
92
94
|
username: string;
|
95
|
+
tag: string | null;
|
93
96
|
subscriptionUuid: string;
|
94
97
|
shortUuid: string;
|
95
98
|
usedTrafficBytes: number;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"users.schema.d.ts","sourceRoot":"","sources":["../../../models/users.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,WAAW
|
1
|
+
{"version":3,"file":"users.schema.d.ts","sourceRoot":"","sources":["../../../models/users.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuEtB,CAAC"}
|
@@ -43,6 +43,7 @@ exports.UsersSchema = zod_1.z.object({
|
|
43
43
|
vlessUuid: zod_1.z.string().uuid(),
|
44
44
|
ssPassword: zod_1.z.string(),
|
45
45
|
description: zod_1.z.nullable(zod_1.z.string()),
|
46
|
+
tag: zod_1.z.nullable(zod_1.z.string()),
|
46
47
|
telegramId: zod_1.z.nullable(zod_1.z.number().int()),
|
47
48
|
email: zod_1.z.nullable(zod_1.z.string().email()),
|
48
49
|
hwidDeviceLimit: zod_1.z.nullable(zod_1.z.number().int()),
|
@@ -24,6 +24,7 @@ __exportStar(require("./nodes"), exports);
|
|
24
24
|
__exportStar(require("./subscription"), exports);
|
25
25
|
__exportStar(require("./subscription-settings"), exports);
|
26
26
|
__exportStar(require("./subscription-template"), exports);
|
27
|
+
__exportStar(require("./subscriptions"), exports);
|
27
28
|
__exportStar(require("./system"), exports);
|
28
29
|
__exportStar(require("./users"), exports);
|
29
30
|
__exportStar(require("./xray"), exports);
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SUBSCRIPTIONS_ROUTES = exports.SUBSCRIPTIONS_CONTROLLER = void 0;
|
4
|
+
exports.SUBSCRIPTIONS_CONTROLLER = 'subscriptions';
|
5
|
+
exports.SUBSCRIPTIONS_ROUTES = {
|
6
|
+
GET: '',
|
7
|
+
GET_BY: {
|
8
|
+
USERNAME: (username) => `by-username/${username}`,
|
9
|
+
},
|
10
|
+
};
|
@@ -22,6 +22,7 @@ exports.USERS_ROUTES = {
|
|
22
22
|
SUBSCRIPTION_UUID: (subscriptionUuid) => `by-subscription-uuid/${subscriptionUuid}`,
|
23
23
|
TELEGRAM_ID: (telegramId) => `by-telegram-id/${telegramId}`,
|
24
24
|
EMAIL: (email) => `by-email/${email}`,
|
25
|
+
TAG: (tag) => `by-tag/${tag}`,
|
25
26
|
},
|
26
27
|
BULK: {
|
27
28
|
DELETE_BY_STATUS: 'bulk/delete-by-status',
|
@@ -38,4 +39,7 @@ exports.USERS_ROUTES = {
|
|
38
39
|
STATS: {
|
39
40
|
GET_USAGE_BY_RANGE: (uuid) => `stats/usage/${uuid}/range`,
|
40
41
|
},
|
42
|
+
TAGS: {
|
43
|
+
GET: 'tags',
|
44
|
+
},
|
41
45
|
};
|
@@ -104,6 +104,7 @@ exports.REST_API = {
|
|
104
104
|
SUBSCRIPTION_UUID: (subscriptionUuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY.SUBSCRIPTION_UUID(subscriptionUuid)}`,
|
105
105
|
TELEGRAM_ID: (telegramId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY.TELEGRAM_ID(telegramId)}`,
|
106
106
|
EMAIL: (email) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY.EMAIL(email)}`,
|
107
|
+
TAG: (tag) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY.TAG(tag)}`,
|
107
108
|
},
|
108
109
|
BULK: {
|
109
110
|
DELETE_BY_STATUS: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.DELETE_BY_STATUS}`,
|
@@ -120,6 +121,9 @@ exports.REST_API = {
|
|
120
121
|
STATS: {
|
121
122
|
GET_USAGE_BY_RANGE: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.STATS.GET_USAGE_BY_RANGE(uuid)}`,
|
122
123
|
},
|
124
|
+
TAGS: {
|
125
|
+
GET: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.TAGS.GET}`,
|
126
|
+
},
|
123
127
|
},
|
124
128
|
SUBSCRIPTION: {
|
125
129
|
GET: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET}/${shortUuid}`,
|
@@ -163,4 +167,10 @@ exports.REST_API = {
|
|
163
167
|
GET_USER_HWID_DEVICES: (userUuid) => `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.GET_USER_HWID_DEVICES(userUuid)}`,
|
164
168
|
DELETE_USER_HWID_DEVICE: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.DELETE_USER_HWID_DEVICE}`,
|
165
169
|
},
|
170
|
+
SUBSCRIPTIONS: {
|
171
|
+
GET: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTIONS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTIONS_ROUTES.GET}`,
|
172
|
+
GET_BY: {
|
173
|
+
USERNAME: (username) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTIONS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTIONS_ROUTES.GET_BY.USERNAME(username)}`,
|
174
|
+
},
|
175
|
+
},
|
166
176
|
};
|
@@ -24,6 +24,7 @@ __exportStar(require("./nodes"), exports);
|
|
24
24
|
__exportStar(require("./subscription"), exports);
|
25
25
|
__exportStar(require("./subscription-settings"), exports);
|
26
26
|
__exportStar(require("./subscription-template"), exports);
|
27
|
+
__exportStar(require("./subscriptions"), exports);
|
27
28
|
__exportStar(require("./system"), exports);
|
28
29
|
__exportStar(require("./users"), exports);
|
29
30
|
__exportStar(require("./xray"), exports);
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GetAllSubscriptionsCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const constants_1 = require("../../constants");
|
6
|
+
const api_1 = require("../../api");
|
7
|
+
var GetAllSubscriptionsCommand;
|
8
|
+
(function (GetAllSubscriptionsCommand) {
|
9
|
+
GetAllSubscriptionsCommand.url = api_1.REST_API.SUBSCRIPTIONS.GET;
|
10
|
+
GetAllSubscriptionsCommand.TSQ_url = GetAllSubscriptionsCommand.url;
|
11
|
+
GetAllSubscriptionsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SUBSCRIPTIONS_ROUTES.GET, 'get', 'Get all subscriptions');
|
12
|
+
GetAllSubscriptionsCommand.RequestQuerySchema = zod_1.z.object({
|
13
|
+
start: zod_1.z.coerce
|
14
|
+
.number()
|
15
|
+
.default(0)
|
16
|
+
.describe('Start index (offset) of the users to return, default is 0'),
|
17
|
+
size: zod_1.z.coerce
|
18
|
+
.number()
|
19
|
+
.min(1, 'Size (limit) must be greater than 0')
|
20
|
+
.max(500, 'Size (limit) must be less than 500')
|
21
|
+
.describe('Number of subscriptions to return, no more than 500')
|
22
|
+
.default(25),
|
23
|
+
});
|
24
|
+
GetAllSubscriptionsCommand.ResponseSchema = zod_1.z.object({
|
25
|
+
response: zod_1.z.object({
|
26
|
+
subscriptions: zod_1.z.array(zod_1.z.object({
|
27
|
+
isFound: zod_1.z.boolean(),
|
28
|
+
user: zod_1.z.object({
|
29
|
+
shortUuid: zod_1.z.string(),
|
30
|
+
daysLeft: zod_1.z.number(),
|
31
|
+
trafficUsed: zod_1.z.string(),
|
32
|
+
trafficLimit: zod_1.z.string(),
|
33
|
+
username: zod_1.z.string(),
|
34
|
+
expiresAt: zod_1.z
|
35
|
+
.string()
|
36
|
+
.datetime()
|
37
|
+
.transform((str) => new Date(str)),
|
38
|
+
isActive: zod_1.z.boolean(),
|
39
|
+
userStatus: zod_1.z.nativeEnum(constants_1.USERS_STATUS),
|
40
|
+
trafficLimitStrategy: zod_1.z.nativeEnum(constants_1.RESET_PERIODS),
|
41
|
+
}),
|
42
|
+
links: zod_1.z.array(zod_1.z.string()),
|
43
|
+
ssConfLinks: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
|
44
|
+
subscriptionUrl: zod_1.z.string(),
|
45
|
+
})),
|
46
|
+
total: zod_1.z.number(),
|
47
|
+
}),
|
48
|
+
});
|
49
|
+
})(GetAllSubscriptionsCommand || (exports.GetAllSubscriptionsCommand = GetAllSubscriptionsCommand = {}));
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GetSubscriptionByUsernameCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const constants_1 = require("../../../constants");
|
6
|
+
const api_1 = require("../../../api");
|
7
|
+
var GetSubscriptionByUsernameCommand;
|
8
|
+
(function (GetSubscriptionByUsernameCommand) {
|
9
|
+
GetSubscriptionByUsernameCommand.url = api_1.REST_API.SUBSCRIPTIONS.GET_BY.USERNAME;
|
10
|
+
GetSubscriptionByUsernameCommand.TSQ_url = GetSubscriptionByUsernameCommand.url(':username');
|
11
|
+
GetSubscriptionByUsernameCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SUBSCRIPTIONS_ROUTES.GET_BY.USERNAME(':username'), 'get', 'Get subscription by username');
|
12
|
+
GetSubscriptionByUsernameCommand.RequestSchema = zod_1.z.object({
|
13
|
+
username: zod_1.z.string(),
|
14
|
+
});
|
15
|
+
GetSubscriptionByUsernameCommand.ResponseSchema = zod_1.z.object({
|
16
|
+
response: zod_1.z.object({
|
17
|
+
isFound: zod_1.z.boolean(),
|
18
|
+
user: zod_1.z.object({
|
19
|
+
shortUuid: zod_1.z.string(),
|
20
|
+
daysLeft: zod_1.z.number(),
|
21
|
+
trafficUsed: zod_1.z.string(),
|
22
|
+
trafficLimit: zod_1.z.string(),
|
23
|
+
username: zod_1.z.string(),
|
24
|
+
expiresAt: zod_1.z
|
25
|
+
.string()
|
26
|
+
.datetime()
|
27
|
+
.transform((str) => new Date(str)),
|
28
|
+
isActive: zod_1.z.boolean(),
|
29
|
+
userStatus: zod_1.z.nativeEnum(constants_1.USERS_STATUS),
|
30
|
+
trafficLimitStrategy: zod_1.z.nativeEnum(constants_1.RESET_PERIODS),
|
31
|
+
}),
|
32
|
+
links: zod_1.z.array(zod_1.z.string()),
|
33
|
+
ssConfLinks: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
|
34
|
+
subscriptionUrl: zod_1.z.string(),
|
35
|
+
}),
|
36
|
+
});
|
37
|
+
})(GetSubscriptionByUsernameCommand || (exports.GetSubscriptionByUsernameCommand = GetSubscriptionByUsernameCommand = {}));
|
@@ -0,0 +1,17 @@
|
|
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("./get-subscription-by-username.command"), exports);
|
@@ -0,0 +1,18 @@
|
|
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("./get-all-subscriptions.command"), exports);
|
18
|
+
__exportStar(require("./get-by"), exports);
|
@@ -38,6 +38,11 @@ var BulkUpdateUsersCommand;
|
|
38
38
|
description: zod_1.z.optional(zod_1.z.string().nullable()),
|
39
39
|
telegramId: zod_1.z.optional(zod_1.z.number().int().nullable()),
|
40
40
|
email: zod_1.z.optional(zod_1.z.string().email('Invalid email format').nullable()),
|
41
|
+
tag: zod_1.z.optional(zod_1.z
|
42
|
+
.string()
|
43
|
+
.regex(/^[A-Z0-9_]+$/, 'Tag can only contain uppercase letters, numbers, underscores')
|
44
|
+
.max(16, 'Tag must be less than 16 characters')
|
45
|
+
.nullable()),
|
41
46
|
}),
|
42
47
|
});
|
43
48
|
BulkUpdateUsersCommand.ResponseSchema = zod_1.z.object({
|
@@ -36,6 +36,11 @@ var BulkAllUpdateUsersCommand;
|
|
36
36
|
description: zod_1.z.optional(zod_1.z.string().nullable()),
|
37
37
|
telegramId: zod_1.z.optional(zod_1.z.number().int().nullable()),
|
38
38
|
email: zod_1.z.optional(zod_1.z.string().email('Invalid email format').nullable()),
|
39
|
+
tag: zod_1.z.optional(zod_1.z
|
40
|
+
.string()
|
41
|
+
.regex(/^[A-Z0-9_]+$/, 'Tag can only contain uppercase letters, numbers, underscores')
|
42
|
+
.max(16, 'Tag must be less than 16 characters')
|
43
|
+
.nullable()),
|
39
44
|
});
|
40
45
|
BulkAllUpdateUsersCommand.ResponseSchema = zod_1.z.object({
|
41
46
|
response: zod_1.z.object({
|
@@ -104,6 +104,11 @@ var CreateUserCommand;
|
|
104
104
|
.describe('Date format: 2025-01-17T15:38:45.065Z')
|
105
105
|
.optional(),
|
106
106
|
description: zod_1.z.string().optional(),
|
107
|
+
tag: zod_1.z
|
108
|
+
.string()
|
109
|
+
.regex(/^[A-Z0-9_]+$/, 'Tag can only contain uppercase letters, numbers, underscores')
|
110
|
+
.max(16, 'Tag must be less than 16 characters')
|
111
|
+
.optional(),
|
107
112
|
telegramId: zod_1.z.optional(zod_1.z.number().int()),
|
108
113
|
email: zod_1.z.string().email('Invalid email format').optional(),
|
109
114
|
hwidDeviceLimit: zod_1.z.optional(zod_1.z
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GetUserByTagCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const constants_1 = require("../../../constants");
|
6
|
+
const models_1 = require("../../../models");
|
7
|
+
const api_1 = require("../../../api");
|
8
|
+
var GetUserByTagCommand;
|
9
|
+
(function (GetUserByTagCommand) {
|
10
|
+
GetUserByTagCommand.url = api_1.REST_API.USERS.GET_BY.TAG;
|
11
|
+
GetUserByTagCommand.TSQ_url = GetUserByTagCommand.url(':tag');
|
12
|
+
GetUserByTagCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.GET_BY.TAG(':tag'), 'get', 'Get users by tag');
|
13
|
+
GetUserByTagCommand.RequestSchema = zod_1.z.object({
|
14
|
+
tag: zod_1.z
|
15
|
+
.string()
|
16
|
+
.regex(/^[A-Z0-9_]+$/, 'Tag can only contain uppercase letters, numbers, underscores')
|
17
|
+
.max(16, 'Tag must be less than 16 characters'),
|
18
|
+
});
|
19
|
+
GetUserByTagCommand.ResponseSchema = zod_1.z.object({
|
20
|
+
response: zod_1.z.array(models_1.ExtendedUsersSchema),
|
21
|
+
});
|
22
|
+
})(GetUserByTagCommand || (exports.GetUserByTagCommand = GetUserByTagCommand = {}));
|
@@ -17,5 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./get-user-by-email.command"), exports);
|
18
18
|
__exportStar(require("./get-user-by-short-uuid.command"), exports);
|
19
19
|
__exportStar(require("./get-user-by-subscription-uuid.command"), exports);
|
20
|
+
__exportStar(require("./get-user-by-tag.command"), exports);
|
20
21
|
__exportStar(require("./get-user-by-telegram-id.command"), exports);
|
21
22
|
__exportStar(require("./get-user-by-username.command"), exports);
|
@@ -23,4 +23,5 @@ __exportStar(require("./get-all-users.command"), exports);
|
|
23
23
|
__exportStar(require("./get-by"), exports);
|
24
24
|
__exportStar(require("./get-user-by-uuid.command"), exports);
|
25
25
|
__exportStar(require("./get-user-usage-by-range.command"), exports);
|
26
|
+
__exportStar(require("./tags"), exports);
|
26
27
|
__exportStar(require("./update-user.command"), exports);
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GetAllTagsCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const constants_1 = require("../../../constants");
|
6
|
+
const api_1 = require("../../../api");
|
7
|
+
var GetAllTagsCommand;
|
8
|
+
(function (GetAllTagsCommand) {
|
9
|
+
GetAllTagsCommand.url = api_1.REST_API.USERS.GET;
|
10
|
+
GetAllTagsCommand.TSQ_url = GetAllTagsCommand.url;
|
11
|
+
GetAllTagsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.TAGS.GET, 'get', 'Get all existing user tags');
|
12
|
+
GetAllTagsCommand.ResponseSchema = zod_1.z.object({
|
13
|
+
response: zod_1.z.object({
|
14
|
+
tags: zod_1.z.array(zod_1.z.string()),
|
15
|
+
}),
|
16
|
+
});
|
17
|
+
})(GetAllTagsCommand || (exports.GetAllTagsCommand = GetAllTagsCommand = {}));
|
@@ -0,0 +1,17 @@
|
|
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("./get-all-tags.command"), exports);
|
@@ -51,6 +51,11 @@ var UpdateUserCommand;
|
|
51
51
|
.describe('Expiration date: 2025-01-17T15:38:45.065Z')
|
52
52
|
.optional(),
|
53
53
|
description: zod_1.z.optional(zod_1.z.string().nullable()),
|
54
|
+
tag: zod_1.z.optional(zod_1.z
|
55
|
+
.string()
|
56
|
+
.regex(/^[A-Z0-9_]+$/, 'Tag can only contain uppercase letters, numbers, underscores')
|
57
|
+
.max(16, 'Tag must be less than 16 characters')
|
58
|
+
.nullable()),
|
54
59
|
telegramId: zod_1.z.optional(zod_1.z.number().int().nullable()),
|
55
60
|
email: zod_1.z.optional(zod_1.z.string().email('Invalid email format').nullable()),
|
56
61
|
hwidDeviceLimit: zod_1.z.optional(zod_1.z.number().int().min(0, 'Device limit must be non-negative').nullable()),
|
@@ -43,6 +43,7 @@ exports.UsersSchema = zod_1.z.object({
|
|
43
43
|
vlessUuid: zod_1.z.string().uuid(),
|
44
44
|
ssPassword: zod_1.z.string(),
|
45
45
|
description: zod_1.z.nullable(zod_1.z.string()),
|
46
|
+
tag: zod_1.z.nullable(zod_1.z.string()),
|
46
47
|
telegramId: zod_1.z.nullable(zod_1.z.number().int()),
|
47
48
|
email: zod_1.z.nullable(zod_1.z.string().email()),
|
48
49
|
hwidDeviceLimit: zod_1.z.nullable(zod_1.z.number().int()),
|