hevy-shared 1.0.962 → 1.0.963

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