chore: initial commit for phase03
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { Type } from '@sinclair/typebox';
|
||||
|
||||
export const CreateGameSchema = {
|
||||
body: Type.Object({
|
||||
slug: Type.String({ minLength: 1, maxLength: 100, pattern: '^[a-z0-9-]+$' }),
|
||||
name: Type.String({ minLength: 1, maxLength: 255 }),
|
||||
dockerImage: Type.String({ minLength: 1 }),
|
||||
defaultPort: Type.Number({ minimum: 1, maximum: 65535 }),
|
||||
startupCommand: Type.String({ minLength: 1 }),
|
||||
stopCommand: Type.Optional(Type.String()),
|
||||
configFiles: Type.Optional(Type.Array(Type.Any())),
|
||||
environmentVars: Type.Optional(Type.Array(Type.Any())),
|
||||
}),
|
||||
};
|
||||
|
||||
export const UpdateGameSchema = {
|
||||
body: Type.Object({
|
||||
name: Type.Optional(Type.String({ minLength: 1, maxLength: 255 })),
|
||||
dockerImage: Type.Optional(Type.String({ minLength: 1 })),
|
||||
defaultPort: Type.Optional(Type.Number({ minimum: 1, maximum: 65535 })),
|
||||
startupCommand: Type.Optional(Type.String({ minLength: 1 })),
|
||||
stopCommand: Type.Optional(Type.String()),
|
||||
configFiles: Type.Optional(Type.Array(Type.Any())),
|
||||
environmentVars: Type.Optional(Type.Array(Type.Any())),
|
||||
}),
|
||||
};
|
||||
|
||||
export const GameIdParamSchema = {
|
||||
params: Type.Object({
|
||||
gameId: Type.String({ format: 'uuid' }),
|
||||
}),
|
||||
};
|
||||
Reference in New Issue
Block a user