@swimedge/metrics 1.1.1 → 1.1.2

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/dist/index.d.ts CHANGED
@@ -53,6 +53,7 @@ export interface SwimSession {
53
53
  avgDistancePerStroke?: number;
54
54
  routeCoordinates?: number[][];
55
55
  routeMapImage?: string;
56
+ routeMapThumbnail?: string;
56
57
  deviceType?: string;
57
58
  osVersion?: string;
58
59
  healthKitWorkoutId?: string;
package/dist/index.js CHANGED
@@ -37,7 +37,9 @@ const formatTime = (seconds) => {
37
37
  if (mins >= 60) {
38
38
  const hours = Math.floor(mins / 60);
39
39
  const remainingMins = mins % 60;
40
- return `${hours}:${remainingMins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
40
+ return `${hours}:${remainingMins.toString().padStart(2, '0')}:${secs
41
+ .toString()
42
+ .padStart(2, '0')}`;
41
43
  }
42
44
  return `${mins}:${secs.toString().padStart(2, '0')}`;
43
45
  };
@@ -353,7 +355,7 @@ exports.METRICS_REGISTRY = {
353
355
  key: 'calories',
354
356
  label: 'Calories',
355
357
  unit: 'kcal',
356
- category: MetricCategory.ENERGY,
358
+ category: MetricCategory.HEALTH,
357
359
  description: 'Total calories burned during the swimming session.',
358
360
  icon: 'flame-outline',
359
361
  isPerSession: true,
@@ -363,7 +365,7 @@ exports.METRICS_REGISTRY = {
363
365
  availableFrom: { watch: true, manual: true },
364
366
  swimTypes: [SwimType.INDOOR, SwimType.OPEN_WATER],
365
367
  hasChart: true,
366
- formatter: (s) => String(s.calories),
368
+ formatter: (s) => s.calories,
367
369
  condition: (s) => !!s.calories,
368
370
  },
369
371
  totalStrokeCount: {
@@ -524,9 +526,11 @@ exports.METRICS_REGISTRY = {
524
526
  2: 'Easy',
525
527
  3: 'Moderate',
526
528
  4: 'Hard',
527
- 5: 'Very Hard'
529
+ 5: 'Very Hard',
528
530
  };
529
- const effortNum = typeof s.perceivedEffort === 'string' ? parseInt(s.perceivedEffort) : s.perceivedEffort;
531
+ const effortNum = typeof s.perceivedEffort === 'string'
532
+ ? parseInt(s.perceivedEffort)
533
+ : s.perceivedEffort;
530
534
  return effortMap[effortNum] || 'Unknown';
531
535
  },
532
536
  condition: (s) => !!s.perceivedEffort,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swimedge/metrics",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Shared metrics registry for SwimEdge (frontend, backend, watch)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",