|
|
import { JSONSchema } from 'fastify'
export const tokenResponseSchema: JSONSchema = { type: 'object', properties: { id: { type: 'string' }, access: { type: 'string' }, refresh: { type: 'string' }, expires: { type: 'number' }, }, }
export const postSchema: JSONSchema = { type: 'object', properties: { id: { type: 'string' }, userId: { type: 'string' }, text: { type: 'string' }, cover: { type: 'string' }, visible: { type: 'boolean' }, created: { type: 'number' }, }, }
export const userSchema: JSONSchema = { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, imageUrl: { type: 'string' }, coverImageUrl: { type: 'string' }, group: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, imageUrl: { type: 'string' }, coverImageUrl: { type: 'string' }, }, }, created: { type: 'number' },
subscription: { type: 'string' }, membership: { type: 'string' }, }, }
export const awardSchema: JSONSchema = { type: 'object', properties: { userId: { type: 'string' }, imageUrl: { type: 'string' }, text: { type: 'string' }, userText: { type: 'string' }, created: { type: 'number' }, }, }
export const groupListingSchema: JSONSchema = { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, about: { type: 'string' }, imageUrl: { type: 'string' }, coverImageUrl: { type: 'string' }, requiresApproval: { type: 'boolean' }, members: { type: 'number' }, posts: { type: 'number' }, awards: { type: 'number' }, points: { type: 'number' }, created: { type: 'number' }, membership: { type: 'string' }, latestAwards: { type: 'array', items: awardSchema, }, }, }
export const errorSchema: JSONSchema = { type: 'object', properties: { message: { type: 'string' }, errors: { type: 'array', items: { type: 'object', properties: { field: { type: 'string' }, message: { type: 'string' }, }, }, }, }, }
|