@remnawave/backend-contract 0.0.10 → 0.0.12
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/commands/inbounds/get-inbounds.command.js +1 -1
- package/build/commands/users/create-user.command.js +2 -4
- package/build/commands/users/update-user.command.js +4 -21
- package/commands/inbounds/get-inbounds.command.ts +1 -1
- package/commands/users/create-user.command.ts +4 -9
- package/commands/users/update-user.command.ts +5 -29
- package/package.json +1 -1
@@ -8,6 +8,6 @@ var GetInboundsCommand;
|
|
8
8
|
(function (GetInboundsCommand) {
|
9
9
|
GetInboundsCommand.url = api_1.REST_API.INBOUNDS.GET_INBOUNDS;
|
10
10
|
GetInboundsCommand.ResponseSchema = zod_1.z.object({
|
11
|
-
response: zod_1.z.array(inbounds_schema_1.InboundsSchema
|
11
|
+
response: zod_1.z.array(inbounds_schema_1.InboundsSchema),
|
12
12
|
});
|
13
13
|
})(GetInboundsCommand || (exports.GetInboundsCommand = GetInboundsCommand = {}));
|
@@ -72,10 +72,8 @@ var CreateUserCommand;
|
|
72
72
|
});
|
73
73
|
}
|
74
74
|
}),
|
75
|
-
|
76
|
-
.array(
|
77
|
-
uuid: true,
|
78
|
-
}), {
|
75
|
+
activeUserInbounds: zod_1.z
|
76
|
+
.array(zod_1.z.string().uuid(), {
|
79
77
|
invalid_type_error: 'Enabled inbounds must be an array',
|
80
78
|
})
|
81
79
|
.optional(),
|
@@ -35,28 +35,11 @@ var UpdateUserCommand;
|
|
35
35
|
});
|
36
36
|
}
|
37
37
|
}),
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
// uuid: true,
|
42
|
-
// }),
|
43
|
-
// {
|
44
|
-
// invalid_type_error: 'Enabled inbounds must be an array',
|
45
|
-
// },
|
46
|
-
// )
|
47
|
-
// .optional(),
|
48
|
-
enabledInbounds: zod_1.z.preprocess((val) => {
|
49
|
-
if (Array.isArray(val)) {
|
50
|
-
return val.map((uuid) => ({ uuid }));
|
51
|
-
}
|
52
|
-
return [];
|
53
|
-
}, zod_1.z
|
54
|
-
.array(models_1.InboundsSchema.pick({
|
55
|
-
uuid: true,
|
56
|
-
}), {
|
57
|
-
invalid_type_error: 'Enabled inbounds must be an array of objects with uuid',
|
38
|
+
activeUserInbounds: zod_1.z
|
39
|
+
.array(zod_1.z.string().uuid(), {
|
40
|
+
invalid_type_error: 'Enabled inbounds must be an array of UUIDs',
|
58
41
|
})
|
59
|
-
.optional()
|
42
|
+
.optional(),
|
60
43
|
expireAt: zod_1.z.coerce
|
61
44
|
.date({
|
62
45
|
required_error: 'Expiration date is required',
|
@@ -6,7 +6,7 @@ export namespace GetInboundsCommand {
|
|
6
6
|
export const url = REST_API.INBOUNDS.GET_INBOUNDS;
|
7
7
|
|
8
8
|
export const ResponseSchema = z.object({
|
9
|
-
response: z.array(InboundsSchema
|
9
|
+
response: z.array(InboundsSchema),
|
10
10
|
});
|
11
11
|
|
12
12
|
export type Response = z.infer<typeof ResponseSchema>;
|
@@ -73,15 +73,10 @@ export namespace CreateUserCommand {
|
|
73
73
|
});
|
74
74
|
}
|
75
75
|
}),
|
76
|
-
|
77
|
-
.array(
|
78
|
-
|
79
|
-
|
80
|
-
}),
|
81
|
-
{
|
82
|
-
invalid_type_error: 'Enabled inbounds must be an array',
|
83
|
-
},
|
84
|
-
)
|
76
|
+
activeUserInbounds: z
|
77
|
+
.array(z.string().uuid(), {
|
78
|
+
invalid_type_error: 'Enabled inbounds must be an array',
|
79
|
+
})
|
85
80
|
.optional(),
|
86
81
|
expireAt: z.coerce
|
87
82
|
.date({
|
@@ -33,35 +33,11 @@ export namespace UpdateUserCommand {
|
|
33
33
|
});
|
34
34
|
}
|
35
35
|
}),
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
// {
|
42
|
-
// invalid_type_error: 'Enabled inbounds must be an array',
|
43
|
-
// },
|
44
|
-
// )
|
45
|
-
// .optional(),
|
46
|
-
enabledInbounds: z.preprocess(
|
47
|
-
(val) => {
|
48
|
-
if (Array.isArray(val)) {
|
49
|
-
return val.map((uuid) => ({ uuid }));
|
50
|
-
}
|
51
|
-
return [];
|
52
|
-
},
|
53
|
-
z
|
54
|
-
.array(
|
55
|
-
InboundsSchema.pick({
|
56
|
-
uuid: true,
|
57
|
-
}),
|
58
|
-
{
|
59
|
-
invalid_type_error:
|
60
|
-
'Enabled inbounds must be an array of objects with uuid',
|
61
|
-
},
|
62
|
-
)
|
63
|
-
.optional(),
|
64
|
-
),
|
36
|
+
activeUserInbounds: z
|
37
|
+
.array(z.string().uuid(), {
|
38
|
+
invalid_type_error: 'Enabled inbounds must be an array of UUIDs',
|
39
|
+
})
|
40
|
+
.optional(),
|
65
41
|
expireAt: z.coerce
|
66
42
|
.date({
|
67
43
|
required_error: 'Expiration date is required',
|