Talha812's picture
Upload 45 files
2c16c8c verified
import { z } from "zod";
//============= Register User Request Schema =================
export const registerUserRequestSchema = z.object({
fullName: z.string(),
email: z.email(),
phone: z.string(),
password: z.string(),
})
export type RegisterUserRequestSchema = z.infer<typeof registerUserRequestSchema>;
//============== Register User Response Schema ================
export const registerUserResponseSchema = z.object({
email: z.string(),
})
export type RegisterUserResponseSchema = z.infer<typeof registerUserResponseSchema>;
//============= Resend Otp Request Schema ===============
export const resendOtpRequestSchema = z.object({
email: z.string(),
})
export type ResendOtpRequestSchema = z.infer<typeof resendOtpRequestSchema>;
//============= Resend Otp Response Schema ===============
export const resendOtpResponseSchema = z.object({
otpCode: z.string(),
})
export type ResendOtpResponseSchema = z.infer<typeof resendOtpResponseSchema>;
//============== Verify Otp Request Schema =================
export const verifyOtpRequestSchema = z.object({
otpCode: z.string(),
email: z.string(),
})
export type VerifyOtpRequestSchema = z.infer<typeof verifyOtpRequestSchema>;
// ============ Login Request Schema =====================
export const loginRequestSchema = z.object({
email: z.email(),
password: z.string(),
})
export type LoginRequestSchema = z.infer<typeof loginRequestSchema>;
export const oauthTokenResponseSchema = z.object({
provider_token: z.string().nullable().optional(),
provider_refresh_token: z.string().nullable().optional(),
access_token: z.string(),
refresh_token: z.string(),
expires_in: z.number(),
expires_at: z.number().optional(),
token_type: z.string(),
user: z.any(),
});
export type OAuthTokenResponse = z.infer<typeof oauthTokenResponseSchema>;
// ============ Forget Password Response Schema =====================
export const forgetPasswordResponseSchema = z.object({
email: z.string(),
})
export type ForgetPasswordResponseSchema = z.infer<typeof forgetPasswordResponseSchema>;
// ============ Reset Password Request Schema =====================
export const resetPasswordRequestSchema = z.object({
email: z.string(),
otpCode: z.string(),
newPassword: z.string(),
})
export type ResetPasswordRequestSchema = z.infer<typeof resetPasswordRequestSchema>;
export const refreshSessionRequestSchema = z.object({
accessToken: z.string(),
refreshToken: z.string(),
});
export type RefreshSessionRequestSchema = z.infer<typeof refreshSessionRequestSchema>;