hevy-shared 1.0.989 → 1.0.991
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 HevyTrainerRoutineName = typeof routineNames[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 routineNames: 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: HevyTrainerRoutineName;
|
|
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: HevyTrainerRoutineName;
|
|
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, HevyTrainerRoutineName[]>;
|
|
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 HevyTrainerRoutineName]: 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: HevyTrainerRoutineName;
|
|
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.routineNames = 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.routineNames = [
|
|
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 {
|
|
2
|
+
import { 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: HevyTrainerProgram | null;
|
|
303
303
|
}
|
|
304
304
|
export interface BackofficeDeletedUserResponse {
|
|
305
305
|
state: 'deleted-account';
|
|
@@ -887,7 +887,6 @@ 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;
|
|
891
890
|
}
|
|
892
891
|
export interface CustomExerciseImage {
|
|
893
892
|
type: 'image';
|
|
@@ -967,7 +966,6 @@ export interface PostWorkoutRequestWorkout {
|
|
|
967
966
|
biometrics?: WorkoutBiometrics;
|
|
968
967
|
is_biometrics_public: boolean;
|
|
969
968
|
trainer_program_id: string | undefined;
|
|
970
|
-
trainer_workout_template_id: string | undefined;
|
|
971
969
|
}
|
|
972
970
|
export type WorkoutDataImporterReport = {
|
|
973
971
|
state: 'idle';
|
|
@@ -1269,97 +1267,6 @@ export interface GetTeamInviteResponse {
|
|
|
1269
1267
|
export interface OutstandingInvitesForCoachTeamResponse {
|
|
1270
1268
|
invites: CoachTeamInvite[];
|
|
1271
1269
|
}
|
|
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 */
|
|
1363
1270
|
export interface HevyTrainerProgram {
|
|
1364
1271
|
id: string;
|
|
1365
1272
|
created_at: string;
|
|
@@ -1376,7 +1283,6 @@ export interface HevyTrainerProgram {
|
|
|
1376
1283
|
rest_timer_length: RestTimerLength;
|
|
1377
1284
|
cardio_preference: CardioPreference;
|
|
1378
1285
|
}
|
|
1379
|
-
/** @deprecated Use PostTrainerProgramV3RequestBody instead */
|
|
1380
1286
|
export interface PostHevyTrainerProgramRequestBody {
|
|
1381
1287
|
program: {
|
|
1382
1288
|
version: 1;
|
|
@@ -1393,7 +1299,6 @@ export interface PostHevyTrainerProgramRequestBody {
|
|
|
1393
1299
|
cardio_preference: CardioPreference;
|
|
1394
1300
|
};
|
|
1395
1301
|
}
|
|
1396
|
-
/** @deprecated Use UpdateTrainerProgramV3RequestBody instead */
|
|
1397
1302
|
export interface UpdateHevyTrainerProgramRequestBody {
|
|
1398
1303
|
program: {
|
|
1399
1304
|
version: 1;
|
|
@@ -1416,7 +1321,7 @@ export interface UpdateHevyTrainerProgramRequestBody {
|
|
|
1416
1321
|
}[];
|
|
1417
1322
|
};
|
|
1418
1323
|
}
|
|
1419
|
-
/** @deprecated Use
|
|
1324
|
+
/** @deprecated Use HevyTrainerProgram instead */
|
|
1420
1325
|
export interface HevyTrainerProgramOld {
|
|
1421
1326
|
id: string;
|
|
1422
1327
|
created_at: string;
|
|
@@ -1431,7 +1336,7 @@ export interface HevyTrainerProgramOld {
|
|
|
1431
1336
|
next_workout_index: number;
|
|
1432
1337
|
workout_duration_minutes?: WorkoutDurationMinutes;
|
|
1433
1338
|
}
|
|
1434
|
-
/** @deprecated Use
|
|
1339
|
+
/** @deprecated Use PostHevyTrainerProgramRequestBody instead */
|
|
1435
1340
|
export interface PostHevyTrainerProgramOldRequestBody {
|
|
1436
1341
|
program: {
|
|
1437
1342
|
title: string;
|
|
@@ -1445,7 +1350,7 @@ export interface PostHevyTrainerProgramOldRequestBody {
|
|
|
1445
1350
|
workout_duration_minutes?: WorkoutDurationMinutes;
|
|
1446
1351
|
};
|
|
1447
1352
|
}
|
|
1448
|
-
/** @deprecated Use
|
|
1353
|
+
/** @deprecated Use UpdateHevyTrainerProgramRequestBody instead */
|
|
1449
1354
|
export interface UpdateHevyTrainerProgramOldRequestBody {
|
|
1450
1355
|
program: {
|
|
1451
1356
|
programId: string;
|
|
@@ -1713,6 +1618,18 @@ export interface UserMetadataResponse {
|
|
|
1713
1618
|
export interface NetworkInfoRequest {
|
|
1714
1619
|
networkType: NetworkType;
|
|
1715
1620
|
}
|
|
1621
|
+
export type Gym = {
|
|
1622
|
+
name: string;
|
|
1623
|
+
address: string;
|
|
1624
|
+
distanceM: number;
|
|
1625
|
+
};
|
|
1626
|
+
export interface GymRequest {
|
|
1627
|
+
latitude: number;
|
|
1628
|
+
longitude: number;
|
|
1629
|
+
}
|
|
1630
|
+
export interface GymResponse {
|
|
1631
|
+
gyms: Gym[];
|
|
1632
|
+
}
|
|
1716
1633
|
export interface StripePrice {
|
|
1717
1634
|
product_id: string;
|
|
1718
1635
|
billing_period: 'month' | 'year' | 'pay-once';
|
|
@@ -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.routineNames.reduce((acc, name) => {
|
|
240
240
|
acc[name] = { exercises: [] };
|
|
241
241
|
return acc;
|
|
242
242
|
}, {});
|