hevy-shared 1.0.962 → 1.0.964

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.
Files changed (86) hide show
  1. package/README.md +17 -2
  2. package/built/API/APIClient.d.ts +157 -0
  3. package/built/API/APIClient.js +381 -0
  4. package/built/API/index.d.ts +2 -0
  5. package/built/API/index.js +18 -0
  6. package/built/API/types.d.ts +38 -0
  7. package/built/API/types.js +18 -0
  8. package/built/adjustEventTokens.d.ts +16 -0
  9. package/built/adjustEventTokens.js +18 -0
  10. package/built/adminPermissions.d.ts +4 -0
  11. package/built/adminPermissions.js +22 -0
  12. package/built/async.d.ts +50 -0
  13. package/built/async.js +170 -0
  14. package/built/chat.d.ts +25 -23
  15. package/built/coachPlans.d.ts +2 -1
  16. package/built/coachPlans.js +2 -2
  17. package/built/cue.d.ts +12 -0
  18. package/built/cue.js +22 -0
  19. package/built/exerciseLocaleUtils.d.ts +17 -0
  20. package/built/exerciseLocaleUtils.js +62 -0
  21. package/built/filterExercises.d.ts +19 -3
  22. package/built/filterExercises.js +72 -60
  23. package/built/hevyTrainer.d.ts +250 -0
  24. package/built/hevyTrainer.js +676 -0
  25. package/built/index.d.ts +1217 -304
  26. package/built/index.js +268 -75
  27. package/built/muscleHeatmaps.d.ts +31 -0
  28. package/built/muscleHeatmaps.js +68 -0
  29. package/built/muscleSplits.d.ts +36 -0
  30. package/built/muscleSplits.js +100 -0
  31. package/built/normalizedWorkoutUtils.d.ts +88 -0
  32. package/built/normalizedWorkoutUtils.js +112 -0
  33. package/built/notifications.d.ts +215 -0
  34. package/built/notifications.js +9 -0
  35. package/built/routineUtils.d.ts +14 -0
  36. package/built/routineUtils.js +186 -0
  37. package/built/setIndicatorUtils.d.ts +4 -3
  38. package/built/setIndicatorUtils.js +15 -1
  39. package/built/tests/async.test.d.ts +1 -0
  40. package/built/tests/async.test.js +49 -0
  41. package/built/tests/hevyTrainer.test.d.ts +1 -0
  42. package/built/tests/hevyTrainer.test.js +1199 -0
  43. package/built/tests/muscleSplit.test.d.ts +1 -0
  44. package/built/tests/muscleSplit.test.js +153 -0
  45. package/built/tests/routineUtils.test.d.ts +1 -0
  46. package/built/tests/routineUtils.test.js +745 -0
  47. package/built/tests/testUtils.d.ts +85 -0
  48. package/built/tests/testUtils.js +319 -0
  49. package/built/tests/utils.test.js +748 -0
  50. package/built/tests/workoutVolume.test.js +165 -49
  51. package/built/translations/index.d.ts +2 -0
  52. package/built/translations/index.js +18 -0
  53. package/built/translations/translationUtils.d.ts +2 -0
  54. package/built/translations/translationUtils.js +61 -0
  55. package/built/translations/types.d.ts +8 -0
  56. package/built/translations/types.js +20 -0
  57. package/built/typeUtils.d.ts +70 -0
  58. package/built/typeUtils.js +55 -0
  59. package/built/units.d.ts +14 -7
  60. package/built/units.js +24 -14
  61. package/built/utils.d.ts +192 -5
  62. package/built/utils.js +598 -85
  63. package/built/websocket.d.ts +14 -2
  64. package/built/workoutVolume.d.ts +24 -5
  65. package/built/workoutVolume.js +25 -34
  66. package/package.json +30 -9
  67. package/.eslintignore +0 -2
  68. package/.eslintrc +0 -21
  69. package/.github/workflows/ci.yml +0 -15
  70. package/.github/workflows/npm-publish.yml +0 -59
  71. package/.github/workflows/pr-auto-assign.yml +0 -15
  72. package/.prettierrc.js +0 -5
  73. package/jest.config.js +0 -4
  74. package/src/chat.ts +0 -130
  75. package/src/coachPlans.ts +0 -57
  76. package/src/constants.ts +0 -14
  77. package/src/filterExercises.ts +0 -222
  78. package/src/index.ts +0 -1576
  79. package/src/setIndicatorUtils.ts +0 -137
  80. package/src/tests/utils.test.ts +0 -156
  81. package/src/tests/workoutVolume.test.ts +0 -93
  82. package/src/units.ts +0 -41
  83. package/src/utils.ts +0 -516
  84. package/src/websocket.ts +0 -36
  85. package/src/workoutVolume.ts +0 -175
  86. package/tsconfig.json +0 -70
package/built/index.d.ts CHANGED
@@ -1,4 +1,7 @@
1
- import { HevyChatUpdatePush } from './chat';
1
+ import { InstructionsLanguage } from './exerciseLocaleUtils';
2
+ import { HevyTrainerRoutineName, WorkoutDurationMinutes } from './hevyTrainer';
3
+ import { Language } from './translations';
4
+ import { Lookup } from './typeUtils';
2
5
  export * from './constants';
3
6
  export * from './utils';
4
7
  export * from './units';
@@ -8,8 +11,19 @@ export * from './workoutVolume';
8
11
  export * from './coachPlans';
9
12
  export * from './chat';
10
13
  export * from './websocket';
11
- export type Language = 'en' | 'es' | 'de' | 'fr' | 'it' | 'pt' | 'tr' | 'zh_CN' | 'zh_TW' | 'ru' | 'ja' | 'ko';
12
- export declare const isLanguage: (x: string) => x is Language;
14
+ export * from './cue';
15
+ export * from './muscleHeatmaps';
16
+ export * from './muscleSplits';
17
+ export * from './notifications';
18
+ export * from './normalizedWorkoutUtils';
19
+ export * from './routineUtils';
20
+ export * from './typeUtils';
21
+ export * from './async';
22
+ export * from './adminPermissions';
23
+ export * from './adjustEventTokens';
24
+ export * from './hevyTrainer';
25
+ export * from './translations';
26
+ export * from './exerciseLocaleUtils';
13
27
  export type WeightUnit = 'kg' | 'lbs';
14
28
  export declare const isWeightUnit: (x: string) => x is WeightUnit;
15
29
  export type DistanceUnit = 'kilometers' | 'miles';
@@ -18,10 +32,16 @@ export type DistanceUnitShort = 'km' | 'mi';
18
32
  export declare const isDistanceUnitShort: (x: string) => x is DistanceUnit;
19
33
  export type BodyMeasurementUnit = 'cm' | 'in';
20
34
  export declare const isBodyMeasurementUnit: (x: string) => x is BodyMeasurementUnit;
21
- export type Weekday = 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday';
35
+ /** Monday is first */
36
+ export declare const orderedWeekdays: readonly ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"];
37
+ export type Weekday = Lookup<typeof orderedWeekdays>;
22
38
  export declare const isWeekday: (x: string) => x is Weekday;
23
- export type TimerVolumeOption = 'off' | 'low' | 'normal' | 'high';
39
+ declare const _timerVolumeOptions: readonly ["off", "low", "normal", "high"];
40
+ export type TimerVolumeOption = Lookup<typeof _timerVolumeOptions>;
24
41
  export declare const isTimerVolumeOption: (x: string) => x is TimerVolumeOption;
42
+ declare const _livePRVolumeOption: readonly ["off", "low", "normal", "high"];
43
+ export type LivePRVolumeOption = Lookup<typeof _livePRVolumeOption>;
44
+ export declare const isLivePRVolumeOption: (x: string) => x is LivePRVolumeOption;
25
45
  export interface ErrorResponse {
26
46
  error: string;
27
47
  }
@@ -56,6 +76,7 @@ export interface AccountResponse {
56
76
  is_coached: boolean;
57
77
  birthday?: string;
58
78
  sex?: Sex;
79
+ height_cm?: number;
59
80
  }
60
81
  export interface UserAccountResponse {
61
82
  id: string;
@@ -68,6 +89,10 @@ export interface UserAccountResponse {
68
89
  gift_pro_expiry?: string;
69
90
  gympass_user_id?: string;
70
91
  is_gympass_plan_active?: boolean;
92
+ is_strava_connected: boolean;
93
+ is_chatgpt_oauth_authorized: boolean;
94
+ country_code?: string;
95
+ city?: string;
71
96
  follows_push_enabled: boolean;
72
97
  likes_push_enabled: boolean;
73
98
  comments_push_enabled: boolean;
@@ -77,11 +102,49 @@ export interface UserAccountResponse {
77
102
  created_at: string;
78
103
  last_workout_at: string;
79
104
  accepted_terms_and_conditions: boolean;
105
+ /** @deprecated 1.31.1 - use `coach_client_status` instead */
80
106
  is_coached: boolean;
107
+ /** @deprecated 1.31.1 - use `coach_status` instead */
81
108
  is_a_coach: boolean;
82
- became_coach_at?: string;
109
+ coach_client_status?: 'coached-active-plan' | 'coached-inactive-plan';
110
+ coach_status?: 'coach-active-plan' | 'coach-inactive-plan';
83
111
  birthday?: string;
84
112
  sex?: Sex;
113
+ email_consent: boolean;
114
+ email_verified: boolean;
115
+ height_cm?: number;
116
+ is_hevy_trainer_user: boolean;
117
+ }
118
+ export interface CoachAppPushTarget {
119
+ type: 'android' | 'ios';
120
+ token: string;
121
+ }
122
+ declare const _coachRoles: readonly ["member", "admin", "owner"];
123
+ export type CoachRole = Lookup<typeof _coachRoles>;
124
+ export declare const isCoachRole: (role: any) => role is CoachRole;
125
+ export interface CoachAccount {
126
+ id: string;
127
+ username: string;
128
+ email: string;
129
+ full_name?: string;
130
+ profile_pic?: string;
131
+ created_at: string;
132
+ last_workout_at: string;
133
+ accepted_terms_and_conditions: boolean;
134
+ became_coach_at?: string;
135
+ has_hevy_routine: boolean;
136
+ role: CoachRole;
137
+ last_app_launch_at: Date | null;
138
+ join_form_message?: string;
139
+ join_form_banner_image_url?: string;
140
+ client_workouts_logged?: number;
141
+ }
142
+ export interface CoachTeam {
143
+ title: string;
144
+ id: string;
145
+ members: CoachAccount[];
146
+ image_url?: string;
147
+ enabled_at?: string;
85
148
  }
86
149
  export interface FollowCountsResponse {
87
150
  follower_count: number;
@@ -105,16 +168,31 @@ export interface AccountUpdate {
105
168
  accepted_terms_and_conditions?: boolean;
106
169
  sex?: Sex;
107
170
  birthday?: string;
171
+ height_cm?: number;
172
+ }
173
+ export interface AppleSignUpRequest {
174
+ email?: string;
175
+ appleUserId: string;
176
+ identityToken: string;
177
+ gympassUserId?: string;
178
+ useAuth2_0?: boolean;
179
+ }
180
+ export interface AppleSignInRequestCoachMobile {
181
+ email?: string;
182
+ appleUserId: string;
183
+ identityToken: string;
184
+ fullName?: string;
108
185
  }
109
186
  export interface AppleSignInRequest {
110
187
  email?: string;
111
- user: string;
188
+ appleUserId: string;
189
+ identityToken: string;
190
+ gympassUserId?: string;
191
+ useAuth2_0?: boolean;
192
+ }
193
+ export interface AppleSignUpWebRequest {
194
+ email?: string;
112
195
  identityToken: string;
113
- /**
114
- * When generateUsername=true. The backend will generate
115
- * a placeholder username when the account gets created.
116
- */
117
- generateUsername: boolean;
118
196
  gympassUserId?: string;
119
197
  }
120
198
  export interface AppleSignInWebRequest {
@@ -124,30 +202,49 @@ export interface AppleSignInWebRequest {
124
202
  }
125
203
  export interface GoogleSignInRequest {
126
204
  email: string;
127
- userId: string;
205
+ googleUserId: string;
128
206
  idToken: string;
129
207
  source?: 'web';
130
- /**
131
- * When generateUsername=true. The backend will generate
132
- * a placeholder username when the account gets created.
133
- */
134
- generateUsername: boolean;
135
208
  gympassUserId?: string;
209
+ useAuth2_0?: boolean;
136
210
  }
137
- export interface FacebookSignInRequest {
138
- userId: string;
139
- accessToken: string;
140
- /**
141
- * When generateUsername=true. The backend will generate
142
- * a placeholder username when the account gets created.
143
- */
144
- generateUsername: boolean;
211
+ export interface GoogleSignUpRequest {
212
+ email: string;
213
+ googleUserId: string;
214
+ idToken: string;
215
+ source?: 'web';
145
216
  gympassUserId?: string;
217
+ useAuth2_0?: boolean;
146
218
  }
147
- export interface SocialLoginResult {
219
+ export interface SocialLoginResult extends ClientAuthTokenResponse {
148
220
  auth_token: string;
221
+ username: string;
222
+ user_id: string;
223
+ email: string;
149
224
  is_new_user: boolean;
150
225
  }
226
+ export interface ClientAuthToken {
227
+ access_token: string;
228
+ refresh_token: string;
229
+ expires_at: Date;
230
+ }
231
+ export interface ClientRefreshTokenRequest {
232
+ refresh_token: string;
233
+ }
234
+ export interface ClientAuthTokenResponse {
235
+ access_token: string;
236
+ refresh_token: string;
237
+ expires_at: string;
238
+ }
239
+ export interface AuthResponse extends ClientAuthTokenResponse {
240
+ user_id: string;
241
+ /**
242
+ * Legacy auth token, will be removed in the future.
243
+ * @deprecated 2.5.3
244
+ */
245
+ auth_token: string;
246
+ }
247
+ export declare const parseClientAuthTokenResponse: (data: ClientAuthTokenResponse) => ClientAuthToken | null;
151
248
  export interface UsernameAvailabilityResponse {
152
249
  isAvailable: boolean;
153
250
  suggestions: string[];
@@ -172,17 +269,59 @@ export interface User {
172
269
  website_link?: string;
173
270
  created_at: string;
174
271
  }
175
- export interface BackofficeUserData {
272
+ export interface BackofficeExistingUserResponse {
273
+ state: 'user-account';
176
274
  id: string;
275
+ username: string;
276
+ email: string;
277
+ full_name?: string;
278
+ description?: string;
279
+ website_link?: string;
280
+ profile_pic?: string;
281
+ gift_pro_expiry?: string;
282
+ gympass_user_id?: string;
283
+ is_gympass_plan_active?: boolean;
284
+ private_profile: boolean;
285
+ created_at: string;
286
+ last_workout_at: string;
287
+ coach_client_status?: 'coached-active-plan' | 'coached-inactive-plan';
288
+ coach_status?: 'coach-active-plan' | 'coach-inactive-plan';
289
+ notes: string | null;
177
290
  is_banned: boolean;
178
- flagged_metadata: UserFlagMetadata;
291
+ metadata: UserMetadataResponse | null;
292
+ shadow_ban_metadata: UserShadowBanMetadata | null;
293
+ shadow_banned_at: string | null;
179
294
  gympass_email: string | null;
295
+ paddle_customer_id: string | null;
296
+ public_api_key: string | null;
297
+ limited_discovery: boolean;
298
+ coach_trial_expire_date?: string;
299
+ hevy_trainer_program: HevyTrainerProgram | null;
300
+ }
301
+ export interface BackofficeDeletedUserResponse {
302
+ state: 'deleted-account';
303
+ id: string;
304
+ username: string;
305
+ email: string;
306
+ full_name?: string;
307
+ description?: string;
308
+ website_link?: string;
309
+ profile_pic?: string;
310
+ created_at: string;
311
+ notes: string | null;
312
+ metadata: UserMetadataResponse | null;
180
313
  }
181
- export type BackofficeUserResponse = UserAccountResponse & BackofficeUserData;
182
- export type BackofficeFeaturedUser = Pick<BackofficeUserResponse, 'id' | 'username' | 'profile_pic' | 'private_profile' | 'last_workout_at'> & {
314
+ export type BackofficeUserResponse = BackofficeExistingUserResponse | BackofficeDeletedUserResponse;
315
+ export type BackofficeFeaturedUser = Pick<BackofficeExistingUserResponse, 'id' | 'username' | 'profile_pic' | 'private_profile' | 'last_workout_at'> & {
183
316
  followers_count: number;
184
317
  };
185
- export type BackofficeFlaggedUser = Pick<BackofficeUserResponse, 'id' | 'username' | 'profile_pic' | 'flagged_metadata'>;
318
+ export type BanType = 'suspicious' | 'warned' | 'restricted';
319
+ export type BackofficeShadowBannedUser = Pick<BackofficeExistingUserResponse, 'id' | 'username' | 'profile_pic'> & {
320
+ shadow_ban_metadata: UserShadowBanMetadata;
321
+ shadow_banned_at: string;
322
+ ban_type: BanType;
323
+ backoffice_notes?: string;
324
+ };
186
325
  export interface BackofficeUserComment {
187
326
  workout_username: string;
188
327
  workout_short_id: string;
@@ -191,13 +330,58 @@ export interface BackofficeUserComment {
191
330
  comment_text: string;
192
331
  }
193
332
  export interface BackofficeAccountUpdate {
333
+ username?: string;
194
334
  email?: string;
195
335
  description?: string;
336
+ notes?: string;
196
337
  /** `null` means we're unlinking the user's Gympass account */
197
338
  gympass_email?: string | null;
339
+ gympass_subscription_active?: boolean;
340
+ gympass_account?: {
341
+ id: string;
342
+ email: string;
343
+ country_code?: string;
344
+ };
345
+ limited_discovery?: boolean;
198
346
  delete_profile_pic?: boolean;
199
347
  delete_link?: boolean;
200
348
  }
349
+ export interface BackofficeSuggestedUsersResponse {
350
+ users: SuggestedUser[];
351
+ }
352
+ export interface BackofficeBlockedUsersResponse {
353
+ users: {
354
+ id: string;
355
+ username: string;
356
+ profile_pic: string | null;
357
+ }[];
358
+ }
359
+ export interface IPBlacklistEntry {
360
+ ip_range: string;
361
+ comment: string;
362
+ created_at: string;
363
+ }
364
+ export interface GetIPBlacklistResponse {
365
+ ip_blacklist: IPBlacklistEntry[];
366
+ }
367
+ export interface BackofficeReportedUserSummary {
368
+ user_id: string;
369
+ username: string;
370
+ num_reports: number;
371
+ last_reported_at: string;
372
+ signed_up_at: string;
373
+ app_language: string;
374
+ platform: string;
375
+ platform_version: string;
376
+ app_version: string;
377
+ geoip_country: string;
378
+ geoip_city: string;
379
+ geoip_timezone: string;
380
+ last_ip: string;
381
+ }
382
+ export interface BackofficeGetReportedUserOverviewResponse {
383
+ reported_users: BackofficeReportedUserSummary[];
384
+ }
201
385
  export interface CoachsClientData {
202
386
  id: string;
203
387
  email: string;
@@ -206,12 +390,28 @@ export interface CoachsClientData {
206
390
  full_name: string | null;
207
391
  last_workout_at: string;
208
392
  notes: string | null;
209
- custom_exercises: ExerciseTemplate[];
393
+ custom_exercises: CustomExercise[];
210
394
  user_preferences: UserPreferences | null;
211
- created_at: string;
212
- archived_date: string | null;
395
+ user_created_at: string;
396
+ coaching_started_at: string;
213
397
  is_sample_user: boolean;
214
398
  client_configuration: ClientConfiguration;
399
+ coach_id: string;
400
+ program?: MinimalClientProgram;
401
+ }
402
+ export interface MinimalClientProgram {
403
+ title: string | null;
404
+ duration_days: number | null;
405
+ start_date: string | null;
406
+ id: string;
407
+ }
408
+ export interface CoachsLead {
409
+ lead_full_name: string;
410
+ lead_email: string;
411
+ lead_message: string;
412
+ lead_user_id?: string;
413
+ lead_coach_id: string;
414
+ created_at: string;
215
415
  }
216
416
  export type CoachPlanUpdateType = 'pause' | 'cancel' | 'change' | 'resume';
217
417
  export interface CoachPlanUpdateRequest {
@@ -221,6 +421,7 @@ export interface CoachPlanUpdateRequest {
221
421
  export declare const DefaultClientConfiguration: ClientConfiguration;
222
422
  export interface ClientConfiguration {
223
423
  is_chat_enabled: boolean;
424
+ are_notifications_enabled: boolean;
224
425
  }
225
426
  export interface ClientsCoachData {
226
427
  username: string;
@@ -231,26 +432,69 @@ export interface ClientsCoachData {
231
432
  coach_id: string;
232
433
  coach_conversation_id?: string;
233
434
  client_configuration: ClientConfiguration;
435
+ is_paying_coach: boolean;
436
+ }
437
+ export interface WebNotificationConfiguration {
438
+ client_completes_workout: boolean;
439
+ client_sends_message: boolean;
440
+ client_adds_measurement: boolean;
441
+ }
442
+ export type WebNotificationConfigurationType = 'client_completes_workout' | 'client_sends_message' | 'client_adds_measurement';
443
+ export interface EmailNotificationConfiguration {
444
+ client_completes_workout: boolean;
445
+ client_sends_message: boolean;
446
+ client_adds_measurement: boolean;
447
+ program_finishes_next_week: boolean;
448
+ }
449
+ export type EmailNotificationConfigurationType = 'client_completes_workout' | 'client_sends_message' | 'client_adds_measurement' | 'program_finishes_next_week';
450
+ export interface MobileNotificationConfiguration {
451
+ client_sends_message: boolean;
452
+ }
453
+ export interface CoachJoinFormData {
454
+ coachUsername: string;
455
+ coachFullname?: string;
456
+ joinMessage?: string;
457
+ joinImageUrl?: string;
458
+ coachProfileImageUrl?: string;
234
459
  }
235
460
  export interface CoachAccountConfiguration {
236
461
  enable_chat_for_new_clients: boolean;
462
+ enable_notifications_for_new_clients: boolean;
463
+ weight_unit?: WeightUnit;
464
+ distance_unit?: DistanceUnit;
465
+ body_measurement_unit?: BodyMeasurementUnit;
466
+ default_rest_timer_seconds?: number;
467
+ is_rpe_enabled_for_new_routines?: boolean;
468
+ first_weekday?: Weekday;
469
+ default_rep_input_type?: RepInputType;
470
+ web_notifications?: WebNotificationConfiguration;
471
+ email_notifications?: EmailNotificationConfiguration;
472
+ mobile_notifications?: MobileNotificationConfiguration;
237
473
  }
238
- export interface UserFlagMetadata {
474
+ export interface UserShadowBanMetadata {
475
+ manual_ban: boolean;
239
476
  reason: string;
240
477
  username?: string | null;
478
+ full_name?: string | null;
241
479
  email?: string | null;
242
480
  description?: string | null;
243
481
  website_link?: string | null;
244
482
  profile_pic_url?: string | null;
245
483
  recaptcha_score?: number | null;
246
484
  }
485
+ declare const _supportedProStores: readonly ["app_store", "play_store", "stripe", "hevy-gift", "gympass", "paddle", "hevy-coach"];
486
+ type UserHevyProSubcriptionStore = Lookup<typeof _supportedProStores>;
247
487
  export interface UserHevyProSubcription {
248
488
  is_pro: boolean;
249
489
  active_subscription?: {
250
- managing_store: 'app_store' | 'play_store' | 'stripe' | 'hevy-gift' | 'gympass';
490
+ managing_store: UserHevyProSubcriptionStore;
251
491
  type: 'monthly' | 'yearly' | 'lifetime' | 'custom';
252
492
  expires_date?: string;
253
- unsubscribe_detected_at?: string;
493
+ grace_period_expires_date?: string | null;
494
+ /**
495
+ * Set if the user has paused/cancelled their subscription
496
+ */
497
+ subscription_cancels_on?: string;
254
498
  };
255
499
  }
256
500
  export interface UserPreferences {
@@ -267,12 +511,20 @@ export interface UserPreferences {
267
511
  plate_calculator_enabled?: boolean;
268
512
  previous_workout_values_from_routine?: boolean;
269
513
  rpe_enabled?: boolean;
270
- timer_volume?: string;
514
+ timer_volume?: TimerVolumeOption;
515
+ live_pr_volume?: LivePRVolumeOption;
271
516
  inline_set_timer_enabled?: boolean;
517
+ default_workout_visibility_public?: boolean;
518
+ default_workout_biometrics_visibility_public?: boolean;
519
+ /** Only updateable by the backend within a special API */
520
+ volume_includes_warmup_sets?: boolean;
272
521
  }
273
- export type UpdateUserPreferencesRequest = Omit<UserPreferences, 'username'>;
522
+ export type UpdateUserPreferencesRequest = Omit<UserPreferences, 'username' | 'volume_includes_warmup_sets'>;
274
523
  export type FollowingStatus = 'not-following' | 'following' | 'requested';
275
524
  export type FollowingStatusMap = {
525
+ [id: string]: Omit<FollowingStatus, 'not-following'>;
526
+ };
527
+ export type FollowingStatusesResponse = {
276
528
  [id: string]: 'following' | 'requested';
277
529
  };
278
530
  export interface FollowRequest {
@@ -289,24 +541,12 @@ export interface SearchUser {
289
541
  private_profile: boolean;
290
542
  verified: boolean;
291
543
  }
292
- export interface RoutineLibraryRoutine {
544
+ export interface CoachInviteSearchUser {
293
545
  id: string;
294
- title: string;
546
+ profile_pic?: string;
295
547
  username: string;
296
- profile_pic: string;
297
- }
298
- export type RoutineLibrarySubsectionKey = 'classic-split' | 'suspension-band' | 'full-body-split' | 'five-by-five' | 'push-pull' | 'no-equipment' | 'only-dumbbells' | 'five-day-split' | 'upper-lower';
299
- export interface RoutineLibrarySubsection {
300
- key: RoutineLibrarySubsectionKey;
301
- title: string;
302
- routines: RoutineLibraryRoutine[];
303
- }
304
- export interface RoutineLibrarySection {
305
- title: string;
306
- subsections: RoutineLibrarySubsection[];
307
- }
308
- export interface RoutineLibrary {
309
- sections: RoutineLibrarySection[];
548
+ email?: string;
549
+ full_name: string | null;
310
550
  }
311
551
  export interface WeeklyWorkoutDuration {
312
552
  week_start_date: string;
@@ -318,6 +558,10 @@ export interface RoutineMetadata {
318
558
  short_id: string;
319
559
  title: string;
320
560
  }
561
+ export type PreviewMutualUser = {
562
+ username: string;
563
+ profile_pic: string | null;
564
+ };
321
565
  export interface UserProfile {
322
566
  username: string;
323
567
  verified: boolean;
@@ -328,12 +572,14 @@ export interface UserProfile {
328
572
  website_link?: string;
329
573
  workout_count: number;
330
574
  following_status: FollowingStatus;
575
+ is_followed_by_requester: boolean;
331
576
  private_profile: boolean;
332
577
  is_blocked: boolean;
333
578
  follower_count: number;
334
579
  following_count: number;
335
580
  routines: RoutineMetadata[];
336
581
  weekly_workout_durations: WeeklyWorkoutDuration[];
582
+ mutual_followers: PreviewMutualUser[];
337
583
  }
338
584
  export interface PublicUserProfile {
339
585
  private_profile: boolean;
@@ -350,36 +596,96 @@ export interface PublicUserProfile {
350
596
  weekly_workout_durations: WeeklyWorkoutDuration[];
351
597
  last_workout?: Workout;
352
598
  }
353
- export type MuscleGroup = 'abdominals' | 'cardio' | 'shoulders' | 'chest' | 'lower_back' | 'full_body' | 'biceps' | 'triceps' | 'upper_back' | 'quadriceps' | 'calves' | 'lats' | 'hamstrings' | 'glutes' | 'abductors' | 'adductors' | 'traps' | 'forearms' | 'neck' | 'other';
354
- export declare const muscleGroups: MuscleGroup[];
599
+ export declare const coreMuscles: readonly ["abdominals"];
600
+ export declare const shoulderMuscles: readonly ["shoulders"];
601
+ export declare const armMuscles: readonly ["biceps", "triceps", "forearms"];
602
+ export declare const legMuscles: readonly ["quadriceps", "hamstrings", "calves", "glutes", "abductors", "adductors"];
603
+ export declare const backMuscles: readonly ["lats", "upper_back", "traps", "lower_back"];
604
+ export declare const chestMuscles: readonly ["chest"];
605
+ export declare const miscellaneousMuscles: readonly ["cardio", "neck", "full_body", "other"];
606
+ export declare const simplifiedMuscleGroups: readonly ["core", "shoulders", "arms", "legs", "back", "chest"];
607
+ export type SimplifiedMuscleGroup = Lookup<typeof simplifiedMuscleGroups>;
608
+ export declare const isSimplifiedMuscleGroup: (x: string) => x is SimplifiedMuscleGroup;
609
+ export declare const muscleGroups: readonly ["abdominals", "shoulders", "biceps", "triceps", "forearms", "quadriceps", "hamstrings", "calves", "glutes", "abductors", "adductors", "lats", "upper_back", "traps", "lower_back", "chest", "cardio", "neck", "full_body", "other"];
610
+ export type MuscleGroup = Lookup<typeof muscleGroups>;
355
611
  export declare const isMuscleGroup: (x: string) => x is MuscleGroup;
356
- export declare const muscleGroupFilters: MuscleGroupFilter[];
612
+ export declare const muscleGroupFilters: readonly ["all_muscles", "abdominals", "shoulders", "biceps", "triceps", "forearms", "quadriceps", "hamstrings", "calves", "glutes", "abductors", "adductors", "lats", "upper_back", "traps", "lower_back", "chest", "cardio", "neck", "full_body", "other"];
613
+ export type MuscleGroupFilter = Lookup<typeof muscleGroupFilters>;
357
614
  export declare const isMuscleGroupFilter: (x: string) => x is MuscleGroupFilter;
358
- export type MuscleGroupFilter = MuscleGroup | 'all_muscles';
615
+ export declare const simplifiedMuscleGroupToMuscleGroups: Record<SimplifiedMuscleGroup, readonly MuscleGroup[]>;
359
616
  /**
360
617
  * Equipment
361
618
  */
362
- export type Equipment = 'none' | 'machine' | 'kettlebell' | 'barbell' | 'dumbbell' | 'resistance_band' | 'suspension' | 'plate' | 'other';
363
- export declare const equipments: Equipment[];
364
- export type EquipmentFilter = Equipment | 'all_equipment';
365
- export declare const equipmentFilters: EquipmentFilter[];
619
+ export declare const equipments: readonly ["none", "barbell", "dumbbell", "kettlebell", "machine", "plate", "resistance_band", "suspension", "other"];
620
+ export type Equipment = Lookup<typeof equipments>;
366
621
  export declare const isEquipment: (x: string) => x is Equipment;
622
+ export declare const equipmentFilters: readonly ["all_equipment", "none", "barbell", "dumbbell", "kettlebell", "machine", "plate", "resistance_band", "suspension", "other"];
623
+ export type EquipmentFilter = Lookup<typeof equipmentFilters>;
367
624
  export declare const isEquipmentFilter: (x: string) => x is EquipmentFilter;
625
+ export declare const exerciseRepTypes: readonly ["weight_reps", "reps_only", "bodyweight_reps", "bodyweight_assisted_reps"];
368
626
  /**
369
- * ExerciseType
627
+ * ExerciseRepType
370
628
  *
371
629
  * weight_reps = Bench Press
372
630
  * bodyweight_reps = Pull ups (Weighted)
373
631
  * bodyweight_assisted_reps = Pull Ups (Assisted)
374
632
  * reps_only = Pull ups
375
633
  */
376
- export type ExerciseRepType = 'weight_reps' | 'bodyweight_reps' | 'bodyweight_assisted_reps' | 'reps_only';
377
- export type ExerciseType = 'distance_duration' | 'duration' | 'short_distance_weight' | ExerciseRepType;
378
- export declare const exerciseTypes: ExerciseType[];
634
+ export type ExerciseRepType = Lookup<typeof exerciseRepTypes>;
635
+ export declare const isExerciseRepType: (x: any) => x is ExerciseRepType;
636
+ export declare const exerciseTypes: readonly ["weight_reps", "reps_only", "bodyweight_reps", "bodyweight_assisted_reps", "duration", "weight_duration", "distance_duration", "short_distance_weight", "floors_duration", "steps_duration"];
637
+ export type ExerciseType = Lookup<typeof exerciseTypes>;
379
638
  export declare const isExerciseType: (x: any) => x is ExerciseType;
380
- export interface ExerciseTemplate {
639
+ export type CustomExerciseType = Exclude<ExerciseType, 'floors_duration' | 'steps_duration'>;
640
+ export declare const customExericseTypes: CustomExerciseType[];
641
+ export declare const isCustomExerciseType: (x: any) => x is CustomExerciseType;
642
+ export declare const trainingGoals: readonly ["strength", "build_muscle", "fat_loss"];
643
+ export declare const trainingLevels: readonly ["beginner", "intermediate", "advanced"];
644
+ export declare const exerciseCategories: readonly ["isolation", "compound", "assistance-compound"];
645
+ export declare const restTimerLengths: readonly ["short", "medium", "long"];
646
+ export type TrainingGoal = Lookup<typeof trainingGoals>;
647
+ export type TrainingLevel = Lookup<typeof trainingLevels>;
648
+ export type ExerciseCategory = Lookup<typeof exerciseCategories>;
649
+ export type RestTimerLength = typeof restTimerLengths[number];
650
+ export type HevyTrainerProgramEquipment = Extract<Equipment, 'barbell' | 'dumbbell' | 'machine'>;
651
+ export declare const hevyTrainerProgramEquipments: readonly ["barbell", "dumbbell", "machine"];
652
+ export declare const granularEquipments: readonly ["barbell", "dumbbell", "kettlebell", "plate", "medicine_ball", "ez_bar", "landmine", "trap_bar", "pullup_bar", "dip_bar", "squat_rack", "flat_bench", "adjustable_bench", "dual_cable_machine", "single_cable_machine", "lat_pulldown_cable", "leg_press_machine", "smith_machine", "t_bar", "plate_machines", "stack_machines", "treadmill", "elliptical_trainer", "rowing_machine", "spinning", "stair_machine", "air_bike", "suspension_band", "resistance_band", "battle_rope", "rings", "jump_rope"];
653
+ export type GranularEquipment = Lookup<typeof granularEquipments>;
654
+ export declare const isGranularEquipment: (x: string) => x is GranularEquipment;
655
+ export declare const weeklyTrainingFrequencies: readonly [1, 2, 3, 4, 5, 6];
656
+ export type WeeklyTrainingFrequency = Lookup<typeof weeklyTrainingFrequencies>;
657
+ /**
658
+ * Base properties that all exercise templates must have
659
+ */
660
+ export interface BaseExerciseTemplate {
381
661
  id: string;
382
662
  title: string;
663
+ exercise_type: ExerciseType;
664
+ muscle_group: MuscleGroup;
665
+ other_muscles: MuscleGroup[];
666
+ equipment_category: Equipment;
667
+ is_archived: boolean;
668
+ is_custom: boolean;
669
+ priority: number;
670
+ volume_doubling_supported?: boolean;
671
+ /** Exercise asset URL */
672
+ url?: string;
673
+ thumbnail_url?: string;
674
+ media_type?: 'video' | 'image';
675
+ }
676
+ /**
677
+ * Library exercises are predefined exercises that come with the app
678
+ * They are stored on the database and downloaded to the client
679
+ * They have additional properties like translations, leaderboard eligibility, etc.
680
+ */
681
+ export interface LibraryExercise extends BaseExerciseTemplate {
682
+ is_custom: false;
683
+ aka?: string;
684
+ manual_tag?: string;
685
+ comparable_exercise?: boolean;
686
+ leaderboard_exercise?: boolean;
687
+ hundred_percent_bodyweight_exercise?: boolean;
688
+ strength_level_exercise?: boolean;
383
689
  es_title?: string;
384
690
  de_title?: string;
385
691
  fr_title?: string;
@@ -391,37 +697,47 @@ export interface ExerciseTemplate {
391
697
  ru_title?: string;
392
698
  zh_cn_title?: string;
393
699
  zh_tw_title?: string;
394
- priority: number;
395
- muscle_group: MuscleGroup;
396
- other_muscles: MuscleGroup[];
397
- exercise_type: ExerciseType;
398
- equipment_category: Equipment;
399
- url?: string;
400
- media_type?: string;
700
+ localised_instructions?: {
701
+ [language in InstructionsLanguage]?: string;
702
+ };
703
+ goal: TrainingGoal[] | undefined;
704
+ level: TrainingLevel[] | undefined;
705
+ category: ExerciseCategory | undefined;
706
+ granular_equipments: GranularEquipment[] | undefined;
707
+ url_female?: string;
708
+ thumbnail_url_female?: string;
709
+ }
710
+ /**
711
+ * Custom exercises are user-created templates with minimal properties
712
+ */
713
+ export interface CustomExercise extends BaseExerciseTemplate {
714
+ is_custom: true;
715
+ exercise_type: CustomExerciseType;
716
+ priority: 10;
717
+ /** @deprecated 2.2.2 */
401
718
  custom_exercise_image_url?: string;
402
- /** @deprecated 1.22.5 */
403
- custom_exercise_image_thumbnail_url?: string;
404
- thumbnail_url?: string;
405
- thumbnail?: number;
406
- manual_tag?: string;
407
- aka?: string;
408
- instructions?: string;
409
- is_custom: boolean;
410
- is_archived: boolean;
719
+ media?: CustomExerciseMedia;
411
720
  /** Used for Hevy Coach: in Hevy Coach, changes to a parent template propagate to children, and clients can't edit the children */
412
721
  parent_exercise_template_id?: string;
413
722
  }
414
- /** Workouts */
415
- export type SetPersonalRecordType = 'best_weight' | 'best_reps' | 'best_volume' | 'best_1rm' | 'best_duration' | 'best_distance';
723
+ declare const _setPersonalRecordTypes: readonly ["best_weight", "best_reps", "best_volume", "best_1rm", "best_duration", "best_distance", "most_floors", "most_steps"];
724
+ export type SetPersonalRecordType = Lookup<typeof _setPersonalRecordTypes>;
725
+ export declare const isSetPersonalRecordType: (x: string) => x is SetPersonalRecordType;
416
726
  export interface SetPersonalRecord {
417
727
  exercise_template_id: string;
418
728
  type: SetPersonalRecordType;
419
729
  record: number;
420
730
  }
421
- export type RPE = 6 | 7 | 7.5 | 8 | 8.5 | 9 | 9.5 | 10;
731
+ export declare const validRpeValues: readonly [6, 7, 7.5, 8, 8.5, 9, 9.5, 10];
732
+ export type RPE = Lookup<typeof validRpeValues>;
422
733
  export declare const isRPE: (x: number) => x is RPE;
423
- export declare const validRpeValues: RPE[];
424
- export type SetType = 'warmup' | 'normal' | 'failure' | 'dropset';
734
+ declare const _setTypes: readonly ["warmup", "normal", "failure", "dropset"];
735
+ export type SetType = Lookup<typeof _setTypes>;
736
+ export declare const isSetType: (x: string) => x is SetType;
737
+ export interface RepRange {
738
+ start: number | null;
739
+ end: number | null;
740
+ }
425
741
  export interface WorkoutExerciseSet {
426
742
  /**
427
743
  * id can be a string or a number because we used
@@ -436,6 +752,7 @@ export interface WorkoutExerciseSet {
436
752
  reps?: number | null;
437
753
  distance_meters?: number | null;
438
754
  duration_seconds?: number | null;
755
+ custom_metric?: number | null;
439
756
  rpe?: RPE | null;
440
757
  /**
441
758
  * @deprecated 1.29.17 -
@@ -451,6 +768,7 @@ export interface WorkoutExerciseSet {
451
768
  type: SetPersonalRecordType;
452
769
  value: number;
453
770
  }[];
771
+ completed_at: string | null;
454
772
  }
455
773
  export interface WorkoutExercise {
456
774
  id: string;
@@ -478,20 +796,29 @@ export interface WorkoutExercise {
478
796
  url?: string;
479
797
  media_type?: string;
480
798
  custom_exercise_image_url?: string | null;
481
- /** @deprecated 1.22.5 */
482
- custom_exercise_image_thumbnail_url?: string | null;
483
799
  thumbnail_url?: string | null;
484
800
  manual_tag?: string;
485
801
  aka?: string;
802
+ /**
803
+ * for exercises with two dumbbells
804
+ *
805
+ * `true` if the weight of each set is the weight of _one_ dumbbell, but the
806
+ * exercise was performed with _two_ dumbbells of that weight
807
+ */
808
+ volume_doubling_enabled: boolean;
486
809
  sets: WorkoutExerciseSet[];
487
810
  }
488
811
  export interface WorkoutComment {
489
812
  id: number;
490
813
  username: string;
491
814
  verified: boolean;
815
+ full_name?: string;
492
816
  profile_pic?: string;
493
817
  comment: string;
494
818
  created_at: string;
819
+ like_count: number;
820
+ is_liked_by_user: boolean;
821
+ parent_comment_id?: number;
495
822
  }
496
823
  export interface WorkoutImage {
497
824
  type: 'image';
@@ -503,6 +830,10 @@ export interface WorkoutVideo {
503
830
  thumbnail_url: string;
504
831
  }
505
832
  export type WorkoutMedia = WorkoutImage | WorkoutVideo;
833
+ export type PreviewWorkoutLike = {
834
+ username: string;
835
+ profile_pic: string;
836
+ };
506
837
  export interface Workout {
507
838
  id: string;
508
839
  short_id: string | null;
@@ -510,7 +841,9 @@ export interface Workout {
510
841
  name: string;
511
842
  description?: string;
512
843
  like_count: number;
844
+ /** @deprecated 2.3.4 */
513
845
  like_images: string[];
846
+ preview_workout_likes: PreviewWorkoutLike[];
514
847
  comment_count: number;
515
848
  comments: WorkoutComment[];
516
849
  /** @deprecated 1.28.13 */
@@ -525,6 +858,7 @@ export interface Workout {
525
858
  exercises: WorkoutExercise[];
526
859
  routine_id?: string;
527
860
  apple_watch: boolean;
861
+ wearos_watch: boolean;
528
862
  verified: boolean;
529
863
  created_at: string;
530
864
  updated_at: string;
@@ -534,8 +868,30 @@ export interface Workout {
534
868
  * why we added estimated_volume_kg
535
869
  */
536
870
  estimated_volume_kg: number;
871
+ /**
872
+ * Whether to include warmup sets in various calculations.
873
+ * https://github.com/hevyapp/hevy-shared/pull/312
874
+ */
875
+ include_warmup_sets: boolean;
537
876
  is_private: boolean;
877
+ /**
878
+ * If applicable, the user ID of the coach who logged this workout
879
+ */
880
+ logged_by_coach_id?: string;
881
+ biometrics?: WorkoutBiometrics;
882
+ is_biometrics_public: boolean;
883
+ trainer_program_id: string | undefined;
538
884
  }
885
+ export interface CustomExerciseImage {
886
+ type: 'image';
887
+ image_url: string;
888
+ }
889
+ export interface CustomExerciseVideo {
890
+ type: 'video';
891
+ video_url: string;
892
+ video_preview_image_url: string;
893
+ }
894
+ export type CustomExerciseMedia = CustomExerciseImage | CustomExerciseVideo;
539
895
  export declare const isPublicWorkout: (x: any) => x is PublicWorkout;
540
896
  export interface PublicWorkout {
541
897
  type: 'public';
@@ -562,68 +918,109 @@ export interface WorkoutSync {
562
918
  updated: Workout[];
563
919
  deleted: string[];
564
920
  isMore: boolean;
921
+ updated_at?: string;
565
922
  }
566
923
  export interface PostWorkoutRequest {
567
924
  workout: PostWorkoutRequestWorkout;
568
- source?: string;
569
- isEventLoggedByAppleWatch?: boolean;
570
- emptyResponse: boolean;
925
+ /**
926
+ * `source` is set by import-workout-data (currently only supports imports from Strong)
927
+ * and for workouts that come from the public API.
928
+ * This prop gives us visibility into workouts that aren't logged within Hevy. Currently,
929
+ * it's used to filter the feed so users aren't spammed by workouts created programmatically.
930
+ */
931
+ source?: 'strong' | 'public-api';
932
+ share_to_strava?: boolean;
933
+ /**
934
+ * Fake UTC format (ISO string of user's _local_ time, but with 'Z' as the
935
+ * time zone), since that is what Strava expects. 🤦‍♂️
936
+ * https://developers.strava.com/docs/reference/#api-Activities-createActivity
937
+ */
938
+ strava_activity_local_time?: string;
939
+ }
940
+ export interface PostClientsWorkoutRequest {
941
+ workout: PostWorkoutRequestWorkout;
571
942
  updateRoutineValues: boolean;
572
- /** @deprecated 1.22.6 */
573
- updateRoutineOptions?: {
574
- updateValuesDumb: boolean;
575
- };
576
943
  }
577
944
  /**
578
945
  * PostWorkoutRequestWorkout describes the final state of a completed workout.
579
946
  * It's used when sending a workout to the server.
580
947
  */
581
948
  export interface PostWorkoutRequestWorkout {
582
- name: string;
949
+ title: string;
583
950
  description: string;
584
- /** @deprecated 1.28.13 */
585
- imageUrls?: string[];
586
951
  media: WorkoutMedia[];
587
- startTime: number;
588
- endTime: number;
952
+ start_time: number;
953
+ end_time: number;
589
954
  exercises: PostWorkoutRequestExercise[];
590
- routineId?: string;
591
- trackWorkoutAsRoutine: boolean;
592
- updateRoutineFromWorkout?: boolean;
593
- appleWatch: boolean;
594
- clientId: string;
595
- isPrivate?: boolean;
955
+ routine_id?: string;
956
+ apple_watch: boolean;
957
+ wearos_watch: boolean;
958
+ workout_id: string;
959
+ is_private: boolean;
960
+ biometrics?: WorkoutBiometrics;
961
+ is_biometrics_public: boolean;
962
+ trainer_program_id: string | undefined;
596
963
  }
597
- export interface PostWorkoutRequestSet {
598
- index: number;
599
- indicator: SetType;
600
- weight?: number | null;
601
- reps?: number | null;
602
- distance?: number | null;
603
- duration?: number | null;
604
- rpe?: RPE | null;
964
+ export declare const isHeartRateSamples: (x: any) => x is HeartRateSample[];
965
+ export declare const isWorkoutBiometrics: (x: any) => x is WorkoutBiometrics;
966
+ export interface WorkoutBiometrics {
967
+ total_calories?: number;
968
+ heart_rate_samples?: HeartRateSample[];
969
+ average_heart_rate?: number;
970
+ }
971
+ export interface HeartRateSample {
972
+ timestamp_ms: number;
973
+ bpm: number;
605
974
  }
606
975
  export interface PostWorkoutRequestExercise {
607
976
  title: string;
608
- /** poorly named exercise template id */
609
- id: string;
610
- supersetId?: number;
611
- autoRestTimerSeconds?: number;
977
+ exercise_template_id: string;
978
+ superset_id?: number;
979
+ rest_timer_seconds?: number;
612
980
  notes: string;
981
+ /**
982
+ * for exercises with two dumbbells
983
+ *
984
+ * `true` if the weight of each set is the weight of _one_ dumbbell, but the
985
+ * exercise was performed with _two_ dumbbells of that weight
986
+ */
987
+ volume_doubling_enabled?: boolean;
613
988
  sets: PostWorkoutRequestSet[];
614
989
  }
990
+ export interface PostWorkoutRequestSet {
991
+ index: number;
992
+ type: SetType;
993
+ weight_kg?: number;
994
+ reps?: number;
995
+ distance_meters?: number;
996
+ duration_seconds?: number;
997
+ custom_metric?: number;
998
+ rpe?: RPE;
999
+ completed_at?: string;
1000
+ }
1001
+ /**
1002
+ * Used to update an existing workout. Props that are defined will be used to
1003
+ * update the corresponding values of the workout in the database, and those
1004
+ * that are undefined will not be changed.
1005
+ */
1006
+ export type UpdateWorkoutRequestWorkout = Partial<Pick<PostWorkoutRequestWorkout, 'title' | 'description' | 'media' | 'exercises' | 'is_private' | 'is_biometrics_public'>> & {
1007
+ start_and_end_time?: Required<Pick<PostWorkoutRequestWorkout, 'start_time' | 'end_time'>>;
1008
+ };
615
1009
  /** Routines */
616
1010
  export interface RoutineSet {
617
- id: number;
618
1011
  index: number;
619
1012
  indicator: SetType;
620
1013
  weight_kg?: number | null;
621
1014
  reps?: number | null;
622
1015
  distance_meters?: number | null;
623
1016
  duration_seconds?: number | null;
1017
+ custom_metric?: number | null;
1018
+ rpe?: RPE | null;
1019
+ rep_range?: RepRange;
624
1020
  }
625
1021
  export interface RoutineExercise {
626
1022
  id: string;
1023
+ /** This is the username of the exercise_template */
627
1024
  username: string;
628
1025
  exercise_template_id: string;
629
1026
  warmup_set_count: number;
@@ -649,14 +1046,12 @@ export interface RoutineExercise {
649
1046
  url?: string | null;
650
1047
  custom_exercise_image_url?: string | null;
651
1048
  parent_exercise_template_id?: string | null;
652
- /** @deprecated 1.22.5 */
653
- custom_exercise_image_thumbnail_url?: string | null;
654
1049
  thumbnail_url?: string | null;
655
1050
  media_type?: string;
656
1051
  superset_id: number | null;
657
1052
  rest_seconds: number | null;
1053
+ input_modifier?: 'rep-range';
658
1054
  }
659
- export type ShallowRoutineExercise = Omit<RoutineExercise, 'sets'>;
660
1055
  export interface BaseRoutine {
661
1056
  id: string;
662
1057
  short_id: string;
@@ -671,15 +1066,26 @@ export interface BaseRoutine {
671
1066
  program_id: string | null;
672
1067
  coach_id: string | null;
673
1068
  notes: string | null;
1069
+ coach_force_rpe_enabled: boolean;
1070
+ hevy_trainer_program_id: string | null;
1071
+ created_at: string;
674
1072
  }
675
1073
  export interface Routine extends BaseRoutine {
676
1074
  username: string;
1075
+ coach_id: null;
677
1076
  }
678
- export interface RoutineWithShallowExercises extends Omit<BaseRoutine, 'exercises'> {
679
- exercises: ShallowRoutineExercise[];
1077
+ export interface HevyTrainerRoutine extends Routine {
1078
+ hevy_trainer_program_id: string;
1079
+ program_id: null;
1080
+ coach_force_rpe_enabled: false;
1081
+ folder_id: null;
680
1082
  }
1083
+ export declare const isHevyTrainerRoutine: (routine: BaseRoutine) => routine is HevyTrainerRoutine;
1084
+ export type CoachsShallowLibraryRoutine = Omit<BaseRoutine, 'exercises' | 'profile_pic' | 'hevy_trainer_program_id' | 'username'>;
681
1085
  export interface CoachesRoutine extends BaseRoutine {
682
1086
  coach_id: string;
1087
+ username: null;
1088
+ hevy_trainer_program_id: null;
683
1089
  }
684
1090
  export interface CoachAndCoachsClientsRoutineSyncResponse {
685
1091
  updated: BaseRoutine[];
@@ -692,6 +1098,7 @@ export interface RoutineSync {
692
1098
  updated: Routine[];
693
1099
  deleted: string[];
694
1100
  isMore: boolean;
1101
+ updated_at?: string;
695
1102
  }
696
1103
  export interface RoutineUpdate {
697
1104
  title: string;
@@ -701,6 +1108,7 @@ export interface RoutineUpdate {
701
1108
  index: number;
702
1109
  program_id: string | null;
703
1110
  notes: string | null;
1111
+ coach_force_rpe_enabled?: boolean;
704
1112
  }
705
1113
  export interface PostRoutineRequest extends RoutineUpdate {
706
1114
  clientId: string;
@@ -711,6 +1119,7 @@ export interface RoutineUpdateExercise {
711
1119
  rest_seconds?: number | null;
712
1120
  sets: RoutineUpdateSet[];
713
1121
  notes?: string | null;
1122
+ input_modifier?: 'rep-range';
714
1123
  }
715
1124
  export interface RoutineUpdateSet {
716
1125
  index: number;
@@ -719,6 +1128,9 @@ export interface RoutineUpdateSet {
719
1128
  reps?: number | null;
720
1129
  distance_meters?: number | null;
721
1130
  duration_seconds?: number | null;
1131
+ custom_metric?: number | null;
1132
+ rpe?: RPE | null;
1133
+ rep_range?: RepRange;
722
1134
  }
723
1135
  export interface RoutineFolderLocationUpdate {
724
1136
  folderId: number;
@@ -736,6 +1148,13 @@ export interface RoutineFolder {
736
1148
  created_at: string;
737
1149
  updated_at: string;
738
1150
  }
1151
+ export interface ShareableRoutineFolder {
1152
+ id: number;
1153
+ title: string;
1154
+ username: string;
1155
+ profile_pic?: string;
1156
+ routines: Routine[];
1157
+ }
739
1158
  export interface Program {
740
1159
  id: string;
741
1160
  title: string;
@@ -745,12 +1164,26 @@ export interface Program {
745
1164
  template_program_id: string | null;
746
1165
  folder_id: number | null;
747
1166
  index: number | null;
1167
+ notes: string | null;
1168
+ duration_days: number | null;
1169
+ start_date: string | null;
748
1170
  }
749
1171
  export interface ProgramUpdate {
750
1172
  title: string;
751
1173
  template_program_id: string | null;
752
1174
  client_id: string | null;
753
1175
  folder_id: number | null;
1176
+ notes: string | null;
1177
+ duration_days: number | null;
1178
+ start_date: string | null;
1179
+ }
1180
+ export interface PostAssignProgramRequest {
1181
+ title: string;
1182
+ notes: string | null;
1183
+ duration_days: number | null;
1184
+ start_date: string | null;
1185
+ template_program_id: string;
1186
+ client_ids: string[];
754
1187
  }
755
1188
  export interface ProgramLocationUpdate {
756
1189
  index: number;
@@ -762,6 +1195,7 @@ export interface ProgramFolder {
762
1195
  id: number;
763
1196
  index: number;
764
1197
  title: string;
1198
+ coach_id: string;
765
1199
  }
766
1200
  export interface ProgramFolderLocationUpdate {
767
1201
  index: number;
@@ -777,77 +1211,263 @@ export interface GetInviteResponse {
777
1211
  coach_username: string;
778
1212
  coach_profile_pic?: string;
779
1213
  invitee_email: string;
1214
+ invitee_username?: string;
780
1215
  }
781
1216
  export interface CoachClientInvite {
782
1217
  client_id: string | null;
783
1218
  coach_id: string;
784
1219
  created_at: Date;
785
1220
  invitee_email: string;
1221
+ invitee_username: string | null;
1222
+ invitee_profile_pic: string | null;
1223
+ invitee_full_name: string | null;
786
1224
  short_id: string;
787
1225
  declined_at: Date | null;
788
1226
  }
789
1227
  export interface OutstandingInvitesForCoachResponse {
790
1228
  invites: CoachClientInvite[];
791
1229
  }
792
- export interface BodyMeasurement {
793
- id: number;
794
- date: string;
795
- weight_kg?: number;
796
- fat_percent?: number;
797
- neck_cm?: number;
798
- shoulder_cm?: number;
799
- chest_cm?: number;
800
- left_bicep_cm?: number;
801
- right_bicep_cm?: number;
802
- left_forearm_cm?: number;
803
- right_forearm_cm?: number;
804
- abdomen?: number;
805
- waist?: number;
806
- hips?: number;
807
- left_thigh?: number;
808
- right_thigh?: number;
809
- left_calf?: number;
810
- right_calf?: number;
811
- }
812
- export interface CustomExercise {
1230
+ export interface CoachTeamInvite {
1231
+ invitee_user_id: string | null;
1232
+ inviter_user_id: string;
1233
+ created_at: Date;
1234
+ invitee_email: string;
1235
+ invitee_username: string | null;
1236
+ invitee_profile_pic: string | null;
1237
+ invitee_full_name: string | null;
1238
+ invitee_role: CoachRole;
1239
+ short_id: string;
1240
+ declined_at: Date | null;
1241
+ }
1242
+ export interface GetTeamInviteResponse {
1243
+ invitee_email: string;
1244
+ invitee_username?: string;
1245
+ team_title: string;
1246
+ team_image_url?: string;
1247
+ }
1248
+ export interface OutstandingInvitesForCoachTeamResponse {
1249
+ invites: CoachTeamInvite[];
1250
+ }
1251
+ export interface TrainerWorkoutTemplateExercise {
1252
+ id: string;
1253
+ exercise_template_id: string;
1254
+ index: number;
1255
+ set_count: number;
1256
+ warmup_set_count: number;
1257
+ rep_range: RepRange;
1258
+ rest_seconds: number;
1259
+ }
1260
+ export interface TrainerWorkoutTemplate {
1261
+ id: string;
1262
+ hevy_trainer_program_id: string;
1263
+ index: number;
1264
+ routine_name: HevyTrainerRoutineName;
1265
+ exercises: TrainerWorkoutTemplateExercise[];
1266
+ }
1267
+ export interface TrainerProgramV3 {
1268
+ id: string;
1269
+ schema_version: 'v3';
1270
+ created_at: string;
1271
+ updated_at: string;
1272
+ level: TrainingLevel;
1273
+ goal: TrainingGoal;
1274
+ equipments: GranularEquipment[];
1275
+ weekly_frequency: WeeklyTrainingFrequency;
1276
+ templates: TrainerWorkoutTemplate[];
1277
+ focus_muscle?: SimplifiedMuscleGroup;
1278
+ next_workout_index: number;
1279
+ workout_duration_minutes: WorkoutDurationMinutes;
1280
+ rest_timer_length: RestTimerLength;
1281
+ }
1282
+ export interface PostTrainerProgramV3RequestBody {
1283
+ program: {
1284
+ level: TrainingLevel;
1285
+ goal: TrainingGoal;
1286
+ equipments: GranularEquipment[];
1287
+ weekly_frequency: WeeklyTrainingFrequency;
1288
+ focus_muscle?: SimplifiedMuscleGroup;
1289
+ next_workout_index?: number;
1290
+ workout_duration_minutes: WorkoutDurationMinutes;
1291
+ rest_timer_length: RestTimerLength;
1292
+ templates: {
1293
+ index: number;
1294
+ routine_name: HevyTrainerRoutineName;
1295
+ exercises: {
1296
+ exercise_template_id: string;
1297
+ index: number;
1298
+ set_count: number;
1299
+ warmup_set_count: number;
1300
+ rep_range?: RepRange;
1301
+ rest_seconds: number;
1302
+ }[];
1303
+ }[];
1304
+ };
1305
+ }
1306
+ export interface UpdateTrainerProgramV3RequestBody {
1307
+ program: {
1308
+ programId: string;
1309
+ level: TrainingLevel;
1310
+ goal: TrainingGoal;
1311
+ equipments: GranularEquipment[];
1312
+ weekly_frequency: WeeklyTrainingFrequency;
1313
+ focus_muscle?: SimplifiedMuscleGroup;
1314
+ next_workout_index?: number;
1315
+ workout_duration_minutes: WorkoutDurationMinutes;
1316
+ rest_timer_length: RestTimerLength;
1317
+ templates: {
1318
+ id: string;
1319
+ index: number;
1320
+ routine_name: HevyTrainerRoutineName;
1321
+ exercises: {
1322
+ exercise_template_id: string;
1323
+ index: number;
1324
+ set_count: number;
1325
+ warmup_set_count: number;
1326
+ rep_range?: RepRange;
1327
+ rest_seconds: number;
1328
+ }[];
1329
+ }[];
1330
+ };
1331
+ }
1332
+ export interface HevyTrainerProgram {
813
1333
  id: string;
1334
+ created_at: string;
1335
+ updated_at: string;
814
1336
  title: string;
815
- muscle_group: MuscleGroup;
816
- other_muscles?: MuscleGroup[];
817
- exercise_type: ExerciseType;
818
- equipment_category: Equipment;
819
- custom_exercise_image_url?: string;
820
- /** @deprecated 1.22.5 */
821
- custom_exercise_image_thumbnail_url?: string;
822
- thumbnail_url?: string;
1337
+ level: TrainingLevel;
1338
+ goal: TrainingGoal;
1339
+ equipments: GranularEquipment[];
1340
+ weekly_frequency: WeeklyTrainingFrequency;
1341
+ routines: HevyTrainerRoutine[];
1342
+ focus_muscle?: SimplifiedMuscleGroup;
1343
+ next_workout_index: number;
1344
+ workout_duration_minutes?: WorkoutDurationMinutes;
1345
+ rest_timer_length: RestTimerLength;
1346
+ }
1347
+ export interface PostHevyTrainerProgramRequestBody {
1348
+ program: {
1349
+ title: string;
1350
+ level: TrainingLevel;
1351
+ goal: TrainingGoal;
1352
+ equipments: GranularEquipment[];
1353
+ weekly_frequency: WeeklyTrainingFrequency;
1354
+ focus_muscle?: SimplifiedMuscleGroup;
1355
+ routines: RoutineUpdate[];
1356
+ next_workout_index?: number;
1357
+ workout_duration_minutes?: WorkoutDurationMinutes;
1358
+ rest_timer_length: RestTimerLength;
1359
+ };
1360
+ }
1361
+ export interface UpdateHevyTrainerProgramRequestBody {
1362
+ program: {
1363
+ programId: string;
1364
+ title: string;
1365
+ level: TrainingLevel;
1366
+ goal: TrainingGoal;
1367
+ equipments: GranularEquipment[];
1368
+ weekly_frequency: WeeklyTrainingFrequency;
1369
+ focus_muscle?: SimplifiedMuscleGroup;
1370
+ next_workout_index?: number;
1371
+ workout_duration_minutes?: WorkoutDurationMinutes;
1372
+ rest_timer_length?: RestTimerLength;
1373
+ routines: {
1374
+ id: string;
1375
+ title: string;
1376
+ notes: string | null;
1377
+ exercises: RoutineUpdateExercise[];
1378
+ }[];
1379
+ };
1380
+ }
1381
+ /** @deprecated Use HevyTrainerProgram instead */
1382
+ export interface HevyTrainerProgramOld {
1383
+ id: string;
823
1384
  created_at: string;
824
- is_archived: boolean;
825
- /** Used for Hevy Coach: in Hevy Coach, changes to a parent template propagate to children, and clients can't edit the children */
826
- parent_exercise_template_id?: string;
827
- coach_id?: string;
1385
+ updated_at: string;
1386
+ title: string;
1387
+ level: TrainingLevel;
1388
+ goal: TrainingGoal;
1389
+ equipments: HevyTrainerProgramEquipment[];
1390
+ weekly_frequency: WeeklyTrainingFrequency;
1391
+ routines: HevyTrainerRoutine[];
1392
+ focus_muscle?: SimplifiedMuscleGroup;
1393
+ next_workout_index: number;
1394
+ workout_duration_minutes?: WorkoutDurationMinutes;
1395
+ }
1396
+ /** @deprecated Use PostHevyTrainerProgramRequestBody instead */
1397
+ export interface PostHevyTrainerProgramOldRequestBody {
1398
+ program: {
1399
+ title: string;
1400
+ level: TrainingLevel;
1401
+ goal: TrainingGoal;
1402
+ equipments: HevyTrainerProgramEquipment[];
1403
+ weekly_frequency: WeeklyTrainingFrequency;
1404
+ focus_muscle?: SimplifiedMuscleGroup;
1405
+ routines: RoutineUpdate[];
1406
+ next_workout_index?: number;
1407
+ workout_duration_minutes?: WorkoutDurationMinutes;
1408
+ };
1409
+ }
1410
+ /** @deprecated Use UpdateHevyTrainerProgramRequestBody instead */
1411
+ export interface UpdateHevyTrainerProgramOldRequestBody {
1412
+ program: {
1413
+ programId: string;
1414
+ title: string;
1415
+ level: TrainingLevel;
1416
+ goal: TrainingGoal;
1417
+ equipments: HevyTrainerProgramEquipment[];
1418
+ weekly_frequency: WeeklyTrainingFrequency;
1419
+ focus_muscle?: SimplifiedMuscleGroup;
1420
+ next_workout_index?: number;
1421
+ workout_duration_minutes?: WorkoutDurationMinutes;
1422
+ routines: {
1423
+ id: string;
1424
+ title: string;
1425
+ notes: string | null;
1426
+ exercises: RoutineUpdateExercise[];
1427
+ }[];
1428
+ };
1429
+ }
1430
+ export declare const measurementsList: readonly ["weight_kg", "lean_mass_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"];
1431
+ type MeasurementProperties = {
1432
+ [key in typeof measurementsList[number]]?: number;
1433
+ };
1434
+ export type BodyMeasurementKey = Lookup<typeof measurementsList>;
1435
+ export declare const isBodyMeasurementKey: (key: string) => key is BodyMeasurementKey;
1436
+ export interface BodyMeasurement extends MeasurementProperties {
1437
+ id: number;
1438
+ date: string;
1439
+ created_at: string;
1440
+ picture_url?: string;
828
1441
  }
1442
+ export type PostBodyMeasurementRequest = Omit<BodyMeasurement, 'id' | 'created_at'>;
829
1443
  export interface CreateCustomExerciseRequest {
830
1444
  title: string;
831
1445
  muscle_group: MuscleGroup;
832
1446
  other_muscles: MuscleGroup[];
833
- exercise_type: ExerciseType;
1447
+ exercise_type: CustomExerciseType;
834
1448
  equipment_category: Equipment;
1449
+ /** @deprecated 2.2.4*/
835
1450
  custom_exercise_image_url?: string;
836
- /** @deprecated 1.22.5 */
837
- custom_exercise_image_thumbnail_url?: string;
1451
+ media?: CustomExerciseMedia;
838
1452
  thumbnail_url?: string;
839
1453
  /** if set, the template will be related to the coach, not via username */
840
1454
  coach_id?: string;
841
1455
  }
1456
+ export interface GetVolumeDoublingEnabledExercisesResponse {
1457
+ exerciseTemplateIds: string[];
1458
+ }
1459
+ export interface PostVolumeDoublingEnabledExercisesRequest {
1460
+ exerciseTemplateIds: string[];
1461
+ }
842
1462
  export interface UpdateCustomExerciseRequest {
843
1463
  id: string;
844
1464
  title: string;
845
1465
  muscle_group: MuscleGroup;
846
1466
  other_muscles: MuscleGroup[];
847
1467
  equipment_category: Equipment;
1468
+ /** @deprecated 2.2.4*/
848
1469
  custom_exercise_image_url?: string;
849
- /** @deprecated 1.22.5 */
850
- custom_exercise_image_thumbnail_url?: string;
1470
+ media?: CustomExerciseMedia;
851
1471
  thumbnail_url?: string;
852
1472
  }
853
1473
  export type ExerciseTemplateCustomizationAttachmentUrlType = 'mp4_video' | 'youtube';
@@ -866,95 +1486,27 @@ export interface ClientRecentExerciseData {
866
1486
  exercise_template_id: string;
867
1487
  date_used: number;
868
1488
  }
869
- /**
870
- * Notifications
871
- */
872
- export type Notification = WorkoutCompleteNotification | WorkoutMentionNotification | WorkoutCommentNotification | WorkoutCommentReplyNotification | WorkoutCommentMentionNotification | WorkoutLikeNotification | FollowNotification | FollowRequestNotification | AcceptFollowRequestNotification | CoachClientInviteNotification | ContactOnHevyNotification;
873
- 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';
874
- export interface BaseNotification {
875
- id: number;
876
- type: NotificationType;
877
- from_username: string;
878
- profile_pic?: string;
879
- date: string;
880
- }
881
- export interface WorkoutCompleteNotification extends BaseNotification {
882
- type: 'workout-complete';
883
- workout_id: string;
884
- workout_title: string;
885
- }
886
- export interface WorkoutMentionNotification extends BaseNotification {
887
- type: 'workout-mention';
888
- workout_id: string;
889
- workout_title: string;
890
- }
891
- export interface WorkoutCommentNotification extends BaseNotification {
892
- type: 'workout-comment';
893
- workout_id: string;
894
- workout_title: string;
895
- comment: string;
896
- }
897
- export interface WorkoutCommentReplyNotification extends BaseNotification {
898
- type: 'workout-comment-reply';
899
- workout_id: string;
900
- workout_title: string;
901
- comment: string;
902
- }
903
- export interface WorkoutCommentMentionNotification extends BaseNotification {
904
- type: 'workout-comment-mention';
905
- workout_id: string;
906
- workout_title: string;
907
- comment: string;
908
- }
909
- export interface WorkoutLikeNotification extends BaseNotification {
910
- type: 'workout-like';
911
- workout_id: string;
912
- workout_title: string;
913
- }
914
- export interface FollowNotification extends BaseNotification {
915
- type: 'follow';
916
- }
917
- export interface FollowRequestNotification extends BaseNotification {
918
- type: 'follow-request';
919
- }
920
- export interface AcceptFollowRequestNotification extends BaseNotification {
921
- type: 'accept-follow-request';
922
- }
923
- export interface CoachClientInviteNotification extends BaseNotification {
924
- type: 'coach-client-invite';
925
- from_full_name?: string;
926
- }
927
- export interface ContactOnHevyNotification extends BaseNotification {
928
- type: 'contact-on-hevy';
929
- contact_name: string;
930
- }
931
- /**
932
- * "Pushes": a push is basically a remote notification, NOT to be confused with a "notification", which is
933
- * a data type in the Hevy database
934
- */
935
- export type PushType = NotificationPushType | DataOnlyPushType;
936
- /**
937
- * These types will have an alert/title, and will only be delivered if the user has given the notification
938
- * permission to the App
939
- */
940
- export type NotificationPushType = NotificationType | 'chat-update';
941
- /**
942
- * These types CAN NOT have an alert/title, but may be delivered even if the user has not given the notification
943
- * permission and even if Hevy isn't running, although these should be treated as best effort
944
- * For iOS/Apple see https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app
945
- * For Android see https://firebase.google.com/docs/cloud-messaging/concept-options#data_messages
946
- */
947
- export type DataOnlyPushType = 'coach-data-changed' | 'coach-program-changed' | 'sync-routines' | 'sync-routine-folders' | 'sync-exercise-templates-and-customizations';
948
1489
  export type WeightRepComparisonMetric = 'one_rep_max' | 'best_weight' | 'best_set_volume';
949
1490
  export type RepsOnlyComparisonMetric = 'best_set_reps' | 'best_session_reps';
950
1491
  export type ComparisonMetric = WeightRepComparisonMetric | RepsOnlyComparisonMetric;
951
- export type ExerciseMetricComparison = WeightRepExerciseMetricComparison | RepsOnlyExerciseMetricComparison;
952
- export interface WeightRepExerciseMetricComparison {
1492
+ export type ExerciseMetricComparison = OneRepMaxMetricComparison | BestWeightMetricComparison | BestSetVolumeMetricComparison | RepsOnlyExerciseMetricComparison;
1493
+ interface BaseWeightRepExerciseMetricComparison {
953
1494
  type: 'weight_rep';
954
1495
  metric_id: WeightRepComparisonMetric;
955
1496
  current_user_value_kg: number;
956
1497
  other_user_value_kg: number;
957
1498
  }
1499
+ export interface OneRepMaxMetricComparison extends BaseWeightRepExerciseMetricComparison {
1500
+ metric_id: 'one_rep_max';
1501
+ }
1502
+ export interface BestSetVolumeMetricComparison extends BaseWeightRepExerciseMetricComparison {
1503
+ metric_id: 'best_set_volume';
1504
+ }
1505
+ export interface BestWeightMetricComparison extends BaseWeightRepExerciseMetricComparison {
1506
+ metric_id: 'best_weight';
1507
+ current_user_rank?: number;
1508
+ other_user_rank?: number;
1509
+ }
958
1510
  export interface RepsOnlyExerciseMetricComparison {
959
1511
  type: 'reps_only';
960
1512
  metric_id: RepsOnlyComparisonMetric;
@@ -967,7 +1519,7 @@ export interface UserWeeklyWorkoutDuration {
967
1519
  total_seconds: number;
968
1520
  }
969
1521
  export interface GeneratePasswordRecoveryTokenResult {
970
- result: 'success' | 'unknown-email';
1522
+ result: 'success';
971
1523
  }
972
1524
  export interface PromoResponse {
973
1525
  endDate: string;
@@ -986,6 +1538,9 @@ export interface PromoResponse {
986
1538
  zh_TW: string;
987
1539
  };
988
1540
  }
1541
+ export interface HevyCoachLaunchStatusResponse {
1542
+ endDate: string;
1543
+ }
989
1544
  export interface UserExerciseSet {
990
1545
  workout_id: string;
991
1546
  workout_short_id: string;
@@ -999,6 +1554,8 @@ export interface UserExerciseSet {
999
1554
  duration_seconds: number | null;
1000
1555
  distance_meters: number | null;
1001
1556
  rpe: RPE | null;
1557
+ user_bodyweight_kg: number | null;
1558
+ custom_metric: number | null;
1002
1559
  }
1003
1560
  export type SetCountMuscleSplitResponse = {
1004
1561
  [key in MuscleGroup]: number;
@@ -1018,6 +1575,29 @@ export interface UserProfileCompareResponse {
1018
1575
  duration_seconds: number;
1019
1576
  };
1020
1577
  }
1578
+ export interface ExerciseLeaderboardEntry {
1579
+ username: string;
1580
+ best_weight_kg: number;
1581
+ profile_pic: string | null;
1582
+ workout_id: string;
1583
+ is_private: boolean;
1584
+ set_id: string;
1585
+ is_outlier: boolean;
1586
+ }
1587
+ export interface ExerciseLeaderboardResponse {
1588
+ leaderboard_entries: ExerciseLeaderboardEntry[];
1589
+ }
1590
+ export type StrengthLevel = 'beginner' | 'intermediate' | 'advanced' | 'elite';
1591
+ export interface GetStrengthLevelParams {
1592
+ sex: Omit<Sex, 'other'>;
1593
+ best_1rm_kg: number;
1594
+ exercise_template_id: string;
1595
+ age: number;
1596
+ bodyweight_kg: number;
1597
+ }
1598
+ export interface StrengthLevelResponse {
1599
+ percentile: number | null;
1600
+ }
1021
1601
  export interface ServerYearInReview {
1022
1602
  supporters: Array<{
1023
1603
  username: string;
@@ -1036,36 +1616,30 @@ export type PlateCalculatorPlate = {
1036
1616
  weight: number;
1037
1617
  unit: WeightUnit;
1038
1618
  };
1039
- export interface PushData {
1040
- deeplink?: string;
1041
- profilePic?: string;
1042
- cue_campaign_id?: string;
1043
- type: PushType;
1044
- additionalHevyData?: any;
1045
- }
1046
- export interface CoachDataChangedPushData extends PushData {
1047
- type: 'coach-data-changed';
1048
- additionalHevyData: ClientsCoachData;
1049
- }
1050
- export interface CoachProgramChangedPushData extends PushData {
1051
- type: 'coach-program-changed';
1052
- additionalHevyData: {
1053
- program: Program | undefined;
1054
- };
1055
- }
1056
- export interface SyncRoutinesPushData extends PushData {
1057
- type: 'sync-routines';
1058
- }
1059
- export interface SyncRoutineFoldersPushData extends PushData {
1060
- type: 'sync-routine-folders';
1061
- }
1062
- export interface SyncCustomExercisesAndCoachCustomizationsPushData extends PushData {
1063
- type: 'sync-exercise-templates-and-customizations';
1064
- }
1065
- export interface ChatUpdatePushData extends PushData {
1066
- type: 'chat-update';
1067
- message: HevyChatUpdatePush;
1619
+ export interface WarmupSet {
1620
+ percentWeight: number;
1621
+ reps: number;
1068
1622
  }
1623
+ export interface WarmupCalculatorData {
1624
+ warmupCalculatorEnabled: boolean;
1625
+ plateRoundingSettingKg: number;
1626
+ plateRoundingSettingLbs: number;
1627
+ dumbbellRoundingSettingKg: number;
1628
+ dumbbellRoundingSettingLbs: number;
1629
+ warmupSets: WarmupSet[];
1630
+ }
1631
+ export interface RecalculateSetPRProgress {
1632
+ numWorkoutsProcessed: number;
1633
+ numWorkoutsTotal: number;
1634
+ }
1635
+ export type RecalculateSetPRStatusResponse = {
1636
+ type: 'ready';
1637
+ } | {
1638
+ type: 'busy';
1639
+ progress: RecalculateSetPRProgress;
1640
+ } | {
1641
+ type: 'error';
1642
+ };
1069
1643
  export interface ExerciseTemplateUnit {
1070
1644
  id: number;
1071
1645
  exercise_template_id: string;
@@ -1076,17 +1650,30 @@ export interface UserMetadataRequest {
1076
1650
  platform: string;
1077
1651
  platformVersion: string;
1078
1652
  appVersion: string;
1653
+ securityId?: string;
1654
+ googleAdId?: string;
1655
+ appleIdfv?: string;
1656
+ adjustAdId?: string;
1079
1657
  }
1658
+ export type NetworkType = 'wifi' | 'cellular' | 'unknown';
1080
1659
  export interface UserMetadataResponse {
1081
1660
  created_at: string;
1082
1661
  updated_at: string;
1083
- app_language: string;
1084
- platform: string;
1085
- platform_version: string;
1086
- app_version: string;
1662
+ app_language: string | null;
1663
+ platform: string | null;
1664
+ platform_version: string | null;
1665
+ app_version: string | null;
1087
1666
  geoip_country: string | null;
1088
1667
  geoip_city: string | null;
1089
1668
  geoip_timezone: string | null;
1669
+ security_id: string | null;
1670
+ adjust_adid: string | null;
1671
+ google_adid: string | null;
1672
+ apple_idfv: string | null;
1673
+ last_ip: string | null;
1674
+ }
1675
+ export interface NetworkInfoRequest {
1676
+ networkType: NetworkType;
1090
1677
  }
1091
1678
  export interface StripePrice {
1092
1679
  product_id: string;
@@ -1106,9 +1693,29 @@ export interface StripeCheckoutSessionRequest {
1106
1693
  export interface StripeCheckoutSessionResponse {
1107
1694
  url: string;
1108
1695
  }
1696
+ export interface PaddlePrice {
1697
+ paddle_price_id: string;
1698
+ billing_period: 'month' | 'year' | 'lifetime';
1699
+ price_usd: number;
1700
+ }
1701
+ export type BillingPeriod = 'lifetime' | 'month' | 'year';
1702
+ export interface PaddlePromoCodeDetails {
1703
+ code: string;
1704
+ percent_off: number;
1705
+ billing_period: BillingPeriod;
1706
+ }
1707
+ export interface PaddlePlanChangeRequest {
1708
+ new_plan: 'monthly' | 'yearly';
1709
+ }
1710
+ /**
1711
+ * @deprecated Migrating to Paddle, but needed to allow existing customers to cancel their Stripe subscriptions
1712
+ */
1109
1713
  export interface StripeCustomerPortalSessionRequest {
1110
1714
  return_url: string;
1111
1715
  }
1716
+ /**
1717
+ * @deprecated Migrating to Paddle, but needed to allow existing customers to cancel their Stripe subscriptions
1718
+ */
1112
1719
  export interface StripeCustomerPortalSessionResponse {
1113
1720
  url: string;
1114
1721
  }
@@ -1117,34 +1724,16 @@ export type UserKeyValues = {
1117
1724
  [key: string]: UserValue;
1118
1725
  };
1119
1726
  export type Sex = 'male' | 'female' | 'other';
1120
- /**
1121
- * A slimmed down version of a coach's client's workout that is used by the
1122
- * coach app to display workout stats, calendar, etc. for a client.
1123
- */
1124
- export interface ClientWorkout extends ClientWorkoutMetadata {
1125
- estimated_volume_kg: number;
1126
- set_count: number;
1127
- prs: SetPersonalRecord[];
1128
- }
1129
- export interface ClientWorkoutMetadata {
1130
- id: string;
1131
- index: number;
1132
- start_time: number;
1133
- end_time: number;
1134
- name: string;
1135
- description: string | null;
1136
- routine_id: string | null;
1137
- short_id: string;
1138
- apple_watch: boolean;
1139
- }
1140
1727
  /**
1141
1728
  * Used for the chat backend to validate authentication details
1142
1729
  */
1143
- export type UserAuthenticationValidationResponse = 'unauthorized' | 'authorized_user' | 'admin' | 'banned' | 'flagged';
1730
+ export type UserAuthenticationValidationResponse = 'unauthorized' | 'authorized_user' | 'admin' | 'banned' | 'shadow_banned';
1731
+ declare const _validUserWorkoutMetricsTypes: readonly ["duration", "reps"];
1144
1732
  /**
1145
1733
  * Used for hevy-web for fetching profile metrics and calendar data
1146
1734
  */
1147
- export type UserWorkoutMetricsType = 'duration' | 'reps';
1735
+ export type UserWorkoutMetricsType = Lookup<typeof _validUserWorkoutMetricsTypes>;
1736
+ export declare const isValidUserWorkoutMetricsType: (x: any) => x is UserWorkoutMetricsType;
1148
1737
  interface WorkoutMetricBase {
1149
1738
  workout_id: string;
1150
1739
  start_time: number;
@@ -1159,10 +1748,334 @@ export interface DurationWorkoutMetric extends WorkoutMetricBase {
1159
1748
  duration_seconds: number;
1160
1749
  }
1161
1750
  export type WorkoutMetric = RepsWorkoutMetric | DurationWorkoutMetric;
1162
- export declare const isValidUserWorkoutMetricsType: (x: any) => x is UserWorkoutMetricsType;
1163
1751
  export interface UserCalendarWorkout {
1164
1752
  workout_short_id: string;
1165
1753
  title: string;
1166
1754
  start_time: number;
1167
1755
  duration_seconds: number;
1168
1756
  }
1757
+ interface BaseClientActivity {
1758
+ type: string;
1759
+ date: string;
1760
+ client_id: string;
1761
+ }
1762
+ export interface ClientWorkoutActivity extends BaseClientActivity {
1763
+ type: 'workout';
1764
+ workout_name: string;
1765
+ workout_id: string;
1766
+ duration_seconds: number;
1767
+ total_volume_kg: number;
1768
+ set_count: number;
1769
+ prs: SetPersonalRecord[];
1770
+ }
1771
+ export interface ClientMeasurementActivity extends BaseClientActivity {
1772
+ type: 'measurement';
1773
+ measurement_id: number;
1774
+ measurement_types: string[];
1775
+ }
1776
+ export interface ClientBodyweightMeasurementActivity extends BaseClientActivity {
1777
+ type: 'bodyweight-measurement';
1778
+ measurement_id: number;
1779
+ weight_kg: number;
1780
+ trend_value: number;
1781
+ }
1782
+ export interface ClientInviteAcceptedActivity extends BaseClientActivity {
1783
+ type: 'invite-accepted';
1784
+ }
1785
+ export interface ClientAddedProgressPictureActivity extends BaseClientActivity {
1786
+ type: 'progress-picture';
1787
+ picture_url: string;
1788
+ measurement_id: number;
1789
+ }
1790
+ export type ClientActivity = ClientWorkoutActivity | ClientMeasurementActivity | ClientBodyweightMeasurementActivity | ClientInviteAcceptedActivity | ClientAddedProgressPictureActivity;
1791
+ export interface WeeklyActiveClients {
1792
+ week_start_date: string;
1793
+ active_client_ids: string[];
1794
+ inactive_client_ids: string[];
1795
+ }
1796
+ interface UserWorkoutBaseMedia {
1797
+ workout_id: string;
1798
+ workout_name: string;
1799
+ workout_index: number;
1800
+ }
1801
+ export interface UserWorkoutImage extends UserWorkoutBaseMedia {
1802
+ type: 'image';
1803
+ url: string;
1804
+ }
1805
+ export interface UserWorkoutVideo extends UserWorkoutBaseMedia {
1806
+ type: 'video';
1807
+ url: string;
1808
+ thumbnail_url: string;
1809
+ }
1810
+ export type UserWorkoutMedia = UserWorkoutImage | UserWorkoutVideo;
1811
+ export type RepInputType = 'reps' | 'rep-range';
1812
+ export type ShareToPlatform = 'strava' | 'appleHealth' | 'healthConnect';
1813
+ export type WorkoutVisibility = 'public' | 'private' | 'default';
1814
+ export interface CreateRoutineCopyRequest {
1815
+ routineId: string;
1816
+ ignoreValues: boolean;
1817
+ index: number | null;
1818
+ copiedRoutineTitle?: string;
1819
+ folderId: number | null;
1820
+ }
1821
+ export type HevyPlatforms = 'hevy' | 'hevy-web' | 'hevy-coach' | 'hevy-coach-web';
1822
+ export type FeedbackType = 'general' | 'feature-request' | 'bug-report' | 'get-help' | 'report-comment' | 'report-workout' | 'report-profile' | 'rating-review' | 'trainer-rating' | 'trainer-general' | 'cancel-subscription';
1823
+ interface BaseFeedback {
1824
+ platform: HevyPlatforms;
1825
+ type: FeedbackType;
1826
+ userId: string;
1827
+ message?: string;
1828
+ data?: any;
1829
+ debugInfo?: any;
1830
+ }
1831
+ export interface GeneralFeedback extends BaseFeedback {
1832
+ type: 'general';
1833
+ }
1834
+ export interface FeatureRequestFeedback extends BaseFeedback {
1835
+ type: 'feature-request';
1836
+ }
1837
+ export interface BugReportFeedback extends BaseFeedback {
1838
+ type: 'bug-report';
1839
+ }
1840
+ export interface GetHelpFeedback extends BaseFeedback {
1841
+ type: 'get-help';
1842
+ data: {
1843
+ source: string;
1844
+ };
1845
+ }
1846
+ export interface ReportCommentFeedback extends BaseFeedback {
1847
+ type: 'report-comment';
1848
+ data: {
1849
+ commentId: number;
1850
+ commentUsername: string;
1851
+ comment: string;
1852
+ workoutId: string;
1853
+ };
1854
+ }
1855
+ export interface ReportWorkoutFeedback extends BaseFeedback {
1856
+ type: 'report-workout';
1857
+ data: {
1858
+ workoutId: string;
1859
+ workoutUsername: string;
1860
+ };
1861
+ }
1862
+ export interface ReportProfileFeedback extends BaseFeedback {
1863
+ type: 'report-profile';
1864
+ data: {
1865
+ profileUsername: string;
1866
+ };
1867
+ }
1868
+ export interface RatingPromptFeedback extends BaseFeedback {
1869
+ type: 'rating-review';
1870
+ }
1871
+ export interface TrainerRatingPromptFeedback extends BaseFeedback {
1872
+ type: 'trainer-rating';
1873
+ data: {
1874
+ rating: number;
1875
+ };
1876
+ }
1877
+ export interface TrainerGeneralFeedback extends BaseFeedback {
1878
+ type: 'trainer-general';
1879
+ }
1880
+ export interface CancelSubscriptionFeedback extends BaseFeedback {
1881
+ type: 'cancel-subscription';
1882
+ data?: {
1883
+ reason: string;
1884
+ };
1885
+ }
1886
+ export type Feedback = GeneralFeedback | FeatureRequestFeedback | BugReportFeedback | GetHelpFeedback | ReportCommentFeedback | ReportWorkoutFeedback | ReportProfileFeedback | RatingPromptFeedback | TrainerRatingPromptFeedback | TrainerGeneralFeedback | CancelSubscriptionFeedback;
1887
+ export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | null;
1888
+ export interface AppLogLine {
1889
+ /**
1890
+ * Line index, starts from 0 when app is initialised and increments by 1 for
1891
+ * each line logged by the log util.
1892
+ */
1893
+ index: number;
1894
+ /** Unix ms. String so it's simpler to handle across different platforms. */
1895
+ timestamp: string;
1896
+ logLevel: LogLevel;
1897
+ /** Used by android.util.Log on Wear OS */
1898
+ tag?: string;
1899
+ msg: string;
1900
+ }
1901
+ export interface PostAppLogRequest {
1902
+ version: 1;
1903
+ lines: AppLogLine[];
1904
+ }
1905
+ export interface BackofficeAppLogResponse {
1906
+ lines: AppLogLine[];
1907
+ }
1908
+ export interface BackofficeAppLogIndexResponse {
1909
+ username: string;
1910
+ entries: {
1911
+ id: string;
1912
+ timestamp: string;
1913
+ appPlatform: string | null;
1914
+ appVersion: string | null;
1915
+ appBuildNumber: string | null;
1916
+ linesLength: number;
1917
+ fileSizeBytes: number;
1918
+ }[];
1919
+ }
1920
+ declare const _suggestedUserSources: readonly ["popular", "local", "contact", "mutual_follows", "follows_you", "featured", "hyper_local"];
1921
+ export type SuggestedUserSource = Lookup<typeof _suggestedUserSources>;
1922
+ export declare const isSuggestedUserSource: (source: string) => source is SuggestedUserSource;
1923
+ export type SuggestedUserLabel = 'contact' | 'mutual_friends' | 'follows_you' | 'featured';
1924
+ export interface SuggestedUser {
1925
+ id: string;
1926
+ profile_pic?: string;
1927
+ username: string;
1928
+ full_name?: string;
1929
+ following_status: FollowingStatus;
1930
+ private_profile: boolean;
1931
+ verified: boolean;
1932
+ source?: SuggestedUserSource;
1933
+ label: SuggestedUserLabel;
1934
+ }
1935
+ export type FollowRate = {
1936
+ source: SuggestedUserSource;
1937
+ follows: number;
1938
+ total: number;
1939
+ };
1940
+ export interface BackofficeSuggestedUsersFollowRateResponse {
1941
+ follow_rates: FollowRate[];
1942
+ }
1943
+ export type BackofficeFeedback = {
1944
+ user_id: string;
1945
+ platform: string;
1946
+ type: string;
1947
+ username?: string;
1948
+ message?: string;
1949
+ data?: any;
1950
+ debug_info?: any;
1951
+ created_at: Date;
1952
+ };
1953
+ export interface BackofficeFeedbacksResponse {
1954
+ feedbacks: BackofficeFeedback[];
1955
+ }
1956
+ export type BackofficeRemoteFeatureFlag = {
1957
+ key: string;
1958
+ name: string;
1959
+ enabled: boolean;
1960
+ description: string;
1961
+ updated_at: Date;
1962
+ created_at: Date;
1963
+ };
1964
+ export type BackofficeRemoteFeatureFlagsResponse = {
1965
+ flags: BackofficeRemoteFeatureFlag[];
1966
+ };
1967
+ export interface FormatAtText {
1968
+ format: 'none' | '@' | 'link';
1969
+ text: string;
1970
+ }
1971
+ export interface GoogleWebSignInRequest {
1972
+ code: string;
1973
+ gympassUserId?: string;
1974
+ }
1975
+ export interface GoogleCoachWebSignInRequest {
1976
+ code: string;
1977
+ invite_short_id?: string;
1978
+ }
1979
+ export interface UserPushNotificationSettings {
1980
+ comment_discussion: boolean;
1981
+ comment_likes: boolean;
1982
+ comment_mention: boolean;
1983
+ comment_on_workout: boolean;
1984
+ comment_replies: boolean;
1985
+ follows: boolean;
1986
+ likes: boolean;
1987
+ monthly_report: boolean;
1988
+ }
1989
+ export interface UserPushNotificationSettingsUpdate {
1990
+ comment_discussion?: boolean;
1991
+ comment_likes?: boolean;
1992
+ comment_mention?: boolean;
1993
+ comment_on_workout?: boolean;
1994
+ comment_replies?: boolean;
1995
+ follows?: boolean;
1996
+ likes?: boolean;
1997
+ monthly_report?: boolean;
1998
+ }
1999
+ export interface AvailableEquipment {
2000
+ platesKg: number[];
2001
+ platesLbs: number[];
2002
+ barsKg: number[];
2003
+ barsLbs: number[];
2004
+ dumbbellsKg: number[];
2005
+ dumbbellsLbs: number[];
2006
+ }
2007
+ export interface HevyTrainerUserPreferences {
2008
+ excludedExercisesIds: string[];
2009
+ availableEquipment: AvailableEquipment;
2010
+ }
2011
+ export interface LinkPreviewMetadataResponse {
2012
+ title: string;
2013
+ url: string;
2014
+ image_url: string;
2015
+ twitter_image_url: string;
2016
+ }
2017
+ export interface UserLinkPreviewMetadataResponse extends LinkPreviewMetadataResponse {
2018
+ username: string;
2019
+ }
2020
+ export interface RoutineLinkPreviewMetadataResponse extends LinkPreviewMetadataResponse {
2021
+ username: string;
2022
+ exercise_count: number;
2023
+ }
2024
+ export interface FolderLinkPreviewMetadataResponse extends LinkPreviewMetadataResponse {
2025
+ username: string;
2026
+ routine_count: number;
2027
+ }
2028
+ export interface ExerciseHistorySet {
2029
+ weight_kg: number | null;
2030
+ reps: number | null;
2031
+ indicator: SetType;
2032
+ duration_seconds: number | null;
2033
+ distance_meters: number | null;
2034
+ rpe: number | null;
2035
+ custom_metric: number | null;
2036
+ set_index: number;
2037
+ prs: SetPersonalRecordType[];
2038
+ }
2039
+ export interface ExerciseInstructionsStep {
2040
+ index?: number;
2041
+ description: string;
2042
+ }
2043
+ export interface ExerciseHistoryWorkout {
2044
+ id: string;
2045
+ name: string;
2046
+ start_time: number;
2047
+ exercises: {
2048
+ sets: ExerciseHistorySet[];
2049
+ }[];
2050
+ }
2051
+ export declare const supportedScopes: readonly ["read-workout", "modify-workout", "read-routine", "modify-routine", "unrestricted"];
2052
+ export type OAuthScope = Lookup<typeof supportedScopes>;
2053
+ export declare const isOAuthScope: (x: string) => x is OAuthScope;
2054
+ export interface WorkoutsWithMediaBackofficeResponse {
2055
+ username: string;
2056
+ workouts: {
2057
+ id: string;
2058
+ name: string;
2059
+ media: WorkoutMedia[];
2060
+ }[];
2061
+ }
2062
+ export interface GetAccountsByEmailResponse {
2063
+ users: {
2064
+ id: string;
2065
+ username: string;
2066
+ profile_pic: string | null;
2067
+ email: string;
2068
+ wellhub_email: string | null;
2069
+ }[];
2070
+ }
2071
+ export interface UserReportSummaryBackoffice {
2072
+ reported_by: string;
2073
+ reported_at: string;
2074
+ report_type: string | null;
2075
+ reason: string;
2076
+ data: unknown;
2077
+ }
2078
+ export interface GetReportedUserSummaryBackofficeResponse {
2079
+ username: string;
2080
+ user_reports: UserReportSummaryBackoffice[];
2081
+ }