@capgo/capacitor-health 8.3.0 → 8.3.1

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/README.md CHANGED
@@ -610,14 +610,14 @@ Supported on iOS (HealthKit) and Android (Health Connect).
610
610
 
611
611
  #### QueryWorkoutsOptions
612
612
 
613
- | Prop | Type | Description |
614
- | ----------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
615
- | **`workoutType`** | <code><a href="#workouttype">WorkoutType</a></code> | Optional workout type filter. If omitted, all workout types are returned. |
616
- | **`startDate`** | <code>string</code> | Inclusive ISO 8601 start date (defaults to now - 1 day). |
617
- | **`endDate`** | <code>string</code> | Exclusive ISO 8601 end date (defaults to now). |
618
- | **`limit`** | <code>number</code> | Maximum number of workouts to return (defaults to 100). |
619
- | **`ascending`** | <code>boolean</code> | Return results sorted ascending by start date (defaults to false). |
620
- | **`anchor`** | <code>string</code> | Anchor for pagination. Use the anchor returned from a previous query to continue from that point. On iOS, this uses HKQueryAnchor. On Android, this uses Health Connect's pageToken. Omit this parameter to start from the beginning. |
613
+ | Prop | Type | Description |
614
+ | ----------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
615
+ | **`workoutType`** | <code><a href="#workouttype">WorkoutType</a></code> | Optional workout type filter. If omitted, all workout types are returned. |
616
+ | **`startDate`** | <code>string</code> | Inclusive ISO 8601 start date (defaults to now - 1 day). |
617
+ | **`endDate`** | <code>string</code> | Exclusive ISO 8601 end date (defaults to now). |
618
+ | **`limit`** | <code>number</code> | Maximum number of workouts to return (defaults to 100). |
619
+ | **`ascending`** | <code>boolean</code> | Return results sorted ascending by start date (defaults to false). |
620
+ | **`anchor`** | <code>string</code> | Anchor for pagination. Use the anchor returned from a previous query to continue from that point. On iOS, this is the ISO 8601 cursor returned by the previous query. On Android, this uses Health Connect's pageToken. Omit this parameter to start from the beginning. |
621
621
 
622
622
 
623
623
  #### QueryAggregatedResult
@@ -675,7 +675,7 @@ Construct a type with a set of properties K of type T
675
675
 
676
676
  #### WorkoutType
677
677
 
678
- <code>'running' | 'cycling' | 'walking' | 'swimming' | 'yoga' | 'strengthTraining' | 'hiking' | 'tennis' | 'basketball' | 'soccer' | 'americanFootball' | 'baseball' | 'crossTraining' | 'elliptical' | 'rowing' | 'stairClimbing' | 'traditionalStrengthTraining' | 'waterFitness' | 'waterPolo' | 'waterSports' | 'wrestling' | 'archery' | 'australianFootball' | 'badminton' | 'barre' | 'bowling' | 'boxing' | 'climbing' | 'cooldown' | 'coreTraining' | 'cricket' | 'crossCountrySkiing' | 'curling' | 'dance' | 'discSports' | 'downhillSkiing' | 'equestrianSports' | 'fencing' | 'fishing' | 'fitnessGaming' | 'flexibility' | 'functionalStrengthTraining' | 'golf' | 'gymnastics' | 'handball' | 'handCycling' | 'highIntensityIntervalTraining' | 'hockey' | 'hunting' | 'jumpRope' | 'kickboxing' | 'lacrosse' | 'martialArts' | 'mindAndBody' | 'mixedCardio' | 'paddleSports' | 'pickleball' | 'pilates' | 'play' | 'preparationAndRecovery' | 'racquetball' | 'rugby' | 'sailing' | 'skatingSports' | 'snowboarding' | 'snowSports' | 'softball' | 'squash' | 'stairs' | 'stepTraining' | 'surfingSports' | 'tableTennis' | 'taiChi' | 'trackAndField' | 'transition' | 'underwaterDiving' | 'volleyball' | 'wheelchairRunPace' | 'wheelchairWalkPace' | 'cardioDance' | 'socialDance' | 'other'</code>
678
+ <code>'americanFootball' | 'australianFootball' | 'badminton' | 'baseball' | 'basketball' | 'bowling' | 'boxing' | 'climbing' | 'cricket' | 'crossTraining' | 'curling' | 'cycling' | 'dance' | 'elliptical' | 'fencing' | 'functionalStrengthTraining' | 'golf' | 'gymnastics' | 'handball' | 'hiking' | 'hockey' | 'jumpRope' | 'kickboxing' | 'lacrosse' | 'martialArts' | 'pilates' | 'racquetball' | 'rowing' | 'rugby' | 'running' | 'sailing' | 'skatingSports' | 'skiing' | 'snowboarding' | 'soccer' | 'softball' | 'squash' | 'stairClimbing' | 'strengthTraining' | 'surfing' | 'swimming' | 'swimmingPool' | 'swimmingOpenWater' | 'tableTennis' | 'tennis' | 'trackAndField' | 'traditionalStrengthTraining' | 'volleyball' | 'walking' | 'waterFitness' | 'waterPolo' | 'waterSports' | 'weightlifting' | 'wheelchair' | 'yoga' | 'archery' | 'barre' | 'cooldown' | 'coreTraining' | 'crossCountrySkiing' | 'discSports' | 'downhillSkiing' | 'equestrianSports' | 'fishing' | 'fitnessGaming' | 'flexibility' | 'handCycling' | 'highIntensityIntervalTraining' | 'hunting' | 'mindAndBody' | 'mixedCardio' | 'paddleSports' | 'pickleball' | 'play' | 'preparationAndRecovery' | 'snowSports' | 'stairs' | 'stepTraining' | 'surfingSports' | 'taiChi' | 'transition' | 'underwaterDiving' | 'wheelchairRunPace' | 'wheelchairWalkPace' | 'wrestling' | 'cardioDance' | 'socialDance' | 'backExtension' | 'barbellShoulderPress' | 'benchPress' | 'benchSitUp' | 'bikingStationary' | 'bootCamp' | 'burpee' | 'calisthenics' | 'crunch' | 'dancing' | 'deadlift' | 'dumbbellCurlLeftArm' | 'dumbbellCurlRightArm' | 'dumbbellFrontRaise' | 'dumbbellLateralRaise' | 'dumbbellTricepsExtensionLeftArm' | 'dumbbellTricepsExtensionRightArm' | 'dumbbellTricepsExtensionTwoArm' | 'exerciseClass' | 'forwardTwist' | 'frisbeedisc' | 'guidedBreathing' | 'iceHockey' | 'iceSkating' | 'jumpingJack' | 'latPullDown' | 'lunge' | 'meditation' | 'paddling' | 'paraGliding' | 'plank' | 'rockClimbing' | 'rollerHockey' | 'rowingMachine' | 'runningTreadmill' | 'scubaDiving' | 'skating' | 'snowshoeing' | 'stairClimbingMachine' | 'stretching' | 'upperTwist' | 'other'</code>
679
679
 
680
680
 
681
681
  #### BucketType
@@ -3,114 +3,112 @@ package app.capgo.plugin.health
3
3
  import androidx.health.connect.client.records.ExerciseSessionRecord
4
4
 
5
5
  /**
6
- * WorkoutType mapper between TypeScript workout types and Android Health Connect exercise types.
7
- *
8
- * Note: Due to platform limitations, some TypeScript workout types map to the same Android
9
- * exercise type. When reading workouts from Android, these will return the primary/legacy
10
- * workout type to maintain backward compatibility:
11
- *
12
- * - highIntensityIntervalTraining, mixedCardio, crossTraining → reads as "crossTraining"
13
- * - kickboxing, martialArts, wrestling → reads as "wrestling"
14
- * - wheelchairRunPace, wheelchairWalkPace → reads as "wheelchairWalkPace"
15
- * - stairs, stairClimbing → reads as "stairClimbing"
16
- * - barre, pilates → reads as "pilates"
17
- * - cooldown, flexibility, preparationAndRecovery → reads as "flexibility"
18
- * - coreTraining, functionalStrengthTraining, strengthTraining, traditionalStrengthTraining → reads as "strengthTraining"
19
- * - mindAndBody, taiChi, yoga → reads as "yoga"
20
- * - trackAndField, running → reads as "running"
21
- * - cardioDance, socialDance, dance → reads as "dance"
22
- * - crossCountrySkiing, downhillSkiing → reads as "downhillSkiing"
23
- *
24
- * This asymmetric mapping is intentional to support the full iOS workout type set while
25
- * maintaining compatibility with Android's more limited exercise type taxonomy.
6
+ * Maps plugin workout strings to Android Health Connect exercise types.
7
+ *
8
+ * Several plugin workout types intentionally share the same Android exercise type. The plugin
9
+ * accepts both cross-platform names and platform-specific aliases when filtering workouts.
26
10
  */
27
11
  object WorkoutType {
28
12
  fun fromString(type: String?): Int? {
29
13
  if (type.isNullOrBlank()) return null
30
-
14
+
31
15
  return when (type) {
32
- "running" -> ExerciseSessionRecord.EXERCISE_TYPE_RUNNING
33
- "cycling" -> ExerciseSessionRecord.EXERCISE_TYPE_BIKING
34
- "walking" -> ExerciseSessionRecord.EXERCISE_TYPE_WALKING
35
- "swimming" -> ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_POOL
36
- "yoga" -> ExerciseSessionRecord.EXERCISE_TYPE_YOGA
37
- "strengthTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING
38
- "hiking" -> ExerciseSessionRecord.EXERCISE_TYPE_HIKING
39
- "tennis" -> ExerciseSessionRecord.EXERCISE_TYPE_TENNIS
40
- "basketball" -> ExerciseSessionRecord.EXERCISE_TYPE_BASKETBALL
41
- "soccer" -> ExerciseSessionRecord.EXERCISE_TYPE_SOCCER
42
16
  "americanFootball" -> ExerciseSessionRecord.EXERCISE_TYPE_FOOTBALL_AMERICAN
43
- "baseball" -> ExerciseSessionRecord.EXERCISE_TYPE_BASEBALL
44
- "crossTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING
45
- "elliptical" -> ExerciseSessionRecord.EXERCISE_TYPE_ELLIPTICAL
46
- "rowing" -> ExerciseSessionRecord.EXERCISE_TYPE_ROWING
47
- "stairClimbing" -> ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING
48
- "traditionalStrengthTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING
49
- "waterFitness" -> ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_POOL
50
- "waterPolo" -> ExerciseSessionRecord.EXERCISE_TYPE_WATER_POLO
51
- "waterSports" -> ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_OPEN_WATER
52
- "wrestling" -> ExerciseSessionRecord.EXERCISE_TYPE_MARTIAL_ARTS
53
- // New comprehensive workout type mappings
54
- "archery" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
55
17
  "australianFootball" -> ExerciseSessionRecord.EXERCISE_TYPE_FOOTBALL_AUSTRALIAN
56
18
  "badminton" -> ExerciseSessionRecord.EXERCISE_TYPE_BADMINTON
57
- "barre" -> ExerciseSessionRecord.EXERCISE_TYPE_PILATES
19
+ "baseball" -> ExerciseSessionRecord.EXERCISE_TYPE_BASEBALL
20
+ "basketball" -> ExerciseSessionRecord.EXERCISE_TYPE_BASKETBALL
58
21
  "bowling" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
59
22
  "boxing" -> ExerciseSessionRecord.EXERCISE_TYPE_BOXING
60
- "climbing" -> ExerciseSessionRecord.EXERCISE_TYPE_ROCK_CLIMBING
61
- "cooldown" -> ExerciseSessionRecord.EXERCISE_TYPE_STRETCHING
62
- "coreTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING
23
+ "climbing", "rockClimbing" -> ExerciseSessionRecord.EXERCISE_TYPE_ROCK_CLIMBING
63
24
  "cricket" -> ExerciseSessionRecord.EXERCISE_TYPE_CRICKET
64
- "crossCountrySkiing" -> ExerciseSessionRecord.EXERCISE_TYPE_SKIING
25
+ "crossTraining", "highIntensityIntervalTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING
65
26
  "curling" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
66
- "dance" -> ExerciseSessionRecord.EXERCISE_TYPE_DANCING
67
- "discSports" -> ExerciseSessionRecord.EXERCISE_TYPE_FRISBEE_DISC
68
- "downhillSkiing" -> ExerciseSessionRecord.EXERCISE_TYPE_SKIING
69
- "equestrianSports" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
27
+ "cycling" -> ExerciseSessionRecord.EXERCISE_TYPE_BIKING
28
+ "dancing", "dance", "cardioDance", "socialDance" -> ExerciseSessionRecord.EXERCISE_TYPE_DANCING
29
+ "elliptical" -> ExerciseSessionRecord.EXERCISE_TYPE_ELLIPTICAL
70
30
  "fencing" -> ExerciseSessionRecord.EXERCISE_TYPE_FENCING
71
- "fishing" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
72
- "fitnessGaming" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
73
- "flexibility" -> ExerciseSessionRecord.EXERCISE_TYPE_STRETCHING
74
- "functionalStrengthTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING
31
+ "functionalStrengthTraining", "strengthTraining", "traditionalStrengthTraining", "coreTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING
75
32
  "golf" -> ExerciseSessionRecord.EXERCISE_TYPE_GOLF
76
33
  "gymnastics" -> ExerciseSessionRecord.EXERCISE_TYPE_GYMNASTICS
77
34
  "handball" -> ExerciseSessionRecord.EXERCISE_TYPE_HANDBALL
78
- "handCycling" -> ExerciseSessionRecord.EXERCISE_TYPE_WHEELCHAIR
79
- "highIntensityIntervalTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING
80
- "hockey" -> ExerciseSessionRecord.EXERCISE_TYPE_ICE_HOCKEY
81
- "hunting" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
35
+ "hiking" -> ExerciseSessionRecord.EXERCISE_TYPE_HIKING
36
+ "hockey", "iceHockey" -> ExerciseSessionRecord.EXERCISE_TYPE_ICE_HOCKEY
82
37
  "jumpRope" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
83
- "kickboxing" -> ExerciseSessionRecord.EXERCISE_TYPE_MARTIAL_ARTS
38
+ "kickboxing", "martialArts", "taiChi", "wrestling" -> ExerciseSessionRecord.EXERCISE_TYPE_MARTIAL_ARTS
84
39
  "lacrosse" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
85
- "martialArts" -> ExerciseSessionRecord.EXERCISE_TYPE_MARTIAL_ARTS
86
- "mindAndBody" -> ExerciseSessionRecord.EXERCISE_TYPE_YOGA
87
- "mixedCardio" -> ExerciseSessionRecord.EXERCISE_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING
88
- "paddleSports" -> ExerciseSessionRecord.EXERCISE_TYPE_PADDLING
40
+ "mindAndBody", "meditation" -> ExerciseSessionRecord.EXERCISE_TYPE_YOGA
41
+ "mixedCardio", "calisthenics" -> ExerciseSessionRecord.EXERCISE_TYPE_CALISTHENICS
42
+ "paddleSports", "paddling" -> ExerciseSessionRecord.EXERCISE_TYPE_PADDLING
89
43
  "pickleball" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
90
44
  "pilates" -> ExerciseSessionRecord.EXERCISE_TYPE_PILATES
91
45
  "play" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
92
- "preparationAndRecovery" -> ExerciseSessionRecord.EXERCISE_TYPE_STRETCHING
46
+ "preparationAndRecovery", "flexibility", "stretching" -> ExerciseSessionRecord.EXERCISE_TYPE_STRETCHING
93
47
  "racquetball" -> ExerciseSessionRecord.EXERCISE_TYPE_RACQUETBALL
48
+ "rowing" -> ExerciseSessionRecord.EXERCISE_TYPE_ROWING
49
+ "rowingMachine" -> ExerciseSessionRecord.EXERCISE_TYPE_ROWING_MACHINE
94
50
  "rugby" -> ExerciseSessionRecord.EXERCISE_TYPE_RUGBY
51
+ "running" -> ExerciseSessionRecord.EXERCISE_TYPE_RUNNING
52
+ "runningTreadmill" -> ExerciseSessionRecord.EXERCISE_TYPE_RUNNING_TREADMILL
95
53
  "sailing" -> ExerciseSessionRecord.EXERCISE_TYPE_SAILING
96
54
  "skatingSports" -> ExerciseSessionRecord.EXERCISE_TYPE_SKATING
55
+ "skating" -> ExerciseSessionRecord.EXERCISE_TYPE_SKATING
56
+ "skiing", "crossCountrySkiing", "downhillSkiing" -> ExerciseSessionRecord.EXERCISE_TYPE_SKIING
97
57
  "snowboarding" -> ExerciseSessionRecord.EXERCISE_TYPE_SNOWBOARDING
98
- "snowSports" -> ExerciseSessionRecord.EXERCISE_TYPE_SNOWSHOEING
58
+ "snowSports", "snowshoeing" -> ExerciseSessionRecord.EXERCISE_TYPE_SNOWSHOEING
59
+ "soccer" -> ExerciseSessionRecord.EXERCISE_TYPE_SOCCER
99
60
  "softball" -> ExerciseSessionRecord.EXERCISE_TYPE_SOFTBALL
100
61
  "squash" -> ExerciseSessionRecord.EXERCISE_TYPE_SQUASH
101
- "stairs" -> ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING
102
- "stepTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING_MACHINE
103
- "surfingSports" -> ExerciseSessionRecord.EXERCISE_TYPE_SURFING
62
+ "stairClimbing", "stairs" -> ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING
63
+ "stepTraining", "stairClimbingMachine" -> ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING_MACHINE
64
+ "surfing", "surfingSports" -> ExerciseSessionRecord.EXERCISE_TYPE_SURFING
65
+ "swimming", "swimmingPool", "waterFitness" -> ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_POOL
66
+ "swimmingOpenWater", "waterSports" -> ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_OPEN_WATER
104
67
  "tableTennis" -> ExerciseSessionRecord.EXERCISE_TYPE_TABLE_TENNIS
105
- "taiChi" -> ExerciseSessionRecord.EXERCISE_TYPE_YOGA
106
- "trackAndField" -> ExerciseSessionRecord.EXERCISE_TYPE_RUNNING
107
- "transition" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
108
- "underwaterDiving" -> ExerciseSessionRecord.EXERCISE_TYPE_SCUBA_DIVING
68
+ "tennis" -> ExerciseSessionRecord.EXERCISE_TYPE_TENNIS
69
+ "trackAndField" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
70
+ "underwaterDiving", "scubaDiving" -> ExerciseSessionRecord.EXERCISE_TYPE_SCUBA_DIVING
109
71
  "volleyball" -> ExerciseSessionRecord.EXERCISE_TYPE_VOLLEYBALL
110
- "wheelchairRunPace" -> ExerciseSessionRecord.EXERCISE_TYPE_WHEELCHAIR
111
- "wheelchairWalkPace" -> ExerciseSessionRecord.EXERCISE_TYPE_WHEELCHAIR
112
- "cardioDance" -> ExerciseSessionRecord.EXERCISE_TYPE_DANCING
113
- "socialDance" -> ExerciseSessionRecord.EXERCISE_TYPE_DANCING
72
+ "walking" -> ExerciseSessionRecord.EXERCISE_TYPE_WALKING
73
+ "waterPolo" -> ExerciseSessionRecord.EXERCISE_TYPE_WATER_POLO
74
+ "weightlifting" -> ExerciseSessionRecord.EXERCISE_TYPE_WEIGHTLIFTING
75
+ "wheelchair", "wheelchairRunPace", "wheelchairWalkPace", "handCycling" -> ExerciseSessionRecord.EXERCISE_TYPE_WHEELCHAIR
76
+ "yoga" -> ExerciseSessionRecord.EXERCISE_TYPE_YOGA
77
+ "archery" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
78
+ "barre" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
79
+ "cooldown" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
80
+ "discSports", "frisbeedisc" -> ExerciseSessionRecord.EXERCISE_TYPE_FRISBEE_DISC
81
+ "equestrianSports" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
82
+ "fishing" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
83
+ "fitnessGaming" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
84
+ "hunting" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
85
+ "transition" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
86
+ "backExtension",
87
+ "barbellShoulderPress",
88
+ "benchPress",
89
+ "benchSitUp",
90
+ "crunch",
91
+ "deadlift",
92
+ "dumbbellCurlLeftArm",
93
+ "dumbbellCurlRightArm",
94
+ "dumbbellFrontRaise",
95
+ "dumbbellLateralRaise",
96
+ "dumbbellTricepsExtensionLeftArm",
97
+ "dumbbellTricepsExtensionRightArm",
98
+ "dumbbellTricepsExtensionTwoArm",
99
+ "forwardTwist",
100
+ "latPullDown",
101
+ "lunge",
102
+ "plank",
103
+ "upperTwist" -> ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING
104
+ "bikingStationary" -> ExerciseSessionRecord.EXERCISE_TYPE_BIKING_STATIONARY
105
+ "bootCamp" -> ExerciseSessionRecord.EXERCISE_TYPE_BOOT_CAMP
106
+ "burpee", "jumpingJack" -> ExerciseSessionRecord.EXERCISE_TYPE_CALISTHENICS
107
+ "exerciseClass" -> ExerciseSessionRecord.EXERCISE_TYPE_EXERCISE_CLASS
108
+ "guidedBreathing" -> ExerciseSessionRecord.EXERCISE_TYPE_GUIDED_BREATHING
109
+ "iceSkating" -> ExerciseSessionRecord.EXERCISE_TYPE_ICE_SKATING
110
+ "paraGliding" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
111
+ "rollerHockey" -> ExerciseSessionRecord.EXERCISE_TYPE_ROLLER_HOCKEY
114
112
  "other" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
115
113
  else -> null
116
114
  }
@@ -118,61 +116,65 @@ object WorkoutType {
118
116
 
119
117
  fun toWorkoutTypeString(exerciseType: Int): String {
120
118
  return when (exerciseType) {
121
- ExerciseSessionRecord.EXERCISE_TYPE_RUNNING -> "running"
122
- ExerciseSessionRecord.EXERCISE_TYPE_BIKING -> "cycling"
123
- ExerciseSessionRecord.EXERCISE_TYPE_BIKING_STATIONARY -> "cycling"
124
- ExerciseSessionRecord.EXERCISE_TYPE_WALKING -> "walking"
125
- ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_POOL -> "swimming"
126
- ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_OPEN_WATER -> "swimming"
127
- ExerciseSessionRecord.EXERCISE_TYPE_YOGA -> "yoga"
128
- ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING -> "strengthTraining"
129
- ExerciseSessionRecord.EXERCISE_TYPE_HIKING -> "hiking"
130
- ExerciseSessionRecord.EXERCISE_TYPE_TENNIS -> "tennis"
131
- ExerciseSessionRecord.EXERCISE_TYPE_BASKETBALL -> "basketball"
132
- ExerciseSessionRecord.EXERCISE_TYPE_SOCCER -> "soccer"
133
119
  ExerciseSessionRecord.EXERCISE_TYPE_FOOTBALL_AMERICAN -> "americanFootball"
134
- ExerciseSessionRecord.EXERCISE_TYPE_BASEBALL -> "baseball"
135
- // Keep backward compatible mapping for existing types
136
- ExerciseSessionRecord.EXERCISE_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING -> "crossTraining"
137
- ExerciseSessionRecord.EXERCISE_TYPE_ELLIPTICAL -> "elliptical"
138
- ExerciseSessionRecord.EXERCISE_TYPE_ROWING -> "rowing"
139
- ExerciseSessionRecord.EXERCISE_TYPE_ROWING_MACHINE -> "rowing"
140
- // Keep stairClimbing as primary mapping for backward compatibility
141
- ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING -> "stairClimbing"
142
- ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING_MACHINE -> "stepTraining"
143
- ExerciseSessionRecord.EXERCISE_TYPE_WATER_POLO -> "waterPolo"
144
- // Keep wrestling as primary mapping for backward compatibility
145
- ExerciseSessionRecord.EXERCISE_TYPE_MARTIAL_ARTS -> "wrestling"
146
- // Comprehensive Android to TypeScript workout type mappings
147
120
  ExerciseSessionRecord.EXERCISE_TYPE_FOOTBALL_AUSTRALIAN -> "australianFootball"
148
121
  ExerciseSessionRecord.EXERCISE_TYPE_BADMINTON -> "badminton"
149
- ExerciseSessionRecord.EXERCISE_TYPE_PILATES -> "pilates"
122
+ ExerciseSessionRecord.EXERCISE_TYPE_BASEBALL -> "baseball"
123
+ ExerciseSessionRecord.EXERCISE_TYPE_BASKETBALL -> "basketball"
150
124
  ExerciseSessionRecord.EXERCISE_TYPE_BOXING -> "boxing"
151
125
  ExerciseSessionRecord.EXERCISE_TYPE_ROCK_CLIMBING -> "climbing"
152
- ExerciseSessionRecord.EXERCISE_TYPE_STRETCHING -> "flexibility"
153
126
  ExerciseSessionRecord.EXERCISE_TYPE_CRICKET -> "cricket"
154
- ExerciseSessionRecord.EXERCISE_TYPE_SKIING -> "downhillSkiing"
155
- ExerciseSessionRecord.EXERCISE_TYPE_DANCING -> "dance"
156
- ExerciseSessionRecord.EXERCISE_TYPE_FRISBEE_DISC -> "discSports"
127
+ ExerciseSessionRecord.EXERCISE_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING -> "crossTraining"
128
+ ExerciseSessionRecord.EXERCISE_TYPE_BIKING -> "cycling"
129
+ ExerciseSessionRecord.EXERCISE_TYPE_BIKING_STATIONARY -> "bikingStationary"
130
+ ExerciseSessionRecord.EXERCISE_TYPE_DANCING -> "dancing"
131
+ ExerciseSessionRecord.EXERCISE_TYPE_ELLIPTICAL -> "elliptical"
157
132
  ExerciseSessionRecord.EXERCISE_TYPE_FENCING -> "fencing"
158
133
  ExerciseSessionRecord.EXERCISE_TYPE_GOLF -> "golf"
159
134
  ExerciseSessionRecord.EXERCISE_TYPE_GYMNASTICS -> "gymnastics"
160
135
  ExerciseSessionRecord.EXERCISE_TYPE_HANDBALL -> "handball"
161
- ExerciseSessionRecord.EXERCISE_TYPE_WHEELCHAIR -> "wheelchairWalkPace"
162
- ExerciseSessionRecord.EXERCISE_TYPE_ICE_HOCKEY -> "hockey"
163
- ExerciseSessionRecord.EXERCISE_TYPE_PADDLING -> "paddleSports"
136
+ ExerciseSessionRecord.EXERCISE_TYPE_HIKING -> "hiking"
137
+ ExerciseSessionRecord.EXERCISE_TYPE_ICE_HOCKEY -> "iceHockey"
138
+ ExerciseSessionRecord.EXERCISE_TYPE_ICE_SKATING -> "iceSkating"
139
+ ExerciseSessionRecord.EXERCISE_TYPE_MARTIAL_ARTS -> "martialArts"
140
+ ExerciseSessionRecord.EXERCISE_TYPE_PILATES -> "pilates"
164
141
  ExerciseSessionRecord.EXERCISE_TYPE_RACQUETBALL -> "racquetball"
142
+ ExerciseSessionRecord.EXERCISE_TYPE_ROWING -> "rowing"
143
+ ExerciseSessionRecord.EXERCISE_TYPE_ROWING_MACHINE -> "rowingMachine"
165
144
  ExerciseSessionRecord.EXERCISE_TYPE_RUGBY -> "rugby"
145
+ ExerciseSessionRecord.EXERCISE_TYPE_RUNNING -> "running"
146
+ ExerciseSessionRecord.EXERCISE_TYPE_RUNNING_TREADMILL -> "runningTreadmill"
166
147
  ExerciseSessionRecord.EXERCISE_TYPE_SAILING -> "sailing"
167
- ExerciseSessionRecord.EXERCISE_TYPE_SKATING -> "skatingSports"
148
+ ExerciseSessionRecord.EXERCISE_TYPE_SKATING -> "skating"
149
+ ExerciseSessionRecord.EXERCISE_TYPE_SKIING -> "skiing"
168
150
  ExerciseSessionRecord.EXERCISE_TYPE_SNOWBOARDING -> "snowboarding"
169
- ExerciseSessionRecord.EXERCISE_TYPE_SNOWSHOEING -> "snowSports"
151
+ ExerciseSessionRecord.EXERCISE_TYPE_SNOWSHOEING -> "snowshoeing"
152
+ ExerciseSessionRecord.EXERCISE_TYPE_SOCCER -> "soccer"
170
153
  ExerciseSessionRecord.EXERCISE_TYPE_SOFTBALL -> "softball"
171
154
  ExerciseSessionRecord.EXERCISE_TYPE_SQUASH -> "squash"
172
- ExerciseSessionRecord.EXERCISE_TYPE_SURFING -> "surfingSports"
155
+ ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING -> "stairClimbing"
156
+ ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING_MACHINE -> "stairClimbingMachine"
157
+ ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING -> "strengthTraining"
158
+ ExerciseSessionRecord.EXERCISE_TYPE_STRETCHING -> "stretching"
159
+ ExerciseSessionRecord.EXERCISE_TYPE_SURFING -> "surfing"
160
+ ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_POOL -> "swimmingPool"
161
+ ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_OPEN_WATER -> "swimmingOpenWater"
173
162
  ExerciseSessionRecord.EXERCISE_TYPE_TABLE_TENNIS -> "tableTennis"
174
- ExerciseSessionRecord.EXERCISE_TYPE_SCUBA_DIVING -> "underwaterDiving"
163
+ ExerciseSessionRecord.EXERCISE_TYPE_TENNIS -> "tennis"
175
164
  ExerciseSessionRecord.EXERCISE_TYPE_VOLLEYBALL -> "volleyball"
165
+ ExerciseSessionRecord.EXERCISE_TYPE_WALKING -> "walking"
166
+ ExerciseSessionRecord.EXERCISE_TYPE_WATER_POLO -> "waterPolo"
167
+ ExerciseSessionRecord.EXERCISE_TYPE_WEIGHTLIFTING -> "weightlifting"
168
+ ExerciseSessionRecord.EXERCISE_TYPE_WHEELCHAIR -> "wheelchair"
169
+ ExerciseSessionRecord.EXERCISE_TYPE_YOGA -> "yoga"
170
+ ExerciseSessionRecord.EXERCISE_TYPE_BOOT_CAMP -> "bootCamp"
171
+ ExerciseSessionRecord.EXERCISE_TYPE_CALISTHENICS -> "calisthenics"
172
+ ExerciseSessionRecord.EXERCISE_TYPE_EXERCISE_CLASS -> "exerciseClass"
173
+ ExerciseSessionRecord.EXERCISE_TYPE_FRISBEE_DISC -> "frisbeedisc"
174
+ ExerciseSessionRecord.EXERCISE_TYPE_GUIDED_BREATHING -> "guidedBreathing"
175
+ ExerciseSessionRecord.EXERCISE_TYPE_PADDLING -> "paddling"
176
+ ExerciseSessionRecord.EXERCISE_TYPE_ROLLER_HOCKEY -> "rollerHockey"
177
+ ExerciseSessionRecord.EXERCISE_TYPE_SCUBA_DIVING -> "scubaDiving"
176
178
  ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT -> "other"
177
179
  else -> "other"
178
180
  }