import { GeospatialPoint, RPE, SetType, WorkoutBiometrics, WorkoutMedia } from '..'; export interface PostWorkoutRequest { workout: PostWorkoutRequestWorkout; /** * `source` is set by import-workout-data (currently only supports imports from Strong) * and for workouts that come from the public API. * This prop gives us visibility into workouts that aren't logged within Hevy. Currently, * it's used to filter the feed so users aren't spammed by workouts created programmatically. */ source?: 'strong' | 'public-api'; share_to_strava?: boolean; } export interface PostClientsWorkoutRequest { workout: PostWorkoutRequestWorkout; updateRoutineValues: boolean; } /** * PostWorkoutRequestWorkout describes the final state of a completed workout. * It's used when sending a workout to the server. */ export interface PostWorkoutRequestWorkout { title: string; description: string; media: WorkoutMedia[]; start_time: number; end_time: number; exercises: PostWorkoutRequestExercise[]; routine_id?: string; apple_watch: boolean; wearos_watch: boolean; workout_id: string; is_private: boolean; biometrics?: WorkoutBiometrics; is_biometrics_public: boolean; trainer_program_id: string | undefined; trainer_workout_template_id: string | undefined; gym: { type: 'commercial'; gym_id: string; } | { type: 'home'; } | null; } export interface PostWorkoutRequestExercise { title: string; exercise_template_id: string; superset_id?: number; rest_timer_seconds?: number; notes: string; /** * for exercises with two dumbbells * * `true` if the weight of each set is the weight of _one_ dumbbell, but the * exercise was performed with _two_ dumbbells of that weight */ volume_doubling_enabled?: boolean; sets: PostWorkoutRequestSet[]; } export interface PostWorkoutRequestSet { index: number; type: SetType; weight_kg?: number; reps?: number; distance_meters?: number; duration_seconds?: number; custom_metric?: number; rpe?: RPE; completed_at?: string; geospatial_data?: GeospatialPoint[]; } /** * Used to update an existing workout. Props that are defined will be used to * update the corresponding values of the workout in the database, and those * that are undefined will not be changed. */ export type UpdateWorkoutRequestWorkout = Partial> & { start_and_end_time?: Required>; };