@remnawave/backend-contract 0.5.8 → 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/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 +4 -0
- package/build/backend/api/routes.d.ts.map +1 -1
- package/build/backend/api/routes.js +4 -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/users.js +4 -0
- package/build/frontend/api/routes.js +4 -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
|
@@ -33,6 +33,7 @@ export declare namespace UpdateUserCommand {
|
|
|
33
33
|
vlessUuid: z.ZodString;
|
|
34
34
|
ssPassword: z.ZodString;
|
|
35
35
|
description: z.ZodNullable<z.ZodString>;
|
|
36
|
+
tag: z.ZodNullable<z.ZodString>;
|
|
36
37
|
telegramId: z.ZodNullable<z.ZodNumber>;
|
|
37
38
|
email: z.ZodNullable<z.ZodString>;
|
|
38
39
|
hwidDeviceLimit: z.ZodNullable<z.ZodNumber>;
|
|
@@ -74,12 +75,14 @@ export declare namespace UpdateUserCommand {
|
|
|
74
75
|
activeUserInbounds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
75
76
|
expireAt: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, Date, string>, Date, string>>;
|
|
76
77
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
78
|
+
tag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
77
79
|
telegramId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
78
80
|
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
79
81
|
hwidDeviceLimit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
80
82
|
}, "strip", z.ZodTypeAny, {
|
|
81
83
|
uuid: string;
|
|
82
84
|
status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
|
|
85
|
+
tag?: string | null | undefined;
|
|
83
86
|
trafficLimitBytes?: number | undefined;
|
|
84
87
|
description?: string | null | undefined;
|
|
85
88
|
trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
|
|
@@ -91,6 +94,7 @@ export declare namespace UpdateUserCommand {
|
|
|
91
94
|
}, {
|
|
92
95
|
uuid: string;
|
|
93
96
|
status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
|
|
97
|
+
tag?: string | null | undefined;
|
|
94
98
|
trafficLimitBytes?: number | undefined;
|
|
95
99
|
description?: string | null | undefined;
|
|
96
100
|
trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
|
|
@@ -132,6 +136,7 @@ export declare namespace UpdateUserCommand {
|
|
|
132
136
|
vlessUuid: z.ZodString;
|
|
133
137
|
ssPassword: z.ZodString;
|
|
134
138
|
description: z.ZodNullable<z.ZodString>;
|
|
139
|
+
tag: z.ZodNullable<z.ZodString>;
|
|
135
140
|
telegramId: z.ZodNullable<z.ZodNumber>;
|
|
136
141
|
email: z.ZodNullable<z.ZodString>;
|
|
137
142
|
hwidDeviceLimit: z.ZodNullable<z.ZodNumber>;
|
|
@@ -181,6 +186,7 @@ export declare namespace UpdateUserCommand {
|
|
|
181
186
|
createdAt: Date;
|
|
182
187
|
updatedAt: Date;
|
|
183
188
|
username: string;
|
|
189
|
+
tag: string | null;
|
|
184
190
|
subscriptionUuid: string;
|
|
185
191
|
shortUuid: string;
|
|
186
192
|
usedTrafficBytes: number;
|
|
@@ -220,6 +226,7 @@ export declare namespace UpdateUserCommand {
|
|
|
220
226
|
createdAt: string;
|
|
221
227
|
updatedAt: string;
|
|
222
228
|
username: string;
|
|
229
|
+
tag: string | null;
|
|
223
230
|
subscriptionUuid: string;
|
|
224
231
|
shortUuid: string;
|
|
225
232
|
usedTrafficBytes: number;
|
|
@@ -263,6 +270,7 @@ export declare namespace UpdateUserCommand {
|
|
|
263
270
|
createdAt: Date;
|
|
264
271
|
updatedAt: Date;
|
|
265
272
|
username: string;
|
|
273
|
+
tag: string | null;
|
|
266
274
|
subscriptionUuid: string;
|
|
267
275
|
shortUuid: string;
|
|
268
276
|
usedTrafficBytes: number;
|
|
@@ -304,6 +312,7 @@ export declare namespace UpdateUserCommand {
|
|
|
304
312
|
createdAt: string;
|
|
305
313
|
updatedAt: string;
|
|
306
314
|
username: string;
|
|
315
|
+
tag: string | null;
|
|
307
316
|
subscriptionUuid: string;
|
|
308
317
|
shortUuid: string;
|
|
309
318
|
usedTrafficBytes: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-user.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/update-user.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,iBAAiB,CAAC;IACxB,MAAM,GAAG,eAAwB,CAAC;IAClC,MAAM,OAAO,eAAM,CAAC;IAEpB,MAAM,eAAe,2CAI3B,CAAC;IAEK,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"update-user.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/update-user.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,iBAAiB,CAAC;IACxB,MAAM,GAAG,eAAwB,CAAC;IAClC,MAAM,OAAO,eAAM,CAAC;IAEpB,MAAM,eAAe,2CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwDxB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
|
@@ -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()),
|
|
@@ -539,5 +539,10 @@ export declare const ERRORS: {
|
|
|
539
539
|
readonly message: "Upsert hwid user device error";
|
|
540
540
|
readonly httpCode: 500;
|
|
541
541
|
};
|
|
542
|
+
readonly GET_ALL_TAGS_ERROR: {
|
|
543
|
+
readonly code: "A103";
|
|
544
|
+
readonly message: "Get all tags error";
|
|
545
|
+
readonly httpCode: 500;
|
|
546
|
+
};
|
|
542
547
|
};
|
|
543
548
|
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqN3B,CAAC"}
|
|
@@ -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()),
|
|
@@ -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}`,
|
|
@@ -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()),
|