hevy-shared 1.0.565 → 1.0.566
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 +16 -1
- package/built/index.js +25 -1
- package/built/normalizedWorkoutUtils.d.ts +3 -1
- package/built/notifications.d.ts +3 -13
- 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
|
}
|
|
@@ -790,6 +791,8 @@ export interface Workout {
|
|
|
790
791
|
* If applicable, the user ID of the coach who logged this workout
|
|
791
792
|
*/
|
|
792
793
|
logged_by_coach_id?: string;
|
|
794
|
+
biometrics?: WorkoutBiometrics;
|
|
795
|
+
is_biometrics_public: boolean;
|
|
793
796
|
}
|
|
794
797
|
export interface CustomExerciseImage {
|
|
795
798
|
type: 'image';
|
|
@@ -866,6 +869,18 @@ export interface PostWorkoutRequestWorkout {
|
|
|
866
869
|
wearos_watch: boolean;
|
|
867
870
|
workout_id: string;
|
|
868
871
|
is_private: boolean;
|
|
872
|
+
biometrics?: WorkoutBiometrics;
|
|
873
|
+
is_biometrics_public: boolean;
|
|
874
|
+
}
|
|
875
|
+
export declare const isHeartRateSamples: (x: any) => x is HeartRateSample[];
|
|
876
|
+
export declare const isWorkoutBiometrics: (x: any) => x is WorkoutBiometrics;
|
|
877
|
+
export interface WorkoutBiometrics {
|
|
878
|
+
total_calories?: number;
|
|
879
|
+
heart_rate_samples?: HeartRateSample[];
|
|
880
|
+
}
|
|
881
|
+
export interface HeartRateSample {
|
|
882
|
+
timestamp_ms: number;
|
|
883
|
+
bpm: number;
|
|
869
884
|
}
|
|
870
885
|
export interface PostWorkoutRequestExercise {
|
|
871
886
|
title: string;
|
|
@@ -897,7 +912,7 @@ export interface PostWorkoutRequestSet {
|
|
|
897
912
|
* update the corresponding values of the workout in the database, and those
|
|
898
913
|
* that are undefined will not be changed.
|
|
899
914
|
*/
|
|
900
|
-
export type UpdateWorkoutRequestWorkout = Partial<Pick<PostWorkoutRequestWorkout, 'title' | 'description' | 'media' | 'exercises' | 'is_private'>> & {
|
|
915
|
+
export type UpdateWorkoutRequestWorkout = Partial<Pick<PostWorkoutRequestWorkout, 'title' | 'description' | 'media' | 'exercises' | 'is_private' | 'is_biometrics_public'>> & {
|
|
901
916
|
start_and_end_time?: Required<Pick<PostWorkoutRequestWorkout, 'start_time' | 'end_time'>>;
|
|
902
917
|
};
|
|
903
918
|
/** 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 | WorkoutCommentReplyNotification | WorkoutCommentMentionNotification | WorkoutLikeNotification |
|
|
11
|
-
export type NotificationType = 'workout-complete' | 'workout-mention' | 'workout-comment' | 'workout-comment-reply' | 'workout-comment-mention' | 'workout-like' | '
|
|
10
|
+
export type Notification = WorkoutCompleteNotification | WorkoutMentionNotification | WorkoutCommentNotification | WorkoutCommentReplyNotification | WorkoutCommentMentionNotification | WorkoutLikeNotification | FollowNotification | FollowRequestNotification | AcceptFollowRequestNotification | CoachClientInviteNotification | ContactOnHevyNotification;
|
|
11
|
+
export type NotificationType = 'workout-complete' | 'workout-mention' | 'workout-comment' | 'workout-comment-reply' | 'workout-comment-mention' | 'workout-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;
|
|
@@ -74,16 +74,6 @@ export interface WorkoutLikeNotification extends BaseNotification {
|
|
|
74
74
|
export interface WorkoutLikeMobilePushData extends BaseMobilePushData {
|
|
75
75
|
type: 'workout-like';
|
|
76
76
|
}
|
|
77
|
-
export interface WorkoutCommentLikeNotification extends BaseNotification {
|
|
78
|
-
type: 'workout-comment-like';
|
|
79
|
-
workout_id: string;
|
|
80
|
-
workout_title: string;
|
|
81
|
-
comment_id: number;
|
|
82
|
-
comment: string;
|
|
83
|
-
}
|
|
84
|
-
export interface WorkoutCommentLikeMobilePushData extends BaseMobilePushData {
|
|
85
|
-
type: 'workout-comment-like';
|
|
86
|
-
}
|
|
87
77
|
export interface FollowNotification extends BaseNotification {
|
|
88
78
|
type: 'follow';
|
|
89
79
|
}
|
|
@@ -183,4 +173,4 @@ export interface MonthlyReportMobilePushData extends BaseMobilePushData {
|
|
|
183
173
|
type: 'monthly-report';
|
|
184
174
|
deeplink: string;
|
|
185
175
|
}
|
|
186
|
-
export type MobilePushData = ChatUpdateMobilePushData | SyncCustomExercisesAndCoachCustomizationsMobilePushData | SyncRoutineFoldersMobilePushData | SyncRoutinesMobilePushData | ProStatusChangedPushMobilePushData | HevyProSubscriptionRenewedMobilePushData | CoachProgramChangedMobilePushData | CoachDataChangedMobilePushData | ContactOnHevyMobilePushData | CoachClientInviteMobilePushData | AcceptFollowRequestMobilePushData | FollowRequestMobilePushData | FollowMobilePushData | WorkoutLikeMobilePushData |
|
|
176
|
+
export type MobilePushData = ChatUpdateMobilePushData | SyncCustomExercisesAndCoachCustomizationsMobilePushData | SyncRoutineFoldersMobilePushData | SyncRoutinesMobilePushData | ProStatusChangedPushMobilePushData | HevyProSubscriptionRenewedMobilePushData | CoachProgramChangedMobilePushData | CoachDataChangedMobilePushData | ContactOnHevyMobilePushData | CoachClientInviteMobilePushData | AcceptFollowRequestMobilePushData | FollowRequestMobilePushData | FollowMobilePushData | WorkoutLikeMobilePushData | WorkoutCommentMentionMobilePushData | WorkoutCommentReplyMobilePushData | WorkoutCommentMobilePushData | WorkoutMentionMobilePushData | WorkoutCompleteMobilePushData | CoachProgramFinishesNextWeekMobilePushData | CoachProgramStartsTodayMobilePushData | CoachLoggedYourWorkoutMobilePushData | CoachLoggedYourMeasurementsMobilePushData | MonthlyReportMobilePushData;
|
package/built/tests/testUtils.js
CHANGED