@remnawave/backend-contract
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -75,6 +75,4 @@ "use strict"; | ||
}), | ||
enabledInbounds: zod_1.z | ||
.array(models_1.InboundsSchema.pick({ | ||
uuid: true, | ||
}), { | ||
activeUserInbounds: zod_1.z | ||
.array(zod_1.z.string().uuid(), { | ||
invalid_type_error: 'Enabled inbounds must be an array', | ||
@@ -81,0 +79,0 @@ }) |
@@ -38,24 +38,7 @@ "use strict"; | ||
}), | ||
// enabledInbounds: z | ||
// .array( | ||
// InboundsSchema.pick({ | ||
// uuid: true, | ||
// }), | ||
// { | ||
// invalid_type_error: 'Enabled inbounds must be an array', | ||
// }, | ||
// ) | ||
// .optional(), | ||
enabledInbounds: zod_1.z.preprocess((val) => { | ||
if (Array.isArray(val)) { | ||
return val.map((uuid) => ({ uuid })); | ||
} | ||
return []; | ||
}, zod_1.z | ||
.array(models_1.InboundsSchema.pick({ | ||
uuid: true, | ||
}), { | ||
invalid_type_error: 'Enabled inbounds must be an array of objects with uuid', | ||
activeUserInbounds: zod_1.z | ||
.array(zod_1.z.string().uuid(), { | ||
invalid_type_error: 'Enabled inbounds must be an array of UUIDs', | ||
}) | ||
.optional()), | ||
.optional(), | ||
expireAt: zod_1.z.coerce | ||
@@ -62,0 +45,0 @@ .date({ |
@@ -76,11 +76,6 @@ import { z } from 'zod'; | ||
}), | ||
enabledInbounds: z | ||
.array( | ||
InboundsSchema.pick({ | ||
uuid: true, | ||
}), | ||
{ | ||
invalid_type_error: 'Enabled inbounds must be an array', | ||
}, | ||
) | ||
activeUserInbounds: z | ||
.array(z.string().uuid(), { | ||
invalid_type_error: 'Enabled inbounds must be an array', | ||
}) | ||
.optional(), | ||
@@ -87,0 +82,0 @@ expireAt: z.coerce |
@@ -36,31 +36,7 @@ import { z } from 'zod'; | ||
}), | ||
// enabledInbounds: z | ||
// .array( | ||
// InboundsSchema.pick({ | ||
// uuid: true, | ||
// }), | ||
// { | ||
// invalid_type_error: 'Enabled inbounds must be an array', | ||
// }, | ||
// ) | ||
// .optional(), | ||
enabledInbounds: z.preprocess( | ||
(val) => { | ||
if (Array.isArray(val)) { | ||
return val.map((uuid) => ({ uuid })); | ||
} | ||
return []; | ||
}, | ||
z | ||
.array( | ||
InboundsSchema.pick({ | ||
uuid: true, | ||
}), | ||
{ | ||
invalid_type_error: | ||
'Enabled inbounds must be an array of objects with uuid', | ||
}, | ||
) | ||
.optional(), | ||
), | ||
activeUserInbounds: z | ||
.array(z.string().uuid(), { | ||
invalid_type_error: 'Enabled inbounds must be an array of UUIDs', | ||
}) | ||
.optional(), | ||
expireAt: z.coerce | ||
@@ -67,0 +43,0 @@ .date({ |
{ | ||
"name": "@remnawave/backend-contract", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "A contract library for Remnawave", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
132855
3259