hevy-shared 1.0.733 → 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
@@ -1749,15 +1749,21 @@ export interface UserPushNotificationSettingsUpdate {
1749
1749
  likes?: boolean;
1750
1750
  monthly_report?: boolean;
1751
1751
  }
1752
- export interface AvailableEquipment {
1753
- platesKg: number[];
1754
- platesLbs: number[];
1755
- barsKg: number[];
1756
- barsLbs: number[];
1757
- dumbbellsKg: number[];
1758
- dumbbellsLbs: number[];
1752
+ export interface ProgressiveOverloadSettings {
1753
+ plate: {
1754
+ kg: number;
1755
+ lbs: number;
1756
+ };
1757
+ dumbbell: {
1758
+ kg: number;
1759
+ lbs: number;
1760
+ };
1761
+ machine: {
1762
+ kg: number;
1763
+ lbs: number;
1764
+ };
1759
1765
  }
1760
1766
  export interface HevyTrainerUserPreferences {
1767
+ progressiveOverloadSettings: ProgressiveOverloadSettings;
1761
1768
  excludedExercisesIds: string[];
1762
- availableEquipment: AvailableEquipment;
1763
1769
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hevy-shared",
3
- "version": "1.0.733",
3
+ "version": "1.0.735",
4
4
  "description": "",
5
5
  "main": "built/index.js",
6
6
  "types": "built/index.d.ts",