import { z } from 'zod'; export type GetApiAuthMe = { pid: number; username: string; accessLevel: number; serverAccessLevel: 'dev' | 'test' | 'prod'; discordId: string | null; stripeTier: { subscriptionId: string; priceId: string; tierName: string; } | null; mii: { imageUrl: string; name: string; } | null; }; export type ProgressItem = { title: string; githubUrl?: string; completion: number; tasks: Array<{ status: 'completed' | 'inprogress' | 'notstarted'; title: string; }>; }; export type GetProgress = { donations: { currentCents: number; goalCents: number; }; completion: number; items: ProgressItem[]; }; export type ApiAuthLogin = { accessToken: string; refreshToken: string; }; export type ApiAccountDiscordLink = { url: string; }; export type ApiAccountCheckoutLink = { url: string; }; export type TierItem = { priceId: string; tierLevel: number; priceCents: number; thumbnailUrl: string | null; name: string; description: string | null; perks: { discordRead: boolean; beta: boolean; }; }; export type ApiAccountTiers = { tiers: TierItem[]; }; export const LoginSchema = z.object({ username: z.string(), password: z.string() }); export type ApiAuthLoginRequest = z.infer; export const RegisterSchema = z.object({ email: z.email(), username: z.string(), miiName: z.string(), password: z.string(), captchaResponse: z.string().optional() }); export type ApiAuthRegisterRequest = z.infer; export const AccountUpdateSchema = z.object({ mii: z.object({ name: z.string(), primary: z.enum(['Y', 'N']), data: z.string() }).optional(), environment: z.enum(['prod', 'test', 'dev']).optional() }); export type ApiAccountUpdateRequest = z.infer; export const ResetPasswordSchema = z.object({ password: z.string(), passwordConfirm: z.string(), resetToken: z.string() }); export type ApiAuthResetPasswordRequest = z.infer; export const ForgotPasswordSchema = z.object({ emailOrPassword: z.string(), captchaResponse: z.string().optional() }); export type ApiAuthForgotPasswordRequest = z.infer; export const CheckoutSchema = z.object({ priceId: z.string() }); export type ApiAccountCheckoutRequest = z.infer;