@dgpholdings/greatoak-shared 1.1.38 → 1.1.40
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.
|
@@ -38,7 +38,7 @@ export type TExercise = {
|
|
|
38
38
|
primaryMuscles: TBodyPartKeys;
|
|
39
39
|
secondaryMuscles: TBodyPartKeys;
|
|
40
40
|
trainingTypes: TTrainingType[];
|
|
41
|
-
|
|
41
|
+
avgSingleRepDurationInSecs?: number;
|
|
42
42
|
difficultyLevel: number;
|
|
43
43
|
hypertrophyLevel: number;
|
|
44
44
|
strengthGainLevel: number;
|
|
@@ -63,6 +63,12 @@ export type TExercise = {
|
|
|
63
63
|
mediumDuration: number;
|
|
64
64
|
longDuration: number;
|
|
65
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
"5.0": 4.3, // 5 km/h walking = 4.3 MET
|
|
68
|
+
"8.0": 8.3, // 8 km/h jogging = 8.3 MET
|
|
69
|
+
"12.0": 11.0, // 12 km/h running = 11.0 MET
|
|
70
|
+
"16.0": 15.0 // 16 km/h fast running = 15.0 MET
|
|
71
|
+
*/
|
|
66
72
|
paceFactors?: {
|
|
67
73
|
[key: string]: number;
|
|
68
74
|
};
|
|
@@ -31,6 +31,8 @@ type TParams = {
|
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
33
|
* Enhanced training stress score computation using metabolic data
|
|
34
|
+
* This is for scoring a SINGLE record of an exercise. Ref: TRecord, TRefinedRecord.
|
|
35
|
+
* To calculate complete scoring/summary of workout use: calculateWorkoutSummary(...) function
|
|
34
36
|
*/
|
|
35
37
|
export declare const computeScoreFromRecord: ({ avgRestDurationSecs, record, exercise, userProfile, isTimeIntervalModeEnabled, }: TParams) => TScoreBreakdown;
|
|
36
38
|
export {};
|
|
@@ -154,8 +154,8 @@ const getExerciseDurationMinutes = (record, exercise) => {
|
|
|
154
154
|
switch (record.type) {
|
|
155
155
|
case "weight-reps":
|
|
156
156
|
case "reps-only": {
|
|
157
|
-
if (exercise.
|
|
158
|
-
durationSecs = exercise.
|
|
157
|
+
if (exercise.avgSingleRepDurationInSecs) {
|
|
158
|
+
durationSecs = record.reps * exercise.avgSingleRepDurationInSecs;
|
|
159
159
|
}
|
|
160
160
|
else {
|
|
161
161
|
// Estimate based on reps and exercise complexity
|
|
@@ -204,6 +204,8 @@ const calculateCalorieBurn = (record, exercise, metValue, durationMinutes, userP
|
|
|
204
204
|
};
|
|
205
205
|
/**
|
|
206
206
|
* Enhanced training stress score computation using metabolic data
|
|
207
|
+
* This is for scoring a SINGLE record of an exercise. Ref: TRecord, TRefinedRecord.
|
|
208
|
+
* To calculate complete scoring/summary of workout use: calculateWorkoutSummary(...) function
|
|
207
209
|
*/
|
|
208
210
|
const computeScoreFromRecord = ({ avgRestDurationSecs, record, exercise, userProfile, isTimeIntervalModeEnabled = false, }) => {
|
|
209
211
|
var _a, _b;
|
|
@@ -340,7 +342,7 @@ const computeScoreFromRecord = ({ avgRestDurationSecs, record, exercise, userPro
|
|
|
340
342
|
actualDuration = (0, time_util_1.mmssToSecs)((_b = record.durationSecs) !== null && _b !== void 0 ? _b : "00:00");
|
|
341
343
|
}
|
|
342
344
|
if (actualDuration > 0) {
|
|
343
|
-
const expectedDuration = exercise.
|
|
345
|
+
const expectedDuration = exercise.avgSingleRepDurationInSecs || record.workDurationSecs;
|
|
344
346
|
const durationDiff = Math.abs(actualDuration - expectedDuration);
|
|
345
347
|
const tolerance = expectedDuration * 0.25; // 25% tolerance
|
|
346
348
|
if (durationDiff > tolerance) {
|