hevy-shared 1.0.979 → 1.0.980

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.
@@ -565,7 +565,7 @@ const appendCardioExerciseSelectionTrace = (traces, params) => {
565
565
  };
566
566
  /** Inserts optional cardio before or after template exercises for one routine. */
567
567
  const attachOptionalCardioToRoutine = ({ cardioPreference, cardioExercises, criteria, debugExerciseSelectionTrace, exerciseSelectionTraces, routine, templatePrescriptionCount, routineExercises, }) => {
568
- if (!cardioPreference)
568
+ if (cardioPreference === 'no-cardio')
569
569
  return;
570
570
  const cardioExercise = cardioExercises.find((ex) => {
571
571
  var _a, _b, _c;
package/built/index.d.ts CHANGED
@@ -650,7 +650,7 @@ export type TrainingGoal = Lookup<typeof trainingGoals>;
650
650
  export type TrainingLevel = Lookup<typeof trainingLevels>;
651
651
  export type ExerciseCategory = Lookup<typeof exerciseCategories>;
652
652
  export type RestTimerLength = typeof restTimerLengths[number];
653
- export type CardioPreference = undefined | 'beginning' | 'end';
653
+ export type CardioPreference = 'no-cardio' | 'beginning' | 'end';
654
654
  export type HevyTrainerProgramEquipment = Extract<Equipment, 'barbell' | 'dumbbell' | 'machine'>;
655
655
  export declare const hevyTrainerProgramEquipments: readonly ["barbell", "dumbbell", "machine"];
656
656
  export declare const granularEquipments: readonly ["barbell", "dumbbell", "kettlebell", "plate", "medicine_ball", "ez_bar", "landmine", "trap_bar", "pullup_bar", "dip_bar", "squat_rack", "flat_bench", "adjustable_bench", "dual_cable_machine", "single_cable_machine", "lat_pulldown_cable", "leg_press_machine", "smith_machine", "t_bar", "plate_machines", "stack_machines", "treadmill", "elliptical_trainer", "rowing_machine", "spinning", "stair_machine", "air_bike", "suspension_band", "resistance_band", "battle_rope", "rings", "jump_rope"];
@@ -608,7 +608,7 @@ describe('generateProgram', () => {
608
608
  workoutDurationMinutes: 60,
609
609
  restTimerLength: 'medium',
610
610
  exerciseStore: [chestExercise],
611
- cardioPreference: undefined,
611
+ cardioPreference: 'no-cardio',
612
612
  });
613
613
  expect(result.success).toBe(true);
614
614
  if (!result.success)
@@ -646,7 +646,7 @@ describe('generateProgram', () => {
646
646
  workoutDurationMinutes: 60,
647
647
  restTimerLength: 'medium',
648
648
  exerciseStore: [],
649
- cardioPreference: undefined,
649
+ cardioPreference: 'no-cardio',
650
650
  });
651
651
  expect(result.success).toBe(false);
652
652
  if (result.success)
@@ -688,7 +688,7 @@ describe('generateProgram', () => {
688
688
  workoutDurationMinutes,
689
689
  restTimerLength: 'medium',
690
690
  exerciseStore: [makeExercise({ id: 'bench' })],
691
- cardioPreference: undefined,
691
+ cardioPreference: 'no-cardio',
692
692
  });
693
693
  const routine = (result.success ? result.program : result.partialProgram)
694
694
  .routines[0];
@@ -757,7 +757,7 @@ describe('generateProgram', () => {
757
757
  makeExercise({ id: 'bench-2', priority: 2 }),
758
758
  makeExercise({ id: 'bench-3', priority: 1 }),
759
759
  ],
760
- cardioPreference: undefined,
760
+ cardioPreference: 'no-cardio',
761
761
  });
762
762
  expect(result.success).toBe(true);
763
763
  if (!result.success)
@@ -787,7 +787,7 @@ describe('generateProgram', () => {
787
787
  exerciseStore: [
788
788
  makeExercise({ id: 'biceps-curl', muscle_group: 'biceps' }),
789
789
  ],
790
- cardioPreference: undefined,
790
+ cardioPreference: 'no-cardio',
791
791
  });
792
792
  expect(result.success).toBe(true);
793
793
  if (!result.success)
@@ -814,7 +814,7 @@ describe('generateProgram', () => {
814
814
  restTimerLength: 'medium',
815
815
  exerciseStore: [bicepsCurl],
816
816
  focusMuscle: 'arms',
817
- cardioPreference: undefined,
817
+ cardioPreference: 'no-cardio',
818
818
  });
819
819
  expect(result.success).toBe(true);
820
820
  if (!result.success)
@@ -840,7 +840,7 @@ describe('generateProgram', () => {
840
840
  restTimerLength: 'medium',
841
841
  exerciseStore: [excluded, alt],
842
842
  excludedExerciseIds: new Set(['excluded']),
843
- cardioPreference: undefined,
843
+ cardioPreference: 'no-cardio',
844
844
  });
845
845
  expect(result.success).toBe(true);
846
846
  if (!result.success)
@@ -860,7 +860,7 @@ describe('generateProgram', () => {
860
860
  restTimerLength: 'medium',
861
861
  exerciseStore: [chest],
862
862
  debugExerciseSelectionTrace: true,
863
- cardioPreference: undefined,
863
+ cardioPreference: 'no-cardio',
864
864
  });
865
865
  expect(result.success).toBe(true);
866
866
  expect(result.exerciseSelectionTraces).toHaveLength(1);
@@ -894,7 +894,7 @@ describe('generateProgram', () => {
894
894
  makeExercise({ id: 'bench-2' }),
895
895
  ],
896
896
  debugExerciseSelectionTrace: true,
897
- cardioPreference: undefined,
897
+ cardioPreference: 'no-cardio',
898
898
  });
899
899
  expect(result.success).toBe(true);
900
900
  expect(result.exerciseSelectionTraces.map((t) => t.prescriptionIndex)).toEqual([0, 1]);
@@ -1128,7 +1128,7 @@ describe('generateProgram', () => {
1128
1128
  workoutDurationMinutes: 60,
1129
1129
  restTimerLength: 'medium',
1130
1130
  exerciseStore: exercises,
1131
- cardioPreference: undefined,
1131
+ cardioPreference: 'no-cardio',
1132
1132
  });
1133
1133
  expect(result.success).toBe(false);
1134
1134
  if (result.success)
@@ -1159,7 +1159,7 @@ describe('generateProgram', () => {
1159
1159
  workoutDurationMinutes: 60,
1160
1160
  restTimerLength: 'medium',
1161
1161
  exerciseStore: exercises,
1162
- cardioPreference: undefined,
1162
+ cardioPreference: 'no-cardio',
1163
1163
  });
1164
1164
  expect(result.success).toBe(true);
1165
1165
  if (!result.success)
@@ -1213,7 +1213,7 @@ describe('generateProgram', () => {
1213
1213
  exerciseStore: exercises,
1214
1214
  focusMuscle: 'arms',
1215
1215
  debugExerciseSelectionTrace: true,
1216
- cardioPreference: undefined,
1216
+ cardioPreference: 'no-cardio',
1217
1217
  });
1218
1218
  const traces = result.exerciseSelectionTraces;
1219
1219
  // Counter increments once per placed focus_muscle prescription, so the
@@ -1271,7 +1271,7 @@ describe('generateProgram', () => {
1271
1271
  exerciseStore: exercises,
1272
1272
  focusMuscle: 'legs',
1273
1273
  debugExerciseSelectionTrace: true,
1274
- cardioPreference: undefined,
1274
+ cardioPreference: 'no-cardio',
1275
1275
  });
1276
1276
  expect(result.success).toBe(true);
1277
1277
  if (!result.success)
@@ -1311,7 +1311,7 @@ describe('generateProgram', () => {
1311
1311
  exerciseStore: [candidateExercise],
1312
1312
  focusMuscle,
1313
1313
  debugExerciseSelectionTrace: true,
1314
- cardioPreference: undefined,
1314
+ cardioPreference: 'no-cardio',
1315
1315
  });
1316
1316
  // Find the routine we targeted (it may not be first in the split).
1317
1317
  const routine = (result.success ? result.program : result.partialProgram).routines.find((r) => r.name === routineName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hevy-shared",
3
- "version": "1.0.979",
3
+ "version": "1.0.980",
4
4
  "description": "",
5
5
  "main": "built/index.js",
6
6
  "types": "built/index.d.ts",