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.
@@ -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, HevyTrainerLibraryExercise[]>;
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';
@@ -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 = sortedExercises[criteria.muscleGroup];
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;
@@ -32,7 +32,6 @@ class RoutineBuilder {
32
32
  notes: null,
33
33
  coach_force_rpe_enabled: false,
34
34
  hevy_trainer_program_id: null,
35
- created_at: '',
36
35
  });
37
36
  this._exercises = [];
38
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hevy-shared",
3
- "version": "1.0.796",
3
+ "version": "1.0.797",
4
4
  "description": "",
5
5
  "main": "built/index.js",
6
6
  "types": "built/index.d.ts",