hevy-shared 1.0.728 → 1.0.730
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.js +9 -2
- package/built/notifications.d.ts +5 -5
- package/package.json +1 -1
package/built/hevyTrainer.js
CHANGED
|
@@ -76,7 +76,7 @@ const isEquipmentCompatible = (exercise, allowedEquipments) => {
|
|
|
76
76
|
allowedEquipments.includes('barbell')));
|
|
77
77
|
};
|
|
78
78
|
/**
|
|
79
|
-
* Checks if
|
|
79
|
+
* Checks if the routine barbell exercise limit is exceeded
|
|
80
80
|
*
|
|
81
81
|
* - We allow up to 2 barbell exercises per routine
|
|
82
82
|
* - Unless the user ONLY has barbell as an allowed equipment
|
|
@@ -235,8 +235,15 @@ const pickExerciseForPrescription = (params) => {
|
|
|
235
235
|
if (exercise)
|
|
236
236
|
return exercise;
|
|
237
237
|
// Pass 5: Find exercise regardless of exercise category (isolation or compound)
|
|
238
|
-
// So search for compound if the exercise category is isolation, and vice versa
|
|
239
238
|
exercise = findMatchingExercise(exercises, Object.assign(Object.assign({}, criteria), { exerciseCategory: criteria.exerciseCategory === 'isolation' ? 'compound' : 'isolation' }), routineContext);
|
|
239
|
+
if (exercise)
|
|
240
|
+
return exercise;
|
|
241
|
+
// Pass 6: Find exercises where the prescription muscle group
|
|
242
|
+
// is in the exercise's other muscles
|
|
243
|
+
const otherMuscles = Object.values(sortedExercises)
|
|
244
|
+
.flat()
|
|
245
|
+
.filter((e) => e.other_muscles.includes(criteria.muscleGroup));
|
|
246
|
+
exercise = findMatchingExercise(otherMuscles, criteria, routineContext);
|
|
240
247
|
return exercise;
|
|
241
248
|
};
|
|
242
249
|
exports.pickExerciseForPrescription = pickExerciseForPrescription;
|
package/built/notifications.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { ClientsCoachData, Program } from '.';
|
|
9
9
|
import { HevyChatUpdateMobilePushData } from './chat';
|
|
10
10
|
export type Notification = WorkoutCompleteNotification | WorkoutMentionNotification | WorkoutCommentNotification | WorkoutCommentMentionNotification | WorkoutCommentReplyNotification | WorkoutCommentDiscussionNotification | WorkoutLikeNotification | WorkoutCommentLikeNotification | FollowNotification | FollowRequestNotification | AcceptFollowRequestNotification | CoachClientInviteNotification | ContactOnHevyNotification;
|
|
11
|
-
export type NotificationType = 'workout-complete' | 'workout-mention' | 'workout-comment' | 'workout-comment-mention' | 'workout-comment-
|
|
11
|
+
export type NotificationType = 'workout-complete' | 'workout-mention' | 'workout-comment' | 'workout-comment-mention' | 'workout-comment-discussion' | 'workout-comment-reply' | 'workout-like' | 'workout-comment-like' | 'follow' | 'follow-request' | 'accept-follow-request' | 'coach-client-invite' | 'contact-on-hevy';
|
|
12
12
|
export interface BaseNotification {
|
|
13
13
|
id: number;
|
|
14
14
|
type: NotificationType;
|
|
@@ -49,13 +49,13 @@ export interface WorkoutCommentMobilePushData extends BaseMobilePushData {
|
|
|
49
49
|
type: 'workout-comment';
|
|
50
50
|
}
|
|
51
51
|
export interface WorkoutCommentDiscussionNotification extends BaseNotification {
|
|
52
|
-
type: 'workout-comment-
|
|
52
|
+
type: 'workout-comment-discussion';
|
|
53
53
|
workout_id: string;
|
|
54
54
|
workout_title: string;
|
|
55
55
|
comment: string;
|
|
56
56
|
}
|
|
57
57
|
export interface WorkoutCommentDiscussionMobilePushData extends BaseMobilePushData {
|
|
58
|
-
type: 'workout-comment-
|
|
58
|
+
type: 'workout-comment-discussion';
|
|
59
59
|
}
|
|
60
60
|
export interface WorkoutCommentMentionNotification extends BaseNotification {
|
|
61
61
|
type: 'workout-comment-mention';
|
|
@@ -67,13 +67,13 @@ export interface WorkoutCommentMentionMobilePushData extends BaseMobilePushData
|
|
|
67
67
|
type: 'workout-comment-mention';
|
|
68
68
|
}
|
|
69
69
|
export interface WorkoutCommentReplyNotification extends BaseNotification {
|
|
70
|
-
type: 'workout-comment-reply
|
|
70
|
+
type: 'workout-comment-reply';
|
|
71
71
|
workout_id: string;
|
|
72
72
|
workout_title: string;
|
|
73
73
|
comment: string;
|
|
74
74
|
}
|
|
75
75
|
export interface WorkoutCommentReplyMobilePushData extends BaseMobilePushData {
|
|
76
|
-
type: 'workout-comment-reply
|
|
76
|
+
type: 'workout-comment-reply';
|
|
77
77
|
}
|
|
78
78
|
export interface WorkoutLikeNotification extends BaseNotification {
|
|
79
79
|
type: 'workout-like';
|