@@ -4,40 +4,9 @@ import type { WorkoutPresetSet } from '@/types/workout';
44import { debug } from '@/utils/logging' ;
55import { getUserLoggingLevel } from '@/utils/userPreferences' ;
66import type { ExerciseEntry } from '@/types/diary' ;
7- import type { GroupedExerciseEntry } from '@/types/exercises' ;
7+ import type { GroupedExerciseEntry , LapDTO } from '@/types/exercises' ;
88import type { ExerciseProgressData } from '@/types/reports' ;
9-
10- interface RawActivityDetail {
11- id ?: string ;
12- detail_type : string ;
13- detail_data : unknown ;
14- provider_name ?: string ;
15- }
16-
17- interface RawExerciseSnapshot {
18- equipment ?: string ;
19- primary_muscles ?: string ;
20- secondary_muscles ?: string ;
21- instructions ?: string ;
22- images ?: string ;
23- [ key : string ] : unknown ;
24- }
25-
26- interface RawExercise {
27- sets ?: string | unknown [ ] ;
28- exercise_snapshot ?: RawExerciseSnapshot ;
29- activity_details ?: RawActivityDetail [ ] ;
30- [ key : string ] : unknown ;
31- }
32-
33- interface RawGroupedEntry {
34- type ?: string ;
35- exercises ?: RawExercise [ ] ;
36- sets ?: string | unknown [ ] ;
37- exercise_snapshot ?: RawExerciseSnapshot ;
38- activity_details ?: RawActivityDetail [ ] ;
39- [ key : string ] : unknown ;
40- }
9+ import { ActivityDetailMetric } from '@/pages/Reports/ActivityReportVisualizer' ;
4110
4211export const getExerciseEntriesForDate = async (
4312 date : string
@@ -83,7 +52,7 @@ export const fetchExerciseEntries = async (
8352 value :
8453 typeof detail . detail_data === 'object'
8554 ? JSON . stringify ( detail . detail_data , null , 2 )
86- : detail . detail_data ,
55+ : String ( detail . detail_data ) ,
8756 provider_name : detail . provider_name ,
8857 detail_type : detail . detail_type ,
8958 } ) )
@@ -114,7 +83,7 @@ export const fetchExerciseEntries = async (
11483 value :
11584 typeof detail . detail_data === 'object'
11685 ? JSON . stringify ( detail . detail_data , null , 2 )
117- : detail . detail_data ,
86+ : String ( detail . detail_data ) ,
11887 provider_name : detail . provider_name ,
11988 detail_type : detail . detail_type ,
12089 } ) )
@@ -327,15 +296,15 @@ export interface ActivityDetailsResponse {
327296 activity ?: {
328297 details ?: {
329298 metricDescriptors ?: unknown [ ] ;
330- activityDetailMetrics ?: unknown [ ] ;
299+ activityDetailMetrics ?: ActivityDetailMetric [ ] ;
331300 geoPolylineDTO ?: {
332301 polyline : { lat : number ; lon : number } [ ] ;
333302 } ;
334303 [ key : string ] : unknown ;
335304 } ;
336305 hr_in_timezones ?: unknown [ ] ;
337306 splits ?: {
338- lapDTOs : unknown [ ] ;
307+ lapDTOs : LapDTO [ ] ;
339308 [ key : string ] : unknown ;
340309 } ;
341310 activity ?: {
0 commit comments