@sports-alliance/sports-lib 7.0.0 → 7.0.3

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.
Files changed (112) hide show
  1. package/.github/workflows/test.yml +2 -2
  2. package/lib/cjs/activities/activity.types.d.ts +6 -3
  3. package/lib/cjs/activities/activity.types.js +9 -4
  4. package/lib/cjs/activities/devices/device.d.ts +1 -0
  5. package/lib/cjs/activities/devices/device.interface.d.ts +1 -0
  6. package/lib/cjs/activities/devices/device.js +1 -0
  7. package/lib/cjs/activities/devices/device.json.interface.d.ts +1 -0
  8. package/lib/cjs/data/data.cycling-position.js +1 -1
  9. package/lib/cjs/data/data.feeling.js +1 -1
  10. package/lib/cjs/data/data.interface.js +1 -1
  11. package/lib/cjs/data/data.rpe.js +1 -1
  12. package/lib/cjs/data/data.store.export.spec.js +28 -14
  13. package/lib/cjs/data/data.store.js +1 -1
  14. package/lib/cjs/events/adapters/file-type.enum.js +1 -1
  15. package/lib/cjs/events/adapters/importers/fit/importer.fit.coros.device.names.js +2 -1
  16. package/lib/cjs/events/adapters/importers/fit/importer.fit.d.ts +2 -1
  17. package/lib/cjs/events/adapters/importers/fit/importer.fit.garmin.device.names.js +61 -2
  18. package/lib/cjs/events/adapters/importers/fit/importer.fit.garmin.profile.data.js +867 -855
  19. package/lib/cjs/events/adapters/importers/fit/importer.fit.garmin.profile.mapper.spec.d.ts +1 -0
  20. package/lib/cjs/events/adapters/importers/fit/importer.fit.garmin.profile.mapper.spec.js +34 -0
  21. package/lib/cjs/events/adapters/importers/fit/importer.fit.integration.spec.js +22 -8
  22. package/lib/cjs/events/adapters/importers/fit/importer.fit.js +24 -2
  23. package/lib/cjs/events/adapters/importers/fit/importer.fit.suunto.device.names.js +1 -0
  24. package/lib/cjs/events/adapters/importers/fit/importer.fit.wahoo.device.names.js +5 -1
  25. package/lib/cjs/events/adapters/importers/gpx/importer.gpx.integration.spec.js +22 -8
  26. package/lib/cjs/events/adapters/importers/gpx/importer.gpx.js +1 -1
  27. package/lib/cjs/events/adapters/importers/gpx/importer.gpx.spec.js +50 -0
  28. package/lib/cjs/events/adapters/importers/suunto/importer.suunto.activity.ids.js +1 -1
  29. package/lib/cjs/events/adapters/importers/suunto/importer.suunto.device.names.js +1 -0
  30. package/lib/cjs/events/adapters/importers/suunto/importer.suunto.integration.spec.js +22 -8
  31. package/lib/cjs/events/adapters/importers/tcx/importer.tcx.integration.spec.js +22 -8
  32. package/lib/cjs/events/utilities/activity.utilities.js +7 -7
  33. package/lib/cjs/events/utilities/grade-calculator/low-pass-filter.js +3 -3
  34. package/lib/cjs/events/utilities/helpers.d.ts +1 -1
  35. package/lib/cjs/events/utilities/helpers.js +19 -19
  36. package/lib/cjs/index.d.ts +1 -1
  37. package/lib/cjs/index.js +5 -1
  38. package/lib/cjs/laps/lap.types.js +1 -1
  39. package/lib/cjs/meta-data/event-meta-data.interface.js +1 -1
  40. package/lib/cjs/privacy/privacy.class.interface.js +1 -1
  41. package/lib/cjs/specs/activities-parsing.integration.spec.js +75 -61
  42. package/lib/cjs/specs/strava-streams-compliance.spec.js +22 -8
  43. package/lib/cjs/streams/compressed.stream.interface.js +2 -2
  44. package/lib/cjs/tiles/tile.settings.interface.js +5 -5
  45. package/lib/cjs/users/settings/dashboard/user.dashboard.settings.interface.js +1 -1
  46. package/lib/cjs/users/settings/user.app.settings.interface.js +1 -1
  47. package/lib/cjs/users/settings/user.chart.settings.interface.js +3 -3
  48. package/lib/cjs/users/settings/user.map.settings.interface.js +2 -2
  49. package/lib/cjs/users/settings/user.unit.settings.interface.js +9 -9
  50. package/lib/esm/activities/activity.types.d.ts +6 -3
  51. package/lib/esm/activities/activity.types.js +7 -2
  52. package/lib/esm/activities/devices/device.d.ts +1 -0
  53. package/lib/esm/activities/devices/device.interface.d.ts +1 -0
  54. package/lib/esm/activities/devices/device.js +1 -0
  55. package/lib/esm/activities/devices/device.json.interface.d.ts +1 -0
  56. package/lib/esm/data/data.store.export.spec.js +6 -6
  57. package/lib/esm/data/data.store.js +1 -1
  58. package/lib/esm/events/adapters/importers/fit/importer.fit.coros.device.names.js +2 -1
  59. package/lib/esm/events/adapters/importers/fit/importer.fit.d.ts +2 -1
  60. package/lib/esm/events/adapters/importers/fit/importer.fit.garmin.device.names.js +61 -2
  61. package/lib/esm/events/adapters/importers/fit/importer.fit.garmin.profile.data.js +867 -855
  62. package/lib/esm/events/adapters/importers/fit/importer.fit.garmin.profile.mapper.spec.d.ts +1 -0
  63. package/lib/esm/events/adapters/importers/fit/importer.fit.garmin.profile.mapper.spec.js +32 -0
  64. package/lib/esm/events/adapters/importers/fit/importer.fit.js +24 -2
  65. package/lib/esm/events/adapters/importers/fit/importer.fit.suunto.device.names.js +1 -0
  66. package/lib/esm/events/adapters/importers/fit/importer.fit.wahoo.device.names.js +5 -1
  67. package/lib/esm/events/adapters/importers/gpx/importer.gpx.js +1 -1
  68. package/lib/esm/events/adapters/importers/gpx/importer.gpx.spec.js +17 -0
  69. package/lib/esm/events/adapters/importers/suunto/importer.suunto.device.names.js +1 -0
  70. package/lib/esm/events/utilities/activity.utilities.js +7 -7
  71. package/lib/esm/events/utilities/grade-calculator/low-pass-filter.js +3 -3
  72. package/lib/esm/events/utilities/helpers.d.ts +1 -1
  73. package/lib/esm/index.d.ts +1 -1
  74. package/lib/esm/specs/activities-parsing.integration.spec.js +53 -53
  75. package/package.json +21 -21
  76. package/.editorconfig +0 -14
  77. package/.eslintignore +0 -4
  78. package/.eslintrc.js +0 -9
  79. package/.prettierignore +0 -24
  80. package/.prettierrc.json +0 -12
  81. package/.vscode/launch.json +0 -49
  82. package/.vscode/tasks.json +0 -34
  83. package/CODE_OF_CONDUCT.md +0 -76
  84. package/debug-fit-import.js +0 -10
  85. package/jest.config.js +0 -23
  86. package/lib/cjs/package.json +0 -1
  87. package/lib/cjs/specs/fixtures/streams/strava/rides/3171472783.json +0 -52534
  88. package/lib/cjs/specs/fixtures/streams/strava/rides/3171487458.json +0 -78818
  89. package/lib/cjs/specs/fixtures/streams/strava/rides/343080886.json +0 -105090
  90. package/lib/cjs/specs/fixtures/streams/strava/rides/5910143591.json +0 -110711
  91. package/lib/cjs/specs/fixtures/streams/strava/runs/2451375851.json +0 -74846
  92. package/lib/cjs/specs/fixtures/streams/strava/runs/2709634581.json +0 -66817
  93. package/lib/cjs/specs/fixtures/streams/strava/runs/3156040843.json +0 -17594
  94. package/lib/cjs/specs/fixtures/streams/strava/runs/3182900697.json +0 -17322
  95. package/lib/cjs/specs/fixtures/streams/strava/runs/3183465494.json +0 -20463
  96. package/lib/cjs/specs/fixtures/streams/strava/runs/3183490558.json +0 -58202
  97. package/lib/esm/specs/fixtures/streams/strava/rides/3171472783.json +0 -52534
  98. package/lib/esm/specs/fixtures/streams/strava/rides/3171487458.json +0 -78818
  99. package/lib/esm/specs/fixtures/streams/strava/rides/343080886.json +0 -105090
  100. package/lib/esm/specs/fixtures/streams/strava/rides/5910143591.json +0 -110711
  101. package/lib/esm/specs/fixtures/streams/strava/runs/2451375851.json +0 -74846
  102. package/lib/esm/specs/fixtures/streams/strava/runs/2709634581.json +0 -66817
  103. package/lib/esm/specs/fixtures/streams/strava/runs/3156040843.json +0 -17594
  104. package/lib/esm/specs/fixtures/streams/strava/runs/3182900697.json +0 -17322
  105. package/lib/esm/specs/fixtures/streams/strava/runs/3183465494.json +0 -20463
  106. package/lib/esm/specs/fixtures/streams/strava/runs/3183490558.json +0 -58202
  107. package/test_output.log +0 -162
  108. package/test_output_2.log +0 -168
  109. package/test_output_3.log +0 -168
  110. package/tsconfig.cjs.json +0 -7
  111. package/tsconfig.esm.json +0 -8
  112. package/tsconfig.lib.json +0 -8
@@ -1,34 +0,0 @@
1
- {
2
- "version": "2.0.0",
3
- "tasks": [
4
- {
5
- "type": "npm",
6
- "script": "build",
7
- "group": "build",
8
- "problemMatcher": [],
9
- "label": "npm: build",
10
- "detail": "npm run clean && tsc --project tsconfig.lib.json"
11
- },
12
- {
13
- "type": "npm",
14
- "script": "watch",
15
- "group": "build",
16
- "isBackground": true,
17
- "problemMatcher": {
18
- "owner": "typescript",
19
- "pattern": "$tsc",
20
- "background": {
21
- "activeOnStart": true,
22
- "beginsPattern": {
23
- "regexp": "^.*Starting compilation in watch mode.*$"
24
- },
25
- "endsPattern": {
26
- "regexp": "^.*Found [0-9]+ errors.*$"
27
- }
28
- }
29
- },
30
- "label": "npm: watch",
31
- "detail": "npm run build -- --watch"
32
- }
33
- ]
34
- }
@@ -1,76 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, sex characteristics, gender identity and expression,
9
- level of experience, education, socio-economic status, nationality, personal
10
- appearance, race, religion, or sexual identity and orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at jimmykane9@gmail.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
-
73
- [homepage]: https://www.contributor-covenant.org
74
-
75
- For answers to common questions about this code of conduct, see
76
- https://www.contributor-covenant.org/faq
@@ -1,10 +0,0 @@
1
- const { FitParser } = require('fit-file-parser');
2
- console.log('Successfully required FitParser');
3
- try {
4
- const parser = new FitParser();
5
- console.log('Parser instance created');
6
- const resolvedPath = require.resolve('fit-file-parser');
7
- console.log('Resolved path:', resolvedPath);
8
- } catch (e) {
9
- console.error('Error:', e);
10
- }
package/jest.config.js DELETED
@@ -1,23 +0,0 @@
1
- module.exports = {
2
- transform: {
3
- '^.+\\.(ts|tsx)$': 'ts-jest',
4
- '^.+\\.(js|jsx)$': 'babel-jest'
5
- },
6
- transformIgnorePatterns: ['node_modules/(?!fit-file-parser|@garmin/fitsdk)'],
7
- testPathIgnorePatterns: ['<rootDir>/lib/', '<rootDir>/node_modules/'],
8
- moduleNameMapper: {
9
- '^node:buffer$': '<rootDir>/node_modules/buffer/index.js'
10
- },
11
- testTimeout: 960000, // Allow 480s for integrations tests
12
- testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
13
- moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
14
- // Since Jest 27 'node' env is the default and recommended one.
15
- // Switch to 'jsdom' to execute test in browser env (was previous behavior until Jest 26)
16
- testEnvironment: 'node',
17
- globals: {
18
- 'ts-jest': {
19
- babelConfig: true
20
- }
21
- },
22
- setupFilesAfterEnv: ['<rootDir>/jest.setup.ts']
23
- };
@@ -1 +0,0 @@
1
- {"type": "commonjs"}