@garmin/fitsdk 21.158.0 → 21.161.0

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/src/stream.js CHANGED
@@ -1,12 +1,12 @@
1
1
  /////////////////////////////////////////////////////////////////////////////////////////////
2
- // Copyright 2024 Garmin International, Inc.
2
+ // Copyright 2025 Garmin International, Inc.
3
3
  // Licensed under the Flexible and Interoperable Data Transfer (FIT) Protocol License; you
4
4
  // may not use this file except in compliance with the Flexible and Interoperable Data
5
5
  // Transfer (FIT) Protocol License.
6
6
  /////////////////////////////////////////////////////////////////////////////////////////////
7
7
  // ****WARNING**** This file is auto-generated! Do NOT edit this file.
8
- // Profile Version = 21.158.0Release
9
- // Tag = production/release/21.158.0-0-gc9428aa
8
+ // Profile Version = 21.161.0Release
9
+ // Tag = production/release/21.161.0-0-g58854c0
10
10
  /////////////////////////////////////////////////////////////////////////////////////////////
11
11
 
12
12
 
@@ -1,12 +1,12 @@
1
1
  /////////////////////////////////////////////////////////////////////////////////////////////
2
- // Copyright 2024 Garmin International, Inc.
2
+ // Copyright 2025 Garmin International, Inc.
3
3
  // Licensed under the Flexible and Interoperable Data Transfer (FIT) Protocol License; you
4
4
  // may not use this file except in compliance with the Flexible and Interoperable Data
5
5
  // Transfer (FIT) Protocol License.
6
6
  /////////////////////////////////////////////////////////////////////////////////////////////
7
7
  // ****WARNING**** This file is auto-generated! Do NOT edit this file.
8
- // Profile Version = 21.158.0Release
9
- // Tag = production/release/21.158.0-0-gc9428aa
8
+ // Profile Version = 21.161.0Release
9
+ // Tag = production/release/21.161.0-0-g58854c0
10
10
  /////////////////////////////////////////////////////////////////////////////////////////////
11
11
 
12
12
 
@@ -1,12 +1,12 @@
1
1
  /////////////////////////////////////////////////////////////////////////////////////////////
2
- // Copyright 2024 Garmin International, Inc.
2
+ // Copyright 2025 Garmin International, Inc.
3
3
  // Licensed under the Flexible and Interoperable Data Transfer (FIT) Protocol License; you
4
4
  // may not use this file except in compliance with the Flexible and Interoperable Data
5
5
  // Transfer (FIT) Protocol License.
6
6
  /////////////////////////////////////////////////////////////////////////////////////////////
7
7
  // ****WARNING**** This file is auto-generated! Do NOT edit this file.
8
- // Profile Version = 21.158.0Release
9
- // Tag = production/release/21.158.0-0-gc9428aa
8
+ // Profile Version = 21.161.0Release
9
+ // Tag = production/release/21.161.0-0-g58854c0
10
10
  /////////////////////////////////////////////////////////////////////////////////////////////
11
11
 
12
12
 
package/src/utils.js CHANGED
@@ -1,12 +1,12 @@
1
1
  /////////////////////////////////////////////////////////////////////////////////////////////
2
- // Copyright 2024 Garmin International, Inc.
2
+ // Copyright 2025 Garmin International, Inc.
3
3
  // Licensed under the Flexible and Interoperable Data Transfer (FIT) Protocol License; you
4
4
  // may not use this file except in compliance with the Flexible and Interoperable Data
5
5
  // Transfer (FIT) Protocol License.
6
6
  /////////////////////////////////////////////////////////////////////////////////////////////
7
7
  // ****WARNING**** This file is auto-generated! Do NOT edit this file.
8
- // Profile Version = 21.158.0Release
9
- // Tag = production/release/21.158.0-0-gc9428aa
8
+ // Profile Version = 21.161.0Release
9
+ // Tag = production/release/21.161.0-0-g58854c0
10
10
  /////////////////////////////////////////////////////////////////////////////////////////////
11
11
 
12
12
 
@@ -25,7 +25,42 @@ const convertDateTimeToDate = (datetime) => {
25
25
  return new Date((datetime ?? 0) * 1000 + FIT_EPOCH_MS);
26
26
  };
27
27
 
28
+ /**
29
+ * Convert a JavaScript Date to a FIT DateTime
30
+ * @param {Date} A JavaScript Date object
31
+ * @return {number} datetime - Seconds since FIT EPOCH
32
+ */
33
+ const convertDateToDateTime = (date) => {
34
+ return (date.getTime() - FIT_EPOCH_MS) / 1000;
35
+ };
36
+
37
+
38
+ /**
39
+ * FIT Base Type enum, for use with Developer Data Field Descriptions
40
+ */
41
+ const FitBaseType = Object.freeze({
42
+ enum: 0,
43
+ sint8: 1,
44
+ uint8: 2,
45
+ sint16: 131,
46
+ uint16: 132,
47
+ sint32: 133,
48
+ uint32: 134,
49
+ string: 7,
50
+ float32: 136,
51
+ float64: 137,
52
+ uint8z: 10,
53
+ uint16z: 139,
54
+ uint32z: 140,
55
+ byte: 13,
56
+ sint64: 142,
57
+ uint64: 143,
58
+ uint64z: 144,
59
+ });
60
+
28
61
  export default {
29
62
  FIT_EPOCH_MS,
30
63
  convertDateTimeToDate,
64
+ convertDateToDateTime,
65
+ FitBaseType,
31
66
  };