@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.
@@ -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.pick({ tag: true, uuid: true })),
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
- enabledInbounds: zod_1.z
76
- .array(models_1.InboundsSchema.pick({
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
- // enabledInbounds: z
39
- // .array(
40
- // InboundsSchema.pick({
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.pick({ tag: true, uuid: true })),
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
- enabledInbounds: z
77
- .array(
78
- InboundsSchema.pick({
79
- uuid: true,
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
- // enabledInbounds: z
37
- // .array(
38
- // InboundsSchema.pick({
39
- // uuid: true,
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',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "A contract library for Remnawave",
5
5
  "main": "index.js",
6
6
  "scripts": {