hevy-shared 1.0.988 → 1.0.989
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/built/hevyTrainer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WeeklyTrainingFrequency, TrainingGoal, TrainingLevel, SimplifiedMuscleGroup, MuscleGroup, LibraryExercise, ExerciseCategory, GranularEquipment, HevyTrainerProgramEquipment, RestTimerLength, CardioPreference } from '.';
|
|
2
2
|
export type HevyTrainerExerciseCategory = typeof hevyTrainerExerciseCategories[number];
|
|
3
|
-
export type
|
|
3
|
+
export type TrainerWorkoutTemplateName = typeof workoutTemplateNames[number];
|
|
4
4
|
export declare const workoutDurationOptions: readonly [40, 60, 80];
|
|
5
5
|
export type WorkoutDurationMinutes = typeof workoutDurationOptions[number];
|
|
6
6
|
export declare const trainerGymTypes: readonly ["home_gym", "garage_gym", "commercial_gym", "full_gym"];
|
|
@@ -16,7 +16,7 @@ export declare const trainerEquipmentToGranularEquipments: (equipments: HevyTrai
|
|
|
16
16
|
export declare const granularEquipmentsToTrainerEquipments: (granularEquipments: GranularEquipment[]) => HevyTrainerProgramEquipment[];
|
|
17
17
|
export declare const hevyTrainerExerciseCategories: readonly ["compound", "isolation"];
|
|
18
18
|
export declare const defaultDurationPerFrequency: Record<WeeklyTrainingFrequency, WorkoutDurationMinutes>;
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const workoutTemplateNames: readonly ["full_body_1", "full_body_2_a", "full_body_2_b", "full_body_3_a", "full_body_3_b", "full_body_3_c", "upper_1_a", "lower_1_a", "upper_1_b", "lower_1_b", "push_1", "pull_1", "legs_1", "upper_2", "lower_2", "push_2_a", "pull_2_a", "legs_2_a", "push_2_b", "pull_2_b", "legs_2_b"];
|
|
20
20
|
export type exerciseId = string;
|
|
21
21
|
export interface ExerciseSelectionCriteria {
|
|
22
22
|
exerciseCategory: HevyTrainerExerciseCategory | 'all';
|
|
@@ -69,7 +69,7 @@ export interface ProgramGenerationParams<T extends HevyTrainerLibraryExercise> {
|
|
|
69
69
|
}
|
|
70
70
|
export interface TemplateExerciseSelectionTraceRecord {
|
|
71
71
|
traceKind: 'template';
|
|
72
|
-
routine:
|
|
72
|
+
routine: TrainerWorkoutTemplateName;
|
|
73
73
|
prescriptionIndex: number;
|
|
74
74
|
prescription: ExercisePrescription;
|
|
75
75
|
resolvedMuscleGroup: MuscleGroup;
|
|
@@ -79,7 +79,7 @@ export interface TemplateExerciseSelectionTraceRecord {
|
|
|
79
79
|
}
|
|
80
80
|
export interface CardioExerciseSelectionTraceRecord {
|
|
81
81
|
traceKind: 'cardio';
|
|
82
|
-
routine:
|
|
82
|
+
routine: TrainerWorkoutTemplateName;
|
|
83
83
|
prescriptionIndex: number;
|
|
84
84
|
selectedExerciseId?: string;
|
|
85
85
|
equipments: GranularEquipment[];
|
|
@@ -92,7 +92,7 @@ export type TrainerProgramAttemptWithTraces = TrainerProgramAttempt & {
|
|
|
92
92
|
};
|
|
93
93
|
export type FrequencyString = 'one_day' | 'two_days' | 'three_days' | 'four_days' | 'five_days' | 'six_days';
|
|
94
94
|
export declare const frequencyMap: Record<WeeklyTrainingFrequency, FrequencyString>;
|
|
95
|
-
export declare const programSplits: Record<WeeklyTrainingFrequency,
|
|
95
|
+
export declare const programSplits: Record<WeeklyTrainingFrequency, TrainerWorkoutTemplateName[]>;
|
|
96
96
|
export type SetsPerGoal = {
|
|
97
97
|
[key in TrainingGoal]: number;
|
|
98
98
|
};
|
|
@@ -138,7 +138,7 @@ export interface WorkoutTemplate {
|
|
|
138
138
|
notes?: string;
|
|
139
139
|
}
|
|
140
140
|
export type Templates = {
|
|
141
|
-
[key in
|
|
141
|
+
[key in TrainerWorkoutTemplateName]: WorkoutTemplate;
|
|
142
142
|
};
|
|
143
143
|
export interface BackofficeTrainerPreset {
|
|
144
144
|
id?: number;
|
|
@@ -180,7 +180,7 @@ export type TrainerProgramExercise = TrainerProgramResistanceExercise | TrainerP
|
|
|
180
180
|
export declare const isTrainerProgramResistanceExercise: (exercise: TrainerProgramExercise) => exercise is TrainerProgramResistanceExercise;
|
|
181
181
|
export declare const isTrainerProgramCardioExercise: (exercise: TrainerProgramExercise) => exercise is TrainerProgramCardioExercise;
|
|
182
182
|
export interface TrainerProgramRoutine {
|
|
183
|
-
name:
|
|
183
|
+
name: TrainerWorkoutTemplateName;
|
|
184
184
|
exercises: TrainerProgramExercise[];
|
|
185
185
|
notes?: string;
|
|
186
186
|
}
|
package/built/hevyTrainer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_TRAINER_CARDIO_ATTACHMENT_DURATION_SECONDS = exports.getPrioritySortedExercises = exports.isEquipmentCompatible = exports.normalizeExerciseCategory = exports.getTrainerRestTimerSeconds = exports.getTrainerRepRange = exports.getTrainerSetCount = exports.isTrainerProgramCardioExercise = exports.isTrainerProgramResistanceExercise = exports.programSplits = exports.frequencyMap = exports.
|
|
3
|
+
exports.DEFAULT_TRAINER_CARDIO_ATTACHMENT_DURATION_SECONDS = exports.getPrioritySortedExercises = exports.isEquipmentCompatible = exports.normalizeExerciseCategory = exports.getTrainerRestTimerSeconds = exports.getTrainerRepRange = exports.getTrainerSetCount = exports.isTrainerProgramCardioExercise = exports.isTrainerProgramResistanceExercise = exports.programSplits = exports.frequencyMap = exports.workoutTemplateNames = exports.defaultDurationPerFrequency = exports.hevyTrainerExerciseCategories = exports.granularEquipmentsToTrainerEquipments = exports.trainerEquipmentToGranularEquipments = exports.granularEquipmentDefaults = exports.trainerGymTypes = exports.workoutDurationOptions = void 0;
|
|
4
4
|
exports.pickTrainerExercise = pickTrainerExercise;
|
|
5
5
|
exports.generateProgram = generateProgram;
|
|
6
6
|
const _1 = require(".");
|
|
@@ -152,7 +152,7 @@ exports.defaultDurationPerFrequency = {
|
|
|
152
152
|
5: 40,
|
|
153
153
|
6: 40,
|
|
154
154
|
};
|
|
155
|
-
exports.
|
|
155
|
+
exports.workoutTemplateNames = [
|
|
156
156
|
// Full body 1x
|
|
157
157
|
'full_body_1',
|
|
158
158
|
// Full body 2x
|
package/built/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InstructionsLanguage } from './exerciseLocaleUtils';
|
|
2
|
-
import { WorkoutDurationMinutes } from './hevyTrainer';
|
|
2
|
+
import { TrainerWorkoutTemplateName, WorkoutDurationMinutes } from './hevyTrainer';
|
|
3
3
|
import { postEmailBackofficeSchema } from './schemas';
|
|
4
4
|
import { Language } from './translations';
|
|
5
5
|
import { Lookup } from './typeUtils';
|
|
@@ -299,7 +299,7 @@ export interface BackofficeExistingUserResponse {
|
|
|
299
299
|
public_api_key: string | null;
|
|
300
300
|
limited_discovery: boolean;
|
|
301
301
|
coach_trial_expire_date?: string;
|
|
302
|
-
hevy_trainer_program:
|
|
302
|
+
hevy_trainer_program: TrainerProgramV3 | null;
|
|
303
303
|
}
|
|
304
304
|
export interface BackofficeDeletedUserResponse {
|
|
305
305
|
state: 'deleted-account';
|
|
@@ -887,6 +887,7 @@ export interface Workout {
|
|
|
887
887
|
biometrics?: WorkoutBiometrics;
|
|
888
888
|
is_biometrics_public: boolean;
|
|
889
889
|
trainer_program_id: string | undefined;
|
|
890
|
+
trainer_workout_template_id: string | undefined;
|
|
890
891
|
}
|
|
891
892
|
export interface CustomExerciseImage {
|
|
892
893
|
type: 'image';
|
|
@@ -966,6 +967,7 @@ export interface PostWorkoutRequestWorkout {
|
|
|
966
967
|
biometrics?: WorkoutBiometrics;
|
|
967
968
|
is_biometrics_public: boolean;
|
|
968
969
|
trainer_program_id: string | undefined;
|
|
970
|
+
trainer_workout_template_id: string | undefined;
|
|
969
971
|
}
|
|
970
972
|
export type WorkoutDataImporterReport = {
|
|
971
973
|
state: 'idle';
|
|
@@ -1267,6 +1269,97 @@ export interface GetTeamInviteResponse {
|
|
|
1267
1269
|
export interface OutstandingInvitesForCoachTeamResponse {
|
|
1268
1270
|
invites: CoachTeamInvite[];
|
|
1269
1271
|
}
|
|
1272
|
+
export interface TrainerWorkoutTemplateExercise {
|
|
1273
|
+
id: string;
|
|
1274
|
+
exercise_template_id: string;
|
|
1275
|
+
index: number;
|
|
1276
|
+
set_count: number;
|
|
1277
|
+
warmup_set_count: number;
|
|
1278
|
+
rep_range: RepRange | null;
|
|
1279
|
+
rest_seconds: number;
|
|
1280
|
+
duration_seconds: number | null;
|
|
1281
|
+
}
|
|
1282
|
+
export interface TrainerWorkoutTemplate {
|
|
1283
|
+
id: string;
|
|
1284
|
+
hevy_trainer_program_id: string;
|
|
1285
|
+
index: number;
|
|
1286
|
+
name: TrainerWorkoutTemplateName;
|
|
1287
|
+
exercises: TrainerWorkoutTemplateExercise[];
|
|
1288
|
+
}
|
|
1289
|
+
export interface TrainerProgramV3 {
|
|
1290
|
+
id: string;
|
|
1291
|
+
schema_version: 'v3';
|
|
1292
|
+
created_at: string;
|
|
1293
|
+
updated_at: string;
|
|
1294
|
+
level: TrainingLevel;
|
|
1295
|
+
goal: TrainingGoal;
|
|
1296
|
+
equipments: GranularEquipment[];
|
|
1297
|
+
weekly_frequency: WeeklyTrainingFrequency;
|
|
1298
|
+
templates: TrainerWorkoutTemplate[];
|
|
1299
|
+
focus_muscle?: SimplifiedMuscleGroup;
|
|
1300
|
+
next_workout_index: number;
|
|
1301
|
+
workout_duration_minutes: WorkoutDurationMinutes;
|
|
1302
|
+
rest_timer_length: RestTimerLength;
|
|
1303
|
+
cardio_preference: CardioPreference;
|
|
1304
|
+
}
|
|
1305
|
+
export interface PostTrainerProgramV3RequestBody {
|
|
1306
|
+
program: {
|
|
1307
|
+
version: 3;
|
|
1308
|
+
title: string;
|
|
1309
|
+
level: TrainingLevel;
|
|
1310
|
+
goal: TrainingGoal;
|
|
1311
|
+
equipments: GranularEquipment[];
|
|
1312
|
+
weekly_frequency: WeeklyTrainingFrequency;
|
|
1313
|
+
focus_muscle?: SimplifiedMuscleGroup;
|
|
1314
|
+
next_workout_index?: number;
|
|
1315
|
+
workout_duration_minutes: WorkoutDurationMinutes;
|
|
1316
|
+
rest_timer_length: RestTimerLength;
|
|
1317
|
+
cardio_preference: CardioPreference;
|
|
1318
|
+
templates: {
|
|
1319
|
+
index: number;
|
|
1320
|
+
name: TrainerWorkoutTemplateName;
|
|
1321
|
+
exercises: {
|
|
1322
|
+
exercise_template_id: string;
|
|
1323
|
+
index: number;
|
|
1324
|
+
set_count: number;
|
|
1325
|
+
warmup_set_count: number;
|
|
1326
|
+
rep_range: RepRange | null;
|
|
1327
|
+
rest_seconds: number;
|
|
1328
|
+
duration_seconds: number | null;
|
|
1329
|
+
}[];
|
|
1330
|
+
}[];
|
|
1331
|
+
};
|
|
1332
|
+
}
|
|
1333
|
+
export interface UpdateTrainerProgramV3RequestBody {
|
|
1334
|
+
program: {
|
|
1335
|
+
version: 3;
|
|
1336
|
+
programId: string;
|
|
1337
|
+
level: TrainingLevel;
|
|
1338
|
+
goal: TrainingGoal;
|
|
1339
|
+
equipments: GranularEquipment[];
|
|
1340
|
+
weekly_frequency: WeeklyTrainingFrequency;
|
|
1341
|
+
focus_muscle?: SimplifiedMuscleGroup;
|
|
1342
|
+
next_workout_index?: number;
|
|
1343
|
+
workout_duration_minutes: WorkoutDurationMinutes;
|
|
1344
|
+
rest_timer_length: RestTimerLength;
|
|
1345
|
+
cardio_preference: CardioPreference;
|
|
1346
|
+
templates: {
|
|
1347
|
+
id: string;
|
|
1348
|
+
index: number;
|
|
1349
|
+
name: TrainerWorkoutTemplateName;
|
|
1350
|
+
exercises: {
|
|
1351
|
+
exercise_template_id: string;
|
|
1352
|
+
index: number;
|
|
1353
|
+
set_count: number;
|
|
1354
|
+
warmup_set_count: number;
|
|
1355
|
+
rep_range: RepRange | null;
|
|
1356
|
+
rest_seconds: number;
|
|
1357
|
+
duration_seconds: number | null;
|
|
1358
|
+
}[];
|
|
1359
|
+
}[];
|
|
1360
|
+
};
|
|
1361
|
+
}
|
|
1362
|
+
/** @deprecated Use TrainerProgramV3 instead */
|
|
1270
1363
|
export interface HevyTrainerProgram {
|
|
1271
1364
|
id: string;
|
|
1272
1365
|
created_at: string;
|
|
@@ -1283,6 +1376,7 @@ export interface HevyTrainerProgram {
|
|
|
1283
1376
|
rest_timer_length: RestTimerLength;
|
|
1284
1377
|
cardio_preference: CardioPreference;
|
|
1285
1378
|
}
|
|
1379
|
+
/** @deprecated Use PostTrainerProgramV3RequestBody instead */
|
|
1286
1380
|
export interface PostHevyTrainerProgramRequestBody {
|
|
1287
1381
|
program: {
|
|
1288
1382
|
version: 1;
|
|
@@ -1299,6 +1393,7 @@ export interface PostHevyTrainerProgramRequestBody {
|
|
|
1299
1393
|
cardio_preference: CardioPreference;
|
|
1300
1394
|
};
|
|
1301
1395
|
}
|
|
1396
|
+
/** @deprecated Use UpdateTrainerProgramV3RequestBody instead */
|
|
1302
1397
|
export interface UpdateHevyTrainerProgramRequestBody {
|
|
1303
1398
|
program: {
|
|
1304
1399
|
version: 1;
|
|
@@ -1321,7 +1416,7 @@ export interface UpdateHevyTrainerProgramRequestBody {
|
|
|
1321
1416
|
}[];
|
|
1322
1417
|
};
|
|
1323
1418
|
}
|
|
1324
|
-
/** @deprecated Use
|
|
1419
|
+
/** @deprecated Use TrainerProgramV3 instead */
|
|
1325
1420
|
export interface HevyTrainerProgramOld {
|
|
1326
1421
|
id: string;
|
|
1327
1422
|
created_at: string;
|
|
@@ -1336,7 +1431,7 @@ export interface HevyTrainerProgramOld {
|
|
|
1336
1431
|
next_workout_index: number;
|
|
1337
1432
|
workout_duration_minutes?: WorkoutDurationMinutes;
|
|
1338
1433
|
}
|
|
1339
|
-
/** @deprecated Use
|
|
1434
|
+
/** @deprecated Use PostTrainerProgramV3RequestBody instead */
|
|
1340
1435
|
export interface PostHevyTrainerProgramOldRequestBody {
|
|
1341
1436
|
program: {
|
|
1342
1437
|
title: string;
|
|
@@ -1350,7 +1445,7 @@ export interface PostHevyTrainerProgramOldRequestBody {
|
|
|
1350
1445
|
workout_duration_minutes?: WorkoutDurationMinutes;
|
|
1351
1446
|
};
|
|
1352
1447
|
}
|
|
1353
|
-
/** @deprecated Use
|
|
1448
|
+
/** @deprecated Use UpdateTrainerProgramV3RequestBody instead */
|
|
1354
1449
|
export interface UpdateHevyTrainerProgramOldRequestBody {
|
|
1355
1450
|
program: {
|
|
1356
1451
|
programId: string;
|
|
@@ -236,7 +236,7 @@ const makeSettings = (overrides = {}) => {
|
|
|
236
236
|
};
|
|
237
237
|
return acc;
|
|
238
238
|
}, {});
|
|
239
|
-
const templates = hevyTrainer_1.
|
|
239
|
+
const templates = hevyTrainer_1.workoutTemplateNames.reduce((acc, name) => {
|
|
240
240
|
acc[name] = { exercises: [] };
|
|
241
241
|
return acc;
|
|
242
242
|
}, {});
|