@swimedge/metrics 1.0.3 → 1.0.5

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
@@ -54,7 +54,6 @@ export interface SwimSession extends SwimSessionLaps {
54
54
  equipment?: string[];
55
55
  avgDistancePerStroke?: number;
56
56
  routeCoordinates?: number[][];
57
- routeMapImage?: string;
58
57
  deviceType?: string;
59
58
  osVersion?: string;
60
59
  healthKitWorkoutId?: string;
@@ -126,6 +125,7 @@ export declare const METRICS_REGISTRY: Record<keyof SwimSession, MetricDefinitio
126
125
  export declare const MetricsHelper: {
127
126
  getMetric: (key: keyof SwimSession) => MetricDefinition;
128
127
  getSessionMetrics: () => MetricDefinition[];
128
+ getChartMetrics: () => MetricDefinition[];
129
129
  getLapMetrics: () => MetricDefinition[];
130
130
  getMetricsByCategory: (category: MetricCategory) => MetricDefinition[];
131
131
  getMetricsBySwimType: (swimType: SwimType) => MetricDefinition[];
package/dist/index.js CHANGED
@@ -193,6 +193,7 @@ exports.METRICS_REGISTRY = {
193
193
  isHealthKit: true,
194
194
  availableFrom: { watch: true, manual: false },
195
195
  swimTypes: [SwimType.INDOOR, SwimType.OPEN_WATER],
196
+ hasChart: true,
196
197
  formatter: (s) => `${(0, exports.formatNumber)(s.waterTemp, 1)}°C`,
197
198
  condition: (s) => !!s.waterTemp,
198
199
  },
@@ -209,6 +210,7 @@ exports.METRICS_REGISTRY = {
209
210
  isHealthKit: true,
210
211
  availableFrom: { watch: true, manual: false },
211
212
  swimTypes: [SwimType.INDOOR, SwimType.OPEN_WATER],
213
+ hasChart: true,
212
214
  formatter: (s) => (0, exports.formatHeartRate)(s.avgHeartRate),
213
215
  condition: (s) => !!s.avgHeartRate,
214
216
  },
@@ -225,6 +227,7 @@ exports.METRICS_REGISTRY = {
225
227
  isHealthKit: true,
226
228
  availableFrom: { watch: true, manual: false },
227
229
  swimTypes: [SwimType.INDOOR, SwimType.OPEN_WATER],
230
+ hasChart: true,
228
231
  formatter: (s) => (0, exports.formatHeartRate)(s.maxHeartRate),
229
232
  condition: (s) => !!s.maxHeartRate,
230
233
  },
@@ -241,6 +244,7 @@ exports.METRICS_REGISTRY = {
241
244
  isHealthKit: true,
242
245
  availableFrom: { watch: true, manual: false },
243
246
  swimTypes: [SwimType.INDOOR, SwimType.OPEN_WATER],
247
+ hasChart: true,
244
248
  formatter: (s) => (0, exports.formatHeartRate)(s.minHeartRate),
245
249
  condition: (s) => !!s.minHeartRate,
246
250
  },
@@ -608,20 +612,11 @@ exports.METRICS_REGISTRY = {
608
612
  availableFrom: { watch: true, manual: false },
609
613
  swimTypes: [SwimType.INDOOR, SwimType.OPEN_WATER],
610
614
  },
611
- routeMapImage: {
612
- key: 'routeMapImage',
613
- label: 'Route Map',
614
- category: MetricCategory.PERFORMANCE,
615
- description: 'Base64 encoded route map image for open water sessions',
616
- isPerSession: true,
617
- availableFrom: { watch: false, manual: false },
618
- swimTypes: [SwimType.OPEN_WATER],
619
- condition: (s) => !!s.routeMapImage,
620
- },
621
615
  };
622
616
  exports.MetricsHelper = {
623
617
  getMetric: (key) => exports.METRICS_REGISTRY[key],
624
618
  getSessionMetrics: () => Object.values(exports.METRICS_REGISTRY).filter((m) => m.isPerSession),
619
+ getChartMetrics: () => Object.values(exports.METRICS_REGISTRY).filter((m) => m.isPerSession && m.hasChart),
625
620
  getLapMetrics: () => Object.values(exports.METRICS_REGISTRY).filter((m) => m.isPerLap),
626
621
  getMetricsByCategory: (category) => Object.values(exports.METRICS_REGISTRY).filter((m) => m.category === category),
627
622
  getMetricsBySwimType: (swimType) => Object.values(exports.METRICS_REGISTRY).filter((m) => m.swimTypes?.includes(swimType)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swimedge/metrics",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Shared metrics registry for SwimEdge (frontend, backend, watch)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",