hevy-shared 1.0.565 → 1.0.567
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 +17 -1
- package/built/index.js +25 -1
- package/built/normalizedWorkoutUtils.d.ts +3 -1
- package/built/notifications.d.ts +17 -7
- package/built/tests/testUtils.js +1 -0
- package/package.json +1 -1
package/built/index.d.ts
CHANGED
|
@@ -465,6 +465,7 @@ export interface UserPreferences {
|
|
|
465
465
|
live_pr_volume?: LivePRVolumeOption;
|
|
466
466
|
inline_set_timer_enabled?: boolean;
|
|
467
467
|
default_workout_visibility_public?: boolean;
|
|
468
|
+
default_workout_biometrics_visibility_public?: boolean;
|
|
468
469
|
/** Only updateable by the backend within a special API */
|
|
469
470
|
volume_includes_warmup_sets?: boolean;
|
|
470
471
|
}
|
|
@@ -737,6 +738,7 @@ export interface WorkoutComment {
|
|
|
737
738
|
like_count: number;
|
|
738
739
|
is_liked_by_user: boolean;
|
|
739
740
|
parent_comment_id?: number;
|
|
741
|
+
replying_to_comment_id?: number;
|
|
740
742
|
}
|
|
741
743
|
export interface WorkoutImage {
|
|
742
744
|
type: 'image';
|
|
@@ -790,6 +792,8 @@ export interface Workout {
|
|
|
790
792
|
* If applicable, the user ID of the coach who logged this workout
|
|
791
793
|
*/
|
|
792
794
|
logged_by_coach_id?: string;
|
|
795
|
+
biometrics?: WorkoutBiometrics;
|
|
796
|
+
is_biometrics_public: boolean;
|
|
793
797
|
}
|
|
794
798
|
export interface CustomExerciseImage {
|
|
795
799
|
type: 'image';
|
|
@@ -866,6 +870,18 @@ export interface PostWorkoutRequestWorkout {
|
|
|
866
870
|
wearos_watch: boolean;
|
|
867
871
|
workout_id: string;
|
|
868
872
|
is_private: boolean;
|
|
873
|
+
biometrics?: WorkoutBiometrics;
|
|
874
|
+
is_biometrics_public: boolean;
|
|
875
|
+
}
|
|
876
|
+
export declare const isHeartRateSamples: (x: any) => x is HeartRateSample[];
|
|
877
|
+
export declare const isWorkoutBiometrics: (x: any) => x is WorkoutBiometrics;
|
|
878
|
+
export interface WorkoutBiometrics {
|
|
879
|
+
total_calories?: number;
|
|
880
|
+
heart_rate_samples?: HeartRateSample[];
|
|
881
|
+
}
|
|
882
|
+
export interface HeartRateSample {
|
|
883
|
+
timestamp_ms: number;
|
|
884
|
+
bpm: number;
|
|
869
885
|
}
|
|
870
886
|
export interface PostWorkoutRequestExercise {
|
|
871
887
|
title: string;
|
|
@@ -897,7 +913,7 @@ export interface PostWorkoutRequestSet {
|
|
|
897
913
|
* update the corresponding values of the workout in the database, and those
|
|
898
914
|
* that are undefined will not be changed.
|
|
899
915
|
*/
|
|
900
|
-
export type UpdateWorkoutRequestWorkout = Partial<Pick<PostWorkoutRequestWorkout, 'title' | 'description' | 'media' | 'exercises' | 'is_private'>> & {
|
|
916
|
+
export type UpdateWorkoutRequestWorkout = Partial<Pick<PostWorkoutRequestWorkout, 'title' | 'description' | 'media' | 'exercises' | 'is_private' | 'is_biometrics_public'>> & {
|
|
901
917
|
start_and_end_time?: Required<Pick<PostWorkoutRequestWorkout, 'start_time' | 'end_time'>>;
|
|
902
918
|
};
|
|
903
919
|
/** Routines */
|
package/built/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.isValidUserWorkoutMetricsType = exports.isBodyMeasurementKey = exports.measurementsList = exports.isPublicWorkout = exports.isSetType = exports.isRPE = exports.validRpeValues = exports.supportedInstructionsLanguages = exports.isCustomExerciseType = exports.customExericseTypes = exports.isExerciseType = exports.exerciseTypes = exports.isExerciseRepType = exports.exerciseRepTypes = exports.isEquipmentFilter = exports.equipmentFilters = exports.isEquipment = exports.equipments = exports.isMuscleGroupFilter = exports.muscleGroupFilters = exports.isMuscleGroup = exports.muscleGroups = exports.DefaultClientConfiguration = exports.isCoachRole = exports.isErrorResponse = exports.isLivePRVolumeOption = exports.isTimerVolumeOption = exports.isWeekday = exports.orderedWeekdays = exports.isBodyMeasurementUnit = exports.isDistanceUnitShort = exports.isDistanceUnit = exports.isWeightUnit = exports.isLanguage = exports.supportedLanguages = void 0;
|
|
17
|
+
exports.isValidUserWorkoutMetricsType = exports.isBodyMeasurementKey = exports.measurementsList = exports.isWorkoutBiometrics = exports.isHeartRateSamples = exports.isPublicWorkout = exports.isSetType = exports.isRPE = exports.validRpeValues = exports.supportedInstructionsLanguages = exports.isCustomExerciseType = exports.customExericseTypes = exports.isExerciseType = exports.exerciseTypes = exports.isExerciseRepType = exports.exerciseRepTypes = exports.isEquipmentFilter = exports.equipmentFilters = exports.isEquipment = exports.equipments = exports.isMuscleGroupFilter = exports.muscleGroupFilters = exports.isMuscleGroup = exports.muscleGroups = exports.DefaultClientConfiguration = exports.isCoachRole = exports.isErrorResponse = exports.isLivePRVolumeOption = exports.isTimerVolumeOption = exports.isWeekday = exports.orderedWeekdays = exports.isBodyMeasurementUnit = exports.isDistanceUnitShort = exports.isDistanceUnit = exports.isWeightUnit = exports.isLanguage = exports.supportedLanguages = void 0;
|
|
18
18
|
const typeUtils_1 = require("./typeUtils");
|
|
19
19
|
__exportStar(require("./constants"), exports);
|
|
20
20
|
__exportStar(require("./utils"), exports);
|
|
@@ -212,6 +212,30 @@ const isPublicWorkout = (x) => {
|
|
|
212
212
|
return x.type === 'public';
|
|
213
213
|
};
|
|
214
214
|
exports.isPublicWorkout = isPublicWorkout;
|
|
215
|
+
const isHeartRateSamples = (x) => {
|
|
216
|
+
if (!x)
|
|
217
|
+
return false;
|
|
218
|
+
if (Array.isArray(x)) {
|
|
219
|
+
for (const sample of x) {
|
|
220
|
+
if (typeof sample.timestamp_ms !== 'number' ||
|
|
221
|
+
typeof sample.bpm !== 'number') {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return true;
|
|
227
|
+
};
|
|
228
|
+
exports.isHeartRateSamples = isHeartRateSamples;
|
|
229
|
+
const isWorkoutBiometrics = (x) => {
|
|
230
|
+
if (!x)
|
|
231
|
+
return false;
|
|
232
|
+
const maybeCalories = x.total_calories;
|
|
233
|
+
const maybeHeartRateSamples = x.heart_rate_samples;
|
|
234
|
+
const caloriesAreValid = !maybeCalories || (typeof maybeCalories === 'number' && maybeCalories >= 0);
|
|
235
|
+
return ((caloriesAreValid && !maybeHeartRateSamples) ||
|
|
236
|
+
(0, exports.isHeartRateSamples)(maybeHeartRateSamples));
|
|
237
|
+
};
|
|
238
|
+
exports.isWorkoutBiometrics = isWorkoutBiometrics;
|
|
215
239
|
exports.measurementsList = [
|
|
216
240
|
'weight_kg',
|
|
217
241
|
'fat_percent',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExerciseType, RPE, SetType, ShareToPlatform, WorkoutMedia, WorkoutVisibility } from '.';
|
|
1
|
+
import { ExerciseType, RPE, SetType, ShareToPlatform, WorkoutBiometrics, WorkoutMedia, WorkoutVisibility } from '.';
|
|
2
2
|
/**
|
|
3
3
|
* Events are used to determine the start time, end time and duration of a
|
|
4
4
|
* `NormalizedWorkout`, in a way that can be persisted to disk.
|
|
@@ -29,10 +29,12 @@ export interface NormalizedWorkout {
|
|
|
29
29
|
appleWatch: boolean;
|
|
30
30
|
wearosWatch: boolean;
|
|
31
31
|
workoutVisibility: WorkoutVisibility;
|
|
32
|
+
isWorkoutBiometricsPublic: boolean;
|
|
32
33
|
shareTo: {
|
|
33
34
|
[key in ShareToPlatform]: boolean;
|
|
34
35
|
};
|
|
35
36
|
clientId: string;
|
|
37
|
+
biometrics?: WorkoutBiometrics;
|
|
36
38
|
}
|
|
37
39
|
export interface NormalizedSet {
|
|
38
40
|
index: number;
|
package/built/notifications.d.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { ClientsCoachData, Program } from '.';
|
|
9
9
|
import { HevyChatUpdateMobilePushData } from './chat';
|
|
10
|
-
export type Notification = WorkoutCompleteNotification | WorkoutMentionNotification | WorkoutCommentNotification |
|
|
11
|
-
export type NotificationType = 'workout-complete' | 'workout-mention' | 'workout-comment' | 'workout-comment-
|
|
10
|
+
export type Notification = WorkoutCompleteNotification | WorkoutMentionNotification | WorkoutCommentNotification | WorkoutCommentDiscussionNotification | WorkoutCommentMentionNotification | WorkoutCommentReplyNotification | WorkoutLikeNotification | WorkoutCommentLikeNotification | FollowNotification | FollowRequestNotification | AcceptFollowRequestNotification | CoachClientInviteNotification | ContactOnHevyNotification;
|
|
11
|
+
export type NotificationType = 'workout-complete' | 'workout-mention' | 'workout-comment' | 'workout-comment-discussion' | 'workout-comment-mention' | '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;
|
|
@@ -48,14 +48,14 @@ export interface WorkoutCommentNotification extends BaseNotification {
|
|
|
48
48
|
export interface WorkoutCommentMobilePushData extends BaseMobilePushData {
|
|
49
49
|
type: 'workout-comment';
|
|
50
50
|
}
|
|
51
|
-
export interface
|
|
52
|
-
type: 'workout-comment-
|
|
51
|
+
export interface WorkoutCommentDiscussionNotification extends BaseNotification {
|
|
52
|
+
type: 'workout-comment-discussion';
|
|
53
53
|
workout_id: string;
|
|
54
54
|
workout_title: string;
|
|
55
55
|
comment: string;
|
|
56
56
|
}
|
|
57
|
-
export interface
|
|
58
|
-
type: 'workout-comment-
|
|
57
|
+
export interface WorkoutCommentDiscussionMobilePushData extends BaseMobilePushData {
|
|
58
|
+
type: 'workout-comment-discussion';
|
|
59
59
|
}
|
|
60
60
|
export interface WorkoutCommentMentionNotification extends BaseNotification {
|
|
61
61
|
type: 'workout-comment-mention';
|
|
@@ -66,6 +66,16 @@ export interface WorkoutCommentMentionNotification extends BaseNotification {
|
|
|
66
66
|
export interface WorkoutCommentMentionMobilePushData extends BaseMobilePushData {
|
|
67
67
|
type: 'workout-comment-mention';
|
|
68
68
|
}
|
|
69
|
+
export interface WorkoutCommentReplyNotification extends BaseNotification {
|
|
70
|
+
type: 'workout-comment-reply';
|
|
71
|
+
workout_id: string;
|
|
72
|
+
workout_title: string;
|
|
73
|
+
comment_id: number;
|
|
74
|
+
comment: string;
|
|
75
|
+
}
|
|
76
|
+
export interface WorkoutCommentReplyMobilePushData extends BaseMobilePushData {
|
|
77
|
+
type: 'workout-comment-reply';
|
|
78
|
+
}
|
|
69
79
|
export interface WorkoutLikeNotification extends BaseNotification {
|
|
70
80
|
type: 'workout-like';
|
|
71
81
|
workout_id: string;
|
|
@@ -183,4 +193,4 @@ export interface MonthlyReportMobilePushData extends BaseMobilePushData {
|
|
|
183
193
|
type: 'monthly-report';
|
|
184
194
|
deeplink: string;
|
|
185
195
|
}
|
|
186
|
-
export type MobilePushData = ChatUpdateMobilePushData | SyncCustomExercisesAndCoachCustomizationsMobilePushData | SyncRoutineFoldersMobilePushData | SyncRoutinesMobilePushData | ProStatusChangedPushMobilePushData | HevyProSubscriptionRenewedMobilePushData | CoachProgramChangedMobilePushData | CoachDataChangedMobilePushData | ContactOnHevyMobilePushData | CoachClientInviteMobilePushData | AcceptFollowRequestMobilePushData | FollowRequestMobilePushData | FollowMobilePushData | WorkoutLikeMobilePushData | WorkoutCommentLikeMobilePushData | WorkoutCommentMentionMobilePushData | WorkoutCommentReplyMobilePushData | WorkoutCommentMobilePushData | WorkoutMentionMobilePushData | WorkoutCompleteMobilePushData | CoachProgramFinishesNextWeekMobilePushData | CoachProgramStartsTodayMobilePushData | CoachLoggedYourWorkoutMobilePushData | CoachLoggedYourMeasurementsMobilePushData | MonthlyReportMobilePushData;
|
|
196
|
+
export type MobilePushData = ChatUpdateMobilePushData | SyncCustomExercisesAndCoachCustomizationsMobilePushData | SyncRoutineFoldersMobilePushData | SyncRoutinesMobilePushData | ProStatusChangedPushMobilePushData | HevyProSubscriptionRenewedMobilePushData | CoachProgramChangedMobilePushData | CoachDataChangedMobilePushData | ContactOnHevyMobilePushData | CoachClientInviteMobilePushData | AcceptFollowRequestMobilePushData | FollowRequestMobilePushData | FollowMobilePushData | WorkoutLikeMobilePushData | WorkoutCommentLikeMobilePushData | WorkoutCommentMentionMobilePushData | WorkoutCommentDiscussionMobilePushData | WorkoutCommentReplyMobilePushData | WorkoutCommentMobilePushData | WorkoutMentionMobilePushData | WorkoutCompleteMobilePushData | CoachProgramFinishesNextWeekMobilePushData | CoachProgramStartsTodayMobilePushData | CoachLoggedYourWorkoutMobilePushData | CoachLoggedYourMeasurementsMobilePushData | MonthlyReportMobilePushData;
|
package/built/tests/testUtils.js
CHANGED