@remnawave/backend-contract 0.1.14 → 0.2.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 +2 -0
- package/build/backend/api/controllers/users.d.ts.map +1 -1
- package/build/backend/api/controllers/users.js +2 -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 +2 -0
- package/build/backend/commands/users/create-user.command.d.ts +16 -0
- package/build/backend/commands/users/create-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/create-user.command.js +4 -4
- package/build/backend/commands/users/disable-user.command.ts.d.ts +10 -0
- package/build/backend/commands/users/disable-user.command.ts.d.ts.map +1 -1
- package/build/backend/commands/users/enable-user.command.d.ts +10 -0
- package/build/backend/commands/users/enable-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-all-users-v2.command.d.ts +14 -0
- package/build/backend/commands/users/get-all-users-v2.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-user-by-email.command.d.ts +217 -0
- package/build/backend/commands/users/get-user-by-email.command.d.ts.map +1 -0
- package/build/backend/commands/users/get-user-by-email.command.js +21 -0
- package/build/backend/commands/users/get-user-by-short-uuid.command.d.ts +10 -0
- package/build/backend/commands/users/get-user-by-short-uuid.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-user-by-subscription-uuid.command.d.ts +10 -0
- package/build/backend/commands/users/get-user-by-subscription-uuid.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-user-by-telegram-id.command.d.ts +217 -0
- package/build/backend/commands/users/get-user-by-telegram-id.command.d.ts.map +1 -0
- package/build/backend/commands/users/get-user-by-telegram-id.command.js +21 -0
- package/build/backend/commands/users/get-user-by-username.command.d.ts +10 -0
- package/build/backend/commands/users/get-user-by-username.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-user-by-uuid.command.d.ts +10 -0
- package/build/backend/commands/users/get-user-by-uuid.command.d.ts.map +1 -1
- package/build/backend/commands/users/index.d.ts +2 -0
- package/build/backend/commands/users/index.d.ts.map +1 -1
- package/build/backend/commands/users/index.js +2 -0
- package/build/backend/commands/users/reset-user-traffic.command.d.ts +10 -0
- package/build/backend/commands/users/reset-user-traffic.command.d.ts.map +1 -1
- package/build/backend/commands/users/revoke-user-subscription.command.d.ts +10 -0
- package/build/backend/commands/users/revoke-user-subscription.command.d.ts.map +1 -1
- package/build/backend/commands/users/update-user.command.d.ts +18 -0
- package/build/backend/commands/users/update-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/update-user.command.js +2 -0
- package/build/backend/commands/xray/get-config.command.d.ts +5 -5
- package/build/backend/commands/xray/get-config.command.js +1 -1
- package/build/backend/commands/xray/update-config.command.d.ts +6 -6
- package/build/backend/commands/xray/update-config.command.d.ts.map +1 -1
- package/build/backend/commands/xray/update-config.command.js +2 -2
- package/build/backend/constants/errors/errors.d.ts +10 -0
- package/build/backend/constants/errors/errors.d.ts.map +1 -1
- package/build/backend/constants/errors/errors.js +11 -1
- package/build/backend/models/users.schema.d.ts +6 -0
- package/build/backend/models/users.schema.d.ts.map +1 -1
- package/build/backend/models/users.schema.js +2 -0
- package/build/frontend/api/controllers/users.js +2 -0
- package/build/frontend/api/routes.js +2 -0
- package/build/frontend/commands/users/create-user.command.js +4 -4
- package/build/frontend/commands/users/get-user-by-email.command.js +21 -0
- package/build/frontend/commands/users/get-user-by-telegram-id.command.js +21 -0
- package/build/frontend/commands/users/index.js +2 -0
- package/build/frontend/commands/users/update-user.command.js +2 -0
- package/build/frontend/commands/xray/get-config.command.js +1 -1
- package/build/frontend/commands/xray/update-config.command.js +2 -2
- package/build/frontend/constants/errors/errors.js +11 -1
- package/build/frontend/models/users.schema.js +2 -0
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"reset-user-traffic.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/reset-user-traffic.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,uBAAuB,CAAC;IAC9B,MAAM,GAAG,0BAAoC,CAAC;IAC9C,MAAM,OAAO,QAAe,CAAC;IAE7B,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc
|
1
|
+
{"version":3,"file":"reset-user-traffic.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/reset-user-traffic.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,uBAAuB,CAAC;IAC9B,MAAM,GAAG,0BAAoC,CAAC;IAC9C,MAAM,OAAO,QAAe,CAAC;IAE7B,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
@@ -41,6 +41,8 @@ export declare namespace RevokeUserSubscriptionCommand {
|
|
41
41
|
vlessUuid: z.ZodString;
|
42
42
|
ssPassword: z.ZodString;
|
43
43
|
description: z.ZodNullable<z.ZodString>;
|
44
|
+
telegramId: z.ZodNullable<z.ZodNumber>;
|
45
|
+
email: z.ZodNullable<z.ZodString>;
|
44
46
|
createdAt: z.ZodEffects<z.ZodString, Date, string>;
|
45
47
|
updatedAt: z.ZodEffects<z.ZodString, Date, string>;
|
46
48
|
activeUserInbounds: z.ZodArray<z.ZodObject<{
|
@@ -71,6 +73,7 @@ export declare namespace RevokeUserSubscriptionCommand {
|
|
71
73
|
}>, "strip", z.ZodTypeAny, {
|
72
74
|
uuid: string;
|
73
75
|
username: string;
|
76
|
+
email: string | null;
|
74
77
|
status: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
75
78
|
createdAt: Date;
|
76
79
|
updatedAt: Date;
|
@@ -90,6 +93,7 @@ export declare namespace RevokeUserSubscriptionCommand {
|
|
90
93
|
trojanPassword: string;
|
91
94
|
vlessUuid: string;
|
92
95
|
ssPassword: string;
|
96
|
+
telegramId: number | null;
|
93
97
|
activeUserInbounds: {
|
94
98
|
uuid: string;
|
95
99
|
type: string;
|
@@ -103,6 +107,7 @@ export declare namespace RevokeUserSubscriptionCommand {
|
|
103
107
|
}, {
|
104
108
|
uuid: string;
|
105
109
|
username: string;
|
110
|
+
email: string | null;
|
106
111
|
createdAt: string;
|
107
112
|
updatedAt: string;
|
108
113
|
subscriptionUuid: string;
|
@@ -119,6 +124,7 @@ export declare namespace RevokeUserSubscriptionCommand {
|
|
119
124
|
trojanPassword: string;
|
120
125
|
vlessUuid: string;
|
121
126
|
ssPassword: string;
|
127
|
+
telegramId: number | null;
|
122
128
|
activeUserInbounds: {
|
123
129
|
uuid: string;
|
124
130
|
type: string;
|
@@ -137,6 +143,7 @@ export declare namespace RevokeUserSubscriptionCommand {
|
|
137
143
|
response: {
|
138
144
|
uuid: string;
|
139
145
|
username: string;
|
146
|
+
email: string | null;
|
140
147
|
status: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
141
148
|
createdAt: Date;
|
142
149
|
updatedAt: Date;
|
@@ -156,6 +163,7 @@ export declare namespace RevokeUserSubscriptionCommand {
|
|
156
163
|
trojanPassword: string;
|
157
164
|
vlessUuid: string;
|
158
165
|
ssPassword: string;
|
166
|
+
telegramId: number | null;
|
159
167
|
activeUserInbounds: {
|
160
168
|
uuid: string;
|
161
169
|
type: string;
|
@@ -171,6 +179,7 @@ export declare namespace RevokeUserSubscriptionCommand {
|
|
171
179
|
response: {
|
172
180
|
uuid: string;
|
173
181
|
username: string;
|
182
|
+
email: string | null;
|
174
183
|
createdAt: string;
|
175
184
|
updatedAt: string;
|
176
185
|
subscriptionUuid: string;
|
@@ -187,6 +196,7 @@ export declare namespace RevokeUserSubscriptionCommand {
|
|
187
196
|
trojanPassword: string;
|
188
197
|
vlessUuid: string;
|
189
198
|
ssPassword: string;
|
199
|
+
telegramId: number | null;
|
190
200
|
activeUserInbounds: {
|
191
201
|
uuid: string;
|
192
202
|
type: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"revoke-user-subscription.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/revoke-user-subscription.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,6BAA6B,CAAC;IACpC,MAAM,GAAG,0BAAqC,CAAC;IAC/C,MAAM,OAAO,QAAe,CAAC;IAE7B,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc
|
1
|
+
{"version":3,"file":"revoke-user-subscription.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/revoke-user-subscription.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,6BAA6B,CAAC;IACpC,MAAM,GAAG,0BAAqC,CAAC;IAC/C,MAAM,OAAO,QAAe,CAAC;IAE7B,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
@@ -32,6 +32,8 @@ export declare namespace UpdateUserCommand {
|
|
32
32
|
vlessUuid: z.ZodString;
|
33
33
|
ssPassword: z.ZodString;
|
34
34
|
description: z.ZodNullable<z.ZodString>;
|
35
|
+
telegramId: z.ZodNullable<z.ZodNumber>;
|
36
|
+
email: z.ZodNullable<z.ZodString>;
|
35
37
|
createdAt: z.ZodEffects<z.ZodString, Date, string>;
|
36
38
|
updatedAt: z.ZodEffects<z.ZodString, Date, string>;
|
37
39
|
activeUserInbounds: z.ZodArray<z.ZodObject<{
|
@@ -64,21 +66,27 @@ export declare namespace UpdateUserCommand {
|
|
64
66
|
activeUserInbounds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
65
67
|
expireAt: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, Date, string>, Date, string>>;
|
66
68
|
description: z.ZodOptional<z.ZodString>;
|
69
|
+
telegramId: z.ZodOptional<z.ZodNumber>;
|
70
|
+
email: z.ZodOptional<z.ZodString>;
|
67
71
|
}>, "strip", z.ZodTypeAny, {
|
68
72
|
uuid: string;
|
73
|
+
email?: string | undefined;
|
69
74
|
status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
|
70
75
|
trafficLimitBytes?: number | undefined;
|
71
76
|
description?: string | undefined;
|
72
77
|
trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
|
73
78
|
expireAt?: Date | undefined;
|
79
|
+
telegramId?: number | undefined;
|
74
80
|
activeUserInbounds?: string[] | undefined;
|
75
81
|
}, {
|
76
82
|
uuid: string;
|
83
|
+
email?: string | undefined;
|
77
84
|
status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
|
78
85
|
trafficLimitBytes?: number | undefined;
|
79
86
|
description?: string | undefined;
|
80
87
|
trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
|
81
88
|
expireAt?: string | undefined;
|
89
|
+
telegramId?: number | undefined;
|
82
90
|
activeUserInbounds?: string[] | undefined;
|
83
91
|
}>;
|
84
92
|
type Request = z.infer<typeof RequestSchema>;
|
@@ -113,6 +121,8 @@ export declare namespace UpdateUserCommand {
|
|
113
121
|
vlessUuid: z.ZodString;
|
114
122
|
ssPassword: z.ZodString;
|
115
123
|
description: z.ZodNullable<z.ZodString>;
|
124
|
+
telegramId: z.ZodNullable<z.ZodNumber>;
|
125
|
+
email: z.ZodNullable<z.ZodString>;
|
116
126
|
createdAt: z.ZodEffects<z.ZodString, Date, string>;
|
117
127
|
updatedAt: z.ZodEffects<z.ZodString, Date, string>;
|
118
128
|
activeUserInbounds: z.ZodArray<z.ZodObject<{
|
@@ -143,6 +153,7 @@ export declare namespace UpdateUserCommand {
|
|
143
153
|
}>, "strip", z.ZodTypeAny, {
|
144
154
|
uuid: string;
|
145
155
|
username: string;
|
156
|
+
email: string | null;
|
146
157
|
status: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
147
158
|
createdAt: Date;
|
148
159
|
updatedAt: Date;
|
@@ -162,6 +173,7 @@ export declare namespace UpdateUserCommand {
|
|
162
173
|
trojanPassword: string;
|
163
174
|
vlessUuid: string;
|
164
175
|
ssPassword: string;
|
176
|
+
telegramId: number | null;
|
165
177
|
activeUserInbounds: {
|
166
178
|
uuid: string;
|
167
179
|
type: string;
|
@@ -175,6 +187,7 @@ export declare namespace UpdateUserCommand {
|
|
175
187
|
}, {
|
176
188
|
uuid: string;
|
177
189
|
username: string;
|
190
|
+
email: string | null;
|
178
191
|
createdAt: string;
|
179
192
|
updatedAt: string;
|
180
193
|
subscriptionUuid: string;
|
@@ -191,6 +204,7 @@ export declare namespace UpdateUserCommand {
|
|
191
204
|
trojanPassword: string;
|
192
205
|
vlessUuid: string;
|
193
206
|
ssPassword: string;
|
207
|
+
telegramId: number | null;
|
194
208
|
activeUserInbounds: {
|
195
209
|
uuid: string;
|
196
210
|
type: string;
|
@@ -209,6 +223,7 @@ export declare namespace UpdateUserCommand {
|
|
209
223
|
response: {
|
210
224
|
uuid: string;
|
211
225
|
username: string;
|
226
|
+
email: string | null;
|
212
227
|
status: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
213
228
|
createdAt: Date;
|
214
229
|
updatedAt: Date;
|
@@ -228,6 +243,7 @@ export declare namespace UpdateUserCommand {
|
|
228
243
|
trojanPassword: string;
|
229
244
|
vlessUuid: string;
|
230
245
|
ssPassword: string;
|
246
|
+
telegramId: number | null;
|
231
247
|
activeUserInbounds: {
|
232
248
|
uuid: string;
|
233
249
|
type: string;
|
@@ -243,6 +259,7 @@ export declare namespace UpdateUserCommand {
|
|
243
259
|
response: {
|
244
260
|
uuid: string;
|
245
261
|
username: string;
|
262
|
+
email: string | null;
|
246
263
|
createdAt: string;
|
247
264
|
updatedAt: string;
|
248
265
|
subscriptionUuid: string;
|
@@ -259,6 +276,7 @@ export declare namespace UpdateUserCommand {
|
|
259
276
|
trojanPassword: string;
|
260
277
|
vlessUuid: string;
|
261
278
|
ssPassword: string;
|
279
|
+
telegramId: number | null;
|
262
280
|
activeUserInbounds: {
|
263
281
|
uuid: string;
|
264
282
|
type: string;
|
@@ -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,qBAAwB,CAAC;IAClC,MAAM,OAAO,qBAAM,CAAC;IAEpB,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,qBAAwB,CAAC;IAClC,MAAM,OAAO,qBAAM,CAAC;IAEpB,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA4CxB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
@@ -50,6 +50,8 @@ var UpdateUserCommand;
|
|
50
50
|
.describe('Expiration date: 2025-01-17T15:38:45.065Z')
|
51
51
|
.optional(),
|
52
52
|
description: zod_1.z.string().optional(),
|
53
|
+
telegramId: zod_1.z.number().optional(),
|
54
|
+
email: zod_1.z.string().optional(),
|
53
55
|
});
|
54
56
|
UpdateUserCommand.ResponseSchema = zod_1.z.object({
|
55
57
|
response: models_1.UsersSchema.extend({
|
@@ -4,19 +4,19 @@ export declare namespace GetXrayConfigCommand {
|
|
4
4
|
const TSQ_url: "/api/xray/get-config";
|
5
5
|
const ResponseSchema: z.ZodObject<{
|
6
6
|
response: z.ZodObject<{
|
7
|
-
config: z.
|
7
|
+
config: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
9
|
-
config:
|
9
|
+
config: {};
|
10
10
|
}, {
|
11
|
-
config:
|
11
|
+
config: {};
|
12
12
|
}>;
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
14
14
|
response: {
|
15
|
-
config:
|
15
|
+
config: {};
|
16
16
|
};
|
17
17
|
}, {
|
18
18
|
response: {
|
19
|
-
config:
|
19
|
+
config: {};
|
20
20
|
};
|
21
21
|
}>;
|
22
22
|
type Response = z.infer<typeof ResponseSchema>;
|
@@ -9,7 +9,7 @@ var GetXrayConfigCommand;
|
|
9
9
|
GetXrayConfigCommand.TSQ_url = GetXrayConfigCommand.url;
|
10
10
|
GetXrayConfigCommand.ResponseSchema = zod_1.z.object({
|
11
11
|
response: zod_1.z.object({
|
12
|
-
config: zod_1.z.
|
12
|
+
config: zod_1.z.object({}),
|
13
13
|
}),
|
14
14
|
});
|
15
15
|
})(GetXrayConfigCommand || (exports.GetXrayConfigCommand = GetXrayConfigCommand = {}));
|
@@ -2,23 +2,23 @@ import { z } from 'zod';
|
|
2
2
|
export declare namespace UpdateXrayConfigCommand {
|
3
3
|
const url: "/api/xray/update-config";
|
4
4
|
const TSQ_url: "/api/xray/update-config";
|
5
|
-
const RequestSchema: z.
|
5
|
+
const RequestSchema: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
|
6
6
|
type Request = z.infer<typeof RequestSchema>;
|
7
7
|
const ResponseSchema: z.ZodObject<{
|
8
8
|
response: z.ZodObject<{
|
9
|
-
config: z.
|
9
|
+
config: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
10
10
|
}, "strip", z.ZodTypeAny, {
|
11
|
-
config:
|
11
|
+
config: {};
|
12
12
|
}, {
|
13
|
-
config:
|
13
|
+
config: {};
|
14
14
|
}>;
|
15
15
|
}, "strip", z.ZodTypeAny, {
|
16
16
|
response: {
|
17
|
-
config:
|
17
|
+
config: {};
|
18
18
|
};
|
19
19
|
}, {
|
20
20
|
response: {
|
21
|
-
config:
|
21
|
+
config: {};
|
22
22
|
};
|
23
23
|
}>;
|
24
24
|
type Response = z.infer<typeof ResponseSchema>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"update-config.command.d.ts","sourceRoot":"","sources":["../../../../commands/xray/update-config.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,yBAAiB,uBAAuB,CAAC;IAC9B,MAAM,GAAG,2BAA8B,CAAC;IACxC,MAAM,OAAO,2BAAM,CAAC;IAEpB,MAAM,aAAa,
|
1
|
+
{"version":3,"file":"update-config.command.d.ts","sourceRoot":"","sources":["../../../../commands/xray/update-config.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,yBAAiB,uBAAuB,CAAC;IAC9B,MAAM,GAAG,2BAA8B,CAAC;IACxC,MAAM,OAAO,2BAAM,CAAC;IAEpB,MAAM,aAAa,uJAA6B,CAAC;IAExD,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;MAIzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
@@ -7,10 +7,10 @@ var UpdateXrayConfigCommand;
|
|
7
7
|
(function (UpdateXrayConfigCommand) {
|
8
8
|
UpdateXrayConfigCommand.url = api_1.REST_API.XRAY.UPDATE_CONFIG;
|
9
9
|
UpdateXrayConfigCommand.TSQ_url = UpdateXrayConfigCommand.url;
|
10
|
-
UpdateXrayConfigCommand.RequestSchema = zod_1.z.
|
10
|
+
UpdateXrayConfigCommand.RequestSchema = zod_1.z.object({}).passthrough();
|
11
11
|
UpdateXrayConfigCommand.ResponseSchema = zod_1.z.object({
|
12
12
|
response: zod_1.z.object({
|
13
|
-
config: zod_1.z.
|
13
|
+
config: zod_1.z.object({}),
|
14
14
|
}),
|
15
15
|
});
|
16
16
|
})(UpdateXrayConfigCommand || (exports.UpdateXrayConfigCommand = UpdateXrayConfigCommand = {}));
|
@@ -329,5 +329,15 @@ export declare const ERRORS: {
|
|
329
329
|
httpCode: number;
|
330
330
|
};
|
331
331
|
};
|
332
|
+
readonly USERS_NOT_FOUND: {
|
333
|
+
readonly code: "A062";
|
334
|
+
readonly message: "Users not found";
|
335
|
+
readonly httpCode: 404;
|
336
|
+
};
|
337
|
+
readonly GET_USER_BY_UNIQUE_FIELDS_NOT_FOUND: {
|
338
|
+
readonly code: "A063";
|
339
|
+
readonly message: "User with specified params not found";
|
340
|
+
readonly httpCode: 404;
|
341
|
+
};
|
332
342
|
};
|
333
343
|
//# 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;;;;;;;;;;;;;;;;CAgB3B,CAAC"}
|
@@ -304,8 +304,18 @@ exports.ERRORS = {
|
|
304
304
|
httpCode: 500,
|
305
305
|
withMessage: (message) => ({
|
306
306
|
code: 'A061',
|
307
|
-
message
|
307
|
+
message,
|
308
308
|
httpCode: 500,
|
309
309
|
}),
|
310
310
|
},
|
311
|
+
USERS_NOT_FOUND: {
|
312
|
+
code: 'A062',
|
313
|
+
message: 'Users not found',
|
314
|
+
httpCode: 404,
|
315
|
+
},
|
316
|
+
GET_USER_BY_UNIQUE_FIELDS_NOT_FOUND: {
|
317
|
+
code: 'A063',
|
318
|
+
message: 'User with specified params not found',
|
319
|
+
httpCode: 404,
|
320
|
+
},
|
311
321
|
};
|
@@ -29,6 +29,8 @@ export declare const UsersSchema: z.ZodObject<{
|
|
29
29
|
vlessUuid: z.ZodString;
|
30
30
|
ssPassword: z.ZodString;
|
31
31
|
description: z.ZodNullable<z.ZodString>;
|
32
|
+
telegramId: z.ZodNullable<z.ZodNumber>;
|
33
|
+
email: z.ZodNullable<z.ZodString>;
|
32
34
|
createdAt: z.ZodEffects<z.ZodString, Date, string>;
|
33
35
|
updatedAt: z.ZodEffects<z.ZodString, Date, string>;
|
34
36
|
activeUserInbounds: z.ZodArray<z.ZodObject<{
|
@@ -47,6 +49,7 @@ export declare const UsersSchema: z.ZodObject<{
|
|
47
49
|
}, "strip", z.ZodTypeAny, {
|
48
50
|
uuid: string;
|
49
51
|
username: string;
|
52
|
+
email: string | null;
|
50
53
|
status: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
51
54
|
createdAt: Date;
|
52
55
|
updatedAt: Date;
|
@@ -66,6 +69,7 @@ export declare const UsersSchema: z.ZodObject<{
|
|
66
69
|
trojanPassword: string;
|
67
70
|
vlessUuid: string;
|
68
71
|
ssPassword: string;
|
72
|
+
telegramId: number | null;
|
69
73
|
activeUserInbounds: {
|
70
74
|
uuid: string;
|
71
75
|
type: string;
|
@@ -74,6 +78,7 @@ export declare const UsersSchema: z.ZodObject<{
|
|
74
78
|
}, {
|
75
79
|
uuid: string;
|
76
80
|
username: string;
|
81
|
+
email: string | null;
|
77
82
|
createdAt: string;
|
78
83
|
updatedAt: string;
|
79
84
|
subscriptionUuid: string;
|
@@ -90,6 +95,7 @@ export declare const UsersSchema: z.ZodObject<{
|
|
90
95
|
trojanPassword: string;
|
91
96
|
vlessUuid: string;
|
92
97
|
ssPassword: string;
|
98
|
+
telegramId: number | null;
|
93
99
|
activeUserInbounds: {
|
94
100
|
uuid: string;
|
95
101
|
type: string;
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoEtB,CAAC"}
|
@@ -43,6 +43,8 @@ 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
|
+
telegramId: zod_1.z.nullable(zod_1.z.number()),
|
47
|
+
email: zod_1.z.nullable(zod_1.z.string()),
|
46
48
|
createdAt: zod_1.z
|
47
49
|
.string()
|
48
50
|
.datetime()
|
@@ -87,6 +87,8 @@ exports.REST_API = {
|
|
87
87
|
BULK: {
|
88
88
|
DELETE_BY_STATUS: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.DELETE_BY_STATUS}`,
|
89
89
|
},
|
90
|
+
GET_BY_TELEGRAM_ID: (telegramId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_TELEGRAM_ID}/${telegramId}`,
|
91
|
+
GET_BY_EMAIL: (email) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_EMAIL}/${email}`,
|
90
92
|
},
|
91
93
|
SUBSCRIPTION: {
|
92
94
|
GET: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET}/${shortUuid}`,
|
@@ -88,23 +88,23 @@ var CreateUserCommand;
|
|
88
88
|
.describe('Date format: 2025-01-17T15:38:45.065Z'),
|
89
89
|
createdAt: zod_1.z
|
90
90
|
.string({
|
91
|
-
required_error: 'Expiration date is required',
|
92
91
|
invalid_type_error: 'Invalid date format',
|
93
92
|
})
|
94
|
-
.datetime({ message: 'Invalid date format', offset: true })
|
93
|
+
.datetime({ message: 'Invalid date format', offset: true, local: true })
|
95
94
|
.transform((str) => new Date(str))
|
96
95
|
.describe('Date format: 2025-01-17T15:38:45.065Z')
|
97
96
|
.optional(),
|
98
97
|
lastTrafficResetAt: zod_1.z
|
99
98
|
.string({
|
100
|
-
required_error: 'Expiration date is required',
|
101
99
|
invalid_type_error: 'Invalid date format',
|
102
100
|
})
|
103
|
-
.datetime({ message: 'Invalid date format', offset: true })
|
101
|
+
.datetime({ message: 'Invalid date format', offset: true, local: true })
|
104
102
|
.transform((str) => new Date(str))
|
105
103
|
.describe('Date format: 2025-01-17T15:38:45.065Z')
|
106
104
|
.optional(),
|
107
105
|
description: zod_1.z.string().optional(),
|
106
|
+
telegramId: zod_1.z.number().optional(),
|
107
|
+
email: zod_1.z.string().optional(),
|
108
108
|
activateAllInbounds: zod_1.z.boolean().optional(),
|
109
109
|
});
|
110
110
|
CreateUserCommand.ResponseSchema = zod_1.z.object({
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GetUserByEmailCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const users_schema_1 = require("../../models/users.schema");
|
6
|
+
const api_1 = require("../../api");
|
7
|
+
const models_1 = require("../../models");
|
8
|
+
var GetUserByEmailCommand;
|
9
|
+
(function (GetUserByEmailCommand) {
|
10
|
+
GetUserByEmailCommand.url = api_1.REST_API.USERS.GET_BY_EMAIL;
|
11
|
+
GetUserByEmailCommand.TSQ_url = GetUserByEmailCommand.url(':email');
|
12
|
+
GetUserByEmailCommand.RequestSchema = zod_1.z.object({
|
13
|
+
email: zod_1.z.string(),
|
14
|
+
});
|
15
|
+
GetUserByEmailCommand.ResponseSchema = zod_1.z.object({
|
16
|
+
response: zod_1.z.array(users_schema_1.UsersSchema.extend({
|
17
|
+
subscriptionUrl: zod_1.z.string(),
|
18
|
+
lastConnectedNode: models_1.LastConnectedNodeSchema,
|
19
|
+
})),
|
20
|
+
});
|
21
|
+
})(GetUserByEmailCommand || (exports.GetUserByEmailCommand = GetUserByEmailCommand = {}));
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GetUserByTelegramIdCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const users_schema_1 = require("../../models/users.schema");
|
6
|
+
const api_1 = require("../../api");
|
7
|
+
const models_1 = require("../../models");
|
8
|
+
var GetUserByTelegramIdCommand;
|
9
|
+
(function (GetUserByTelegramIdCommand) {
|
10
|
+
GetUserByTelegramIdCommand.url = api_1.REST_API.USERS.GET_BY_TELEGRAM_ID;
|
11
|
+
GetUserByTelegramIdCommand.TSQ_url = GetUserByTelegramIdCommand.url(':telegramId');
|
12
|
+
GetUserByTelegramIdCommand.RequestSchema = zod_1.z.object({
|
13
|
+
telegramId: zod_1.z.string(),
|
14
|
+
});
|
15
|
+
GetUserByTelegramIdCommand.ResponseSchema = zod_1.z.object({
|
16
|
+
response: zod_1.z.array(users_schema_1.UsersSchema.extend({
|
17
|
+
subscriptionUrl: zod_1.z.string(),
|
18
|
+
lastConnectedNode: models_1.LastConnectedNodeSchema,
|
19
|
+
})),
|
20
|
+
});
|
21
|
+
})(GetUserByTelegramIdCommand || (exports.GetUserByTelegramIdCommand = GetUserByTelegramIdCommand = {}));
|
@@ -27,3 +27,5 @@ __exportStar(require("./reset-user-traffic.command"), exports);
|
|
27
27
|
__exportStar(require("./revoke-user-subscription.command"), exports);
|
28
28
|
__exportStar(require("./update-user.command"), exports);
|
29
29
|
__exportStar(require("./bulk"), exports);
|
30
|
+
__exportStar(require("./get-user-by-telegram-id.command"), exports);
|
31
|
+
__exportStar(require("./get-user-by-email.command"), exports);
|
@@ -50,6 +50,8 @@ var UpdateUserCommand;
|
|
50
50
|
.describe('Expiration date: 2025-01-17T15:38:45.065Z')
|
51
51
|
.optional(),
|
52
52
|
description: zod_1.z.string().optional(),
|
53
|
+
telegramId: zod_1.z.number().optional(),
|
54
|
+
email: zod_1.z.string().optional(),
|
53
55
|
});
|
54
56
|
UpdateUserCommand.ResponseSchema = zod_1.z.object({
|
55
57
|
response: models_1.UsersSchema.extend({
|
@@ -9,7 +9,7 @@ var GetXrayConfigCommand;
|
|
9
9
|
GetXrayConfigCommand.TSQ_url = GetXrayConfigCommand.url;
|
10
10
|
GetXrayConfigCommand.ResponseSchema = zod_1.z.object({
|
11
11
|
response: zod_1.z.object({
|
12
|
-
config: zod_1.z.
|
12
|
+
config: zod_1.z.object({}),
|
13
13
|
}),
|
14
14
|
});
|
15
15
|
})(GetXrayConfigCommand || (exports.GetXrayConfigCommand = GetXrayConfigCommand = {}));
|
@@ -7,10 +7,10 @@ var UpdateXrayConfigCommand;
|
|
7
7
|
(function (UpdateXrayConfigCommand) {
|
8
8
|
UpdateXrayConfigCommand.url = api_1.REST_API.XRAY.UPDATE_CONFIG;
|
9
9
|
UpdateXrayConfigCommand.TSQ_url = UpdateXrayConfigCommand.url;
|
10
|
-
UpdateXrayConfigCommand.RequestSchema = zod_1.z.
|
10
|
+
UpdateXrayConfigCommand.RequestSchema = zod_1.z.object({}).passthrough();
|
11
11
|
UpdateXrayConfigCommand.ResponseSchema = zod_1.z.object({
|
12
12
|
response: zod_1.z.object({
|
13
|
-
config: zod_1.z.
|
13
|
+
config: zod_1.z.object({}),
|
14
14
|
}),
|
15
15
|
});
|
16
16
|
})(UpdateXrayConfigCommand || (exports.UpdateXrayConfigCommand = UpdateXrayConfigCommand = {}));
|
@@ -304,8 +304,18 @@ exports.ERRORS = {
|
|
304
304
|
httpCode: 500,
|
305
305
|
withMessage: (message) => ({
|
306
306
|
code: 'A061',
|
307
|
-
message
|
307
|
+
message,
|
308
308
|
httpCode: 500,
|
309
309
|
}),
|
310
310
|
},
|
311
|
+
USERS_NOT_FOUND: {
|
312
|
+
code: 'A062',
|
313
|
+
message: 'Users not found',
|
314
|
+
httpCode: 404,
|
315
|
+
},
|
316
|
+
GET_USER_BY_UNIQUE_FIELDS_NOT_FOUND: {
|
317
|
+
code: 'A063',
|
318
|
+
message: 'User with specified params not found',
|
319
|
+
httpCode: 404,
|
320
|
+
},
|
311
321
|
};
|
@@ -43,6 +43,8 @@ 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
|
+
telegramId: zod_1.z.nullable(zod_1.z.number()),
|
47
|
+
email: zod_1.z.nullable(zod_1.z.string()),
|
46
48
|
createdAt: zod_1.z
|
47
49
|
.string()
|
48
50
|
.datetime()
|