hevy-shared 1.0.1063 → 1.0.1064
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/exerciseLocaleUtils.d.ts +2 -1
- package/built/geography.d.ts +1 -0
- package/built/geography.js +15 -0
- package/built/index.d.ts +6 -26
- package/built/index.js +1 -0
- package/built/tests/geography.test.d.ts +1 -0
- package/built/tests/geography.test.js +25 -0
- package/built/typeUtils.d.ts +4 -1
- package/built/typeUtils.js +11 -2
- package/built/workout/index.d.ts +2 -6
- package/built/workout/index.js +1 -6
- package/built/workout/publicWorkout.d.ts +3 -15
- package/built/workout/shared.d.ts +13 -0
- package/built/workout/shared.js +2 -0
- package/built/workout/userWorkout.d.ts +4 -41
- package/built/workout/workout.d.ts +4 -50
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LibraryExercise, Lookup } from '.';
|
|
2
2
|
import { Language } from './translations';
|
|
3
|
+
import { LocalizedExerciseTitles } from './workout/shared';
|
|
3
4
|
/** Keeping exercise instruction/title localization utils here instead of translations
|
|
4
5
|
* so I don't need to import exercise types from here in translations (translations was
|
|
5
6
|
* created so that hevy-web can import utils from shared without importing something from
|
|
@@ -8,7 +9,7 @@ import { Language } from './translations';
|
|
|
8
9
|
export declare const supportedInstructionsLanguages: readonly ["en", "it", "de", "es", "fr", "pt"];
|
|
9
10
|
export type InstructionsLanguage = Lookup<typeof supportedInstructionsLanguages>;
|
|
10
11
|
export declare const isSupportedInstructionsLanguage: (lang: string) => lang is InstructionsLanguage;
|
|
11
|
-
type LocalizableExerciseTemplate = Pick<LibraryExercise, 'title' |
|
|
12
|
+
type LocalizableExerciseTemplate = Pick<LibraryExercise, 'title' | keyof LocalizedExerciseTitles | 'localised_instructions' | 'is_custom'>;
|
|
12
13
|
export declare const localisedExerciseTitle: (locale: Language, template: LocalizableExerciseTemplate) => string;
|
|
13
14
|
export declare const localisedExerciseInstructions: (locale: Language, exerciseTemplate: LocalizableExerciseTemplate) => string;
|
|
14
15
|
export declare const localeSelect: <T>(locale: Language, options: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const distanceMBetween: (lat1: number, lon1: number, lat2: number, lon2: number) => number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.distanceMBetween = void 0;
|
|
4
|
+
const haversineDistance = (lat1, lon1, lat2, lon2) => {
|
|
5
|
+
const R = 6371;
|
|
6
|
+
const dLat = ((lat2 - lat1) * Math.PI) / 180;
|
|
7
|
+
const dLon = ((lon2 - lon1) * Math.PI) / 180;
|
|
8
|
+
const a = Math.sin(dLat / 2) ** 2 +
|
|
9
|
+
Math.cos((lat1 * Math.PI) / 180) *
|
|
10
|
+
Math.cos((lat2 * Math.PI) / 180) *
|
|
11
|
+
Math.sin(dLon / 2) ** 2;
|
|
12
|
+
return R * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
13
|
+
};
|
|
14
|
+
const distanceMBetween = (lat1, lon1, lat2, lon2) => Math.round(haversineDistance(lat1, lon1, lat2, lon2) * 1000);
|
|
15
|
+
exports.distanceMBetween = distanceMBetween;
|
package/built/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Language } from './translations';
|
|
|
5
5
|
import { Lookup } from './typeUtils';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import { UserWorkout } from './workout';
|
|
8
|
+
import { LocalizedExerciseTitles } from './workout/shared';
|
|
8
9
|
export * from './schemas';
|
|
9
10
|
export * from './constants';
|
|
10
11
|
export * from './utils';
|
|
@@ -29,6 +30,7 @@ export * from './hevyTrainer';
|
|
|
29
30
|
export * from './translations';
|
|
30
31
|
export * from './exerciseLocaleUtils';
|
|
31
32
|
export * from './getVolumeComparison';
|
|
33
|
+
export * from './geography';
|
|
32
34
|
export type WeightUnit = 'kg' | 'lbs';
|
|
33
35
|
export declare const isWeightUnit: (x: string) => x is WeightUnit;
|
|
34
36
|
export type DistanceUnit = 'kilometers' | 'miles';
|
|
@@ -701,7 +703,7 @@ export interface BaseExerciseTemplate {
|
|
|
701
703
|
* They are stored on the database and downloaded to the client
|
|
702
704
|
* They have additional properties like translations, leaderboard eligibility, etc.
|
|
703
705
|
*/
|
|
704
|
-
export interface LibraryExercise extends BaseExerciseTemplate {
|
|
706
|
+
export interface LibraryExercise extends BaseExerciseTemplate, LocalizedExerciseTitles {
|
|
705
707
|
is_custom: false;
|
|
706
708
|
aka?: string;
|
|
707
709
|
manual_tag?: string;
|
|
@@ -709,17 +711,6 @@ export interface LibraryExercise extends BaseExerciseTemplate {
|
|
|
709
711
|
leaderboard_exercise?: boolean;
|
|
710
712
|
hundred_percent_bodyweight_exercise?: boolean;
|
|
711
713
|
strength_level_exercise?: boolean;
|
|
712
|
-
es_title?: string;
|
|
713
|
-
de_title?: string;
|
|
714
|
-
fr_title?: string;
|
|
715
|
-
it_title?: string;
|
|
716
|
-
pt_title?: string;
|
|
717
|
-
ko_title?: string;
|
|
718
|
-
ja_title?: string;
|
|
719
|
-
tr_title?: string;
|
|
720
|
-
ru_title?: string;
|
|
721
|
-
zh_cn_title?: string;
|
|
722
|
-
zh_tw_title?: string;
|
|
723
714
|
localised_instructions?: {
|
|
724
715
|
[language in InstructionsLanguage]?: string;
|
|
725
716
|
};
|
|
@@ -837,7 +828,7 @@ export interface RoutineSet {
|
|
|
837
828
|
rpe?: RPE | null;
|
|
838
829
|
rep_range?: RepRange;
|
|
839
830
|
}
|
|
840
|
-
export interface RoutineExercise {
|
|
831
|
+
export interface RoutineExercise extends LocalizedExerciseTitles {
|
|
841
832
|
id: string;
|
|
842
833
|
/** This is the username of the exercise_template */
|
|
843
834
|
username: string;
|
|
@@ -845,17 +836,6 @@ export interface RoutineExercise {
|
|
|
845
836
|
warmup_set_count: number;
|
|
846
837
|
normal_set_count: number;
|
|
847
838
|
title: string;
|
|
848
|
-
es_title?: string | null;
|
|
849
|
-
de_title?: string | null;
|
|
850
|
-
fr_title?: string | null;
|
|
851
|
-
it_title?: string | null;
|
|
852
|
-
pt_title?: string | null;
|
|
853
|
-
ko_title?: string | null;
|
|
854
|
-
ja_title?: string | null;
|
|
855
|
-
tr_title?: string | null;
|
|
856
|
-
ru_title?: string | null;
|
|
857
|
-
zh_cn_title?: string | null;
|
|
858
|
-
zh_tw_title?: string | null;
|
|
859
839
|
muscle_group: MuscleGroup;
|
|
860
840
|
other_muscles: MuscleGroup[];
|
|
861
841
|
exercise_type: ExerciseType;
|
|
@@ -1500,7 +1480,6 @@ export interface UserMetadataRequest {
|
|
|
1500
1480
|
googleAdId?: string;
|
|
1501
1481
|
appleIdfv?: string;
|
|
1502
1482
|
adjustAdId?: string;
|
|
1503
|
-
timezone?: string;
|
|
1504
1483
|
}
|
|
1505
1484
|
export type NetworkType = 'wifi' | 'cellular' | 'unknown';
|
|
1506
1485
|
export interface UserMetadataResponse {
|
|
@@ -1528,7 +1507,8 @@ type CommercialGym = {
|
|
|
1528
1507
|
name: string;
|
|
1529
1508
|
fullAddress: string;
|
|
1530
1509
|
city: string;
|
|
1531
|
-
|
|
1510
|
+
latitude: number;
|
|
1511
|
+
longitude: number;
|
|
1532
1512
|
};
|
|
1533
1513
|
export type Gym = CommercialGym;
|
|
1534
1514
|
export interface StripePrice {
|
package/built/index.js
CHANGED
|
@@ -41,6 +41,7 @@ __exportStar(require("./hevyTrainer"), exports);
|
|
|
41
41
|
__exportStar(require("./translations"), exports);
|
|
42
42
|
__exportStar(require("./exerciseLocaleUtils"), exports);
|
|
43
43
|
__exportStar(require("./getVolumeComparison"), exports);
|
|
44
|
+
__exportStar(require("./geography"), exports);
|
|
44
45
|
const isWeightUnit = (x) => {
|
|
45
46
|
return x === 'kg' || x === 'lbs';
|
|
46
47
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const geography_1 = require("../geography");
|
|
13
|
+
describe('Geography utils', () => {
|
|
14
|
+
describe('distanceMBetween', () => {
|
|
15
|
+
it('Calculates the distance between two sets of coordinates', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
expect((0, geography_1.distanceMBetween)(51.001, 52, 51, 52)).toBe(111);
|
|
17
|
+
expect((0, geography_1.distanceMBetween)(51.002, 52, 51, 52)).toBe(222);
|
|
18
|
+
expect((0, geography_1.distanceMBetween)(50.999, 52, 51, 52)).toBe(111);
|
|
19
|
+
expect((0, geography_1.distanceMBetween)(51.01, 52, 51, 52)).toBe(1112);
|
|
20
|
+
expect((0, geography_1.distanceMBetween)(51.04, 52, 51, 52)).toBe(4448);
|
|
21
|
+
expect((0, geography_1.distanceMBetween)(51.035, 52.035, 51, 52)).toBe(4598);
|
|
22
|
+
expect((0, geography_1.distanceMBetween)(50.965, 51.965, 51, 52)).toBe(4599);
|
|
23
|
+
}));
|
|
24
|
+
});
|
|
25
|
+
});
|
package/built/typeUtils.d.ts
CHANGED
|
@@ -4,7 +4,10 @@ export type DeepReadonly<T> = {
|
|
|
4
4
|
readonly [P in keyof T]: T[P] extends (...args: any[]) => any ? T[P] : DeepReadonly<T[P]>;
|
|
5
5
|
};
|
|
6
6
|
export declare const exhaustiveTypeCheck: (_: never) => undefined;
|
|
7
|
-
export declare
|
|
7
|
+
export declare class ExhaustiveTypeException extends Error {
|
|
8
|
+
constructor(type: never);
|
|
9
|
+
}
|
|
10
|
+
export declare const exhaustiveTypeException: (type: never) => ExhaustiveTypeException;
|
|
8
11
|
export type Some<T> = {
|
|
9
12
|
hasValue: true;
|
|
10
13
|
value: T;
|
package/built/typeUtils.js
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TODO = exports.typeSafeIndex = exports.parseJSON = exports.assertNonNullish = exports.dangerousUncheckedTypeCast = exports.exhaustiveTypeException = exports.exhaustiveTypeCheck = exports.isInArray = void 0;
|
|
3
|
+
exports.TODO = exports.typeSafeIndex = exports.parseJSON = exports.assertNonNullish = exports.dangerousUncheckedTypeCast = exports.exhaustiveTypeException = exports.ExhaustiveTypeException = exports.exhaustiveTypeCheck = exports.isInArray = void 0;
|
|
4
4
|
exports.isNonNullish = isNonNullish;
|
|
5
5
|
const isInArray = (value, array) => array.includes(value);
|
|
6
6
|
exports.isInArray = isInArray;
|
|
7
7
|
const exhaustiveTypeCheck = (_) => void _;
|
|
8
8
|
exports.exhaustiveTypeCheck = exhaustiveTypeCheck;
|
|
9
|
-
|
|
9
|
+
class ExhaustiveTypeException extends Error {
|
|
10
|
+
constructor(type) {
|
|
11
|
+
const message = `Assertion failed: "unreachable" code reached with unknown type: ${typeof type === 'object' ? JSON.stringify(type) : String(type)}`;
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = 'ExhaustiveTypeException';
|
|
14
|
+
this.message = message;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.ExhaustiveTypeException = ExhaustiveTypeException;
|
|
18
|
+
const exhaustiveTypeException = (type) => new ExhaustiveTypeException(type);
|
|
10
19
|
exports.exhaustiveTypeException = exhaustiveTypeException;
|
|
11
20
|
/**
|
|
12
21
|
* Please use this instead of using the 'as' keyword directly, so it's easier
|
package/built/workout/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OwnedWorkout
|
|
2
|
-
|
|
1
|
+
import { OwnedWorkout } from './workout';
|
|
2
|
+
export * from './shared';
|
|
3
3
|
export * from './workout';
|
|
4
4
|
export * from './userWorkout';
|
|
5
5
|
export * from './publicWorkout';
|
|
@@ -11,7 +11,3 @@ export interface WorkoutSync {
|
|
|
11
11
|
isMore: boolean;
|
|
12
12
|
updated_at?: string;
|
|
13
13
|
}
|
|
14
|
-
export type Workout = OwnedWorkout & Partial<UserWorkout>;
|
|
15
|
-
export type WorkoutExercise = OwnedWorkoutExercise & Partial<UserWorkoutExercise>;
|
|
16
|
-
export type WorkoutExerciseSet = OwnedWorkoutExerciseSet & Partial<UserWorkoutExerciseSet>;
|
|
17
|
-
export declare function isOwnedWorkout(workout: OwnedWorkout | UserWorkout): workout is OwnedWorkout;
|
package/built/workout/index.js
CHANGED
|
@@ -14,14 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports
|
|
17
|
+
__exportStar(require("./shared"), exports);
|
|
18
18
|
__exportStar(require("./workout"), exports);
|
|
19
19
|
__exportStar(require("./userWorkout"), exports);
|
|
20
20
|
__exportStar(require("./publicWorkout"), exports);
|
|
21
21
|
__exportStar(require("./normalizedWorkout"), exports);
|
|
22
22
|
__exportStar(require("./postWorkoutRequest"), exports);
|
|
23
|
-
// Stub
|
|
24
|
-
function isOwnedWorkout(workout) {
|
|
25
|
-
void workout;
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DistanceUnit,
|
|
1
|
+
import { DistanceUnit, ExerciseType, MuscleGroup, RPE, SetPersonalRecordType, SetType, WeightUnit } from '..';
|
|
2
|
+
import { LocalizedExerciseTitles } from './shared';
|
|
2
3
|
export declare const isPublicWorkout: (x: any) => x is PublicWorkout;
|
|
3
4
|
export interface PublicWorkout {
|
|
4
5
|
type: 'public';
|
|
@@ -21,29 +22,16 @@ export interface PublicWorkout {
|
|
|
21
22
|
distance_unit: DistanceUnit;
|
|
22
23
|
estimated_volume_kg: number;
|
|
23
24
|
}
|
|
24
|
-
export interface PublicWorkoutExercise {
|
|
25
|
+
export interface PublicWorkoutExercise extends LocalizedExerciseTitles {
|
|
25
26
|
id: string;
|
|
26
27
|
exercise_template_id: string;
|
|
27
28
|
title: string;
|
|
28
|
-
es_title?: string | null;
|
|
29
|
-
de_title?: string | null;
|
|
30
|
-
fr_title?: string | null;
|
|
31
|
-
it_title?: string | null;
|
|
32
|
-
pt_title?: string | null;
|
|
33
|
-
ko_title?: string | null;
|
|
34
|
-
ja_title?: string | null;
|
|
35
|
-
tr_title?: string | null;
|
|
36
|
-
ru_title?: string | null;
|
|
37
|
-
zh_cn_title?: string | null;
|
|
38
|
-
zh_tw_title?: string | null;
|
|
39
29
|
superset_id: number | null;
|
|
40
30
|
rest_seconds: number | null;
|
|
41
31
|
notes: string;
|
|
42
|
-
priority: number;
|
|
43
32
|
muscle_group: MuscleGroup;
|
|
44
33
|
other_muscles: MuscleGroup[];
|
|
45
34
|
exercise_type: ExerciseType;
|
|
46
|
-
equipment_category: Equipment;
|
|
47
35
|
url?: string;
|
|
48
36
|
media_type?: string;
|
|
49
37
|
custom_exercise_image_url?: string | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface LocalizedExerciseTitles {
|
|
2
|
+
es_title?: string | null;
|
|
3
|
+
de_title?: string | null;
|
|
4
|
+
fr_title?: string | null;
|
|
5
|
+
it_title?: string | null;
|
|
6
|
+
pt_title?: string | null;
|
|
7
|
+
ko_title?: string | null;
|
|
8
|
+
ja_title?: string | null;
|
|
9
|
+
tr_title?: string | null;
|
|
10
|
+
ru_title?: string | null;
|
|
11
|
+
zh_cn_title?: string | null;
|
|
12
|
+
zh_tw_title?: string | null;
|
|
13
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExerciseType, MuscleGroup, PreviewWorkoutLike, RPE, SetPersonalRecordType, SetType, WorkoutBiometrics, WorkoutComment, WorkoutMedia } from '..';
|
|
2
|
+
import { LocalizedExerciseTitles } from './shared';
|
|
2
3
|
export interface UserWorkout {
|
|
3
4
|
id: string;
|
|
4
5
|
short_id: string | null;
|
|
@@ -6,13 +7,9 @@ export interface UserWorkout {
|
|
|
6
7
|
name: string;
|
|
7
8
|
description?: string;
|
|
8
9
|
like_count: number;
|
|
9
|
-
/** @deprecated 2.3.4 */
|
|
10
|
-
like_images: string[];
|
|
11
10
|
preview_workout_likes: PreviewWorkoutLike[];
|
|
12
11
|
comment_count: number;
|
|
13
12
|
comments: WorkoutComment[];
|
|
14
|
-
/** @deprecated 1.28.13 */
|
|
15
|
-
image_urls?: string[];
|
|
16
13
|
media: WorkoutMedia[];
|
|
17
14
|
is_liked_by_user: boolean;
|
|
18
15
|
start_time: number;
|
|
@@ -25,7 +22,6 @@ export interface UserWorkout {
|
|
|
25
22
|
apple_watch: boolean;
|
|
26
23
|
wearos_watch: boolean;
|
|
27
24
|
verified: boolean;
|
|
28
|
-
created_at: string;
|
|
29
25
|
updated_at: string;
|
|
30
26
|
nth_workout: number;
|
|
31
27
|
/**
|
|
@@ -39,45 +35,22 @@ export interface UserWorkout {
|
|
|
39
35
|
*/
|
|
40
36
|
include_warmup_sets: boolean;
|
|
41
37
|
is_private: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* If applicable, the user ID of the coach who logged this workout
|
|
44
|
-
*/
|
|
45
|
-
logged_by_coach_id?: string;
|
|
46
38
|
biometrics?: WorkoutBiometrics;
|
|
47
39
|
is_biometrics_public: boolean;
|
|
48
|
-
trainer_program_id: string | undefined;
|
|
49
|
-
trainer_workout_template_id: string | undefined;
|
|
50
40
|
gym: UserWorkoutGym | undefined;
|
|
41
|
+
is_home_gym: boolean;
|
|
51
42
|
}
|
|
52
|
-
export interface UserWorkoutExercise {
|
|
43
|
+
export interface UserWorkoutExercise extends LocalizedExerciseTitles {
|
|
53
44
|
id: string;
|
|
54
45
|
exercise_template_id: string;
|
|
55
46
|
title: string;
|
|
56
|
-
es_title?: string | null;
|
|
57
|
-
de_title?: string | null;
|
|
58
|
-
fr_title?: string | null;
|
|
59
|
-
it_title?: string | null;
|
|
60
|
-
pt_title?: string | null;
|
|
61
|
-
ko_title?: string | null;
|
|
62
|
-
ja_title?: string | null;
|
|
63
|
-
tr_title?: string | null;
|
|
64
|
-
ru_title?: string | null;
|
|
65
|
-
zh_cn_title?: string | null;
|
|
66
|
-
zh_tw_title?: string | null;
|
|
67
47
|
superset_id: number | null;
|
|
68
48
|
rest_seconds: number | null;
|
|
69
49
|
notes: string;
|
|
70
|
-
priority: number;
|
|
71
50
|
muscle_group: MuscleGroup;
|
|
72
51
|
other_muscles: MuscleGroup[];
|
|
73
52
|
exercise_type: ExerciseType;
|
|
74
|
-
equipment_category: Equipment;
|
|
75
|
-
url?: string;
|
|
76
|
-
media_type?: string;
|
|
77
|
-
custom_exercise_image_url?: string | null;
|
|
78
53
|
thumbnail_url?: string | null;
|
|
79
|
-
manual_tag?: string;
|
|
80
|
-
aka?: string;
|
|
81
54
|
/**
|
|
82
55
|
* for exercises with two dumbbells
|
|
83
56
|
*
|
|
@@ -103,16 +76,6 @@ export interface UserWorkoutExerciseSet {
|
|
|
103
76
|
duration_seconds?: number | null;
|
|
104
77
|
custom_metric?: number | null;
|
|
105
78
|
rpe?: RPE | null;
|
|
106
|
-
/**
|
|
107
|
-
* @deprecated 1.29.17 -
|
|
108
|
-
* we can only set this to `best_weight`, `best_reps`, `best_duration` or
|
|
109
|
-
* `best_distance`. sending anything else would cause older clients to crash.
|
|
110
|
-
* newer clients will ignore this field and use the `prs` field instead.
|
|
111
|
-
*/
|
|
112
|
-
personalRecords?: Array<{
|
|
113
|
-
type: 'best_weight' | 'best_reps' | 'best_duration' | 'best_distance';
|
|
114
|
-
value: number;
|
|
115
|
-
}>;
|
|
116
79
|
prs: {
|
|
117
80
|
type: SetPersonalRecordType;
|
|
118
81
|
value: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExerciseType, MuscleGroup, PreviewWorkoutLike, RPE, SetPersonalRecordType, SetType, WorkoutBiometrics, WorkoutComment, WorkoutMedia } from '..';
|
|
2
|
+
import { LocalizedExerciseTitles } from './shared';
|
|
2
3
|
export interface OwnedWorkout {
|
|
3
4
|
id: string;
|
|
4
5
|
short_id: string | null;
|
|
@@ -6,13 +7,9 @@ export interface OwnedWorkout {
|
|
|
6
7
|
name: string;
|
|
7
8
|
description?: string;
|
|
8
9
|
like_count: number;
|
|
9
|
-
/** @deprecated 2.3.4 */
|
|
10
|
-
like_images: string[];
|
|
11
10
|
preview_workout_likes: PreviewWorkoutLike[];
|
|
12
11
|
comment_count: number;
|
|
13
12
|
comments: WorkoutComment[];
|
|
14
|
-
/** @deprecated 1.28.13 */
|
|
15
|
-
image_urls?: string[];
|
|
16
13
|
media: WorkoutMedia[];
|
|
17
14
|
is_liked_by_user: boolean;
|
|
18
15
|
start_time: number;
|
|
@@ -28,60 +25,27 @@ export interface OwnedWorkout {
|
|
|
28
25
|
created_at: string;
|
|
29
26
|
updated_at: string;
|
|
30
27
|
nth_workout: number;
|
|
31
|
-
/**
|
|
32
|
-
* See https://github.com/hevyapp/hevy-backend/pull/193 to understand
|
|
33
|
-
* why we added estimated_volume_kg
|
|
34
|
-
*/
|
|
35
|
-
estimated_volume_kg: number;
|
|
36
|
-
/**
|
|
37
|
-
* Whether to include warmup sets in various calculations.
|
|
38
|
-
* https://github.com/hevyapp/hevy-shared/pull/312
|
|
39
|
-
*/
|
|
40
|
-
include_warmup_sets: boolean;
|
|
41
28
|
is_private: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* If applicable, the user ID of the coach who logged this workout
|
|
44
|
-
*/
|
|
45
|
-
logged_by_coach_id?: string;
|
|
46
29
|
biometrics?: WorkoutBiometrics;
|
|
47
30
|
is_biometrics_public: boolean;
|
|
48
|
-
trainer_program_id: string | undefined;
|
|
49
31
|
trainer_workout_template_id: string | undefined;
|
|
50
32
|
gym_id: string | undefined;
|
|
51
33
|
is_home_gym: boolean;
|
|
52
34
|
}
|
|
53
35
|
export interface TrainerWorkout extends OwnedWorkout {
|
|
54
|
-
|
|
36
|
+
trainer_workout_template_id: string;
|
|
55
37
|
}
|
|
56
|
-
export interface OwnedWorkoutExercise {
|
|
38
|
+
export interface OwnedWorkoutExercise extends LocalizedExerciseTitles {
|
|
57
39
|
id: string;
|
|
58
40
|
exercise_template_id: string;
|
|
59
41
|
title: string;
|
|
60
|
-
es_title?: string | null;
|
|
61
|
-
de_title?: string | null;
|
|
62
|
-
fr_title?: string | null;
|
|
63
|
-
it_title?: string | null;
|
|
64
|
-
pt_title?: string | null;
|
|
65
|
-
ko_title?: string | null;
|
|
66
|
-
ja_title?: string | null;
|
|
67
|
-
tr_title?: string | null;
|
|
68
|
-
ru_title?: string | null;
|
|
69
|
-
zh_cn_title?: string | null;
|
|
70
|
-
zh_tw_title?: string | null;
|
|
71
42
|
superset_id: number | null;
|
|
72
43
|
rest_seconds: number | null;
|
|
73
44
|
notes: string;
|
|
74
|
-
priority: number;
|
|
75
45
|
muscle_group: MuscleGroup;
|
|
76
46
|
other_muscles: MuscleGroup[];
|
|
77
47
|
exercise_type: ExerciseType;
|
|
78
|
-
equipment_category: Equipment;
|
|
79
|
-
url?: string;
|
|
80
|
-
media_type?: string;
|
|
81
|
-
custom_exercise_image_url?: string | null;
|
|
82
48
|
thumbnail_url?: string | null;
|
|
83
|
-
manual_tag?: string;
|
|
84
|
-
aka?: string;
|
|
85
49
|
/**
|
|
86
50
|
* for exercises with two dumbbells
|
|
87
51
|
*
|
|
@@ -107,16 +71,6 @@ export interface OwnedWorkoutExerciseSet {
|
|
|
107
71
|
duration_seconds?: number | null;
|
|
108
72
|
custom_metric?: number | null;
|
|
109
73
|
rpe?: RPE | null;
|
|
110
|
-
/**
|
|
111
|
-
* @deprecated 1.29.17 -
|
|
112
|
-
* we can only set this to `best_weight`, `best_reps`, `best_duration` or
|
|
113
|
-
* `best_distance`. sending anything else would cause older clients to crash.
|
|
114
|
-
* newer clients will ignore this field and use the `prs` field instead.
|
|
115
|
-
*/
|
|
116
|
-
personalRecords?: Array<{
|
|
117
|
-
type: 'best_weight' | 'best_reps' | 'best_duration' | 'best_distance';
|
|
118
|
-
value: number;
|
|
119
|
-
}>;
|
|
120
74
|
prs: {
|
|
121
75
|
type: SetPersonalRecordType;
|
|
122
76
|
value: number;
|