Skip to content

@kaiord/core


@kaiord/core / repetitionBlockSchema

Variable: repetitionBlockSchema

const repetitionBlockSchema: ZodObject<{ id: ZodOptional<ZodString>; repeatCount: ZodNumber; steps: ZodArray<ZodObject<{ duration: ZodDiscriminatedUnion<[ZodObject<{ seconds: ZodNumber; type: ZodLiteral<"time">; }, $strip>, ZodObject<{ meters: ZodNumber; type: ZodLiteral<"distance">; }, $strip>, ZodObject<{ bpm: ZodNumber; type: ZodLiteral<"heart_rate_less_than">; }, $strip>, ZodObject<{ bpm: ZodNumber; repeatFrom: ZodNumber; type: ZodLiteral<"repeat_until_heart_rate_greater_than">; }, $strip>], "type">; durationType: ZodEnum<{ calories: "calories"; distance: "distance"; heart_rate_less_than: "heart_rate_less_than"; open: "open"; power_greater_than: "power_greater_than"; power_less_than: "power_less_than"; repeat_until_calories: "repeat_until_calories"; repeat_until_distance: "repeat_until_distance"; repeat_until_heart_rate_greater_than: "repeat_until_heart_rate_greater_than"; repeat_until_heart_rate_less_than: "repeat_until_heart_rate_less_than"; repeat_until_power_greater_than: "repeat_until_power_greater_than"; repeat_until_power_less_than: "repeat_until_power_less_than"; repeat_until_time: "repeat_until_time"; time: "time"; }>; equipment: ZodOptional<ZodEnum<{ none: "none"; swim_fins: "swim_fins"; swim_kickboard: "swim_kickboard"; swim_paddles: "swim_paddles"; swim_pull_buoy: "swim_pull_buoy"; swim_snorkel: "swim_snorkel"; }>>; extensions: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; intensity: ZodOptional<ZodEnum<{ active: "active"; cooldown: "cooldown"; interval: "interval"; other: "other"; recovery: "recovery"; rest: "rest"; warmup: "warmup"; }>>; name: ZodOptional<ZodString>; notes: ZodOptional<ZodString>; stepIndex: ZodNumber; target: ZodDiscriminatedUnion<[ZodObject<{ type: ZodLiteral<"power">; value: ZodDiscriminatedUnion<[..., ..., ..., ...], "unit">; }, $strip>, ZodObject<{ type: ZodLiteral<"heart_rate">; value: ZodDiscriminatedUnion<[..., ..., ..., ...], "unit">; }, $strip>, ZodObject<{ type: ZodLiteral<"cadence">; value: ZodDiscriminatedUnion<[..., ...], "unit">; }, $strip>], "type">; targetType: ZodEnum<{ cadence: "cadence"; heart_rate: "heart_rate"; open: "open"; pace: "pace"; power: "power"; stroke_type: "stroke_type"; }>; }, $strip>>; }, $strip>

Defined in: packages/core/src/domain/schemas/workout.ts:15

Zod schema for a repetition block.

Validates a group of workout steps that repeat multiple times.