@remnawave/backend-contract 0.0.50 → 0.0.51

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,10 +21,12 @@ 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
- .preprocess((str) => (typeof str === 'string' ? JSON.parse(str) : str), zod_1.z.array(FilterSchema))
24
+ .union([zod_1.z.string(), zod_1.z.array(FilterSchema)])
25
+ .transform((val) => (typeof val === 'string' ? JSON.parse(val) : val))
25
26
  .optional(),
26
27
  filterModes: zod_1.z
27
- .preprocess((str) => (typeof str === 'string' ? JSON.parse(str) : str), zod_1.z.record(zod_1.z.string(), zod_1.z.string()))
28
+ .union([zod_1.z.string(), zod_1.z.record(zod_1.z.string(), zod_1.z.string())])
29
+ .transform((val) => (typeof val === 'string' ? JSON.parse(val) : val))
28
30
  .optional(),
29
31
  globalFilterMode: zod_1.z.string().optional(),
30
32
  sorting: zod_1.z
@@ -21,17 +21,13 @@ export namespace GetAllUsersV2Command {
21
21
  start: z.coerce.number().optional(),
22
22
  size: z.coerce.number().optional(),
23
23
  filters: z
24
- .preprocess(
25
- (str) => (typeof str === 'string' ? JSON.parse(str) : str),
26
- z.array(FilterSchema),
27
- )
24
+ .union([z.string(), z.array(FilterSchema)])
25
+ .transform((val) => (typeof val === 'string' ? JSON.parse(val) : val))
28
26
  .optional(),
29
27
 
30
28
  filterModes: z
31
- .preprocess(
32
- (str) => (typeof str === 'string' ? JSON.parse(str) : str),
33
- z.record(z.string(), z.string()),
34
- )
29
+ .union([z.string(), z.record(z.string(), z.string())])
30
+ .transform((val) => (typeof val === 'string' ? JSON.parse(val) : val))
35
31
  .optional(),
36
32
  globalFilterMode: z.string().optional(),
37
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "0.0.50",
3
+ "version": "0.0.51",
4
4
  "description": "A contract library for Remnawave",
5
5
  "main": "index.js",
6
6
  "scripts": {