@remnawave/backend-contract 0.0.51 → 0.0.53
Sign up to get free protection for your applications and to get access to all the features.
- package/build/commands/users/get-all-users-v2.command.js +3 -5
- package/build/constants/errors/errors.js +5 -0
- package/build/models/api-tokens.schema.js +2 -2
- package/commands/users/get-all-users-v2.command.ts +10 -5
- package/constants/errors/errors.ts +6 -0
- package/models/api-tokens.schema.ts +2 -2
- package/package.json +1 -1
@@ -10,7 +10,7 @@ var GetAllUsersV2Command;
|
|
10
10
|
GetAllUsersV2Command.TSQ_url = GetAllUsersV2Command.url;
|
11
11
|
const FilterSchema = zod_1.z.object({
|
12
12
|
id: zod_1.z.string(),
|
13
|
-
value: zod_1.z.
|
13
|
+
value: zod_1.z.unknown(),
|
14
14
|
});
|
15
15
|
const SortingSchema = zod_1.z.object({
|
16
16
|
id: zod_1.z.string(),
|
@@ -21,12 +21,10 @@ var GetAllUsersV2Command;
|
|
21
21
|
start: zod_1.z.coerce.number().optional(),
|
22
22
|
size: zod_1.z.coerce.number().optional(),
|
23
23
|
filters: zod_1.z
|
24
|
-
.
|
25
|
-
.transform((val) => (typeof val === 'string' ? JSON.parse(val) : val))
|
24
|
+
.preprocess((str) => (typeof str === 'string' ? JSON.parse(str) : str), zod_1.z.array(FilterSchema))
|
26
25
|
.optional(),
|
27
26
|
filterModes: zod_1.z
|
28
|
-
.
|
29
|
-
.transform((val) => (typeof val === 'string' ? JSON.parse(val) : val))
|
27
|
+
.preprocess((str) => (typeof str === 'string' ? JSON.parse(str) : str), zod_1.z.record(zod_1.z.string(), zod_1.z.string()))
|
30
28
|
.optional(),
|
31
29
|
globalFilterMode: zod_1.z.string().optional(),
|
32
30
|
sorting: zod_1.z
|
@@ -7,6 +7,6 @@ exports.ApiTokensSchema = zod_1.z.object({
|
|
7
7
|
token: zod_1.z.string(),
|
8
8
|
tokenName: zod_1.z.string(),
|
9
9
|
tokenDescription: zod_1.z.nullable(zod_1.z.string()),
|
10
|
-
createdAt: zod_1.z.
|
11
|
-
updatedAt: zod_1.z.
|
10
|
+
createdAt: zod_1.z.string().transform((str) => new Date(str)),
|
11
|
+
updatedAt: zod_1.z.string().transform((str) => new Date(str)),
|
12
12
|
});
|
@@ -8,7 +8,7 @@ export namespace GetAllUsersV2Command {
|
|
8
8
|
|
9
9
|
const FilterSchema = z.object({
|
10
10
|
id: z.string(),
|
11
|
-
value: z.
|
11
|
+
value: z.unknown(),
|
12
12
|
});
|
13
13
|
|
14
14
|
const SortingSchema = z.object({
|
@@ -21,14 +21,19 @@ export namespace GetAllUsersV2Command {
|
|
21
21
|
start: z.coerce.number().optional(),
|
22
22
|
size: z.coerce.number().optional(),
|
23
23
|
filters: z
|
24
|
-
.
|
25
|
-
|
24
|
+
.preprocess(
|
25
|
+
(str) => (typeof str === 'string' ? JSON.parse(str) : str),
|
26
|
+
z.array(FilterSchema),
|
27
|
+
)
|
26
28
|
.optional(),
|
27
29
|
|
28
30
|
filterModes: z
|
29
|
-
.
|
30
|
-
|
31
|
+
.preprocess(
|
32
|
+
(str) => (typeof str === 'string' ? JSON.parse(str) : str),
|
33
|
+
z.record(z.string(), z.string()),
|
34
|
+
)
|
31
35
|
.optional(),
|
36
|
+
|
32
37
|
globalFilterMode: z.string().optional(),
|
33
38
|
|
34
39
|
sorting: z
|
@@ -30,6 +30,7 @@ export const ERRORS = {
|
|
30
30
|
message: 'Node not found',
|
31
31
|
httpCode: 404,
|
32
32
|
},
|
33
|
+
|
33
34
|
CONFIG_NOT_FOUND: {
|
34
35
|
code: 'A012',
|
35
36
|
message: 'Configuration not found',
|
@@ -260,4 +261,9 @@ export const ERRORS = {
|
|
260
261
|
message: 'Create config error',
|
261
262
|
httpCode: 500,
|
262
263
|
},
|
264
|
+
ENABLED_NODES_NOT_FOUND: {
|
265
|
+
code: 'A054',
|
266
|
+
message: 'Enabled nodes not found',
|
267
|
+
httpCode: 409,
|
268
|
+
},
|
263
269
|
} as const;
|
@@ -6,6 +6,6 @@ export const ApiTokensSchema = z.object({
|
|
6
6
|
tokenName: z.string(),
|
7
7
|
tokenDescription: z.nullable(z.string()),
|
8
8
|
|
9
|
-
createdAt: z.
|
10
|
-
updatedAt: z.
|
9
|
+
createdAt: z.string().transform((str) => new Date(str)),
|
10
|
+
updatedAt: z.string().transform((str) => new Date(str)),
|
11
11
|
});
|