Files
aniplay-api/src/types/user.ts

27 lines
768 B
TypeScript

import { z } from "zod";
export type User = z.infer<typeof User>;
export const User = z
.object({
id: z.number().openapi({ type: "integer", format: "int64" }),
name: z.string(),
})
.optional()
.nullable();
export type UserProfile = z.infer<typeof UserProfile>;
export const UserProfile = z.object({
statistics: z.object({
minutesWatched: z.number().openapi({ type: "integer", format: "int64" }),
episodesWatched: z.number().openapi({ type: "integer", format: "int64" }),
count: z.number().int(),
meanScore: z.number().openapi({ type: "number", format: "float" }),
}),
id: z.number().openapi({ type: "integer", format: "int64" }),
name: z.string(),
avatar: z.object({
medium: z.string(),
large: z.string(),
}),
});