hevy-shared 1.0.796 → 1.0.797
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 +4 -5
- package/built/hevyTrainer.js +4 -2
- package/built/index.d.ts +0 -1
- package/built/tests/testUtils.js +0 -1
- package/package.json +1 -1
package/built/hevyTrainer.d.ts
CHANGED
|
@@ -21,8 +21,9 @@ export interface ExerciseSelectionContext {
|
|
|
21
21
|
routineUsedExerciseIds?: Set<string>;
|
|
22
22
|
excludedExerciseIds?: Set<string>;
|
|
23
23
|
}
|
|
24
|
-
export interface ExerciseSelectionParams {
|
|
25
|
-
sortedExercises: Record<MuscleGroup,
|
|
24
|
+
export interface ExerciseSelectionParams<T extends HevyTrainerLibraryExercise> {
|
|
25
|
+
sortedExercises: Record<MuscleGroup, T[]>;
|
|
26
|
+
handPickedExercises?: T[];
|
|
26
27
|
criteria: ExerciseSelectionCriteria;
|
|
27
28
|
context: ExerciseSelectionContext;
|
|
28
29
|
}
|
|
@@ -137,9 +138,7 @@ export declare const getPrioritySortedExercises: <T extends HevyTrainerLibraryEx
|
|
|
137
138
|
/**
|
|
138
139
|
* Selects the best exercise for a given prescription using a multi-pass strategy
|
|
139
140
|
*/
|
|
140
|
-
export declare const pickExerciseForPrescription: <T extends HevyTrainerLibraryExercise>(params: ExerciseSelectionParams
|
|
141
|
-
sortedExercises: Record<MuscleGroup, T[]>;
|
|
142
|
-
}) => T | undefined;
|
|
141
|
+
export declare const pickExerciseForPrescription: <T extends HevyTrainerLibraryExercise>(params: ExerciseSelectionParams<T>) => T | undefined;
|
|
143
142
|
export type HevyTrainerLibraryExercise = Pick<LibraryExercise, 'id' | 'title' | 'priority' | 'muscle_group' | 'other_muscles' | 'exercise_type' | 'equipment_category' | 'category' | 'level' | 'goal'>;
|
|
144
143
|
export interface ExercisePrescriptionError {
|
|
145
144
|
type: 'exercise_not_found';
|
package/built/hevyTrainer.js
CHANGED
|
@@ -219,8 +219,10 @@ const findAlternativeIsolationExercise = (exercises, criteria, context) => {
|
|
|
219
219
|
* Selects the best exercise for a given prescription using a multi-pass strategy
|
|
220
220
|
*/
|
|
221
221
|
const pickExerciseForPrescription = (params) => {
|
|
222
|
-
const { sortedExercises, criteria, context } = params;
|
|
223
|
-
const exercises =
|
|
222
|
+
const { sortedExercises, handPickedExercises, criteria, context } = params;
|
|
223
|
+
const exercises = handPickedExercises
|
|
224
|
+
? [...handPickedExercises, ...sortedExercises[criteria.muscleGroup]]
|
|
225
|
+
: sortedExercises[criteria.muscleGroup];
|
|
224
226
|
// Pass 1: Find exact match not used in program
|
|
225
227
|
const programContext = {
|
|
226
228
|
programUsedExerciseIds: context.programUsedExerciseIds,
|
package/built/index.d.ts
CHANGED
|
@@ -1027,7 +1027,6 @@ export interface BaseRoutine {
|
|
|
1027
1027
|
notes: string | null;
|
|
1028
1028
|
coach_force_rpe_enabled: boolean;
|
|
1029
1029
|
hevy_trainer_program_id: string | null;
|
|
1030
|
-
created_at: string;
|
|
1031
1030
|
}
|
|
1032
1031
|
export interface Routine extends BaseRoutine {
|
|
1033
1032
|
username: string;
|
package/built/tests/testUtils.js
CHANGED