hevy-shared 1.0.1021 → 1.0.1023

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/index.d.ts CHANGED
@@ -1405,8 +1405,7 @@ export type CommercialGym = {
1405
1405
  name: string;
1406
1406
  fullAddress: string;
1407
1407
  city: string;
1408
- latitude: number;
1409
- longitude: number;
1408
+ distanceM: number;
1410
1409
  };
1411
1410
  export type HomeGym = {
1412
1411
  type: 'home';
@@ -1,12 +1,17 @@
1
- import { Workout } from './workout';
1
+ import { OwnedWorkout, OwnedWorkoutExercise, OwnedWorkoutExerciseSet } from './workout';
2
+ import { UserWorkout, UserWorkoutExercise, UserWorkoutExerciseSet } from './userWorkout';
2
3
  export * from './workout';
3
4
  export * from './userWorkout';
4
5
  export * from './publicWorkout';
5
6
  export * from './normalizedWorkout';
6
7
  export * from './postWorkoutRequest';
7
8
  export interface WorkoutSync {
8
- updated: Workout[];
9
+ updated: OwnedWorkout[];
9
10
  deleted: string[];
10
11
  isMore: boolean;
11
12
  updated_at?: string;
12
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;
@@ -14,8 +14,14 @@ 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.isOwnedWorkout = isOwnedWorkout;
17
18
  __exportStar(require("./workout"), exports);
18
19
  __exportStar(require("./userWorkout"), exports);
19
20
  __exportStar(require("./publicWorkout"), exports);
20
21
  __exportStar(require("./normalizedWorkout"), exports);
21
22
  __exportStar(require("./postWorkoutRequest"), exports);
23
+ // Stub
24
+ function isOwnedWorkout(workout) {
25
+ void workout;
26
+ return true;
27
+ }
@@ -39,7 +39,7 @@ export interface PostWorkoutRequestWorkout {
39
39
  biometrics?: WorkoutBiometrics;
40
40
  is_biometrics_public: boolean;
41
41
  trainer_program_id: string | undefined;
42
- gymId: string | undefined;
42
+ gym_id: string | undefined;
43
43
  }
44
44
  export interface PostWorkoutRequestExercise {
45
45
  title: string;
@@ -1,5 +1,5 @@
1
1
  import { Equipment, ExerciseType, MuscleGroup, PreviewWorkoutLike, RPE, SetPersonalRecordType, SetType, WorkoutBiometrics, WorkoutComment, WorkoutMedia } from '..';
2
- export interface Workout {
2
+ export interface OwnedWorkout {
3
3
  id: string;
4
4
  short_id: string | null;
5
5
  index: number;
@@ -20,7 +20,7 @@ export interface Workout {
20
20
  user_id: string;
21
21
  username: string;
22
22
  profile_image: string;
23
- exercises: WorkoutExercise[];
23
+ exercises: OwnedWorkoutExercise[];
24
24
  routine_id?: string;
25
25
  apple_watch: boolean;
26
26
  wearos_watch: boolean;
@@ -48,7 +48,10 @@ export interface Workout {
48
48
  trainer_program_id: string | undefined;
49
49
  gymId: string | undefined;
50
50
  }
51
- export interface WorkoutExercise {
51
+ export interface TrainerWorkout extends OwnedWorkout {
52
+ trainer_program_id: string;
53
+ }
54
+ export interface OwnedWorkoutExercise {
52
55
  id: string;
53
56
  exercise_template_id: string;
54
57
  title: string;
@@ -84,9 +87,9 @@ export interface WorkoutExercise {
84
87
  * exercise was performed with _two_ dumbbells of that weight
85
88
  */
86
89
  volume_doubling_enabled: boolean;
87
- sets: WorkoutExerciseSet[];
90
+ sets: OwnedWorkoutExerciseSet[];
88
91
  }
89
- export interface WorkoutExerciseSet {
92
+ export interface OwnedWorkoutExerciseSet {
90
93
  /**
91
94
  * id can be a string or a number because we used
92
95
  * to store it as int4 and now we store it as int8
@@ -1,4 +1,4 @@
1
- import { BodyMeasurement, ExerciseType, BaseExerciseTemplate, WorkoutExerciseSet } from '.';
1
+ import { BodyMeasurement, ExerciseType, BaseExerciseTemplate, OwnedWorkoutExerciseSet } from '.';
2
2
  export declare const isVolumeDoublingSupportableForExerciseTemplate: (exerciseTemplate: Pick<BaseExerciseTemplate, "equipment_category" | "exercise_type">) => boolean;
3
3
  export interface VolumeCalculableWorkout {
4
4
  exercises: {
@@ -6,7 +6,7 @@ export interface VolumeCalculableWorkout {
6
6
  exercise_template_id: string;
7
7
  volume_doubling_enabled: boolean;
8
8
  hundred_percent_bodyweight_exercise: boolean;
9
- sets: Pick<WorkoutExerciseSet, 'indicator' | 'weight_kg' | 'reps' | 'distance_meters' | 'duration_seconds'>[];
9
+ sets: Pick<OwnedWorkoutExerciseSet, 'indicator' | 'weight_kg' | 'reps' | 'distance_meters' | 'duration_seconds'>[];
10
10
  }[];
11
11
  include_warmup_sets: boolean;
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hevy-shared",
3
- "version": "1.0.1021",
3
+ "version": "1.0.1023",
4
4
  "description": "",
5
5
  "main": "built/index.js",
6
6
  "types": "built/index.d.ts",