Spaces:
Sleeping
Sleeping
| /** | |
| * Generated by orval v8.5.3 🍺 | |
| * Do not edit manually. | |
| * Api | |
| * Mihrab Islamic Day Canvas API | |
| * OpenAPI spec version: 1.0.0 | |
| */ | |
| import * as zod from "zod"; | |
| /** | |
| * @summary Health check | |
| */ | |
| export const HealthCheckResponse = zod.object({ | |
| status: zod.string(), | |
| }); | |
| /** | |
| * @summary Register a new user | |
| */ | |
| export const registerBodyPasswordMin = 8; | |
| export const RegisterBody = zod.object({ | |
| email: zod.string().email(), | |
| password: zod.string().min(registerBodyPasswordMin), | |
| displayName: zod.string().optional(), | |
| }); | |
| /** | |
| * @summary Login | |
| */ | |
| export const LoginBody = zod.object({ | |
| email: zod.string().email(), | |
| password: zod.string(), | |
| }); | |
| export const LoginResponse = zod.object({ | |
| token: zod.string(), | |
| user: zod.object({ | |
| id: zod.string(), | |
| email: zod.string(), | |
| displayName: zod.string().optional(), | |
| avatarUrl: zod.string().nullish(), | |
| role: zod.string(), | |
| streakCurrent: zod.number(), | |
| streakLongest: zod.number(), | |
| totalPoints: zod.number(), | |
| isOnboarded: zod.boolean(), | |
| createdAt: zod.string(), | |
| }), | |
| }); | |
| /** | |
| * @summary Logout | |
| */ | |
| export const LogoutResponse = zod.object({ | |
| success: zod.boolean(), | |
| message: zod.string().optional(), | |
| }); | |
| /** | |
| * @summary Get current user | |
| */ | |
| export const GetMeResponse = zod.object({ | |
| id: zod.string(), | |
| email: zod.string(), | |
| displayName: zod.string().optional(), | |
| avatarUrl: zod.string().nullish(), | |
| role: zod.string(), | |
| streakCurrent: zod.number(), | |
| streakLongest: zod.number(), | |
| totalPoints: zod.number(), | |
| isOnboarded: zod.boolean(), | |
| createdAt: zod.string(), | |
| }); | |
| /** | |
| * @summary Get user profile | |
| */ | |
| export const GetProfileResponse = zod.object({ | |
| userId: zod.string(), | |
| displayName: zod.string().nullish(), | |
| avatarUrl: zod.string().nullish(), | |
| bio: zod.string().nullish(), | |
| location: zod.string().nullish(), | |
| timezone: zod.string(), | |
| islamicDayStart: zod.string(), | |
| streakCurrent: zod.number(), | |
| streakLongest: zod.number(), | |
| totalPoints: zod.number(), | |
| isOnboarded: zod.boolean(), | |
| createdAt: zod.string(), | |
| updatedAt: zod.string(), | |
| }); | |
| /** | |
| * @summary Update user profile | |
| */ | |
| export const UpdateProfileBody = zod.object({ | |
| displayName: zod.string().optional(), | |
| bio: zod.string().optional(), | |
| location: zod.string().optional(), | |
| timezone: zod.string().optional(), | |
| islamicDayStart: zod.string().optional(), | |
| isOnboarded: zod.boolean().optional(), | |
| }); | |
| export const UpdateProfileResponse = zod.object({ | |
| userId: zod.string(), | |
| displayName: zod.string().nullish(), | |
| avatarUrl: zod.string().nullish(), | |
| bio: zod.string().nullish(), | |
| location: zod.string().nullish(), | |
| timezone: zod.string(), | |
| islamicDayStart: zod.string(), | |
| streakCurrent: zod.number(), | |
| streakLongest: zod.number(), | |
| totalPoints: zod.number(), | |
| isOnboarded: zod.boolean(), | |
| createdAt: zod.string(), | |
| updatedAt: zod.string(), | |
| }); | |
| /** | |
| * @summary Get user preferences | |
| */ | |
| export const GetPreferencesResponse = zod.object({ | |
| userId: zod.string(), | |
| locale: zod.string(), | |
| theme: zod.string(), | |
| notificationsEnabled: zod.boolean(), | |
| reminderMinutesBefore: zod.number(), | |
| prayerCalculationMethod: zod.string(), | |
| gracePeriodDays: zod.number(), | |
| showHijriDate: zod.boolean(), | |
| focusTimerDefault: zod.number(), | |
| weeklyGoalDays: zod.number(), | |
| createdAt: zod.string(), | |
| updatedAt: zod.string(), | |
| }); | |
| /** | |
| * @summary Update user preferences | |
| */ | |
| export const UpdatePreferencesBody = zod.object({ | |
| locale: zod.string().optional(), | |
| theme: zod.string().optional(), | |
| notificationsEnabled: zod.boolean().optional(), | |
| reminderMinutesBefore: zod.number().optional(), | |
| prayerCalculationMethod: zod.string().optional(), | |
| gracePeriodDays: zod.number().optional(), | |
| showHijriDate: zod.boolean().optional(), | |
| focusTimerDefault: zod.number().optional(), | |
| weeklyGoalDays: zod.number().optional(), | |
| }); | |
| export const UpdatePreferencesResponse = zod.object({ | |
| userId: zod.string(), | |
| locale: zod.string(), | |
| theme: zod.string(), | |
| notificationsEnabled: zod.boolean(), | |
| reminderMinutesBefore: zod.number(), | |
| prayerCalculationMethod: zod.string(), | |
| gracePeriodDays: zod.number(), | |
| showHijriDate: zod.boolean(), | |
| focusTimerDefault: zod.number(), | |
| weeklyGoalDays: zod.number(), | |
| createdAt: zod.string(), | |
| updatedAt: zod.string(), | |
| }); | |
| /** | |
| * @summary List all available habits | |
| */ | |
| export const ListHabitsResponseItem = zod.object({ | |
| id: zod.string(), | |
| nameAr: zod.string(), | |
| nameEn: zod.string(), | |
| icon: zod.string(), | |
| category: zod.string(), | |
| defaultTarget: zod.number(), | |
| isPrayerRelated: zod.boolean(), | |
| prayerId: zod.string().nullish(), | |
| frequency: zod.string(), | |
| sortOrder: zod.number(), | |
| }); | |
| export const ListHabitsResponse = zod.array(ListHabitsResponseItem); | |
| /** | |
| * @summary List user habits | |
| */ | |
| export const ListMyHabitsResponseItem = zod.object({ | |
| id: zod.string(), | |
| habitId: zod.string(), | |
| habit: zod.object({ | |
| id: zod.string(), | |
| nameAr: zod.string(), | |
| nameEn: zod.string(), | |
| icon: zod.string(), | |
| category: zod.string(), | |
| defaultTarget: zod.number(), | |
| isPrayerRelated: zod.boolean(), | |
| prayerId: zod.string().nullish(), | |
| frequency: zod.string(), | |
| sortOrder: zod.number(), | |
| }), | |
| targetValue: zod.number().nullish(), | |
| isActive: zod.boolean(), | |
| startedAt: zod.string(), | |
| assignmentSource: zod.string(), | |
| createdAt: zod.string(), | |
| }); | |
| export const ListMyHabitsResponse = zod.array(ListMyHabitsResponseItem); | |
| /** | |
| * @summary Add habit to user | |
| */ | |
| export const AddUserHabitBody = zod.object({ | |
| habitId: zod.string(), | |
| targetValue: zod.number().optional(), | |
| }); | |
| /** | |
| * @summary Remove user habit | |
| */ | |
| export const RemoveUserHabitParams = zod.object({ | |
| habitId: zod.coerce.string(), | |
| }); | |
| export const RemoveUserHabitResponse = zod.object({ | |
| success: zod.boolean(), | |
| message: zod.string().optional(), | |
| }); | |
| /** | |
| * @summary List days | |
| */ | |
| export const ListDaysQueryParams = zod.object({ | |
| from: zod.coerce.string().optional(), | |
| to: zod.coerce.string().optional(), | |
| }); | |
| export const ListDaysResponseItem = zod.object({ | |
| id: zod.string(), | |
| date: zod.string(), | |
| status: zod.string(), | |
| mood: zod.number().nullish(), | |
| journalText: zod.string().nullish(), | |
| gratitudeText: zod.string().nullish(), | |
| createdAt: zod.string(), | |
| updatedAt: zod.string(), | |
| }); | |
| export const ListDaysResponse = zod.array(ListDaysResponseItem); | |
| /** | |
| * @summary Get today's day entry | |
| */ | |
| export const GetTodayResponse = zod.object({ | |
| id: zod.string(), | |
| date: zod.string(), | |
| status: zod.string(), | |
| mood: zod.number().nullish(), | |
| journalText: zod.string().nullish(), | |
| gratitudeText: zod.string().nullish(), | |
| habitEntries: zod.array( | |
| zod.object({ | |
| id: zod.string(), | |
| habitId: zod.string(), | |
| habit: zod.object({ | |
| id: zod.string(), | |
| nameAr: zod.string(), | |
| nameEn: zod.string(), | |
| icon: zod.string(), | |
| category: zod.string(), | |
| defaultTarget: zod.number(), | |
| isPrayerRelated: zod.boolean(), | |
| prayerId: zod.string().nullish(), | |
| frequency: zod.string(), | |
| sortOrder: zod.number(), | |
| }), | |
| value: zod.number(), | |
| targetValue: zod.number().nullish(), | |
| isCompleted: zod.boolean(), | |
| completedAt: zod.string().nullish(), | |
| notes: zod.string().nullish(), | |
| }), | |
| ), | |
| completionRate: zod.number(), | |
| createdAt: zod.string(), | |
| updatedAt: zod.string(), | |
| }); | |
| /** | |
| * @summary Update today's entry | |
| */ | |
| export const updateTodayBodyMoodMax = 5; | |
| export const UpdateTodayBody = zod.object({ | |
| mood: zod.number().min(1).max(updateTodayBodyMoodMax).optional(), | |
| journalText: zod.string().optional(), | |
| gratitudeText: zod.string().optional(), | |
| status: zod.string().optional(), | |
| }); | |
| export const UpdateTodayResponse = zod.object({ | |
| id: zod.string(), | |
| date: zod.string(), | |
| status: zod.string(), | |
| mood: zod.number().nullish(), | |
| journalText: zod.string().nullish(), | |
| gratitudeText: zod.string().nullish(), | |
| habitEntries: zod.array( | |
| zod.object({ | |
| id: zod.string(), | |
| habitId: zod.string(), | |
| habit: zod.object({ | |
| id: zod.string(), | |
| nameAr: zod.string(), | |
| nameEn: zod.string(), | |
| icon: zod.string(), | |
| category: zod.string(), | |
| defaultTarget: zod.number(), | |
| isPrayerRelated: zod.boolean(), | |
| prayerId: zod.string().nullish(), | |
| frequency: zod.string(), | |
| sortOrder: zod.number(), | |
| }), | |
| value: zod.number(), | |
| targetValue: zod.number().nullish(), | |
| isCompleted: zod.boolean(), | |
| completedAt: zod.string().nullish(), | |
| notes: zod.string().nullish(), | |
| }), | |
| ), | |
| completionRate: zod.number(), | |
| createdAt: zod.string(), | |
| updatedAt: zod.string(), | |
| }); | |
| /** | |
| * @summary Get day by date | |
| */ | |
| export const GetDayParams = zod.object({ | |
| date: zod.coerce.string(), | |
| }); | |
| export const GetDayResponse = zod.object({ | |
| id: zod.string(), | |
| date: zod.string(), | |
| status: zod.string(), | |
| mood: zod.number().nullish(), | |
| journalText: zod.string().nullish(), | |
| gratitudeText: zod.string().nullish(), | |
| habitEntries: zod.array( | |
| zod.object({ | |
| id: zod.string(), | |
| habitId: zod.string(), | |
| habit: zod.object({ | |
| id: zod.string(), | |
| nameAr: zod.string(), | |
| nameEn: zod.string(), | |
| icon: zod.string(), | |
| category: zod.string(), | |
| defaultTarget: zod.number(), | |
| isPrayerRelated: zod.boolean(), | |
| prayerId: zod.string().nullish(), | |
| frequency: zod.string(), | |
| sortOrder: zod.number(), | |
| }), | |
| value: zod.number(), | |
| targetValue: zod.number().nullish(), | |
| isCompleted: zod.boolean(), | |
| completedAt: zod.string().nullish(), | |
| notes: zod.string().nullish(), | |
| }), | |
| ), | |
| completionRate: zod.number(), | |
| createdAt: zod.string(), | |
| updatedAt: zod.string(), | |
| }); | |
| /** | |
| * @summary Toggle habit completion for a day | |
| */ | |
| export const ToggleHabitEntryParams = zod.object({ | |
| date: zod.coerce.string(), | |
| habitId: zod.coerce.string(), | |
| }); | |
| export const ToggleHabitEntryBody = zod.object({ | |
| isCompleted: zod.boolean(), | |
| value: zod.number().optional(), | |
| notes: zod.string().optional(), | |
| }); | |
| export const ToggleHabitEntryResponse = zod.object({ | |
| id: zod.string(), | |
| habitId: zod.string(), | |
| habit: zod.object({ | |
| id: zod.string(), | |
| nameAr: zod.string(), | |
| nameEn: zod.string(), | |
| icon: zod.string(), | |
| category: zod.string(), | |
| defaultTarget: zod.number(), | |
| isPrayerRelated: zod.boolean(), | |
| prayerId: zod.string().nullish(), | |
| frequency: zod.string(), | |
| sortOrder: zod.number(), | |
| }), | |
| value: zod.number(), | |
| targetValue: zod.number().nullish(), | |
| isCompleted: zod.boolean(), | |
| completedAt: zod.string().nullish(), | |
| notes: zod.string().nullish(), | |
| }); | |
| /** | |
| * @summary Cache prayer times for a date | |
| */ | |
| export const CachePrayerTimesBody = zod.object({ | |
| date: zod.string(), | |
| latitude: zod.number(), | |
| longitude: zod.number(), | |
| calculationMethod: zod.string(), | |
| fajr: zod.string(), | |
| sunrise: zod.string(), | |
| dhuhr: zod.string(), | |
| asr: zod.string(), | |
| maghrib: zod.string(), | |
| isha: zod.string(), | |
| }); | |
| export const CachePrayerTimesResponse = zod.object({ | |
| success: zod.boolean(), | |
| message: zod.string().optional(), | |
| }); | |
| /** | |
| * @summary List all badges | |
| */ | |
| export const ListBadgesResponseItem = zod.object({ | |
| id: zod.string(), | |
| slug: zod.string(), | |
| nameAr: zod.string(), | |
| nameEn: zod.string(), | |
| descriptionAr: zod.string(), | |
| descriptionEn: zod.string(), | |
| icon: zod.string(), | |
| category: zod.string(), | |
| threshold: zod.number(), | |
| }); | |
| export const ListBadgesResponse = zod.array(ListBadgesResponseItem); | |
| /** | |
| * @summary List user badges | |
| */ | |
| export const ListMyBadgesResponseItem = zod.object({ | |
| id: zod.string(), | |
| badge: zod.object({ | |
| id: zod.string(), | |
| slug: zod.string(), | |
| nameAr: zod.string(), | |
| nameEn: zod.string(), | |
| descriptionAr: zod.string(), | |
| descriptionEn: zod.string(), | |
| icon: zod.string(), | |
| category: zod.string(), | |
| threshold: zod.number(), | |
| }), | |
| awardedAt: zod.string(), | |
| }); | |
| export const ListMyBadgesResponse = zod.array(ListMyBadgesResponseItem); | |
| /** | |
| * @summary Get dashboard statistics | |
| */ | |
| export const GetDashboardStatsResponse = zod.object({ | |
| todayCompletion: zod.number(), | |
| weeklyCompletion: zod.number(), | |
| streakCurrent: zod.number(), | |
| streakLongest: zod.number(), | |
| totalPoints: zod.number(), | |
| totalHabitsCompleted: zod.number(), | |
| badgesEarned: zod.number(), | |
| activeHabits: zod.number(), | |
| moodAverage: zod.number().nullish(), | |
| recentActivity: zod.array( | |
| zod.object({ | |
| id: zod.string(), | |
| eventType: zod.string(), | |
| eventData: zod.object({}).passthrough(), | |
| createdAt: zod.string(), | |
| }), | |
| ), | |
| }); | |
| /** | |
| * @summary Get weekly statistics | |
| */ | |
| export const GetWeeklyStatsQueryParams = zod.object({ | |
| week: zod.coerce.string().optional(), | |
| }); | |
| export const GetWeeklyStatsResponse = zod.object({ | |
| weekStart: zod.string(), | |
| weekEnd: zod.string(), | |
| days: zod.array( | |
| zod.object({ | |
| date: zod.string(), | |
| completionRate: zod.number(), | |
| habitsCompleted: zod.number(), | |
| habitsTotal: zod.number(), | |
| mood: zod.number().nullish(), | |
| }), | |
| ), | |
| overallCompletion: zod.number(), | |
| completedHabitsTotal: zod.number(), | |
| moodAverage: zod.number().nullish(), | |
| bestDay: zod.string().nullish(), | |
| }); | |
| /** | |
| * @summary Get streak information | |
| */ | |
| export const GetStreakInfoResponse = zod.object({ | |
| current: zod.number(), | |
| longest: zod.number(), | |
| lastCompletedDate: zod.string().nullish(), | |
| isAtRisk: zod.boolean(), | |
| daysUntilLoss: zod.number().nullish(), | |
| }); | |