hevy-shared 1.0.684 → 1.0.686
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 +36 -4
- package/built/index.js +9 -7
- package/built/notifications.d.ts +5 -2
- package/built/tests/testUtils.js +1 -0
- package/built/utils.js +1 -1
- package/package.json +1 -1
package/built/index.d.ts
CHANGED
|
@@ -105,6 +105,8 @@ export interface UserAccountResponse {
|
|
|
105
105
|
birthday?: string;
|
|
106
106
|
sex?: Sex;
|
|
107
107
|
email_consent: boolean;
|
|
108
|
+
/** Indicates whether the account needs additional (email) verification to access certain APIs */
|
|
109
|
+
sensitive_api_requires_verification: boolean;
|
|
108
110
|
}
|
|
109
111
|
export interface CoachAppPushTarget {
|
|
110
112
|
type: 'android' | 'ios';
|
|
@@ -451,8 +453,6 @@ export interface UserHevyProSubcription {
|
|
|
451
453
|
subscription_cancels_on?: string;
|
|
452
454
|
};
|
|
453
455
|
}
|
|
454
|
-
export declare const ALL_CALENDAR_VIEW_OPTIONS: readonly ["month", "year", "multi_year"];
|
|
455
|
-
export type CalendarViewOption = typeof ALL_CALENDAR_VIEW_OPTIONS;
|
|
456
456
|
export interface UserPreferences {
|
|
457
457
|
username: string;
|
|
458
458
|
language?: Language;
|
|
@@ -474,7 +474,6 @@ export interface UserPreferences {
|
|
|
474
474
|
default_workout_biometrics_visibility_public?: boolean;
|
|
475
475
|
/** Only updateable by the backend within a special API */
|
|
476
476
|
volume_includes_warmup_sets?: boolean;
|
|
477
|
-
calendar_view_selection?: CalendarViewOption;
|
|
478
477
|
}
|
|
479
478
|
export type UpdateUserPreferencesRequest = Omit<UserPreferences, 'username' | 'volume_includes_warmup_sets'>;
|
|
480
479
|
export type FollowingStatus = 'not-following' | 'following' | 'requested';
|
|
@@ -601,6 +600,10 @@ export declare const exerciseCategories: readonly ["isolation", "compound", "ass
|
|
|
601
600
|
export type TrainingGoal = Lookup<typeof trainingGoals>;
|
|
602
601
|
export type TrainingLevel = Lookup<typeof trainingLevels>;
|
|
603
602
|
export type ExerciseCategory = Lookup<typeof exerciseCategories>;
|
|
603
|
+
export type HevyTrainerProgramEquipment = Extract<Equipment, 'barbell' | 'dumbbell' | 'machine'>;
|
|
604
|
+
export declare const hevyTrainerProgramEquipments: readonly ["barbell", "dumbbell", "machine"];
|
|
605
|
+
export declare const weeklyTrainingFrequencies: readonly [1, 2, 3, 4, 5, 6];
|
|
606
|
+
export type WeeklyTrainingFrequency = Lookup<typeof weeklyTrainingFrequencies>;
|
|
604
607
|
/**
|
|
605
608
|
* Base properties that all exercise templates must have
|
|
606
609
|
*/
|
|
@@ -1010,13 +1013,23 @@ export interface BaseRoutine {
|
|
|
1010
1013
|
coach_id: string | null;
|
|
1011
1014
|
notes: string | null;
|
|
1012
1015
|
coach_force_rpe_enabled: boolean;
|
|
1016
|
+
hevy_trainer_program_id: string | null;
|
|
1013
1017
|
}
|
|
1014
1018
|
export interface Routine extends BaseRoutine {
|
|
1015
1019
|
username: string;
|
|
1020
|
+
coach_id: null;
|
|
1016
1021
|
}
|
|
1017
|
-
export
|
|
1022
|
+
export interface HevyTrainerRoutine extends Routine {
|
|
1023
|
+
hevy_trainer_program_id: string;
|
|
1024
|
+
program_id: null;
|
|
1025
|
+
coach_force_rpe_enabled: false;
|
|
1026
|
+
folder_id: null;
|
|
1027
|
+
}
|
|
1028
|
+
export type CoachsShallowLibraryRoutine = Omit<BaseRoutine, 'exercises' | 'profile_pic' | 'hevy_trainer_program_id' | 'username'>;
|
|
1018
1029
|
export interface CoachesRoutine extends BaseRoutine {
|
|
1019
1030
|
coach_id: string;
|
|
1031
|
+
username: null;
|
|
1032
|
+
hevy_trainer_program_id: null;
|
|
1020
1033
|
}
|
|
1021
1034
|
export interface CoachAndCoachsClientsRoutineSyncResponse {
|
|
1022
1035
|
updated: BaseRoutine[];
|
|
@@ -1179,6 +1192,25 @@ export interface GetTeamInviteResponse {
|
|
|
1179
1192
|
export interface OutstandingInvitesForCoachTeamResponse {
|
|
1180
1193
|
invites: CoachTeamInvite[];
|
|
1181
1194
|
}
|
|
1195
|
+
export interface HevyTrainerProgram {
|
|
1196
|
+
title: string;
|
|
1197
|
+
level: TrainingLevel;
|
|
1198
|
+
goal: TrainingGoal;
|
|
1199
|
+
equipments: HevyTrainerProgramEquipment[];
|
|
1200
|
+
weekly_frequency: WeeklyTrainingFrequency;
|
|
1201
|
+
routines: HevyTrainerRoutine[];
|
|
1202
|
+
next_workout_index: number;
|
|
1203
|
+
}
|
|
1204
|
+
export interface PostHevyTrainerProgramRequestBody {
|
|
1205
|
+
program: {
|
|
1206
|
+
title: string;
|
|
1207
|
+
level: TrainingLevel;
|
|
1208
|
+
goal: TrainingGoal;
|
|
1209
|
+
equipments: HevyTrainerProgramEquipment[];
|
|
1210
|
+
weekly_frequency: WeeklyTrainingFrequency;
|
|
1211
|
+
routines: RoutineUpdate[];
|
|
1212
|
+
};
|
|
1213
|
+
}
|
|
1182
1214
|
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"];
|
|
1183
1215
|
type MeasurementProperties = {
|
|
1184
1216
|
[key in typeof measurementsList[number]]?: number;
|
package/built/index.js
CHANGED
|
@@ -14,8 +14,8 @@ 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.
|
|
18
|
-
exports.isSuggestedUserSource = exports.isValidUserWorkoutMetricsType = void 0;
|
|
17
|
+
exports.measurementsList = exports.isWorkoutBiometrics = exports.isHeartRateSamples = exports.isPublicWorkout = exports.isSetType = exports.isRPE = exports.validRpeValues = exports.isSetPersonalRecordType = exports.supportedInstructionsLanguages = exports.weeklyTrainingFrequencies = exports.hevyTrainerProgramEquipments = exports.exerciseCategories = exports.trainingLevels = exports.trainingGoals = 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.isSimplifiedMuscleGroup = exports.simplifiedMuscleGroups = exports.miscellaneousMuscles = exports.chestMuscles = exports.backMuscles = exports.legMuscles = exports.armMuscles = exports.shoulderMuscles = exports.coreMuscles = 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
|
+
exports.isSuggestedUserSource = exports.isValidUserWorkoutMetricsType = exports.isBodyMeasurementKey = void 0;
|
|
19
19
|
const typeUtils_1 = require("./typeUtils");
|
|
20
20
|
__exportStar(require("./constants"), exports);
|
|
21
21
|
__exportStar(require("./utils"), exports);
|
|
@@ -105,11 +105,6 @@ const _supportedProStores = [
|
|
|
105
105
|
'paddle',
|
|
106
106
|
'hevy-coach',
|
|
107
107
|
];
|
|
108
|
-
exports.ALL_CALENDAR_VIEW_OPTIONS = [
|
|
109
|
-
'month',
|
|
110
|
-
'year',
|
|
111
|
-
'multi_year',
|
|
112
|
-
];
|
|
113
108
|
exports.coreMuscles = ['abdominals'];
|
|
114
109
|
exports.shoulderMuscles = ['shoulders'];
|
|
115
110
|
exports.armMuscles = ['biceps', 'triceps', 'forearms'];
|
|
@@ -213,6 +208,7 @@ exports.isExerciseType = isExerciseType;
|
|
|
213
208
|
exports.customExericseTypes = exports.exerciseTypes.filter((type) => type !== 'floors_duration' && type !== 'steps_duration');
|
|
214
209
|
const isCustomExerciseType = (x) => (0, typeUtils_1.isInArray)(x, exports.customExericseTypes);
|
|
215
210
|
exports.isCustomExerciseType = isCustomExerciseType;
|
|
211
|
+
// Hevy Trainer related types
|
|
216
212
|
exports.trainingGoals = ['strength', 'build_muscle', 'fat_loss'];
|
|
217
213
|
exports.trainingLevels = ['beginner', 'intermediate', 'advanced'];
|
|
218
214
|
exports.exerciseCategories = [
|
|
@@ -220,6 +216,12 @@ exports.exerciseCategories = [
|
|
|
220
216
|
'compound',
|
|
221
217
|
'assistance-compound',
|
|
222
218
|
];
|
|
219
|
+
exports.hevyTrainerProgramEquipments = [
|
|
220
|
+
'barbell',
|
|
221
|
+
'dumbbell',
|
|
222
|
+
'machine',
|
|
223
|
+
];
|
|
224
|
+
exports.weeklyTrainingFrequencies = [1, 2, 3, 4, 5, 6];
|
|
223
225
|
exports.supportedInstructionsLanguages = [
|
|
224
226
|
'en',
|
|
225
227
|
'it',
|
package/built/notifications.d.ts
CHANGED
|
@@ -141,7 +141,7 @@ export type NotificationMobilePushDataType = NotificationType | 'chat-update' |
|
|
|
141
141
|
* For iOS/Apple see https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app
|
|
142
142
|
* For Android see https://firebase.google.com/docs/cloud-messaging/concept-options#data_messages
|
|
143
143
|
*/
|
|
144
|
-
export type DataOnlyMobilePushDataType = 'coach-data-changed' | 'coach-program-changed' | 'sync-workouts' | 'sync-routines' | 'sync-routine-folders' | 'sync-exercise-templates-and-customizations' | 'hevy-pro-status-changed' | 'hevy-pro-subscription-renewed';
|
|
144
|
+
export type DataOnlyMobilePushDataType = 'coach-data-changed' | 'coach-program-changed' | 'sync-workouts' | 'sync-routines' | 'sync-routine-folders' | 'sync-exercise-templates-and-customizations' | 'sync-account' | 'hevy-pro-status-changed' | 'hevy-pro-subscription-renewed' | never;
|
|
145
145
|
export interface CoachDataChangedMobilePushData extends BaseMobilePushData {
|
|
146
146
|
type: 'coach-data-changed';
|
|
147
147
|
additionalHevyData: ClientsCoachData;
|
|
@@ -170,6 +170,9 @@ export interface SyncRoutineFoldersMobilePushData extends BaseMobilePushData {
|
|
|
170
170
|
export interface SyncCustomExercisesAndCoachCustomizationsMobilePushData extends BaseMobilePushData {
|
|
171
171
|
type: 'sync-exercise-templates-and-customizations';
|
|
172
172
|
}
|
|
173
|
+
export interface SyncAccountMobilePushData extends BaseMobilePushData {
|
|
174
|
+
type: 'sync-account';
|
|
175
|
+
}
|
|
173
176
|
export interface CoachProgramFinishesNextWeekMobilePushData extends BaseMobilePushData {
|
|
174
177
|
type: 'coach-program-finishes-next-week';
|
|
175
178
|
}
|
|
@@ -203,4 +206,4 @@ export interface GracePeriodResolveMobilePushData extends BaseMobilePushData {
|
|
|
203
206
|
type: 'grace-period-resolve';
|
|
204
207
|
deeplink: string;
|
|
205
208
|
}
|
|
206
|
-
export type MobilePushData = ChatUpdateMobilePushData | SyncCustomExercisesAndCoachCustomizationsMobilePushData | SyncWorkoutsMobilePushData | SyncRoutineFoldersMobilePushData | SyncRoutinesMobilePushData | ProStatusChangedPushMobilePushData | HevyProSubscriptionRenewedMobilePushData | CoachProgramChangedMobilePushData | CoachDataChangedMobilePushData | ContactOnHevyMobilePushData | CoachClientInviteMobilePushData | AcceptFollowRequestMobilePushData | FollowRequestMobilePushData | FollowMobilePushData | WorkoutLikeMobilePushData | WorkoutCommentLikeMobilePushData | WorkoutCommentMentionMobilePushData | WorkoutCommentDiscussionMobilePushData | WorkoutCommentReplyMobilePushData | WorkoutCommentMobilePushData | WorkoutMentionMobilePushData | WorkoutCompleteMobilePushData | CoachProgramFinishesNextWeekMobilePushData | CoachProgramStartsTodayMobilePushData | CoachLoggedYourWorkoutMobilePushData | CoachLoggedYourMeasurementsMobilePushData | MonthlyReportMobilePushData | GracePeriodEnterMobilePushData | GracePeriodResolveMobilePushData;
|
|
209
|
+
export type MobilePushData = ChatUpdateMobilePushData | SyncCustomExercisesAndCoachCustomizationsMobilePushData | SyncWorkoutsMobilePushData | SyncRoutineFoldersMobilePushData | SyncRoutinesMobilePushData | SyncAccountMobilePushData | ProStatusChangedPushMobilePushData | HevyProSubscriptionRenewedMobilePushData | CoachProgramChangedMobilePushData | CoachDataChangedMobilePushData | ContactOnHevyMobilePushData | CoachClientInviteMobilePushData | AcceptFollowRequestMobilePushData | FollowRequestMobilePushData | FollowMobilePushData | WorkoutLikeMobilePushData | WorkoutCommentLikeMobilePushData | WorkoutCommentMentionMobilePushData | WorkoutCommentDiscussionMobilePushData | WorkoutCommentReplyMobilePushData | WorkoutCommentMobilePushData | WorkoutMentionMobilePushData | WorkoutCompleteMobilePushData | CoachProgramFinishesNextWeekMobilePushData | CoachProgramStartsTodayMobilePushData | CoachLoggedYourWorkoutMobilePushData | CoachLoggedYourMeasurementsMobilePushData | MonthlyReportMobilePushData | GracePeriodEnterMobilePushData | GracePeriodResolveMobilePushData;
|
package/built/tests/testUtils.js
CHANGED
package/built/utils.js
CHANGED
|
@@ -97,7 +97,7 @@ exports.secondsToWordFormat = secondsToWordFormat;
|
|
|
97
97
|
*/
|
|
98
98
|
const secondsToWordFormatMinutes = (seconds) => {
|
|
99
99
|
const hours = Math.floor(seconds / 3600);
|
|
100
|
-
const minutes = Math.
|
|
100
|
+
const minutes = Math.round((seconds - hours * 3600) / 60);
|
|
101
101
|
if (hours) {
|
|
102
102
|
return `${hours}h ${minutes}min`;
|
|
103
103
|
}
|