diff --git a/src/server/eight/types.ts b/src/server/eight/types.ts index 4d55e8b..978b05f 100644 --- a/src/server/eight/types.ts +++ b/src/server/eight/types.ts @@ -25,47 +25,36 @@ export const DeviceListSchema = z.object({ export const UserProfileSchema = z.object({ user: z.object({ - userId: z.string(), - email: z.string().email(), - firstName: z.string(), - lastName: z.string(), - gender: z.enum(["male", "female", "other"]).optional(), - tempPreference: z.enum(["cool", "warm", "neutral"]).optional(), - tempPreferenceUpdatedAt: z.string().optional(), - dob: z.string().optional(), - zip: z.number().optional(), - devices: z.array(z.string()), - emailVerified: z.boolean().optional(), - sharingMetricsTo: z.array(z.unknown()).optional(), - sharingMetricsFrom: z.array(z.unknown()).optional(), - notifications: z.object({ - weeklyReportEmail: z.boolean(), - sessionProcessed: z.boolean(), - temperatureRecommendation: z.boolean(), - healthInsight: z.boolean(), - sleepInsight: z.boolean(), - marketingUpdates: z.boolean(), - bedtimeReminder: z.boolean(), - alarmWakeupPush: z.boolean(), - }).optional(), - createdAt: z.string().optional(), - experimentalFeatures: z.boolean().optional(), - autopilotEnabled: z.boolean().optional(), - lastReset: z.string().optional(), - nextReset: z.string().optional(), - sleepTracking: z.object({ - enabledSince: z.string(), - }).optional(), - features: z.array( - z.enum(["warming", "cooling", "vibration", "tapControls"]), - ).optional(), - currentDevice: z.object({ - id: z.string(), - side: z.enum(["left", "right"]), - timeZone: z.string(), - }), - hotelGuest: z.boolean().optional(), - }), + userId: z.string().optional(), + email: z.string().optional(), + firstName: z.string().optional(), + lastName: z.string().optional(), + gender: z.string().optional(), + tempPreference: z.string().optional(), + tempPreferenceUpdatedAt: z.string().optional(), + dob: z.string().optional(), + zip: z.number().optional(), + devices: z.array(z.string()), + emailVerified: z.boolean().optional(), + sharingMetricsTo: z.array(z.unknown()).optional(), + sharingMetricsFrom: z.array(z.unknown()).optional(), + notifications: z.record(z.boolean()).optional(), + createdAt: z.string().optional(), + experimentalFeatures: z.boolean().optional(), + autopilotEnabled: z.boolean().optional(), + lastReset: z.string().optional(), + nextReset: z.string().optional(), + sleepTracking: z.object({ + enabledSince: z.string().optional(), + }).optional(), + features: z.array(z.string()).optional(), + currentDevice: z.object({ + id: z.string(), + side: z.string(), + timeZone: z.string(), + }), + hotelGuest: z.boolean().optional(), + }).catchall(z.unknown()), }); export const DeviceDataSchema = z.object({