hevy-shared 1.0.1018 → 1.0.1020
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/hevyTrainer.d.ts +54 -45
- package/built/hevyTrainer.js +65 -64
- package/built/index.d.ts +11 -333
- package/built/index.js +3 -8
- package/built/routineUtils.d.ts +1 -2
- package/built/tests/hevyTrainer.test.js +75 -62
- package/built/tests/testUtils.d.ts +1 -2
- package/built/tests/testUtils.js +1 -2
- package/built/workout/index.d.ts +11 -0
- package/built/workout/index.js +20 -0
- package/built/{normalizedWorkoutUtils.d.ts → workout/normalizedWorkout.d.ts} +2 -3
- package/built/{normalizedWorkoutUtils.js → workout/normalizedWorkout.js} +2 -2
- package/built/workout/postWorkoutRequest.d.ts +77 -0
- package/built/workout/postWorkoutRequest.js +2 -0
- package/built/workout/publicWorkout.d.ts +93 -0
- package/built/workout/publicWorkout.js +7 -0
- package/built/workout/userWorkout.d.ts +130 -0
- package/built/workout/userWorkout.js +2 -0
- package/built/workout/workout.d.ts +120 -0
- package/built/workout/workout.js +2 -0
- package/package.json +3 -5
package/built/index.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { InstructionsLanguage } from './exerciseLocaleUtils';
|
|
2
|
-
import {
|
|
2
|
+
import { WorkoutDurationMinutes } from './hevyTrainer';
|
|
3
3
|
import { BugReportQuestionSchema, CreateBugReportRequestBodySchema, postEmailBackofficeSchema } from './schemas';
|
|
4
4
|
import { Language } from './translations';
|
|
5
|
-
import { Lookup
|
|
5
|
+
import { Lookup } from './typeUtils';
|
|
6
6
|
import { z } from 'zod';
|
|
7
|
+
import { UserWorkout } from './workout';
|
|
7
8
|
export * from './schemas';
|
|
8
9
|
export * from './constants';
|
|
9
10
|
export * from './utils';
|
|
10
11
|
export * from './units';
|
|
12
|
+
export * from './workout';
|
|
11
13
|
export * from './filterExercises';
|
|
12
14
|
export * from './setIndicatorUtils';
|
|
13
15
|
export * from './workoutVolume';
|
|
@@ -18,7 +20,6 @@ export * from './cue';
|
|
|
18
20
|
export * from './muscleHeatmaps';
|
|
19
21
|
export * from './muscleSplits';
|
|
20
22
|
export * from './notifications';
|
|
21
|
-
export * from './normalizedWorkoutUtils';
|
|
22
23
|
export * from './routineUtils';
|
|
23
24
|
export * from './typeUtils';
|
|
24
25
|
export * from './async';
|
|
@@ -300,7 +301,7 @@ export interface BackofficeExistingUserResponse {
|
|
|
300
301
|
public_api_key: string | null;
|
|
301
302
|
limited_discovery: boolean;
|
|
302
303
|
coach_trial_expire_date?: string;
|
|
303
|
-
hevy_trainer_program:
|
|
304
|
+
hevy_trainer_program: HevyTrainerProgram | null;
|
|
304
305
|
}
|
|
305
306
|
export interface BackofficeDeletedUserResponse {
|
|
306
307
|
state: 'deleted-account';
|
|
@@ -599,7 +600,7 @@ export interface PublicUserProfile {
|
|
|
599
600
|
following_count: number;
|
|
600
601
|
routines: RoutineMetadata[];
|
|
601
602
|
weekly_workout_durations: WeeklyWorkoutDuration[];
|
|
602
|
-
last_workout?:
|
|
603
|
+
last_workout?: UserWorkout;
|
|
603
604
|
}
|
|
604
605
|
export declare const coreMuscles: readonly ["abdominals"];
|
|
605
606
|
export declare const shoulderMuscles: readonly ["shoulders"];
|
|
@@ -745,80 +746,6 @@ export interface RepRange {
|
|
|
745
746
|
start: number | null;
|
|
746
747
|
end: number | null;
|
|
747
748
|
}
|
|
748
|
-
export interface StrictRepRange extends RepRange {
|
|
749
|
-
start: number;
|
|
750
|
-
end: number;
|
|
751
|
-
}
|
|
752
|
-
export interface WorkoutExerciseSet {
|
|
753
|
-
/**
|
|
754
|
-
* id can be a string or a number because we used
|
|
755
|
-
* to store it as int4 and now we store it as int8
|
|
756
|
-
* which is too big to store (accurately) in a JS
|
|
757
|
-
* number.
|
|
758
|
-
*/
|
|
759
|
-
id: number | string;
|
|
760
|
-
index: number;
|
|
761
|
-
indicator: SetType;
|
|
762
|
-
weight_kg?: number | null;
|
|
763
|
-
reps?: number | null;
|
|
764
|
-
distance_meters?: number | null;
|
|
765
|
-
duration_seconds?: number | null;
|
|
766
|
-
custom_metric?: number | null;
|
|
767
|
-
rpe?: RPE | null;
|
|
768
|
-
/**
|
|
769
|
-
* @deprecated 1.29.17 -
|
|
770
|
-
* we can only set this to `best_weight`, `best_reps`, `best_duration` or
|
|
771
|
-
* `best_distance`. sending anything else would cause older clients to crash.
|
|
772
|
-
* newer clients will ignore this field and use the `prs` field instead.
|
|
773
|
-
*/
|
|
774
|
-
personalRecords?: Array<{
|
|
775
|
-
type: 'best_weight' | 'best_reps' | 'best_duration' | 'best_distance';
|
|
776
|
-
value: number;
|
|
777
|
-
}>;
|
|
778
|
-
prs: {
|
|
779
|
-
type: SetPersonalRecordType;
|
|
780
|
-
value: number;
|
|
781
|
-
}[];
|
|
782
|
-
completed_at: string | null;
|
|
783
|
-
}
|
|
784
|
-
export interface WorkoutExercise {
|
|
785
|
-
id: string;
|
|
786
|
-
exercise_template_id: string;
|
|
787
|
-
title: string;
|
|
788
|
-
es_title?: string | null;
|
|
789
|
-
de_title?: string | null;
|
|
790
|
-
fr_title?: string | null;
|
|
791
|
-
it_title?: string | null;
|
|
792
|
-
pt_title?: string | null;
|
|
793
|
-
ko_title?: string | null;
|
|
794
|
-
ja_title?: string | null;
|
|
795
|
-
tr_title?: string | null;
|
|
796
|
-
ru_title?: string | null;
|
|
797
|
-
zh_cn_title?: string | null;
|
|
798
|
-
zh_tw_title?: string | null;
|
|
799
|
-
superset_id: number | null;
|
|
800
|
-
rest_seconds: number | null;
|
|
801
|
-
notes: string;
|
|
802
|
-
priority: number;
|
|
803
|
-
muscle_group: MuscleGroup;
|
|
804
|
-
other_muscles: MuscleGroup[];
|
|
805
|
-
exercise_type: ExerciseType;
|
|
806
|
-
equipment_category: Equipment;
|
|
807
|
-
url?: string;
|
|
808
|
-
media_type?: string;
|
|
809
|
-
custom_exercise_image_url?: string | null;
|
|
810
|
-
thumbnail_url?: string | null;
|
|
811
|
-
manual_tag?: string;
|
|
812
|
-
aka?: string;
|
|
813
|
-
/**
|
|
814
|
-
* for exercises with two dumbbells
|
|
815
|
-
*
|
|
816
|
-
* `true` if the weight of each set is the weight of _one_ dumbbell, but the
|
|
817
|
-
* exercise was performed with _two_ dumbbells of that weight
|
|
818
|
-
*/
|
|
819
|
-
volume_doubling_enabled: boolean;
|
|
820
|
-
sets: WorkoutExerciseSet[];
|
|
821
|
-
}
|
|
822
749
|
export interface WorkoutComment {
|
|
823
750
|
id: number;
|
|
824
751
|
username: string;
|
|
@@ -845,56 +772,6 @@ export type PreviewWorkoutLike = {
|
|
|
845
772
|
username: string;
|
|
846
773
|
profile_pic: string;
|
|
847
774
|
};
|
|
848
|
-
export interface Workout {
|
|
849
|
-
id: string;
|
|
850
|
-
short_id: string | null;
|
|
851
|
-
index: number;
|
|
852
|
-
name: string;
|
|
853
|
-
description?: string;
|
|
854
|
-
like_count: number;
|
|
855
|
-
/** @deprecated 2.3.4 */
|
|
856
|
-
like_images: string[];
|
|
857
|
-
preview_workout_likes: PreviewWorkoutLike[];
|
|
858
|
-
comment_count: number;
|
|
859
|
-
comments: WorkoutComment[];
|
|
860
|
-
/** @deprecated 1.28.13 */
|
|
861
|
-
image_urls?: string[];
|
|
862
|
-
media: WorkoutMedia[];
|
|
863
|
-
is_liked_by_user: boolean;
|
|
864
|
-
start_time: number;
|
|
865
|
-
end_time: number;
|
|
866
|
-
user_id: string;
|
|
867
|
-
username: string;
|
|
868
|
-
profile_image: string;
|
|
869
|
-
exercises: WorkoutExercise[];
|
|
870
|
-
routine_id?: string;
|
|
871
|
-
apple_watch: boolean;
|
|
872
|
-
wearos_watch: boolean;
|
|
873
|
-
verified: boolean;
|
|
874
|
-
created_at: string;
|
|
875
|
-
updated_at: string;
|
|
876
|
-
nth_workout: number;
|
|
877
|
-
/**
|
|
878
|
-
* See https://github.com/hevyapp/hevy-backend/pull/193 to understand
|
|
879
|
-
* why we added estimated_volume_kg
|
|
880
|
-
*/
|
|
881
|
-
estimated_volume_kg: number;
|
|
882
|
-
/**
|
|
883
|
-
* Whether to include warmup sets in various calculations.
|
|
884
|
-
* https://github.com/hevyapp/hevy-shared/pull/312
|
|
885
|
-
*/
|
|
886
|
-
include_warmup_sets: boolean;
|
|
887
|
-
is_private: boolean;
|
|
888
|
-
/**
|
|
889
|
-
* If applicable, the user ID of the coach who logged this workout
|
|
890
|
-
*/
|
|
891
|
-
logged_by_coach_id?: string;
|
|
892
|
-
biometrics?: WorkoutBiometrics;
|
|
893
|
-
is_biometrics_public: boolean;
|
|
894
|
-
trainer_program_id: string | undefined;
|
|
895
|
-
gym: TODO<Gym> | undefined;
|
|
896
|
-
trainer_workout_template_id: string | undefined;
|
|
897
|
-
}
|
|
898
775
|
export interface CustomExerciseImage {
|
|
899
776
|
type: 'image';
|
|
900
777
|
image_url: string;
|
|
@@ -905,77 +782,6 @@ export interface CustomExerciseVideo {
|
|
|
905
782
|
video_preview_image_url: string;
|
|
906
783
|
}
|
|
907
784
|
export type CustomExerciseMedia = CustomExerciseImage | CustomExerciseVideo;
|
|
908
|
-
export declare const isPublicWorkout: (x: any) => x is PublicWorkout;
|
|
909
|
-
export interface PublicWorkout {
|
|
910
|
-
type: 'public';
|
|
911
|
-
id: string;
|
|
912
|
-
short_id: string | null;
|
|
913
|
-
name: string;
|
|
914
|
-
create_at: string;
|
|
915
|
-
start_time: number;
|
|
916
|
-
end_time: number;
|
|
917
|
-
username: string;
|
|
918
|
-
profile_image: string | null;
|
|
919
|
-
preview_image: string | null;
|
|
920
|
-
is_private: boolean;
|
|
921
|
-
exercises: WorkoutExercise[];
|
|
922
|
-
/**
|
|
923
|
-
* weight_unit and distance_unit are the current unit
|
|
924
|
-
* preferences of the owner of the workout.
|
|
925
|
-
*/
|
|
926
|
-
weight_unit: WeightUnit;
|
|
927
|
-
distance_unit: DistanceUnit;
|
|
928
|
-
estimated_volume_kg: number;
|
|
929
|
-
}
|
|
930
|
-
export interface WorkoutSync {
|
|
931
|
-
updated: Workout[];
|
|
932
|
-
deleted: string[];
|
|
933
|
-
isMore: boolean;
|
|
934
|
-
updated_at?: string;
|
|
935
|
-
}
|
|
936
|
-
export interface PostWorkoutRequest {
|
|
937
|
-
workout: PostWorkoutRequestWorkout;
|
|
938
|
-
/**
|
|
939
|
-
* `source` is set by import-workout-data (currently only supports imports from Strong)
|
|
940
|
-
* and for workouts that come from the public API.
|
|
941
|
-
* This prop gives us visibility into workouts that aren't logged within Hevy. Currently,
|
|
942
|
-
* it's used to filter the feed so users aren't spammed by workouts created programmatically.
|
|
943
|
-
*/
|
|
944
|
-
source?: 'strong' | 'public-api';
|
|
945
|
-
share_to_strava?: boolean;
|
|
946
|
-
/**
|
|
947
|
-
* Fake UTC format (ISO string of user's _local_ time, but with 'Z' as the
|
|
948
|
-
* time zone), since that is what Strava expects. 🤦♂️
|
|
949
|
-
* https://developers.strava.com/docs/reference/#api-Activities-createActivity
|
|
950
|
-
*/
|
|
951
|
-
strava_activity_local_time?: string;
|
|
952
|
-
}
|
|
953
|
-
export interface PostClientsWorkoutRequest {
|
|
954
|
-
workout: PostWorkoutRequestWorkout;
|
|
955
|
-
updateRoutineValues: boolean;
|
|
956
|
-
}
|
|
957
|
-
/**
|
|
958
|
-
* PostWorkoutRequestWorkout describes the final state of a completed workout.
|
|
959
|
-
* It's used when sending a workout to the server.
|
|
960
|
-
*/
|
|
961
|
-
export interface PostWorkoutRequestWorkout {
|
|
962
|
-
title: string;
|
|
963
|
-
description: string;
|
|
964
|
-
media: WorkoutMedia[];
|
|
965
|
-
start_time: number;
|
|
966
|
-
end_time: number;
|
|
967
|
-
exercises: PostWorkoutRequestExercise[];
|
|
968
|
-
routine_id?: string;
|
|
969
|
-
apple_watch: boolean;
|
|
970
|
-
wearos_watch: boolean;
|
|
971
|
-
workout_id: string;
|
|
972
|
-
is_private: boolean;
|
|
973
|
-
biometrics?: WorkoutBiometrics;
|
|
974
|
-
is_biometrics_public: boolean;
|
|
975
|
-
trainer_program_id: string | undefined;
|
|
976
|
-
gym: TODO<Gym> | undefined;
|
|
977
|
-
trainer_workout_template_id: string | undefined;
|
|
978
|
-
}
|
|
979
785
|
export type WorkoutDataImporterReport = {
|
|
980
786
|
state: 'idle';
|
|
981
787
|
} | {
|
|
@@ -1000,40 +806,6 @@ export interface HeartRateSample {
|
|
|
1000
806
|
timestamp_ms: number;
|
|
1001
807
|
bpm: number;
|
|
1002
808
|
}
|
|
1003
|
-
export interface PostWorkoutRequestExercise {
|
|
1004
|
-
title: string;
|
|
1005
|
-
exercise_template_id: string;
|
|
1006
|
-
superset_id?: number;
|
|
1007
|
-
rest_timer_seconds?: number;
|
|
1008
|
-
notes: string;
|
|
1009
|
-
/**
|
|
1010
|
-
* for exercises with two dumbbells
|
|
1011
|
-
*
|
|
1012
|
-
* `true` if the weight of each set is the weight of _one_ dumbbell, but the
|
|
1013
|
-
* exercise was performed with _two_ dumbbells of that weight
|
|
1014
|
-
*/
|
|
1015
|
-
volume_doubling_enabled?: boolean;
|
|
1016
|
-
sets: PostWorkoutRequestSet[];
|
|
1017
|
-
}
|
|
1018
|
-
export interface PostWorkoutRequestSet {
|
|
1019
|
-
index: number;
|
|
1020
|
-
type: SetType;
|
|
1021
|
-
weight_kg?: number;
|
|
1022
|
-
reps?: number;
|
|
1023
|
-
distance_meters?: number;
|
|
1024
|
-
duration_seconds?: number;
|
|
1025
|
-
custom_metric?: number;
|
|
1026
|
-
rpe?: RPE;
|
|
1027
|
-
completed_at?: string;
|
|
1028
|
-
}
|
|
1029
|
-
/**
|
|
1030
|
-
* Used to update an existing workout. Props that are defined will be used to
|
|
1031
|
-
* update the corresponding values of the workout in the database, and those
|
|
1032
|
-
* that are undefined will not be changed.
|
|
1033
|
-
*/
|
|
1034
|
-
export type UpdateWorkoutRequestWorkout = Partial<Pick<PostWorkoutRequestWorkout, 'title' | 'description' | 'media' | 'exercises' | 'is_private' | 'is_biometrics_public'>> & {
|
|
1035
|
-
start_and_end_time?: Required<Pick<PostWorkoutRequestWorkout, 'start_time' | 'end_time'>>;
|
|
1036
|
-
};
|
|
1037
809
|
/** Routines */
|
|
1038
810
|
export interface RoutineSet {
|
|
1039
811
|
index: number;
|
|
@@ -1102,14 +874,12 @@ export interface Routine extends BaseRoutine {
|
|
|
1102
874
|
username: string;
|
|
1103
875
|
coach_id: null;
|
|
1104
876
|
}
|
|
1105
|
-
/** @deprecated Use TrainerWorkoutTemplate instead */
|
|
1106
877
|
export interface HevyTrainerRoutine extends Routine {
|
|
1107
878
|
hevy_trainer_program_id: string;
|
|
1108
879
|
program_id: null;
|
|
1109
880
|
coach_force_rpe_enabled: false;
|
|
1110
881
|
folder_id: null;
|
|
1111
882
|
}
|
|
1112
|
-
/** @deprecated Use TrainerWorkoutTemplate instead */
|
|
1113
883
|
export declare const isHevyTrainerRoutine: (routine: BaseRoutine) => routine is HevyTrainerRoutine;
|
|
1114
884
|
export type CoachsShallowLibraryRoutine = Omit<BaseRoutine, 'exercises' | 'profile_pic' | 'hevy_trainer_program_id' | 'username'>;
|
|
1115
885
|
export interface CoachesRoutine extends BaseRoutine {
|
|
@@ -1278,97 +1048,6 @@ export interface GetTeamInviteResponse {
|
|
|
1278
1048
|
export interface OutstandingInvitesForCoachTeamResponse {
|
|
1279
1049
|
invites: CoachTeamInvite[];
|
|
1280
1050
|
}
|
|
1281
|
-
export interface TrainerWorkoutTemplateResistanceExercise {
|
|
1282
|
-
kind: 'resistance';
|
|
1283
|
-
id: string;
|
|
1284
|
-
exercise_template_id: string;
|
|
1285
|
-
index: number;
|
|
1286
|
-
set_count: number;
|
|
1287
|
-
warmup_set_count: number;
|
|
1288
|
-
rep_range: StrictRepRange;
|
|
1289
|
-
rest_seconds: number;
|
|
1290
|
-
}
|
|
1291
|
-
export interface TrainerWorkoutTemplateCardioExercise {
|
|
1292
|
-
kind: 'cardio';
|
|
1293
|
-
id: string;
|
|
1294
|
-
exercise_template_id: string;
|
|
1295
|
-
index: number;
|
|
1296
|
-
set_count: 1;
|
|
1297
|
-
duration_seconds: number;
|
|
1298
|
-
}
|
|
1299
|
-
export interface TrainerWorkoutTemplateOtherExercise {
|
|
1300
|
-
kind: 'other';
|
|
1301
|
-
id: string;
|
|
1302
|
-
exercise_template_id: string;
|
|
1303
|
-
index: number;
|
|
1304
|
-
set_count: number;
|
|
1305
|
-
}
|
|
1306
|
-
export type TrainerWorkoutTemplateExercise = TrainerWorkoutTemplateResistanceExercise | TrainerWorkoutTemplateCardioExercise | TrainerWorkoutTemplateOtherExercise;
|
|
1307
|
-
export interface TrainerWorkoutTemplate {
|
|
1308
|
-
id: string;
|
|
1309
|
-
hevy_trainer_program_id: string;
|
|
1310
|
-
index: number;
|
|
1311
|
-
name: TrainerWorkoutTemplateName;
|
|
1312
|
-
exercises: TrainerWorkoutTemplateExercise[];
|
|
1313
|
-
}
|
|
1314
|
-
export interface TrainerProgramV3 {
|
|
1315
|
-
id: string;
|
|
1316
|
-
schema_version: 'v3';
|
|
1317
|
-
created_at: string;
|
|
1318
|
-
updated_at: string;
|
|
1319
|
-
level: TrainingLevel;
|
|
1320
|
-
goal: TrainingGoal;
|
|
1321
|
-
equipments: GranularEquipment[];
|
|
1322
|
-
weekly_frequency: WeeklyTrainingFrequency;
|
|
1323
|
-
templates: TrainerWorkoutTemplate[];
|
|
1324
|
-
focus_muscle?: SimplifiedMuscleGroup;
|
|
1325
|
-
next_workout_index: number;
|
|
1326
|
-
workout_duration_minutes: WorkoutDurationMinutes;
|
|
1327
|
-
rest_timer_length: RestTimerLength;
|
|
1328
|
-
cardio_preference: CardioPreference;
|
|
1329
|
-
}
|
|
1330
|
-
export type TrainerWorkoutTemplateExerciseInput = Omit<TrainerWorkoutTemplateResistanceExercise, 'id'> | Omit<TrainerWorkoutTemplateCardioExercise, 'id'> | Omit<TrainerWorkoutTemplateOtherExercise, 'id'>;
|
|
1331
|
-
export interface PostTrainerWorkoutTemplate {
|
|
1332
|
-
name: TrainerWorkoutTemplateName;
|
|
1333
|
-
index: number;
|
|
1334
|
-
exercises: TrainerWorkoutTemplateExerciseInput[];
|
|
1335
|
-
}
|
|
1336
|
-
export interface UpdateTrainerWorkoutTemplate extends PostTrainerWorkoutTemplate {
|
|
1337
|
-
id: string;
|
|
1338
|
-
}
|
|
1339
|
-
export interface PostTrainerProgramV3RequestBody {
|
|
1340
|
-
program: {
|
|
1341
|
-
version: 3;
|
|
1342
|
-
title: string;
|
|
1343
|
-
level: TrainingLevel;
|
|
1344
|
-
goal: TrainingGoal;
|
|
1345
|
-
equipments: GranularEquipment[];
|
|
1346
|
-
weekly_frequency: WeeklyTrainingFrequency;
|
|
1347
|
-
focus_muscle?: SimplifiedMuscleGroup;
|
|
1348
|
-
next_workout_index?: number;
|
|
1349
|
-
workout_duration_minutes: WorkoutDurationMinutes;
|
|
1350
|
-
rest_timer_length: RestTimerLength;
|
|
1351
|
-
cardio_preference: CardioPreference;
|
|
1352
|
-
templates: PostTrainerWorkoutTemplate[];
|
|
1353
|
-
};
|
|
1354
|
-
}
|
|
1355
|
-
export interface UpdateTrainerProgramV3RequestBody {
|
|
1356
|
-
program: {
|
|
1357
|
-
version: 3;
|
|
1358
|
-
programId: string;
|
|
1359
|
-
level: TrainingLevel;
|
|
1360
|
-
goal: TrainingGoal;
|
|
1361
|
-
equipments: GranularEquipment[];
|
|
1362
|
-
weekly_frequency: WeeklyTrainingFrequency;
|
|
1363
|
-
focus_muscle?: SimplifiedMuscleGroup;
|
|
1364
|
-
next_workout_index?: number;
|
|
1365
|
-
workout_duration_minutes: WorkoutDurationMinutes;
|
|
1366
|
-
rest_timer_length: RestTimerLength;
|
|
1367
|
-
cardio_preference: CardioPreference;
|
|
1368
|
-
templates: UpdateTrainerWorkoutTemplate[];
|
|
1369
|
-
};
|
|
1370
|
-
}
|
|
1371
|
-
/** @deprecated Use TrainerProgramV3 instead */
|
|
1372
1051
|
export interface HevyTrainerProgram {
|
|
1373
1052
|
id: string;
|
|
1374
1053
|
created_at: string;
|
|
@@ -1385,7 +1064,6 @@ export interface HevyTrainerProgram {
|
|
|
1385
1064
|
rest_timer_length: RestTimerLength;
|
|
1386
1065
|
cardio_preference: CardioPreference;
|
|
1387
1066
|
}
|
|
1388
|
-
/** @deprecated Use PostTrainerProgramV3RequestBody instead */
|
|
1389
1067
|
export interface PostHevyTrainerProgramRequestBody {
|
|
1390
1068
|
program: {
|
|
1391
1069
|
version: 1;
|
|
@@ -1402,7 +1080,6 @@ export interface PostHevyTrainerProgramRequestBody {
|
|
|
1402
1080
|
cardio_preference: CardioPreference;
|
|
1403
1081
|
};
|
|
1404
1082
|
}
|
|
1405
|
-
/** @deprecated Use UpdateTrainerProgramV3RequestBody instead */
|
|
1406
1083
|
export interface UpdateHevyTrainerProgramRequestBody {
|
|
1407
1084
|
program: {
|
|
1408
1085
|
version: 1;
|
|
@@ -1425,7 +1102,7 @@ export interface UpdateHevyTrainerProgramRequestBody {
|
|
|
1425
1102
|
}[];
|
|
1426
1103
|
};
|
|
1427
1104
|
}
|
|
1428
|
-
/** @deprecated Use
|
|
1105
|
+
/** @deprecated Use HevyTrainerProgram instead */
|
|
1429
1106
|
export interface HevyTrainerProgramOld {
|
|
1430
1107
|
id: string;
|
|
1431
1108
|
created_at: string;
|
|
@@ -1440,7 +1117,7 @@ export interface HevyTrainerProgramOld {
|
|
|
1440
1117
|
next_workout_index: number;
|
|
1441
1118
|
workout_duration_minutes?: WorkoutDurationMinutes;
|
|
1442
1119
|
}
|
|
1443
|
-
/** @deprecated Use
|
|
1120
|
+
/** @deprecated Use PostHevyTrainerProgramRequestBody instead */
|
|
1444
1121
|
export interface PostHevyTrainerProgramOldRequestBody {
|
|
1445
1122
|
program: {
|
|
1446
1123
|
title: string;
|
|
@@ -1454,7 +1131,7 @@ export interface PostHevyTrainerProgramOldRequestBody {
|
|
|
1454
1131
|
workout_duration_minutes?: WorkoutDurationMinutes;
|
|
1455
1132
|
};
|
|
1456
1133
|
}
|
|
1457
|
-
/** @deprecated Use
|
|
1134
|
+
/** @deprecated Use UpdateHevyTrainerProgramRequestBody instead */
|
|
1458
1135
|
export interface UpdateHevyTrainerProgramOldRequestBody {
|
|
1459
1136
|
program: {
|
|
1460
1137
|
programId: string;
|
|
@@ -1728,7 +1405,8 @@ export type CommercialGym = {
|
|
|
1728
1405
|
name: string;
|
|
1729
1406
|
fullAddress: string;
|
|
1730
1407
|
city: string;
|
|
1731
|
-
|
|
1408
|
+
latitude: number;
|
|
1409
|
+
longitude: number;
|
|
1732
1410
|
};
|
|
1733
1411
|
export type HomeGym = {
|
|
1734
1412
|
type: 'home';
|
package/built/index.js
CHANGED
|
@@ -14,13 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
exports.isOAuthScope = exports.supportedScopes = exports.isSuggestedUserSource = exports.isValidUserWorkoutMetricsType = exports.isBodyMeasurementKey = exports.measurementsList = exports.isHevyTrainerRoutine = exports.isWorkoutBiometrics =
|
|
17
|
+
exports.isHeartRateSamples = exports.isSetType = exports.isRPE = exports.validRpeValues = exports.isSetPersonalRecordType = exports.weeklyTrainingFrequencies = exports.isGranularEquipment = exports.granularEquipments = exports.hevyTrainerProgramEquipments = exports.cardioPreferences = exports.restTimerLengths = exports.exerciseCategories = exports.trainingLevels = exports.trainingGoals = exports.isCustomExerciseType = exports.customExericseTypes = exports.isExerciseType = exports.exerciseTypes = exports.isExerciseRepType = exports.exerciseRepTypes = exports.isEquipmentFilter = exports.equipmentFilters = exports.isEquipment = exports.equipments = exports.simplifiedMuscleGroupToMuscleGroups = exports.isMuscleGroupFilter = exports.muscleGroupFilters = exports.isMuscleGroup = exports.muscleGroups = exports.isSimplifiedMuscleGroup = exports.simplifiedMuscleGroups = exports.miscellaneousMuscles = exports.chestMuscles = exports.backMuscles = exports.legMuscles = exports.armMuscles = exports.shoulderMuscles = exports.coreMuscles = exports.DefaultClientConfiguration = exports.parseClientAuthTokenResponse = exports.isCoachRole = exports.isErrorResponse = exports.isLivePRVolumeOption = exports.isTimerVolumeOption = exports.isWeekday = exports.orderedWeekdays = exports.isBodyMeasurementUnit = exports.isDistanceUnitShort = exports.isDistanceUnit = exports.isWeightUnit = void 0;
|
|
18
|
+
exports.isOAuthScope = exports.supportedScopes = exports.isSuggestedUserSource = exports.isValidUserWorkoutMetricsType = exports.isBodyMeasurementKey = exports.measurementsList = exports.isHevyTrainerRoutine = exports.isWorkoutBiometrics = void 0;
|
|
19
19
|
const typeUtils_1 = require("./typeUtils");
|
|
20
20
|
__exportStar(require("./schemas"), exports);
|
|
21
21
|
__exportStar(require("./constants"), exports);
|
|
22
22
|
__exportStar(require("./utils"), exports);
|
|
23
23
|
__exportStar(require("./units"), exports);
|
|
24
|
+
__exportStar(require("./workout"), exports);
|
|
24
25
|
__exportStar(require("./filterExercises"), exports);
|
|
25
26
|
__exportStar(require("./setIndicatorUtils"), exports);
|
|
26
27
|
__exportStar(require("./workoutVolume"), exports);
|
|
@@ -31,7 +32,6 @@ __exportStar(require("./cue"), exports);
|
|
|
31
32
|
__exportStar(require("./muscleHeatmaps"), exports);
|
|
32
33
|
__exportStar(require("./muscleSplits"), exports);
|
|
33
34
|
__exportStar(require("./notifications"), exports);
|
|
34
|
-
__exportStar(require("./normalizedWorkoutUtils"), exports);
|
|
35
35
|
__exportStar(require("./routineUtils"), exports);
|
|
36
36
|
__exportStar(require("./typeUtils"), exports);
|
|
37
37
|
__exportStar(require("./async"), exports);
|
|
@@ -296,10 +296,6 @@ exports.isRPE = isRPE;
|
|
|
296
296
|
const _setTypes = ['warmup', 'normal', 'failure', 'dropset'];
|
|
297
297
|
const isSetType = (x) => (0, typeUtils_1.isInArray)(x, _setTypes);
|
|
298
298
|
exports.isSetType = isSetType;
|
|
299
|
-
const isPublicWorkout = (x) => {
|
|
300
|
-
return x.type === 'public';
|
|
301
|
-
};
|
|
302
|
-
exports.isPublicWorkout = isPublicWorkout;
|
|
303
299
|
const isHeartRateSamples = (x) => {
|
|
304
300
|
if (!x || !Array.isArray(x))
|
|
305
301
|
return false;
|
|
@@ -324,7 +320,6 @@ const isWorkoutBiometrics = (x) => {
|
|
|
324
320
|
return caloriesAreValid && heartSamplesAreValid;
|
|
325
321
|
};
|
|
326
322
|
exports.isWorkoutBiometrics = isWorkoutBiometrics;
|
|
327
|
-
/** @deprecated Use TrainerWorkoutTemplate instead */
|
|
328
323
|
const isHevyTrainerRoutine = (routine) => routine.hevy_trainer_program_id !== null;
|
|
329
324
|
exports.isHevyTrainerRoutine = isHevyTrainerRoutine;
|
|
330
325
|
exports.measurementsList = [
|
package/built/routineUtils.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BaseRoutine, HevyTrainerRoutine, RoutineUpdate } from '.';
|
|
2
|
-
import { NormalizedWorkout } from './normalizedWorkoutUtils';
|
|
1
|
+
import { BaseRoutine, HevyTrainerRoutine, NormalizedWorkout, RoutineUpdate } from '.';
|
|
3
2
|
export declare const majorRoutineUpdate: (routine: BaseRoutine, workout: NormalizedWorkout) => RoutineUpdate;
|
|
4
3
|
export declare const minorRoutineUpdate: (routine: BaseRoutine, workout: NormalizedWorkout) => RoutineUpdate;
|
|
5
4
|
/**
|