mirror of
https://github.com/YuzuZensai/Minikura.git
synced 2026-09-13 18:59:25 +00:00
♻️ refactor: remove unused code
This commit is contained in:
@@ -54,49 +54,7 @@ export const createServerSchema = z.object({
|
||||
level_type: z.string().optional(),
|
||||
});
|
||||
|
||||
export const updateServerSchema = z.object({
|
||||
description: z.string().nullable().optional(),
|
||||
listen_port: z.number().int().min(1).max(65535).optional(),
|
||||
service_type: z.nativeEnum(ServiceType).optional(),
|
||||
node_port: z
|
||||
.union([
|
||||
z
|
||||
.number()
|
||||
.int()
|
||||
.min(30000, "Node port must be at least 30000")
|
||||
.max(32767, "Node port must be at most 32767"),
|
||||
z.null(),
|
||||
])
|
||||
.optional(),
|
||||
env_variables: z
|
||||
.array(
|
||||
z.object({
|
||||
key: z.string().min(1),
|
||||
value: z.string(),
|
||||
})
|
||||
)
|
||||
.optional(),
|
||||
memory: z.number().int().min(256).optional(),
|
||||
memory_request: z.number().int().min(256).optional(),
|
||||
cpu_request: z.string().optional(),
|
||||
cpu_limit: z.string().optional(),
|
||||
|
||||
jar_type: z.nativeEnum(MinecraftServerJarType).optional(),
|
||||
minecraft_version: z.string().optional(),
|
||||
|
||||
jvm_opts: z.string().optional(),
|
||||
use_aikar_flags: z.boolean().optional(),
|
||||
use_meowice_flags: z.boolean().optional(),
|
||||
|
||||
difficulty: z.nativeEnum(ServerDifficulty).optional(),
|
||||
game_mode: z.nativeEnum(GameMode).optional(),
|
||||
max_players: z.number().int().min(1).max(1000).optional(),
|
||||
pvp: z.boolean().optional(),
|
||||
online_mode: z.boolean().optional(),
|
||||
motd: z.string().optional(),
|
||||
level_seed: z.string().optional(),
|
||||
level_type: z.string().optional(),
|
||||
});
|
||||
export const updateServerSchema = createServerSchema.omit({ id: true, type: true }).partial();
|
||||
|
||||
export const createReverseProxySchema = z.object({
|
||||
id: z
|
||||
@@ -123,18 +81,9 @@ export const createReverseProxySchema = z.object({
|
||||
cpu_limit: z.string().optional(),
|
||||
});
|
||||
|
||||
export const updateReverseProxySchema = z.object({
|
||||
description: z.string().nullable().optional(),
|
||||
external_address: z.string().optional(),
|
||||
external_port: z.number().int().min(1).max(65535).optional(),
|
||||
listen_port: z.number().int().min(1).max(65535).optional(),
|
||||
type: z.nativeEnum(ReverseProxyServerType).optional(),
|
||||
service_type: z.nativeEnum(ServiceType).optional(),
|
||||
node_port: z.union([z.number().int().min(30000).max(32767), z.null()]).optional(),
|
||||
memory: z.number().int().min(256).optional(),
|
||||
cpu_request: z.string().optional(),
|
||||
cpu_limit: z.string().optional(),
|
||||
});
|
||||
export const updateReverseProxySchema = createReverseProxySchema
|
||||
.omit({ id: true, env_variables: true })
|
||||
.partial();
|
||||
|
||||
export const envVariableSchema = z.object({
|
||||
key: z.string().min(1, "Key is required"),
|
||||
|
||||
Reference in New Issue
Block a user