@remnawave/backend-contract 0.0.36 → 0.0.38

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,21 +6,29 @@ const api_1 = require("../../api");
6
6
  const users_schema_1 = require("../../models/users.schema");
7
7
  var GetAllUsersV2Command;
8
8
  (function (GetAllUsersV2Command) {
9
- GetAllUsersV2Command.url = api_1.REST_API.USERS.GET_ALL;
9
+ GetAllUsersV2Command.url = api_1.REST_API.USERS.GET_ALL_V2;
10
10
  GetAllUsersV2Command.RequestQuerySchema = zod_1.z.object({
11
- start: zod_1.z.number().optional(),
12
- size: zod_1.z.number().optional(),
11
+ start: zod_1.z.coerce.number().optional(),
12
+ size: zod_1.z.coerce.number().optional(),
13
13
  filters: zod_1.z
14
- .array(zod_1.z.object({
14
+ .string()
15
+ .transform((str) => JSON.parse(str))
16
+ .pipe(zod_1.z.array(zod_1.z.object({
15
17
  id: zod_1.z.string(),
16
18
  value: zod_1.z.string(),
17
- }))
19
+ })))
18
20
  .optional(),
19
21
  filterModes: zod_1.z
20
- .record(zod_1.z.string(), zod_1.z.enum(['contains', 'startsWith', 'endsWith']))
22
+ .string()
23
+ .transform((str) => JSON.parse(str))
24
+ .pipe(zod_1.z.record(zod_1.z.string(), zod_1.z.string()))
21
25
  .optional(),
22
26
  globalFilterMode: zod_1.z.string().optional(),
23
- sorting: zod_1.z.array(zod_1.z.object({ id: zod_1.z.string(), desc: zod_1.z.boolean() })).optional(),
27
+ sorting: zod_1.z
28
+ .string()
29
+ .transform((str) => JSON.parse(str))
30
+ .pipe(zod_1.z.array(zod_1.z.object({ id: zod_1.z.string(), desc: zod_1.z.boolean() })))
31
+ .optional(),
24
32
  });
25
33
  GetAllUsersV2Command.ResponseSchema = zod_1.z.object({
26
34
  response: zod_1.z.object({
@@ -3,24 +3,34 @@ import { REST_API } from '../../api';
3
3
  import { UsersSchema } from '../../models/users.schema';
4
4
 
5
5
  export namespace GetAllUsersV2Command {
6
- export const url = REST_API.USERS.GET_ALL;
6
+ export const url = REST_API.USERS.GET_ALL_V2;
7
7
 
8
8
  export const RequestQuerySchema = z.object({
9
- start: z.number().optional(),
10
- size: z.number().optional(),
9
+ start: z.coerce.number().optional(),
10
+ size: z.coerce.number().optional(),
11
11
  filters: z
12
- .array(
13
- z.object({
14
- id: z.string(),
15
- value: z.string(),
16
- }),
12
+ .string()
13
+ .transform((str) => JSON.parse(str))
14
+ .pipe(
15
+ z.array(
16
+ z.object({
17
+ id: z.string(),
18
+ value: z.string(),
19
+ }),
20
+ ),
17
21
  )
18
22
  .optional(),
19
23
  filterModes: z
20
- .record(z.string(), z.enum(['contains', 'startsWith', 'endsWith']))
24
+ .string()
25
+ .transform((str) => JSON.parse(str))
26
+ .pipe(z.record(z.string(), z.string()))
21
27
  .optional(),
22
28
  globalFilterMode: z.string().optional(),
23
- sorting: z.array(z.object({ id: z.string(), desc: z.boolean() })).optional(),
29
+ sorting: z
30
+ .string()
31
+ .transform((str) => JSON.parse(str))
32
+ .pipe(z.array(z.object({ id: z.string(), desc: z.boolean() })))
33
+ .optional(),
24
34
  });
25
35
 
26
36
  export type RequestQuery = z.infer<typeof RequestQuerySchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "0.0.36",
3
+ "version": "0.0.38",
4
4
  "description": "A contract library for Remnawave",
5
5
  "main": "index.js",
6
6
  "scripts": {