hevy-shared 1.0.734 → 1.0.735

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.
@@ -6,7 +6,7 @@ export declare const hevyTrainerExerciseCategories: readonly ["compound", "isola
6
6
  export declare const routineNames: readonly ["full_body_1", "full_body_2_a", "full_body_2_b", "full_body_3_a", "full_body_3_b", "full_body_3_c", "upper_1_a", "lower_1_a", "upper_1_b", "lower_1_b", "push_1", "pull_1", "legs_1", "upper_2", "lower_2", "push_2_a", "pull_2_a", "legs_2_a", "push_2_b", "pull_2_b", "legs_2_b"];
7
7
  export type exerciseId = string;
8
8
  export interface ExerciseSelectionCriteria {
9
- exerciseCategory: HevyTrainerExerciseCategory;
9
+ exerciseCategory: HevyTrainerExerciseCategory | 'all';
10
10
  equipments: HevyTrainerProgramEquipment[];
11
11
  routineBarbellExerciseCount: number;
12
12
  level: TrainingLevel;
@@ -164,7 +164,8 @@ const getMuscleGroup = ({ muscleGroupPrescription, programFocusMuscleExerciseCou
164
164
  */
165
165
  const isExerciseMatch = (exercise, criteria) => {
166
166
  var _a, _b, _c, _d;
167
- const categoryMatch = exercise.category === criteria.exerciseCategory ||
167
+ const categoryMatch = criteria.exerciseCategory === 'all' ||
168
+ exercise.category === criteria.exerciseCategory ||
168
169
  (exercise.category === 'assistance-compound' &&
169
170
  criteria.exerciseCategory === 'compound');
170
171
  const levelMatch = (_b = (_a = exercise.level) === null || _a === void 0 ? void 0 : _a.includes(criteria.level)) !== null && _b !== void 0 ? _b : false;
@@ -235,15 +236,15 @@ const pickExerciseForPrescription = (params) => {
235
236
  if (exercise)
236
237
  return exercise;
237
238
  // Pass 5: Find exercise regardless of exercise category (isolation or compound)
238
- exercise = findMatchingExercise(exercises, Object.assign(Object.assign({}, criteria), { exerciseCategory: criteria.exerciseCategory === 'isolation' ? 'compound' : 'isolation' }), routineContext);
239
+ exercise = findMatchingExercise(exercises, Object.assign(Object.assign({}, criteria), { exerciseCategory: 'all' }), routineContext);
239
240
  if (exercise)
240
241
  return exercise;
241
242
  // Pass 6: Find exercises where the prescription muscle group
242
- // is in the exercise's other muscles
243
- const otherMuscles = Object.values(sortedExercises)
243
+ // is in the exercise's other muscles, also ignores exercise category
244
+ const secondaryMuscleExercises = Object.values(sortedExercises)
244
245
  .flat()
245
246
  .filter((e) => e.other_muscles.includes(criteria.muscleGroup));
246
- exercise = findMatchingExercise(otherMuscles, criteria, routineContext);
247
+ exercise = findMatchingExercise(secondaryMuscleExercises, Object.assign(Object.assign({}, criteria), { exerciseCategory: 'all' }), routineContext);
247
248
  return exercise;
248
249
  };
249
250
  exports.pickExerciseForPrescription = pickExerciseForPrescription;
package/built/index.d.ts CHANGED
@@ -266,7 +266,6 @@ export interface BackofficeExistingUserResponse {
266
266
  public_api_key: string | null;
267
267
  limited_discovery: boolean;
268
268
  coach_trial_expire_date?: string;
269
- is_hevy_trainer_beta_enabled: boolean;
270
269
  }
271
270
  export interface BackofficeDeletedUserResponse {
272
271
  state: 'deleted-account';
@@ -307,7 +306,6 @@ export interface BackofficeAccountUpdate {
307
306
  limited_discovery?: boolean;
308
307
  delete_profile_pic?: boolean;
309
308
  delete_link?: boolean;
310
- is_hevy_trainer_beta_enabled?: boolean;
311
309
  }
312
310
  export interface BackofficeSuggestedUsersResponse {
313
311
  users: SuggestedUser[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hevy-shared",
3
- "version": "1.0.734",
3
+ "version": "1.0.735",
4
4
  "description": "",
5
5
  "main": "built/index.js",
6
6
  "types": "built/index.d.ts",