@remnawave/backend-contract 2.1.53 → 2.1.55
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/commands/users/update-user.command.d.ts +33 -4
- package/build/backend/commands/users/update-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/update-user.command.js +16 -3
- package/build/frontend/commands/users/update-user.command.js +16 -3
- package/package.json +1 -1
@@ -3,8 +3,9 @@ export declare namespace UpdateUserCommand {
|
|
3
3
|
const url: "/api/users/";
|
4
4
|
const TSQ_url: "/api/users/";
|
5
5
|
const endpointDetails: import("../../constants").EndpointDetails;
|
6
|
-
const RequestSchema: z.ZodObject<{
|
7
|
-
|
6
|
+
const RequestSchema: z.ZodEffects<z.ZodObject<{
|
7
|
+
username: z.ZodOptional<z.ZodString>;
|
8
|
+
uuid: z.ZodOptional<z.ZodString>;
|
8
9
|
status: z.ZodOptional<z.ZodEnum<["ACTIVE", "DISABLED"]>>;
|
9
10
|
trafficLimitBytes: z.ZodOptional<z.ZodNumber>;
|
10
11
|
trafficLimitStrategy: z.ZodOptional<z.ZodEffects<z.ZodDefault<z.ZodNativeEnum<{
|
@@ -21,8 +22,9 @@ export declare namespace UpdateUserCommand {
|
|
21
22
|
hwidDeviceLimit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
22
23
|
activeInternalSquads: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
23
24
|
}, "strip", z.ZodTypeAny, {
|
24
|
-
uuid: string;
|
25
25
|
status?: "DISABLED" | "ACTIVE" | undefined;
|
26
|
+
uuid?: string | undefined;
|
27
|
+
username?: string | undefined;
|
26
28
|
tag?: string | null | undefined;
|
27
29
|
trafficLimitBytes?: number | undefined;
|
28
30
|
description?: string | null | undefined;
|
@@ -33,8 +35,35 @@ export declare namespace UpdateUserCommand {
|
|
33
35
|
hwidDeviceLimit?: number | null | undefined;
|
34
36
|
activeInternalSquads?: string[] | undefined;
|
35
37
|
}, {
|
36
|
-
uuid: string;
|
37
38
|
status?: "DISABLED" | "ACTIVE" | undefined;
|
39
|
+
uuid?: string | undefined;
|
40
|
+
username?: string | undefined;
|
41
|
+
tag?: string | null | undefined;
|
42
|
+
trafficLimitBytes?: number | undefined;
|
43
|
+
description?: string | null | undefined;
|
44
|
+
trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
|
45
|
+
expireAt?: string | undefined;
|
46
|
+
telegramId?: number | null | undefined;
|
47
|
+
email?: string | null | undefined;
|
48
|
+
hwidDeviceLimit?: number | null | undefined;
|
49
|
+
activeInternalSquads?: string[] | undefined;
|
50
|
+
}>, {
|
51
|
+
status?: "DISABLED" | "ACTIVE" | undefined;
|
52
|
+
uuid?: string | undefined;
|
53
|
+
username?: string | undefined;
|
54
|
+
tag?: string | null | undefined;
|
55
|
+
trafficLimitBytes?: number | undefined;
|
56
|
+
description?: string | null | undefined;
|
57
|
+
trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
|
58
|
+
expireAt?: Date | undefined;
|
59
|
+
telegramId?: number | null | undefined;
|
60
|
+
email?: string | null | undefined;
|
61
|
+
hwidDeviceLimit?: number | null | undefined;
|
62
|
+
activeInternalSquads?: string[] | undefined;
|
63
|
+
}, {
|
64
|
+
status?: "DISABLED" | "ACTIVE" | undefined;
|
65
|
+
uuid?: string | undefined;
|
66
|
+
username?: string | undefined;
|
38
67
|
tag?: string | null | undefined;
|
39
68
|
trafficLimitBytes?: number | undefined;
|
40
69
|
description?: string | null | undefined;
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgFpB,CAAC;IAEP,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"}
|
@@ -9,9 +9,14 @@ var UpdateUserCommand;
|
|
9
9
|
(function (UpdateUserCommand) {
|
10
10
|
UpdateUserCommand.url = api_1.REST_API.USERS.UPDATE;
|
11
11
|
UpdateUserCommand.TSQ_url = UpdateUserCommand.url;
|
12
|
-
UpdateUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.UPDATE, 'patch', 'Update a user');
|
13
|
-
UpdateUserCommand.RequestSchema = zod_1.z
|
14
|
-
|
12
|
+
UpdateUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.UPDATE, 'patch', 'Update a user by UUID or username');
|
13
|
+
UpdateUserCommand.RequestSchema = zod_1.z
|
14
|
+
.object({
|
15
|
+
username: zod_1.z.optional(zod_1.z.string().describe('Username of the user')),
|
16
|
+
uuid: zod_1.z.optional(zod_1.z
|
17
|
+
.string()
|
18
|
+
.uuid()
|
19
|
+
.describe('UUID of the user. UUID has higher priority than username, so if both are provided, username will be ignored.')),
|
15
20
|
status: zod_1.z
|
16
21
|
.enum([constants_1.USERS_STATUS.ACTIVE, constants_1.USERS_STATUS.DISABLED], {
|
17
22
|
errorMap: () => ({
|
@@ -64,6 +69,14 @@ var UpdateUserCommand;
|
|
64
69
|
invalid_type_error: 'Enabled internal squads must be an array of UUIDs',
|
65
70
|
})
|
66
71
|
.optional(),
|
72
|
+
})
|
73
|
+
.superRefine((data, ctx) => {
|
74
|
+
if (!data.uuid && !data.username) {
|
75
|
+
ctx.addIssue({
|
76
|
+
code: zod_1.z.ZodIssueCode.custom,
|
77
|
+
message: 'Either uuid or username must be provided',
|
78
|
+
});
|
79
|
+
}
|
67
80
|
});
|
68
81
|
UpdateUserCommand.ResponseSchema = zod_1.z.object({
|
69
82
|
response: models_1.ExtendedUsersSchema,
|
@@ -9,9 +9,14 @@ var UpdateUserCommand;
|
|
9
9
|
(function (UpdateUserCommand) {
|
10
10
|
UpdateUserCommand.url = api_1.REST_API.USERS.UPDATE;
|
11
11
|
UpdateUserCommand.TSQ_url = UpdateUserCommand.url;
|
12
|
-
UpdateUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.UPDATE, 'patch', 'Update a user');
|
13
|
-
UpdateUserCommand.RequestSchema = zod_1.z
|
14
|
-
|
12
|
+
UpdateUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.UPDATE, 'patch', 'Update a user by UUID or username');
|
13
|
+
UpdateUserCommand.RequestSchema = zod_1.z
|
14
|
+
.object({
|
15
|
+
username: zod_1.z.optional(zod_1.z.string().describe('Username of the user')),
|
16
|
+
uuid: zod_1.z.optional(zod_1.z
|
17
|
+
.string()
|
18
|
+
.uuid()
|
19
|
+
.describe('UUID of the user. UUID has higher priority than username, so if both are provided, username will be ignored.')),
|
15
20
|
status: zod_1.z
|
16
21
|
.enum([constants_1.USERS_STATUS.ACTIVE, constants_1.USERS_STATUS.DISABLED], {
|
17
22
|
errorMap: () => ({
|
@@ -64,6 +69,14 @@ var UpdateUserCommand;
|
|
64
69
|
invalid_type_error: 'Enabled internal squads must be an array of UUIDs',
|
65
70
|
})
|
66
71
|
.optional(),
|
72
|
+
})
|
73
|
+
.superRefine((data, ctx) => {
|
74
|
+
if (!data.uuid && !data.username) {
|
75
|
+
ctx.addIssue({
|
76
|
+
code: zod_1.z.ZodIssueCode.custom,
|
77
|
+
message: 'Either uuid or username must be provided',
|
78
|
+
});
|
79
|
+
}
|
67
80
|
});
|
68
81
|
UpdateUserCommand.ResponseSchema = zod_1.z.object({
|
69
82
|
response: models_1.ExtendedUsersSchema,
|