feat: create a guild (#1)
This commit is contained in:
@ -1,12 +1,24 @@
|
||||
import { Type } from '@sinclair/typebox'
|
||||
import { Type, Static } from '@sinclair/typebox'
|
||||
|
||||
import { channelSchema } from './Channel'
|
||||
import { memberSchema } from './Member'
|
||||
import { date, id } from './utils'
|
||||
|
||||
export const guildSchema = {
|
||||
id,
|
||||
name: Type.String({ minLength: 3, maxLength: 30 }),
|
||||
icon: Type.String({ format: 'uri-reference' }),
|
||||
description: Type.String({ maxLength: 160 }),
|
||||
name: Type.String({ minLength: 1, maxLength: 30 }),
|
||||
icon: Type.Union([Type.String({ format: 'uri-reference' }), Type.Null()]),
|
||||
description: Type.Union([Type.String({ maxLength: 160 }), Type.Null()]),
|
||||
createdAt: date.createdAt,
|
||||
updatedAt: date.updatedAt
|
||||
}
|
||||
|
||||
export const guildCompleteSchema = {
|
||||
...guildSchema,
|
||||
channels: Type.Array(Type.Object(channelSchema)),
|
||||
members: Type.Array(Type.Object(memberSchema))
|
||||
}
|
||||
|
||||
export const guildCompleteObjectSchema = Type.Object(guildCompleteSchema)
|
||||
|
||||
export type GuildComplete = Static<typeof guildCompleteObjectSchema>
|
||||
|
Reference in New Issue
Block a user