hevy-shared 1.0.769 → 1.0.771
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 -0
- package/built/hevyTrainer.js +12 -2
- package/package.json +1 -1
package/built/hevyTrainer.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export type HevyTrainerExerciseCategory = typeof hevyTrainerExerciseCategories[n
|
|
|
3
3
|
export type HevyTrainerRoutineName = typeof routineNames[number];
|
|
4
4
|
export type HevyTrainerProgramEquipment = Extract<Equipment, 'barbell' | 'dumbbell' | 'machine'>;
|
|
5
5
|
export declare const hevyTrainerExerciseCategories: readonly ["compound", "isolation"];
|
|
6
|
+
export type WorkoutDurationMinutes = typeof workoutDurationOptions[number];
|
|
7
|
+
export declare const workoutDurationOptions: readonly [40, 60, 80];
|
|
6
8
|
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
9
|
export type exerciseId = string;
|
|
8
10
|
export interface ExerciseSelectionCriteria {
|
|
@@ -29,6 +31,7 @@ export interface ProgramGenerationParams<T extends HevyTrainerLibraryExercise> {
|
|
|
29
31
|
selectedGoal: TrainingGoal;
|
|
30
32
|
selectedLevel: TrainingLevel;
|
|
31
33
|
selectedEquipments: HevyTrainerProgramEquipment[];
|
|
34
|
+
selectedWorkoutDurationMinutes?: WorkoutDurationMinutes;
|
|
32
35
|
exerciseStore: T[];
|
|
33
36
|
focusMuscle?: SimplifiedMuscleGroup;
|
|
34
37
|
excludedExerciseIds?: Set<string>;
|
|
@@ -68,6 +71,7 @@ export interface ExercisePrescription {
|
|
|
68
71
|
muscle_group: MuscleGroup | 'focus_muscle';
|
|
69
72
|
category: HevyTrainerExerciseCategory;
|
|
70
73
|
warmup_set_count?: number;
|
|
74
|
+
min_workout_duration_limit?: WorkoutDurationMinutes;
|
|
71
75
|
}
|
|
72
76
|
export interface WorkoutTemplate {
|
|
73
77
|
exercises: ExercisePrescription[];
|
package/built/hevyTrainer.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateProgram = exports.pickExerciseForPrescription = exports.getPrioritySortedExercises = exports.getTrainerRestTimerSeconds = exports.getTrainerRepRange = exports.getTrainerSetCount = exports.programSplits = exports.frequencyMap = exports.routineNames = exports.hevyTrainerExerciseCategories = void 0;
|
|
3
|
+
exports.generateProgram = exports.pickExerciseForPrescription = exports.getPrioritySortedExercises = exports.getTrainerRestTimerSeconds = exports.getTrainerRepRange = exports.getTrainerSetCount = exports.programSplits = exports.frequencyMap = exports.routineNames = exports.workoutDurationOptions = exports.hevyTrainerExerciseCategories = void 0;
|
|
4
4
|
const _1 = require(".");
|
|
5
5
|
const MAX_BARBELL_EXERCISES_PER_ROUTINE = 2;
|
|
6
6
|
exports.hevyTrainerExerciseCategories = ['compound', 'isolation'];
|
|
7
|
+
exports.workoutDurationOptions = [40, 60, 80];
|
|
7
8
|
exports.routineNames = [
|
|
8
9
|
// Full body 1x
|
|
9
10
|
'full_body_1',
|
|
@@ -253,7 +254,7 @@ exports.pickExerciseForPrescription = pickExerciseForPrescription;
|
|
|
253
254
|
*/
|
|
254
255
|
const generateProgram = (params) => {
|
|
255
256
|
var _a;
|
|
256
|
-
const { trainerAlgorithmSettings, selectedDays, selectedGoal, selectedLevel, selectedEquipments, exerciseStore, focusMuscle, excludedExerciseIds, } = params;
|
|
257
|
+
const { trainerAlgorithmSettings, selectedDays, selectedGoal, selectedLevel, selectedEquipments, selectedWorkoutDurationMinutes, exerciseStore, focusMuscle, excludedExerciseIds, } = params;
|
|
257
258
|
const routines = exports.programSplits[selectedDays];
|
|
258
259
|
const program = {
|
|
259
260
|
name: selectedDays,
|
|
@@ -278,6 +279,15 @@ const generateProgram = (params) => {
|
|
|
278
279
|
if (!muscleGroup) {
|
|
279
280
|
continue;
|
|
280
281
|
}
|
|
282
|
+
// If the exercise does not meet the min workout duration limit, skip the exercise
|
|
283
|
+
const execiseDoesNotMeetMinWorkoutDurationLimit = selectedWorkoutDurationMinutes &&
|
|
284
|
+
exercisePrescription.min_workout_duration_limit
|
|
285
|
+
? exercisePrescription.min_workout_duration_limit >
|
|
286
|
+
selectedWorkoutDurationMinutes
|
|
287
|
+
: false;
|
|
288
|
+
if (execiseDoesNotMeetMinWorkoutDurationLimit) {
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
281
291
|
const exercise = (0, exports.pickExerciseForPrescription)({
|
|
282
292
|
sortedExercises,
|
|
283
293
|
criteria: {
|