hevy-shared 1.0.960 → 1.0.962
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -0
- package/.eslintrc +21 -0
- package/.github/workflows/ci.yml +15 -0
- package/.github/workflows/npm-publish.yml +59 -0
- package/.github/workflows/pr-auto-assign.yml +15 -0
- package/.prettierrc.js +5 -0
- package/README.md +2 -17
- package/built/chat.d.ts +23 -25
- package/built/coachPlans.d.ts +1 -2
- package/built/coachPlans.js +2 -2
- package/built/filterExercises.d.ts +3 -19
- package/built/filterExercises.js +60 -72
- package/built/index.d.ts +304 -1140
- package/built/index.js +75 -269
- package/built/setIndicatorUtils.d.ts +3 -4
- package/built/setIndicatorUtils.js +1 -15
- package/built/tests/utils.test.js +0 -748
- package/built/tests/workoutVolume.test.js +49 -165
- package/built/units.d.ts +7 -14
- package/built/units.js +14 -24
- package/built/utils.d.ts +5 -192
- package/built/utils.js +85 -598
- package/built/websocket.d.ts +2 -14
- package/built/workoutVolume.d.ts +5 -24
- package/built/workoutVolume.js +34 -25
- package/jest.config.js +4 -0
- package/package.json +10 -32
- package/src/chat.ts +130 -0
- package/src/coachPlans.ts +57 -0
- package/src/constants.ts +14 -0
- package/src/filterExercises.ts +222 -0
- package/src/index.ts +1576 -0
- package/src/setIndicatorUtils.ts +137 -0
- package/src/tests/utils.test.ts +156 -0
- package/src/tests/workoutVolume.test.ts +93 -0
- package/src/units.ts +41 -0
- package/src/utils.ts +516 -0
- package/src/websocket.ts +36 -0
- package/src/workoutVolume.ts +175 -0
- package/tsconfig.json +70 -0
- package/built/API/APIClient.d.ts +0 -157
- package/built/API/APIClient.js +0 -381
- package/built/API/index.d.ts +0 -2
- package/built/API/index.js +0 -18
- package/built/API/types.d.ts +0 -38
- package/built/API/types.js +0 -18
- package/built/adjustEventTokens.d.ts +0 -16
- package/built/adjustEventTokens.js +0 -18
- package/built/adminPermissions.d.ts +0 -4
- package/built/adminPermissions.js +0 -22
- package/built/async.d.ts +0 -50
- package/built/async.js +0 -170
- package/built/cue.d.ts +0 -12
- package/built/cue.js +0 -22
- package/built/exerciseLocaleUtils.d.ts +0 -17
- package/built/exerciseLocaleUtils.js +0 -62
- package/built/hevyTrainer.d.ts +0 -250
- package/built/hevyTrainer.js +0 -676
- package/built/muscleHeatmaps.d.ts +0 -31
- package/built/muscleHeatmaps.js +0 -68
- package/built/muscleSplits.d.ts +0 -36
- package/built/muscleSplits.js +0 -100
- package/built/normalizedWorkoutUtils.d.ts +0 -88
- package/built/normalizedWorkoutUtils.js +0 -112
- package/built/notifications.d.ts +0 -215
- package/built/notifications.js +0 -9
- package/built/routineUtils.d.ts +0 -14
- package/built/routineUtils.js +0 -186
- package/built/schemas.d.ts +0 -6
- package/built/schemas.js +0 -12
- package/built/tests/async.test.d.ts +0 -1
- package/built/tests/async.test.js +0 -49
- package/built/tests/hevyTrainer.test.d.ts +0 -1
- package/built/tests/hevyTrainer.test.js +0 -1199
- package/built/tests/muscleSplit.test.d.ts +0 -1
- package/built/tests/muscleSplit.test.js +0 -153
- package/built/tests/routineUtils.test.d.ts +0 -1
- package/built/tests/routineUtils.test.js +0 -745
- package/built/tests/testUtils.d.ts +0 -85
- package/built/tests/testUtils.js +0 -319
- package/built/translations/index.d.ts +0 -2
- package/built/translations/index.js +0 -18
- package/built/translations/translationUtils.d.ts +0 -2
- package/built/translations/translationUtils.js +0 -61
- package/built/translations/types.d.ts +0 -8
- package/built/translations/types.js +0 -20
- package/built/typeUtils.d.ts +0 -70
- package/built/typeUtils.js +0 -55
package/built/index.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
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';
|
|
1
|
+
import { HevyChatUpdatePush } from './chat';
|
|
8
2
|
export * from './constants';
|
|
9
3
|
export * from './utils';
|
|
10
4
|
export * from './units';
|
|
@@ -14,19 +8,8 @@ export * from './workoutVolume';
|
|
|
14
8
|
export * from './coachPlans';
|
|
15
9
|
export * from './chat';
|
|
16
10
|
export * from './websocket';
|
|
17
|
-
export
|
|
18
|
-
export
|
|
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';
|
|
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;
|
|
30
13
|
export type WeightUnit = 'kg' | 'lbs';
|
|
31
14
|
export declare const isWeightUnit: (x: string) => x is WeightUnit;
|
|
32
15
|
export type DistanceUnit = 'kilometers' | 'miles';
|
|
@@ -35,16 +18,10 @@ export type DistanceUnitShort = 'km' | 'mi';
|
|
|
35
18
|
export declare const isDistanceUnitShort: (x: string) => x is DistanceUnit;
|
|
36
19
|
export type BodyMeasurementUnit = 'cm' | 'in';
|
|
37
20
|
export declare const isBodyMeasurementUnit: (x: string) => x is BodyMeasurementUnit;
|
|
38
|
-
|
|
39
|
-
export declare const orderedWeekdays: readonly ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"];
|
|
40
|
-
export type Weekday = Lookup<typeof orderedWeekdays>;
|
|
21
|
+
export type Weekday = 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday';
|
|
41
22
|
export declare const isWeekday: (x: string) => x is Weekday;
|
|
42
|
-
|
|
43
|
-
export type TimerVolumeOption = Lookup<typeof _timerVolumeOptions>;
|
|
23
|
+
export type TimerVolumeOption = 'off' | 'low' | 'normal' | 'high';
|
|
44
24
|
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;
|
|
48
25
|
export interface ErrorResponse {
|
|
49
26
|
error: string;
|
|
50
27
|
}
|
|
@@ -79,7 +56,6 @@ export interface AccountResponse {
|
|
|
79
56
|
is_coached: boolean;
|
|
80
57
|
birthday?: string;
|
|
81
58
|
sex?: Sex;
|
|
82
|
-
height_cm?: number;
|
|
83
59
|
}
|
|
84
60
|
export interface UserAccountResponse {
|
|
85
61
|
id: string;
|
|
@@ -92,10 +68,6 @@ export interface UserAccountResponse {
|
|
|
92
68
|
gift_pro_expiry?: string;
|
|
93
69
|
gympass_user_id?: string;
|
|
94
70
|
is_gympass_plan_active?: boolean;
|
|
95
|
-
is_strava_connected: boolean;
|
|
96
|
-
is_chatgpt_oauth_authorized: boolean;
|
|
97
|
-
country_code?: string;
|
|
98
|
-
city?: string;
|
|
99
71
|
follows_push_enabled: boolean;
|
|
100
72
|
likes_push_enabled: boolean;
|
|
101
73
|
comments_push_enabled: boolean;
|
|
@@ -105,49 +77,11 @@ export interface UserAccountResponse {
|
|
|
105
77
|
created_at: string;
|
|
106
78
|
last_workout_at: string;
|
|
107
79
|
accepted_terms_and_conditions: boolean;
|
|
108
|
-
/** @deprecated 1.31.1 - use `coach_client_status` instead */
|
|
109
80
|
is_coached: boolean;
|
|
110
|
-
/** @deprecated 1.31.1 - use `coach_status` instead */
|
|
111
81
|
is_a_coach: boolean;
|
|
112
|
-
|
|
113
|
-
coach_status?: 'coach-active-plan' | 'coach-inactive-plan';
|
|
82
|
+
became_coach_at?: string;
|
|
114
83
|
birthday?: string;
|
|
115
84
|
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;
|
|
151
85
|
}
|
|
152
86
|
export interface FollowCountsResponse {
|
|
153
87
|
follower_count: number;
|
|
@@ -171,31 +105,16 @@ export interface AccountUpdate {
|
|
|
171
105
|
accepted_terms_and_conditions?: boolean;
|
|
172
106
|
sex?: Sex;
|
|
173
107
|
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;
|
|
188
108
|
}
|
|
189
109
|
export interface AppleSignInRequest {
|
|
190
110
|
email?: string;
|
|
191
|
-
|
|
192
|
-
identityToken: string;
|
|
193
|
-
gympassUserId?: string;
|
|
194
|
-
useAuth2_0?: boolean;
|
|
195
|
-
}
|
|
196
|
-
export interface AppleSignUpWebRequest {
|
|
197
|
-
email?: string;
|
|
111
|
+
user: string;
|
|
198
112
|
identityToken: string;
|
|
113
|
+
/**
|
|
114
|
+
* When generateUsername=true. The backend will generate
|
|
115
|
+
* a placeholder username when the account gets created.
|
|
116
|
+
*/
|
|
117
|
+
generateUsername: boolean;
|
|
199
118
|
gympassUserId?: string;
|
|
200
119
|
}
|
|
201
120
|
export interface AppleSignInWebRequest {
|
|
@@ -205,49 +124,30 @@ export interface AppleSignInWebRequest {
|
|
|
205
124
|
}
|
|
206
125
|
export interface GoogleSignInRequest {
|
|
207
126
|
email: string;
|
|
208
|
-
|
|
127
|
+
userId: string;
|
|
209
128
|
idToken: string;
|
|
210
129
|
source?: 'web';
|
|
130
|
+
/**
|
|
131
|
+
* When generateUsername=true. The backend will generate
|
|
132
|
+
* a placeholder username when the account gets created.
|
|
133
|
+
*/
|
|
134
|
+
generateUsername: boolean;
|
|
211
135
|
gympassUserId?: string;
|
|
212
|
-
useAuth2_0?: boolean;
|
|
213
136
|
}
|
|
214
|
-
export interface
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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;
|
|
219
145
|
gympassUserId?: string;
|
|
220
|
-
useAuth2_0?: boolean;
|
|
221
146
|
}
|
|
222
|
-
export interface SocialLoginResult
|
|
147
|
+
export interface SocialLoginResult {
|
|
223
148
|
auth_token: string;
|
|
224
|
-
username: string;
|
|
225
|
-
user_id: string;
|
|
226
|
-
email: string;
|
|
227
149
|
is_new_user: boolean;
|
|
228
150
|
}
|
|
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;
|
|
251
151
|
export interface UsernameAvailabilityResponse {
|
|
252
152
|
isAvailable: boolean;
|
|
253
153
|
suggestions: string[];
|
|
@@ -272,59 +172,17 @@ export interface User {
|
|
|
272
172
|
website_link?: string;
|
|
273
173
|
created_at: string;
|
|
274
174
|
}
|
|
275
|
-
export interface
|
|
276
|
-
state: 'user-account';
|
|
175
|
+
export interface BackofficeUserData {
|
|
277
176
|
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;
|
|
293
177
|
is_banned: boolean;
|
|
294
|
-
|
|
295
|
-
shadow_ban_metadata: UserShadowBanMetadata | null;
|
|
296
|
-
shadow_banned_at: string | null;
|
|
178
|
+
flagged_metadata: UserFlagMetadata;
|
|
297
179
|
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;
|
|
316
180
|
}
|
|
317
|
-
export type BackofficeUserResponse =
|
|
318
|
-
export type BackofficeFeaturedUser = Pick<
|
|
181
|
+
export type BackofficeUserResponse = UserAccountResponse & BackofficeUserData;
|
|
182
|
+
export type BackofficeFeaturedUser = Pick<BackofficeUserResponse, 'id' | 'username' | 'profile_pic' | 'private_profile' | 'last_workout_at'> & {
|
|
319
183
|
followers_count: number;
|
|
320
184
|
};
|
|
321
|
-
export type
|
|
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
|
-
};
|
|
185
|
+
export type BackofficeFlaggedUser = Pick<BackofficeUserResponse, 'id' | 'username' | 'profile_pic' | 'flagged_metadata'>;
|
|
328
186
|
export interface BackofficeUserComment {
|
|
329
187
|
workout_username: string;
|
|
330
188
|
workout_short_id: string;
|
|
@@ -333,58 +191,13 @@ export interface BackofficeUserComment {
|
|
|
333
191
|
comment_text: string;
|
|
334
192
|
}
|
|
335
193
|
export interface BackofficeAccountUpdate {
|
|
336
|
-
username?: string;
|
|
337
194
|
email?: string;
|
|
338
195
|
description?: string;
|
|
339
|
-
notes?: string;
|
|
340
196
|
/** `null` means we're unlinking the user's Gympass account */
|
|
341
197
|
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;
|
|
349
198
|
delete_profile_pic?: boolean;
|
|
350
199
|
delete_link?: boolean;
|
|
351
200
|
}
|
|
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
|
-
}
|
|
388
201
|
export interface CoachsClientData {
|
|
389
202
|
id: string;
|
|
390
203
|
email: string;
|
|
@@ -393,28 +206,12 @@ export interface CoachsClientData {
|
|
|
393
206
|
full_name: string | null;
|
|
394
207
|
last_workout_at: string;
|
|
395
208
|
notes: string | null;
|
|
396
|
-
custom_exercises:
|
|
209
|
+
custom_exercises: ExerciseTemplate[];
|
|
397
210
|
user_preferences: UserPreferences | null;
|
|
398
|
-
|
|
399
|
-
|
|
211
|
+
created_at: string;
|
|
212
|
+
archived_date: string | null;
|
|
400
213
|
is_sample_user: boolean;
|
|
401
214
|
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;
|
|
418
215
|
}
|
|
419
216
|
export type CoachPlanUpdateType = 'pause' | 'cancel' | 'change' | 'resume';
|
|
420
217
|
export interface CoachPlanUpdateRequest {
|
|
@@ -424,7 +221,6 @@ export interface CoachPlanUpdateRequest {
|
|
|
424
221
|
export declare const DefaultClientConfiguration: ClientConfiguration;
|
|
425
222
|
export interface ClientConfiguration {
|
|
426
223
|
is_chat_enabled: boolean;
|
|
427
|
-
are_notifications_enabled: boolean;
|
|
428
224
|
}
|
|
429
225
|
export interface ClientsCoachData {
|
|
430
226
|
username: string;
|
|
@@ -435,69 +231,26 @@ export interface ClientsCoachData {
|
|
|
435
231
|
coach_id: string;
|
|
436
232
|
coach_conversation_id?: string;
|
|
437
233
|
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;
|
|
462
234
|
}
|
|
463
235
|
export interface CoachAccountConfiguration {
|
|
464
236
|
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;
|
|
476
237
|
}
|
|
477
|
-
export interface
|
|
478
|
-
manual_ban: boolean;
|
|
238
|
+
export interface UserFlagMetadata {
|
|
479
239
|
reason: string;
|
|
480
240
|
username?: string | null;
|
|
481
|
-
full_name?: string | null;
|
|
482
241
|
email?: string | null;
|
|
483
242
|
description?: string | null;
|
|
484
243
|
website_link?: string | null;
|
|
485
244
|
profile_pic_url?: string | null;
|
|
486
245
|
recaptcha_score?: number | null;
|
|
487
246
|
}
|
|
488
|
-
declare const _supportedProStores: readonly ["app_store", "play_store", "stripe", "hevy-gift", "gympass", "paddle", "hevy-coach"];
|
|
489
|
-
type UserHevyProSubcriptionStore = Lookup<typeof _supportedProStores>;
|
|
490
247
|
export interface UserHevyProSubcription {
|
|
491
248
|
is_pro: boolean;
|
|
492
249
|
active_subscription?: {
|
|
493
|
-
managing_store:
|
|
250
|
+
managing_store: 'app_store' | 'play_store' | 'stripe' | 'hevy-gift' | 'gympass';
|
|
494
251
|
type: 'monthly' | 'yearly' | 'lifetime' | 'custom';
|
|
495
252
|
expires_date?: string;
|
|
496
|
-
|
|
497
|
-
/**
|
|
498
|
-
* Set if the user has paused/cancelled their subscription
|
|
499
|
-
*/
|
|
500
|
-
subscription_cancels_on?: string;
|
|
253
|
+
unsubscribe_detected_at?: string;
|
|
501
254
|
};
|
|
502
255
|
}
|
|
503
256
|
export interface UserPreferences {
|
|
@@ -514,20 +267,12 @@ export interface UserPreferences {
|
|
|
514
267
|
plate_calculator_enabled?: boolean;
|
|
515
268
|
previous_workout_values_from_routine?: boolean;
|
|
516
269
|
rpe_enabled?: boolean;
|
|
517
|
-
timer_volume?:
|
|
518
|
-
live_pr_volume?: LivePRVolumeOption;
|
|
270
|
+
timer_volume?: string;
|
|
519
271
|
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;
|
|
524
272
|
}
|
|
525
|
-
export type UpdateUserPreferencesRequest = Omit<UserPreferences, 'username'
|
|
273
|
+
export type UpdateUserPreferencesRequest = Omit<UserPreferences, 'username'>;
|
|
526
274
|
export type FollowingStatus = 'not-following' | 'following' | 'requested';
|
|
527
275
|
export type FollowingStatusMap = {
|
|
528
|
-
[id: string]: Omit<FollowingStatus, 'not-following'>;
|
|
529
|
-
};
|
|
530
|
-
export type FollowingStatusesResponse = {
|
|
531
276
|
[id: string]: 'following' | 'requested';
|
|
532
277
|
};
|
|
533
278
|
export interface FollowRequest {
|
|
@@ -544,12 +289,24 @@ export interface SearchUser {
|
|
|
544
289
|
private_profile: boolean;
|
|
545
290
|
verified: boolean;
|
|
546
291
|
}
|
|
547
|
-
export interface
|
|
292
|
+
export interface RoutineLibraryRoutine {
|
|
548
293
|
id: string;
|
|
549
|
-
|
|
294
|
+
title: string;
|
|
550
295
|
username: string;
|
|
551
|
-
|
|
552
|
-
|
|
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[];
|
|
553
310
|
}
|
|
554
311
|
export interface WeeklyWorkoutDuration {
|
|
555
312
|
week_start_date: string;
|
|
@@ -561,10 +318,6 @@ export interface RoutineMetadata {
|
|
|
561
318
|
short_id: string;
|
|
562
319
|
title: string;
|
|
563
320
|
}
|
|
564
|
-
export type PreviewMutualUser = {
|
|
565
|
-
username: string;
|
|
566
|
-
profile_pic: string | null;
|
|
567
|
-
};
|
|
568
321
|
export interface UserProfile {
|
|
569
322
|
username: string;
|
|
570
323
|
verified: boolean;
|
|
@@ -575,14 +328,12 @@ export interface UserProfile {
|
|
|
575
328
|
website_link?: string;
|
|
576
329
|
workout_count: number;
|
|
577
330
|
following_status: FollowingStatus;
|
|
578
|
-
is_followed_by_requester: boolean;
|
|
579
331
|
private_profile: boolean;
|
|
580
332
|
is_blocked: boolean;
|
|
581
333
|
follower_count: number;
|
|
582
334
|
following_count: number;
|
|
583
335
|
routines: RoutineMetadata[];
|
|
584
336
|
weekly_workout_durations: WeeklyWorkoutDuration[];
|
|
585
|
-
mutual_followers: PreviewMutualUser[];
|
|
586
337
|
}
|
|
587
338
|
export interface PublicUserProfile {
|
|
588
339
|
private_profile: boolean;
|
|
@@ -599,96 +350,36 @@ export interface PublicUserProfile {
|
|
|
599
350
|
weekly_workout_durations: WeeklyWorkoutDuration[];
|
|
600
351
|
last_workout?: Workout;
|
|
601
352
|
}
|
|
602
|
-
export
|
|
603
|
-
export declare const
|
|
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>;
|
|
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[];
|
|
614
355
|
export declare const isMuscleGroup: (x: string) => x is MuscleGroup;
|
|
615
|
-
export declare const muscleGroupFilters:
|
|
616
|
-
export type MuscleGroupFilter = Lookup<typeof muscleGroupFilters>;
|
|
356
|
+
export declare const muscleGroupFilters: MuscleGroupFilter[];
|
|
617
357
|
export declare const isMuscleGroupFilter: (x: string) => x is MuscleGroupFilter;
|
|
618
|
-
export
|
|
358
|
+
export type MuscleGroupFilter = MuscleGroup | 'all_muscles';
|
|
619
359
|
/**
|
|
620
360
|
* Equipment
|
|
621
361
|
*/
|
|
622
|
-
export
|
|
623
|
-
export
|
|
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[];
|
|
624
366
|
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>;
|
|
627
367
|
export declare const isEquipmentFilter: (x: string) => x is EquipmentFilter;
|
|
628
|
-
export declare const exerciseRepTypes: readonly ["weight_reps", "reps_only", "bodyweight_reps", "bodyweight_assisted_reps"];
|
|
629
368
|
/**
|
|
630
|
-
*
|
|
369
|
+
* ExerciseType
|
|
631
370
|
*
|
|
632
371
|
* weight_reps = Bench Press
|
|
633
372
|
* bodyweight_reps = Pull ups (Weighted)
|
|
634
373
|
* bodyweight_assisted_reps = Pull Ups (Assisted)
|
|
635
374
|
* reps_only = Pull ups
|
|
636
375
|
*/
|
|
637
|
-
export type ExerciseRepType =
|
|
638
|
-
export
|
|
639
|
-
export declare const exerciseTypes:
|
|
640
|
-
export type ExerciseType = Lookup<typeof exerciseTypes>;
|
|
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[];
|
|
641
379
|
export declare const isExerciseType: (x: any) => x is ExerciseType;
|
|
642
|
-
export
|
|
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 {
|
|
380
|
+
export interface ExerciseTemplate {
|
|
664
381
|
id: string;
|
|
665
382
|
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;
|
|
692
383
|
es_title?: string;
|
|
693
384
|
de_title?: string;
|
|
694
385
|
fr_title?: string;
|
|
@@ -700,47 +391,37 @@ export interface LibraryExercise extends BaseExerciseTemplate {
|
|
|
700
391
|
ru_title?: string;
|
|
701
392
|
zh_cn_title?: string;
|
|
702
393
|
zh_tw_title?: string;
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
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 */
|
|
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;
|
|
721
401
|
custom_exercise_image_url?: string;
|
|
722
|
-
|
|
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;
|
|
723
411
|
/** Used for Hevy Coach: in Hevy Coach, changes to a parent template propagate to children, and clients can't edit the children */
|
|
724
412
|
parent_exercise_template_id?: string;
|
|
725
413
|
}
|
|
726
|
-
|
|
727
|
-
export type SetPersonalRecordType =
|
|
728
|
-
export declare const isSetPersonalRecordType: (x: string) => x is SetPersonalRecordType;
|
|
414
|
+
/** Workouts */
|
|
415
|
+
export type SetPersonalRecordType = 'best_weight' | 'best_reps' | 'best_volume' | 'best_1rm' | 'best_duration' | 'best_distance';
|
|
729
416
|
export interface SetPersonalRecord {
|
|
730
417
|
exercise_template_id: string;
|
|
731
418
|
type: SetPersonalRecordType;
|
|
732
419
|
record: number;
|
|
733
420
|
}
|
|
734
|
-
export
|
|
735
|
-
export type RPE = Lookup<typeof validRpeValues>;
|
|
421
|
+
export type RPE = 6 | 7 | 7.5 | 8 | 8.5 | 9 | 9.5 | 10;
|
|
736
422
|
export declare const isRPE: (x: number) => x is RPE;
|
|
737
|
-
declare const
|
|
738
|
-
export type SetType =
|
|
739
|
-
export declare const isSetType: (x: string) => x is SetType;
|
|
740
|
-
export interface RepRange {
|
|
741
|
-
start: number | null;
|
|
742
|
-
end: number | null;
|
|
743
|
-
}
|
|
423
|
+
export declare const validRpeValues: RPE[];
|
|
424
|
+
export type SetType = 'warmup' | 'normal' | 'failure' | 'dropset';
|
|
744
425
|
export interface WorkoutExerciseSet {
|
|
745
426
|
/**
|
|
746
427
|
* id can be a string or a number because we used
|
|
@@ -755,7 +436,6 @@ export interface WorkoutExerciseSet {
|
|
|
755
436
|
reps?: number | null;
|
|
756
437
|
distance_meters?: number | null;
|
|
757
438
|
duration_seconds?: number | null;
|
|
758
|
-
custom_metric?: number | null;
|
|
759
439
|
rpe?: RPE | null;
|
|
760
440
|
/**
|
|
761
441
|
* @deprecated 1.29.17 -
|
|
@@ -771,7 +451,6 @@ export interface WorkoutExerciseSet {
|
|
|
771
451
|
type: SetPersonalRecordType;
|
|
772
452
|
value: number;
|
|
773
453
|
}[];
|
|
774
|
-
completed_at: string | null;
|
|
775
454
|
}
|
|
776
455
|
export interface WorkoutExercise {
|
|
777
456
|
id: string;
|
|
@@ -799,29 +478,20 @@ export interface WorkoutExercise {
|
|
|
799
478
|
url?: string;
|
|
800
479
|
media_type?: string;
|
|
801
480
|
custom_exercise_image_url?: string | null;
|
|
481
|
+
/** @deprecated 1.22.5 */
|
|
482
|
+
custom_exercise_image_thumbnail_url?: string | null;
|
|
802
483
|
thumbnail_url?: string | null;
|
|
803
484
|
manual_tag?: string;
|
|
804
485
|
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;
|
|
812
486
|
sets: WorkoutExerciseSet[];
|
|
813
487
|
}
|
|
814
488
|
export interface WorkoutComment {
|
|
815
489
|
id: number;
|
|
816
490
|
username: string;
|
|
817
491
|
verified: boolean;
|
|
818
|
-
full_name?: string;
|
|
819
492
|
profile_pic?: string;
|
|
820
493
|
comment: string;
|
|
821
494
|
created_at: string;
|
|
822
|
-
like_count: number;
|
|
823
|
-
is_liked_by_user: boolean;
|
|
824
|
-
parent_comment_id?: number;
|
|
825
495
|
}
|
|
826
496
|
export interface WorkoutImage {
|
|
827
497
|
type: 'image';
|
|
@@ -833,10 +503,6 @@ export interface WorkoutVideo {
|
|
|
833
503
|
thumbnail_url: string;
|
|
834
504
|
}
|
|
835
505
|
export type WorkoutMedia = WorkoutImage | WorkoutVideo;
|
|
836
|
-
export type PreviewWorkoutLike = {
|
|
837
|
-
username: string;
|
|
838
|
-
profile_pic: string;
|
|
839
|
-
};
|
|
840
506
|
export interface Workout {
|
|
841
507
|
id: string;
|
|
842
508
|
short_id: string | null;
|
|
@@ -844,9 +510,7 @@ export interface Workout {
|
|
|
844
510
|
name: string;
|
|
845
511
|
description?: string;
|
|
846
512
|
like_count: number;
|
|
847
|
-
/** @deprecated 2.3.4 */
|
|
848
513
|
like_images: string[];
|
|
849
|
-
preview_workout_likes: PreviewWorkoutLike[];
|
|
850
514
|
comment_count: number;
|
|
851
515
|
comments: WorkoutComment[];
|
|
852
516
|
/** @deprecated 1.28.13 */
|
|
@@ -861,7 +525,6 @@ export interface Workout {
|
|
|
861
525
|
exercises: WorkoutExercise[];
|
|
862
526
|
routine_id?: string;
|
|
863
527
|
apple_watch: boolean;
|
|
864
|
-
wearos_watch: boolean;
|
|
865
528
|
verified: boolean;
|
|
866
529
|
created_at: string;
|
|
867
530
|
updated_at: string;
|
|
@@ -871,30 +534,8 @@ export interface Workout {
|
|
|
871
534
|
* why we added estimated_volume_kg
|
|
872
535
|
*/
|
|
873
536
|
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;
|
|
879
537
|
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;
|
|
896
538
|
}
|
|
897
|
-
export type CustomExerciseMedia = CustomExerciseImage | CustomExerciseVideo;
|
|
898
539
|
export declare const isPublicWorkout: (x: any) => x is PublicWorkout;
|
|
899
540
|
export interface PublicWorkout {
|
|
900
541
|
type: 'public';
|
|
@@ -921,109 +562,68 @@ export interface WorkoutSync {
|
|
|
921
562
|
updated: Workout[];
|
|
922
563
|
deleted: string[];
|
|
923
564
|
isMore: boolean;
|
|
924
|
-
updated_at?: string;
|
|
925
565
|
}
|
|
926
566
|
export interface PostWorkoutRequest {
|
|
927
567
|
workout: PostWorkoutRequestWorkout;
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
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;
|
|
568
|
+
source?: string;
|
|
569
|
+
isEventLoggedByAppleWatch?: boolean;
|
|
570
|
+
emptyResponse: boolean;
|
|
945
571
|
updateRoutineValues: boolean;
|
|
572
|
+
/** @deprecated 1.22.6 */
|
|
573
|
+
updateRoutineOptions?: {
|
|
574
|
+
updateValuesDumb: boolean;
|
|
575
|
+
};
|
|
946
576
|
}
|
|
947
577
|
/**
|
|
948
578
|
* PostWorkoutRequestWorkout describes the final state of a completed workout.
|
|
949
579
|
* It's used when sending a workout to the server.
|
|
950
580
|
*/
|
|
951
581
|
export interface PostWorkoutRequestWorkout {
|
|
952
|
-
|
|
582
|
+
name: string;
|
|
953
583
|
description: string;
|
|
584
|
+
/** @deprecated 1.28.13 */
|
|
585
|
+
imageUrls?: string[];
|
|
954
586
|
media: WorkoutMedia[];
|
|
955
|
-
|
|
956
|
-
|
|
587
|
+
startTime: number;
|
|
588
|
+
endTime: number;
|
|
957
589
|
exercises: PostWorkoutRequestExercise[];
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
is_biometrics_public: boolean;
|
|
965
|
-
trainer_program_id: string | undefined;
|
|
966
|
-
}
|
|
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;
|
|
590
|
+
routineId?: string;
|
|
591
|
+
trackWorkoutAsRoutine: boolean;
|
|
592
|
+
updateRoutineFromWorkout?: boolean;
|
|
593
|
+
appleWatch: boolean;
|
|
594
|
+
clientId: string;
|
|
595
|
+
isPrivate?: boolean;
|
|
973
596
|
}
|
|
974
|
-
export interface
|
|
975
|
-
|
|
976
|
-
|
|
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;
|
|
977
605
|
}
|
|
978
606
|
export interface PostWorkoutRequestExercise {
|
|
979
607
|
title: string;
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
608
|
+
/** poorly named exercise template id */
|
|
609
|
+
id: string;
|
|
610
|
+
supersetId?: number;
|
|
611
|
+
autoRestTimerSeconds?: number;
|
|
983
612
|
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;
|
|
991
613
|
sets: PostWorkoutRequestSet[];
|
|
992
614
|
}
|
|
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
|
-
};
|
|
1012
615
|
/** Routines */
|
|
1013
616
|
export interface RoutineSet {
|
|
617
|
+
id: number;
|
|
1014
618
|
index: number;
|
|
1015
619
|
indicator: SetType;
|
|
1016
620
|
weight_kg?: number | null;
|
|
1017
621
|
reps?: number | null;
|
|
1018
622
|
distance_meters?: number | null;
|
|
1019
623
|
duration_seconds?: number | null;
|
|
1020
|
-
custom_metric?: number | null;
|
|
1021
|
-
rpe?: RPE | null;
|
|
1022
|
-
rep_range?: RepRange;
|
|
1023
624
|
}
|
|
1024
625
|
export interface RoutineExercise {
|
|
1025
626
|
id: string;
|
|
1026
|
-
/** This is the username of the exercise_template */
|
|
1027
627
|
username: string;
|
|
1028
628
|
exercise_template_id: string;
|
|
1029
629
|
warmup_set_count: number;
|
|
@@ -1049,12 +649,14 @@ export interface RoutineExercise {
|
|
|
1049
649
|
url?: string | null;
|
|
1050
650
|
custom_exercise_image_url?: string | null;
|
|
1051
651
|
parent_exercise_template_id?: string | null;
|
|
652
|
+
/** @deprecated 1.22.5 */
|
|
653
|
+
custom_exercise_image_thumbnail_url?: string | null;
|
|
1052
654
|
thumbnail_url?: string | null;
|
|
1053
655
|
media_type?: string;
|
|
1054
656
|
superset_id: number | null;
|
|
1055
657
|
rest_seconds: number | null;
|
|
1056
|
-
input_modifier?: 'rep-range';
|
|
1057
658
|
}
|
|
659
|
+
export type ShallowRoutineExercise = Omit<RoutineExercise, 'sets'>;
|
|
1058
660
|
export interface BaseRoutine {
|
|
1059
661
|
id: string;
|
|
1060
662
|
short_id: string;
|
|
@@ -1069,26 +671,15 @@ export interface BaseRoutine {
|
|
|
1069
671
|
program_id: string | null;
|
|
1070
672
|
coach_id: string | null;
|
|
1071
673
|
notes: string | null;
|
|
1072
|
-
coach_force_rpe_enabled: boolean;
|
|
1073
|
-
hevy_trainer_program_id: string | null;
|
|
1074
|
-
created_at: string;
|
|
1075
674
|
}
|
|
1076
675
|
export interface Routine extends BaseRoutine {
|
|
1077
676
|
username: string;
|
|
1078
|
-
coach_id: null;
|
|
1079
677
|
}
|
|
1080
|
-
export interface
|
|
1081
|
-
|
|
1082
|
-
program_id: null;
|
|
1083
|
-
coach_force_rpe_enabled: false;
|
|
1084
|
-
folder_id: null;
|
|
678
|
+
export interface RoutineWithShallowExercises extends Omit<BaseRoutine, 'exercises'> {
|
|
679
|
+
exercises: ShallowRoutineExercise[];
|
|
1085
680
|
}
|
|
1086
|
-
export declare const isHevyTrainerRoutine: (routine: BaseRoutine) => routine is HevyTrainerRoutine;
|
|
1087
|
-
export type CoachsShallowLibraryRoutine = Omit<BaseRoutine, 'exercises' | 'profile_pic' | 'hevy_trainer_program_id' | 'username'>;
|
|
1088
681
|
export interface CoachesRoutine extends BaseRoutine {
|
|
1089
682
|
coach_id: string;
|
|
1090
|
-
username: null;
|
|
1091
|
-
hevy_trainer_program_id: null;
|
|
1092
683
|
}
|
|
1093
684
|
export interface CoachAndCoachsClientsRoutineSyncResponse {
|
|
1094
685
|
updated: BaseRoutine[];
|
|
@@ -1101,7 +692,6 @@ export interface RoutineSync {
|
|
|
1101
692
|
updated: Routine[];
|
|
1102
693
|
deleted: string[];
|
|
1103
694
|
isMore: boolean;
|
|
1104
|
-
updated_at?: string;
|
|
1105
695
|
}
|
|
1106
696
|
export interface RoutineUpdate {
|
|
1107
697
|
title: string;
|
|
@@ -1111,7 +701,6 @@ export interface RoutineUpdate {
|
|
|
1111
701
|
index: number;
|
|
1112
702
|
program_id: string | null;
|
|
1113
703
|
notes: string | null;
|
|
1114
|
-
coach_force_rpe_enabled?: boolean;
|
|
1115
704
|
}
|
|
1116
705
|
export interface PostRoutineRequest extends RoutineUpdate {
|
|
1117
706
|
clientId: string;
|
|
@@ -1122,7 +711,6 @@ export interface RoutineUpdateExercise {
|
|
|
1122
711
|
rest_seconds?: number | null;
|
|
1123
712
|
sets: RoutineUpdateSet[];
|
|
1124
713
|
notes?: string | null;
|
|
1125
|
-
input_modifier?: 'rep-range';
|
|
1126
714
|
}
|
|
1127
715
|
export interface RoutineUpdateSet {
|
|
1128
716
|
index: number;
|
|
@@ -1131,9 +719,6 @@ export interface RoutineUpdateSet {
|
|
|
1131
719
|
reps?: number | null;
|
|
1132
720
|
distance_meters?: number | null;
|
|
1133
721
|
duration_seconds?: number | null;
|
|
1134
|
-
custom_metric?: number | null;
|
|
1135
|
-
rpe?: RPE | null;
|
|
1136
|
-
rep_range?: RepRange;
|
|
1137
722
|
}
|
|
1138
723
|
export interface RoutineFolderLocationUpdate {
|
|
1139
724
|
folderId: number;
|
|
@@ -1151,13 +736,6 @@ export interface RoutineFolder {
|
|
|
1151
736
|
created_at: string;
|
|
1152
737
|
updated_at: string;
|
|
1153
738
|
}
|
|
1154
|
-
export interface ShareableRoutineFolder {
|
|
1155
|
-
id: number;
|
|
1156
|
-
title: string;
|
|
1157
|
-
username: string;
|
|
1158
|
-
profile_pic?: string;
|
|
1159
|
-
routines: Routine[];
|
|
1160
|
-
}
|
|
1161
739
|
export interface Program {
|
|
1162
740
|
id: string;
|
|
1163
741
|
title: string;
|
|
@@ -1167,26 +745,12 @@ export interface Program {
|
|
|
1167
745
|
template_program_id: string | null;
|
|
1168
746
|
folder_id: number | null;
|
|
1169
747
|
index: number | null;
|
|
1170
|
-
notes: string | null;
|
|
1171
|
-
duration_days: number | null;
|
|
1172
|
-
start_date: string | null;
|
|
1173
748
|
}
|
|
1174
749
|
export interface ProgramUpdate {
|
|
1175
750
|
title: string;
|
|
1176
751
|
template_program_id: string | null;
|
|
1177
752
|
client_id: string | null;
|
|
1178
753
|
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[];
|
|
1190
754
|
}
|
|
1191
755
|
export interface ProgramLocationUpdate {
|
|
1192
756
|
index: number;
|
|
@@ -1198,7 +762,6 @@ export interface ProgramFolder {
|
|
|
1198
762
|
id: number;
|
|
1199
763
|
index: number;
|
|
1200
764
|
title: string;
|
|
1201
|
-
coach_id: string;
|
|
1202
765
|
}
|
|
1203
766
|
export interface ProgramFolderLocationUpdate {
|
|
1204
767
|
index: number;
|
|
@@ -1214,182 +777,77 @@ export interface GetInviteResponse {
|
|
|
1214
777
|
coach_username: string;
|
|
1215
778
|
coach_profile_pic?: string;
|
|
1216
779
|
invitee_email: string;
|
|
1217
|
-
invitee_username?: string;
|
|
1218
780
|
}
|
|
1219
781
|
export interface CoachClientInvite {
|
|
1220
782
|
client_id: string | null;
|
|
1221
783
|
coach_id: string;
|
|
1222
784
|
created_at: Date;
|
|
1223
785
|
invitee_email: string;
|
|
1224
|
-
invitee_username: string | null;
|
|
1225
|
-
invitee_profile_pic: string | null;
|
|
1226
|
-
invitee_full_name: string | null;
|
|
1227
786
|
short_id: string;
|
|
1228
787
|
declined_at: Date | null;
|
|
1229
788
|
}
|
|
1230
789
|
export interface OutstandingInvitesForCoachResponse {
|
|
1231
790
|
invites: CoachClientInvite[];
|
|
1232
791
|
}
|
|
1233
|
-
export interface
|
|
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 {
|
|
1255
|
-
id: string;
|
|
1256
|
-
created_at: string;
|
|
1257
|
-
updated_at: string;
|
|
1258
|
-
title: 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;
|
|
1306
|
-
created_at: 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 {
|
|
792
|
+
export interface BodyMeasurement {
|
|
1359
793
|
id: number;
|
|
1360
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 {
|
|
813
|
+
id: string;
|
|
814
|
+
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;
|
|
1361
823
|
created_at: string;
|
|
1362
|
-
|
|
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;
|
|
1363
828
|
}
|
|
1364
|
-
export type PostBodyMeasurementRequest = Omit<BodyMeasurement, 'id' | 'created_at'>;
|
|
1365
829
|
export interface CreateCustomExerciseRequest {
|
|
1366
830
|
title: string;
|
|
1367
831
|
muscle_group: MuscleGroup;
|
|
1368
832
|
other_muscles: MuscleGroup[];
|
|
1369
|
-
exercise_type:
|
|
833
|
+
exercise_type: ExerciseType;
|
|
1370
834
|
equipment_category: Equipment;
|
|
1371
|
-
/** @deprecated 2.2.4*/
|
|
1372
835
|
custom_exercise_image_url?: string;
|
|
1373
|
-
|
|
836
|
+
/** @deprecated 1.22.5 */
|
|
837
|
+
custom_exercise_image_thumbnail_url?: string;
|
|
1374
838
|
thumbnail_url?: string;
|
|
1375
839
|
/** if set, the template will be related to the coach, not via username */
|
|
1376
840
|
coach_id?: string;
|
|
1377
841
|
}
|
|
1378
|
-
export interface GetVolumeDoublingEnabledExercisesResponse {
|
|
1379
|
-
exerciseTemplateIds: string[];
|
|
1380
|
-
}
|
|
1381
|
-
export interface PostVolumeDoublingEnabledExercisesRequest {
|
|
1382
|
-
exerciseTemplateIds: string[];
|
|
1383
|
-
}
|
|
1384
842
|
export interface UpdateCustomExerciseRequest {
|
|
1385
843
|
id: string;
|
|
1386
844
|
title: string;
|
|
1387
845
|
muscle_group: MuscleGroup;
|
|
1388
846
|
other_muscles: MuscleGroup[];
|
|
1389
847
|
equipment_category: Equipment;
|
|
1390
|
-
/** @deprecated 2.2.4*/
|
|
1391
848
|
custom_exercise_image_url?: string;
|
|
1392
|
-
|
|
849
|
+
/** @deprecated 1.22.5 */
|
|
850
|
+
custom_exercise_image_thumbnail_url?: string;
|
|
1393
851
|
thumbnail_url?: string;
|
|
1394
852
|
}
|
|
1395
853
|
export type ExerciseTemplateCustomizationAttachmentUrlType = 'mp4_video' | 'youtube';
|
|
@@ -1408,27 +866,95 @@ export interface ClientRecentExerciseData {
|
|
|
1408
866
|
exercise_template_id: string;
|
|
1409
867
|
date_used: number;
|
|
1410
868
|
}
|
|
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';
|
|
1411
948
|
export type WeightRepComparisonMetric = 'one_rep_max' | 'best_weight' | 'best_set_volume';
|
|
1412
949
|
export type RepsOnlyComparisonMetric = 'best_set_reps' | 'best_session_reps';
|
|
1413
950
|
export type ComparisonMetric = WeightRepComparisonMetric | RepsOnlyComparisonMetric;
|
|
1414
|
-
export type ExerciseMetricComparison =
|
|
1415
|
-
interface
|
|
951
|
+
export type ExerciseMetricComparison = WeightRepExerciseMetricComparison | RepsOnlyExerciseMetricComparison;
|
|
952
|
+
export interface WeightRepExerciseMetricComparison {
|
|
1416
953
|
type: 'weight_rep';
|
|
1417
954
|
metric_id: WeightRepComparisonMetric;
|
|
1418
955
|
current_user_value_kg: number;
|
|
1419
956
|
other_user_value_kg: number;
|
|
1420
957
|
}
|
|
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
|
-
}
|
|
1432
958
|
export interface RepsOnlyExerciseMetricComparison {
|
|
1433
959
|
type: 'reps_only';
|
|
1434
960
|
metric_id: RepsOnlyComparisonMetric;
|
|
@@ -1441,7 +967,7 @@ export interface UserWeeklyWorkoutDuration {
|
|
|
1441
967
|
total_seconds: number;
|
|
1442
968
|
}
|
|
1443
969
|
export interface GeneratePasswordRecoveryTokenResult {
|
|
1444
|
-
result: 'success';
|
|
970
|
+
result: 'success' | 'unknown-email';
|
|
1445
971
|
}
|
|
1446
972
|
export interface PromoResponse {
|
|
1447
973
|
endDate: string;
|
|
@@ -1460,9 +986,6 @@ export interface PromoResponse {
|
|
|
1460
986
|
zh_TW: string;
|
|
1461
987
|
};
|
|
1462
988
|
}
|
|
1463
|
-
export interface HevyCoachLaunchStatusResponse {
|
|
1464
|
-
endDate: string;
|
|
1465
|
-
}
|
|
1466
989
|
export interface UserExerciseSet {
|
|
1467
990
|
workout_id: string;
|
|
1468
991
|
workout_short_id: string;
|
|
@@ -1476,8 +999,6 @@ export interface UserExerciseSet {
|
|
|
1476
999
|
duration_seconds: number | null;
|
|
1477
1000
|
distance_meters: number | null;
|
|
1478
1001
|
rpe: RPE | null;
|
|
1479
|
-
user_bodyweight_kg: number | null;
|
|
1480
|
-
custom_metric: number | null;
|
|
1481
1002
|
}
|
|
1482
1003
|
export type SetCountMuscleSplitResponse = {
|
|
1483
1004
|
[key in MuscleGroup]: number;
|
|
@@ -1497,29 +1018,6 @@ export interface UserProfileCompareResponse {
|
|
|
1497
1018
|
duration_seconds: number;
|
|
1498
1019
|
};
|
|
1499
1020
|
}
|
|
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
|
-
}
|
|
1523
1021
|
export interface ServerYearInReview {
|
|
1524
1022
|
supporters: Array<{
|
|
1525
1023
|
username: string;
|
|
@@ -1538,30 +1036,36 @@ export type PlateCalculatorPlate = {
|
|
|
1538
1036
|
weight: number;
|
|
1539
1037
|
unit: WeightUnit;
|
|
1540
1038
|
};
|
|
1541
|
-
export interface
|
|
1542
|
-
|
|
1543
|
-
|
|
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;
|
|
1544
1068
|
}
|
|
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
|
-
};
|
|
1565
1069
|
export interface ExerciseTemplateUnit {
|
|
1566
1070
|
id: number;
|
|
1567
1071
|
exercise_template_id: string;
|
|
@@ -1572,30 +1076,17 @@ export interface UserMetadataRequest {
|
|
|
1572
1076
|
platform: string;
|
|
1573
1077
|
platformVersion: string;
|
|
1574
1078
|
appVersion: string;
|
|
1575
|
-
securityId?: string;
|
|
1576
|
-
googleAdId?: string;
|
|
1577
|
-
appleIdfv?: string;
|
|
1578
|
-
adjustAdId?: string;
|
|
1579
1079
|
}
|
|
1580
|
-
export type NetworkType = 'wifi' | 'cellular' | 'unknown';
|
|
1581
1080
|
export interface UserMetadataResponse {
|
|
1582
1081
|
created_at: string;
|
|
1583
1082
|
updated_at: string;
|
|
1584
|
-
app_language: string
|
|
1585
|
-
platform: string
|
|
1586
|
-
platform_version: string
|
|
1587
|
-
app_version: string
|
|
1083
|
+
app_language: string;
|
|
1084
|
+
platform: string;
|
|
1085
|
+
platform_version: string;
|
|
1086
|
+
app_version: string;
|
|
1588
1087
|
geoip_country: string | null;
|
|
1589
1088
|
geoip_city: string | null;
|
|
1590
1089
|
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;
|
|
1599
1090
|
}
|
|
1600
1091
|
export interface StripePrice {
|
|
1601
1092
|
product_id: string;
|
|
@@ -1615,29 +1106,9 @@ export interface StripeCheckoutSessionRequest {
|
|
|
1615
1106
|
export interface StripeCheckoutSessionResponse {
|
|
1616
1107
|
url: string;
|
|
1617
1108
|
}
|
|
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
|
-
*/
|
|
1635
1109
|
export interface StripeCustomerPortalSessionRequest {
|
|
1636
1110
|
return_url: string;
|
|
1637
1111
|
}
|
|
1638
|
-
/**
|
|
1639
|
-
* @deprecated Migrating to Paddle, but needed to allow existing customers to cancel their Stripe subscriptions
|
|
1640
|
-
*/
|
|
1641
1112
|
export interface StripeCustomerPortalSessionResponse {
|
|
1642
1113
|
url: string;
|
|
1643
1114
|
}
|
|
@@ -1646,16 +1117,34 @@ export type UserKeyValues = {
|
|
|
1646
1117
|
[key: string]: UserValue;
|
|
1647
1118
|
};
|
|
1648
1119
|
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
|
+
}
|
|
1649
1140
|
/**
|
|
1650
1141
|
* Used for the chat backend to validate authentication details
|
|
1651
1142
|
*/
|
|
1652
|
-
export type UserAuthenticationValidationResponse = 'unauthorized' | 'authorized_user' | 'admin' | 'banned' | '
|
|
1653
|
-
declare const _validUserWorkoutMetricsTypes: readonly ["duration", "reps"];
|
|
1143
|
+
export type UserAuthenticationValidationResponse = 'unauthorized' | 'authorized_user' | 'admin' | 'banned' | 'flagged';
|
|
1654
1144
|
/**
|
|
1655
1145
|
* Used for hevy-web for fetching profile metrics and calendar data
|
|
1656
1146
|
*/
|
|
1657
|
-
export type UserWorkoutMetricsType =
|
|
1658
|
-
export declare const isValidUserWorkoutMetricsType: (x: any) => x is UserWorkoutMetricsType;
|
|
1147
|
+
export type UserWorkoutMetricsType = 'duration' | 'reps';
|
|
1659
1148
|
interface WorkoutMetricBase {
|
|
1660
1149
|
workout_id: string;
|
|
1661
1150
|
start_time: number;
|
|
@@ -1670,335 +1159,10 @@ export interface DurationWorkoutMetric extends WorkoutMetricBase {
|
|
|
1670
1159
|
duration_seconds: number;
|
|
1671
1160
|
}
|
|
1672
1161
|
export type WorkoutMetric = RepsWorkoutMetric | DurationWorkoutMetric;
|
|
1162
|
+
export declare const isValidUserWorkoutMetricsType: (x: any) => x is UserWorkoutMetricsType;
|
|
1673
1163
|
export interface UserCalendarWorkout {
|
|
1674
1164
|
workout_short_id: string;
|
|
1675
1165
|
title: string;
|
|
1676
1166
|
start_time: number;
|
|
1677
1167
|
duration_seconds: number;
|
|
1678
1168
|
}
|
|
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
|
-
}
|