Skip to content

@kaiord/core


@kaiord/core / sleepRecordSchema

Variable: sleepRecordSchema

const sleepRecordSchema: ZodObject<{ endTime: ZodISODateTime; externalId: ZodOptional<ZodString>; kaiordRecordId: ZodOptional<ZodString>; kind: ZodLiteral<"sleep">; restingHeartRate: ZodOptional<ZodNumber>; score: ZodOptional<ZodNumber>; sourceBridgeId: ZodOptional<ZodString>; stages: ZodArray<ZodObject<{ durationSeconds: ZodNumber; stage: ZodEnum<{ awake: "awake"; deep: "deep"; light: "light"; rem: "rem"; }>; startTime: ZodISODateTime; }, $strip>>; startTime: ZodISODateTime; totalDurationSeconds: ZodNumber; version: ZodString; }, $strip>

Defined in: packages/core/src/domain/schemas/health/sleep.ts:30

Zod schema for extensions.health.sleep — a single overnight sleep session with REM/deep/light/awake stages, total duration, and optional sleep score / resting heart rate.

version is constrained to 2.x so future additive evolution within the v2 line is accepted without bumping the canonical KRD version.