hevy-shared 1.0.916 → 1.0.918
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 +3 -3
- package/built/hevyTrainer.js +7 -7
- package/built/index.d.ts +1 -1
- package/built/index.js +1 -1
- package/package.json +1 -1
package/built/hevyTrainer.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare const routineNames: readonly ["full_body_1", "full_body_2_a", "fu
|
|
|
20
20
|
export type exerciseId = string;
|
|
21
21
|
export interface ExerciseSelectionCriteria {
|
|
22
22
|
exerciseCategory: HevyTrainerExerciseCategory | 'all';
|
|
23
|
-
|
|
23
|
+
equipments: GranularEquipment[];
|
|
24
24
|
routineBarbellExerciseCount: number;
|
|
25
25
|
level: TrainingLevel;
|
|
26
26
|
goal: TrainingGoal;
|
|
@@ -42,7 +42,7 @@ export interface ProgramGenerationParams<T extends HevyTrainerLibraryExercise> {
|
|
|
42
42
|
selectedDays: WeeklyTrainingFrequency;
|
|
43
43
|
selectedGoal: TrainingGoal;
|
|
44
44
|
selectedLevel: TrainingLevel;
|
|
45
|
-
|
|
45
|
+
selectedEquipments: GranularEquipment[];
|
|
46
46
|
selectedWorkoutDurationMinutes?: WorkoutDurationMinutes;
|
|
47
47
|
exerciseStore: T[];
|
|
48
48
|
focusMuscle?: SimplifiedMuscleGroup;
|
|
@@ -175,7 +175,7 @@ export interface ExercisePrescriptionError {
|
|
|
175
175
|
context: {
|
|
176
176
|
goal: TrainingGoal;
|
|
177
177
|
level: TrainingLevel;
|
|
178
|
-
|
|
178
|
+
equipments: GranularEquipment[];
|
|
179
179
|
focusMuscle?: SimplifiedMuscleGroup;
|
|
180
180
|
};
|
|
181
181
|
}
|
package/built/hevyTrainer.js
CHANGED
|
@@ -73,7 +73,7 @@ exports.granularEquipmentDefaults = {
|
|
|
73
73
|
'suspension_band',
|
|
74
74
|
'battle_rope',
|
|
75
75
|
'rings',
|
|
76
|
-
'
|
|
76
|
+
'jump_rope',
|
|
77
77
|
],
|
|
78
78
|
};
|
|
79
79
|
const trainerEquipmentToGranularEquipmentsMap = {
|
|
@@ -377,8 +377,8 @@ const isExerciseMatch = (exercise, criteria) => {
|
|
|
377
377
|
criteria.exerciseCategory === 'compound');
|
|
378
378
|
const levelMatch = (_b = (_a = exercise.level) === null || _a === void 0 ? void 0 : _a.includes(criteria.level)) !== null && _b !== void 0 ? _b : false;
|
|
379
379
|
const goalMatch = (_d = (_c = exercise.goal) === null || _c === void 0 ? void 0 : _c.includes(criteria.goal)) !== null && _d !== void 0 ? _d : false;
|
|
380
|
-
const equipmentMatch = (0, exports.isEquipmentCompatible)(exercise, criteria.
|
|
381
|
-
const barbellLimitOk = !isBarbellLimitExceeded(exercise, criteria.routineBarbellExerciseCount, criteria.
|
|
380
|
+
const equipmentMatch = (0, exports.isEquipmentCompatible)(exercise, criteria.equipments);
|
|
381
|
+
const barbellLimitOk = !isBarbellLimitExceeded(exercise, criteria.routineBarbellExerciseCount, criteria.equipments);
|
|
382
382
|
return (categoryMatch && levelMatch && goalMatch && equipmentMatch && barbellLimitOk);
|
|
383
383
|
};
|
|
384
384
|
/**
|
|
@@ -388,7 +388,7 @@ const isAlternativeIsolationExerciseMatch = (exercise, criteria) => {
|
|
|
388
388
|
var _a, _b;
|
|
389
389
|
const isIsolationCategory = criteria.exerciseCategory === 'isolation';
|
|
390
390
|
const isAlternativeExercise = isolationExerciseAlternatives[criteria.muscleGroup].includes(exercise.id);
|
|
391
|
-
const equipmentMatch = (0, exports.isEquipmentCompatible)(exercise, criteria.
|
|
391
|
+
const equipmentMatch = (0, exports.isEquipmentCompatible)(exercise, criteria.equipments);
|
|
392
392
|
const levelMatch = (_b = (_a = exercise.level) === null || _a === void 0 ? void 0 : _a.includes(criteria.level)) !== null && _b !== void 0 ? _b : false;
|
|
393
393
|
return (isIsolationCategory && isAlternativeExercise && equipmentMatch && levelMatch);
|
|
394
394
|
};
|
|
@@ -462,7 +462,7 @@ exports.pickExerciseForPrescription = pickExerciseForPrescription;
|
|
|
462
462
|
*/
|
|
463
463
|
const generateProgram = (params) => {
|
|
464
464
|
var _a;
|
|
465
|
-
const { trainerAlgorithmSettings, selectedDays, selectedGoal, selectedLevel,
|
|
465
|
+
const { trainerAlgorithmSettings, selectedDays, selectedGoal, selectedLevel, selectedEquipments, selectedWorkoutDurationMinutes, exerciseStore, focusMuscle, excludedExerciseIds, } = params;
|
|
466
466
|
const routines = exports.programSplits[selectedDays];
|
|
467
467
|
const program = {
|
|
468
468
|
name: selectedDays,
|
|
@@ -501,7 +501,7 @@ const generateProgram = (params) => {
|
|
|
501
501
|
sortedExercises,
|
|
502
502
|
criteria: {
|
|
503
503
|
exerciseCategory: exercisePrescription.category,
|
|
504
|
-
|
|
504
|
+
equipments: selectedEquipments,
|
|
505
505
|
muscleGroup,
|
|
506
506
|
routineBarbellExerciseCount,
|
|
507
507
|
level: selectedLevel,
|
|
@@ -542,7 +542,7 @@ const generateProgram = (params) => {
|
|
|
542
542
|
context: {
|
|
543
543
|
goal: selectedGoal,
|
|
544
544
|
level: selectedLevel,
|
|
545
|
-
|
|
545
|
+
equipments: selectedEquipments,
|
|
546
546
|
focusMuscle,
|
|
547
547
|
},
|
|
548
548
|
});
|
package/built/index.d.ts
CHANGED
|
@@ -647,7 +647,7 @@ export type TrainingLevel = Lookup<typeof trainingLevels>;
|
|
|
647
647
|
export type ExerciseCategory = Lookup<typeof exerciseCategories>;
|
|
648
648
|
export type HevyTrainerProgramEquipment = Extract<Equipment, 'barbell' | 'dumbbell' | 'machine'>;
|
|
649
649
|
export declare const hevyTrainerProgramEquipments: readonly ["barbell", "dumbbell", "machine"];
|
|
650
|
-
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", "
|
|
650
|
+
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"];
|
|
651
651
|
export type GranularEquipment = Lookup<typeof granularEquipments>;
|
|
652
652
|
export declare const isGranularEquipment: (x: string) => x is GranularEquipment;
|
|
653
653
|
export declare const weeklyTrainingFrequencies: readonly [1, 2, 3, 4, 5, 6];
|
package/built/index.js
CHANGED
|
@@ -264,7 +264,7 @@ exports.granularEquipments = [
|
|
|
264
264
|
'resistance_band',
|
|
265
265
|
'battle_rope',
|
|
266
266
|
'rings',
|
|
267
|
-
'
|
|
267
|
+
'jump_rope',
|
|
268
268
|
];
|
|
269
269
|
const isGranularEquipment = (x) => (0, typeUtils_1.isInArray)(x, exports.granularEquipments);
|
|
270
270
|
exports.isGranularEquipment = isGranularEquipment;
|