@swimedge/metrics 1.0.6 → 1.0.7
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 +2 -1
- package/dist/index.js +20 -10
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare enum SwimType {
|
|
|
7
7
|
OPEN_WATER = "openWater"
|
|
8
8
|
}
|
|
9
9
|
export interface SwimLap {
|
|
10
|
+
lapNumber?: number;
|
|
10
11
|
strokeCount?: number;
|
|
11
12
|
pace?: number;
|
|
12
13
|
strokeRate?: number;
|
|
@@ -14,7 +15,6 @@ export interface SwimLap {
|
|
|
14
15
|
strokeStyle?: string;
|
|
15
16
|
splitTime?: number;
|
|
16
17
|
swolfScore?: number;
|
|
17
|
-
calories?: number;
|
|
18
18
|
}
|
|
19
19
|
export interface SwimSession {
|
|
20
20
|
id: string;
|
|
@@ -56,6 +56,7 @@ export interface SwimSession {
|
|
|
56
56
|
osVersion?: string;
|
|
57
57
|
healthKitWorkoutId?: string;
|
|
58
58
|
lapData?: SwimLap[];
|
|
59
|
+
swimLaps?: SwimLap[];
|
|
59
60
|
}
|
|
60
61
|
export interface AggregatedSwimMetrics {
|
|
61
62
|
totalDistance: number;
|
package/dist/index.js
CHANGED
|
@@ -62,6 +62,15 @@ const formatSwimType = (swimType) => {
|
|
|
62
62
|
};
|
|
63
63
|
exports.formatSwimType = formatSwimType;
|
|
64
64
|
exports.LAP_METRICS_REGISTRY = {
|
|
65
|
+
lapNumber: {
|
|
66
|
+
key: 'lapNumber',
|
|
67
|
+
label: 'Lap #',
|
|
68
|
+
category: MetricCategory.PERFORMANCE,
|
|
69
|
+
description: 'Lap number in the session',
|
|
70
|
+
decimals: 0,
|
|
71
|
+
availableFrom: { watch: true, manual: false },
|
|
72
|
+
swimTypes: [SwimType.INDOOR],
|
|
73
|
+
},
|
|
65
74
|
strokeCount: {
|
|
66
75
|
key: 'strokeCount',
|
|
67
76
|
label: 'Strokes',
|
|
@@ -141,16 +150,16 @@ exports.LAP_METRICS_REGISTRY = {
|
|
|
141
150
|
availableFrom: { watch: true, manual: false },
|
|
142
151
|
swimTypes: [SwimType.INDOOR],
|
|
143
152
|
},
|
|
144
|
-
calories: {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
},
|
|
153
|
+
// calories: {
|
|
154
|
+
// key: 'calories',
|
|
155
|
+
// label: 'Cal',
|
|
156
|
+
// unit: 'kcal',
|
|
157
|
+
// category: MetricCategory.ENERGY,
|
|
158
|
+
// description: 'Calories burned in this lap',
|
|
159
|
+
// decimals: 0,
|
|
160
|
+
// availableFrom: { watch: true, manual: false },
|
|
161
|
+
// swimTypes: [SwimType.INDOOR],
|
|
162
|
+
// },
|
|
154
163
|
};
|
|
155
164
|
exports.METRICS_REGISTRY = {
|
|
156
165
|
distance: {
|
|
@@ -227,6 +236,7 @@ exports.METRICS_REGISTRY = {
|
|
|
227
236
|
availableFrom: { watch: true, manual: true },
|
|
228
237
|
swimTypes: [SwimType.INDOOR],
|
|
229
238
|
hasChart: true,
|
|
239
|
+
formatter: (s) => String(s.laps || 0),
|
|
230
240
|
condition: (s) => !!s.laps,
|
|
231
241
|
},
|
|
232
242
|
avgPace: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swimedge/metrics",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Shared metrics registry for SwimEdge (frontend, backend, watch)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -52,4 +52,4 @@
|
|
|
52
52
|
"ts-jest": "^29.1.0",
|
|
53
53
|
"typescript": "^5.0.0"
|
|
54
54
|
}
|
|
55
|
-
}
|
|
55
|
+
}
|