hevy-shared 1.0.771 → 1.0.773
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/index.d.ts +1 -0
- package/built/utils.d.ts +9 -0
- package/built/utils.js +17 -1
- package/package.json +1 -1
package/built/index.d.ts
CHANGED
|
@@ -1224,6 +1224,7 @@ export interface PostHevyTrainerProgramRequestBody {
|
|
|
1224
1224
|
weekly_frequency: WeeklyTrainingFrequency;
|
|
1225
1225
|
focus_muscle?: SimplifiedMuscleGroup;
|
|
1226
1226
|
routines: RoutineUpdate[];
|
|
1227
|
+
next_workout_index?: number;
|
|
1227
1228
|
};
|
|
1228
1229
|
}
|
|
1229
1230
|
export declare const measurementsList: readonly ["weight_kg", "fat_percent", "neck_cm", "shoulder_cm", "chest_cm", "left_bicep_cm", "right_bicep_cm", "left_forearm_cm", "right_forearm_cm", "abdomen", "waist", "hips", "left_thigh", "right_thigh", "left_calf", "right_calf"];
|
package/built/utils.d.ts
CHANGED
|
@@ -175,6 +175,15 @@ export interface TotalSetCountWorkout {
|
|
|
175
175
|
*/
|
|
176
176
|
export declare const userExerciseSetWeight: (set: UserExerciseSet, exerciseStore: BaseExerciseTemplate[], hundredPercentBodyweightExercise: boolean) => number;
|
|
177
177
|
export declare const workoutSetCount: (w: TotalSetCountWorkout) => number;
|
|
178
|
+
interface GetEstimatedExercisesDuration {
|
|
179
|
+
exercises: {
|
|
180
|
+
rest_seconds: number | null;
|
|
181
|
+
sets: {
|
|
182
|
+
duration_seconds?: number | null;
|
|
183
|
+
}[];
|
|
184
|
+
}[];
|
|
185
|
+
}
|
|
186
|
+
export declare const getEstimatedExercisesDurationSeconds: ({ exercises, }: GetEstimatedExercisesDuration) => number;
|
|
178
187
|
export declare const oneRepMaxPercentageMap: {
|
|
179
188
|
[s: number]: number;
|
|
180
189
|
};
|
package/built/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getYoutubeVideoId = exports.validateYoutubeUrl = exports.splitAtUsernamesAndLinks = exports.isVersionAGreaterOrEqualToVersionB = exports.generateUserGroupValue = exports.generateUserGroup = exports.isBaseExerciseTemplate = exports.getStrengthLevelFromPercentile = exports.numberToLocaleString = exports.numberWithCommas = exports.setVolume = exports.oneRepMax = exports.oneRepMaxPercentageMap = exports.workoutSetCount = exports.userExerciseSetWeight = exports.workoutDistanceMeters = exports.workoutReps = exports.workoutDurationSeconds = exports.removeAccents = exports.getClosestDataPointAroundTargetDate = exports.getClosestDataPointBeforeTargetDate = exports.findMapped = exports.stringToNumber = exports.forceStringToNumber = exports.formatDurationInput = exports.isValidFormattedTime = exports.isWholeNumber = exports.isNumber = exports.isValidUuid = exports.isValidPhoneNumber = exports.isValidWebUrl = exports.URL_REGEX = exports.isValidEmail = exports.secondsToWordFormatMinutes = exports.secondsToWordFormat = exports.secondsToClockFormat = exports.secondsToClockParts = exports.isValidUsername = exports.roundToWholeNumber = exports.roundToOneDecimal = exports.roundToTwoDecimal = exports.divide = exports.clampNumber = exports.num = void 0;
|
|
3
|
+
exports.getYoutubeVideoId = exports.validateYoutubeUrl = exports.splitAtUsernamesAndLinks = exports.isVersionAGreaterOrEqualToVersionB = exports.generateUserGroupValue = exports.generateUserGroup = exports.isBaseExerciseTemplate = exports.getStrengthLevelFromPercentile = exports.numberToLocaleString = exports.numberWithCommas = exports.setVolume = exports.oneRepMax = exports.oneRepMaxPercentageMap = exports.getEstimatedExercisesDurationSeconds = exports.workoutSetCount = exports.userExerciseSetWeight = exports.workoutDistanceMeters = exports.workoutReps = exports.workoutDurationSeconds = exports.removeAccents = exports.getClosestDataPointAroundTargetDate = exports.getClosestDataPointBeforeTargetDate = exports.findMapped = exports.stringToNumber = exports.forceStringToNumber = exports.formatDurationInput = exports.isValidFormattedTime = exports.isWholeNumber = exports.isNumber = exports.isValidUuid = exports.isValidPhoneNumber = exports.isValidWebUrl = exports.URL_REGEX = exports.isValidEmail = exports.secondsToWordFormatMinutes = exports.secondsToWordFormat = exports.secondsToClockFormat = exports.secondsToClockParts = exports.isValidUsername = exports.roundToWholeNumber = exports.roundToOneDecimal = exports.roundToTwoDecimal = exports.divide = exports.clampNumber = exports.num = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Doesn't matter what you throw in the function it'll
|
|
6
6
|
* always return a number. Non number values will return
|
|
@@ -444,6 +444,22 @@ const workoutSetCount = (w) => {
|
|
|
444
444
|
}, 0);
|
|
445
445
|
};
|
|
446
446
|
exports.workoutSetCount = workoutSetCount;
|
|
447
|
+
const ESTIMATED_SET_DURATION = 45;
|
|
448
|
+
const ESTIMATED_REST_TIMER_DURATION = 90;
|
|
449
|
+
const getEstimatedExercisesDurationSeconds = ({ exercises, }) => {
|
|
450
|
+
const totalSeconds = exercises.reduce((exercisesTotal, exercise) => {
|
|
451
|
+
var _a;
|
|
452
|
+
const restPerSet = (_a = exercise.rest_seconds) !== null && _a !== void 0 ? _a : ESTIMATED_REST_TIMER_DURATION;
|
|
453
|
+
const exerciseTotal = exercise.sets.reduce((setTotal, set) => {
|
|
454
|
+
var _a;
|
|
455
|
+
const duration = (_a = set.duration_seconds) !== null && _a !== void 0 ? _a : ESTIMATED_SET_DURATION;
|
|
456
|
+
return setTotal + duration + restPerSet;
|
|
457
|
+
}, 0);
|
|
458
|
+
return exercisesTotal + exerciseTotal;
|
|
459
|
+
}, 0);
|
|
460
|
+
return totalSeconds;
|
|
461
|
+
};
|
|
462
|
+
exports.getEstimatedExercisesDurationSeconds = getEstimatedExercisesDurationSeconds;
|
|
447
463
|
exports.oneRepMaxPercentageMap = {
|
|
448
464
|
1: 1.0,
|
|
449
465
|
2: 0.97,
|