incyclist-services 1.7.70 → 1.7.72
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/lib/cjs/devices/ride/service.js +7 -0
- package/lib/cjs/ride/display/service.js +4 -5
- package/lib/cjs/ride/page/service.js +18 -0
- package/lib/cjs/ride/route/GpxDisplayService.js +16 -16
- package/lib/cjs/ride/route/RouteDisplayService.js +1 -1
- package/lib/cjs/settings/display/ride/service.js +20 -2
- package/lib/esm/{src/activities/upload/intervals.js → activities/upload/trainingpeaks.js} +30 -48
- package/lib/esm/apps/base/api/trainingpeaks/api.js +143 -0
- package/lib/esm/apps/base/api/trainingpeaks/index.js +1 -0
- package/lib/esm/{src/apps/strava/StravaAppConnection.js → apps/trainingpeaks/TrainingPeaksAppConnection.js} +32 -33
- package/lib/esm/devices/ride/service.js +7 -0
- package/lib/esm/ride/display/service.js +4 -5
- package/lib/esm/ride/page/service.js +18 -0
- package/lib/esm/ride/route/GpxDisplayService.js +16 -16
- package/lib/esm/ride/route/RouteDisplayService.js +1 -1
- package/lib/esm/settings/display/ride/service.js +20 -2
- package/lib/esm/{src/workouts/calendar/sync/intervals → workouts/calendar/sync/trainingpeaks}/provider.js +64 -71
- package/lib/types/activities/upload/trainingpeaks.d.ts +16 -0
- package/lib/types/apps/base/api/trainingpeaks/api.d.ts +30 -0
- package/lib/types/apps/base/api/trainingpeaks/index.d.ts +2 -0
- package/lib/types/apps/base/api/trainingpeaks/types.d.ts +55 -0
- package/lib/types/apps/trainingpeaks/TrainingPeaksAppConnection.d.ts +22 -0
- package/lib/types/apps/trainingpeaks/types.d.ts +6 -0
- package/lib/types/ride/page/service.d.ts +1 -0
- package/lib/types/ride/page/types.d.ts +2 -1
- package/lib/types/ride/route/GpxDisplayService.d.ts +3 -3
- package/lib/types/settings/display/ride/service.d.ts +5 -2
- package/lib/types/workouts/calendar/sync/trainingpeaks/provider.d.ts +22 -0
- package/package.json +2 -2
- package/lib/esm/package.json +0 -68
- package/lib/esm/settings/display/gear/index.js +0 -0
- package/lib/esm/settings/display/gear/service.js +0 -127
- package/lib/esm/src/activities/active-rides/index.js +0 -2
- package/lib/esm/src/activities/active-rides/mq.js +0 -187
- package/lib/esm/src/activities/active-rides/service.js +0 -870
- package/lib/esm/src/activities/active-rides/sessions.js +0 -0
- package/lib/esm/src/activities/base/api/active-rides/api.js +0 -118
- package/lib/esm/src/activities/base/api/active-rides/index.js +0 -2
- package/lib/esm/src/activities/base/api/active-rides/types.js +0 -1
- package/lib/esm/src/activities/base/api/fitconvert/consts.js +0 -2
- package/lib/esm/src/activities/base/api/fitconvert/fitconvert.js +0 -94
- package/lib/esm/src/activities/base/api/fitconvert/index.js +0 -1
- package/lib/esm/src/activities/base/api/index.js +0 -1
- package/lib/esm/src/activities/base/convert/converter.js +0 -17
- package/lib/esm/src/activities/base/convert/factory.js +0 -72
- package/lib/esm/src/activities/base/convert/fit/index.js +0 -2
- package/lib/esm/src/activities/base/convert/fit/local-fit.js +0 -237
- package/lib/esm/src/activities/base/convert/fit/remote-fit.js +0 -51
- package/lib/esm/src/activities/base/convert/index.js +0 -4
- package/lib/esm/src/activities/base/convert/tcx/index.js +0 -1
- package/lib/esm/src/activities/base/convert/tcx/tcx.js +0 -206
- package/lib/esm/src/activities/base/convert/tcx/types.js +0 -1
- package/lib/esm/src/activities/base/convert/types.js +0 -5
- package/lib/esm/src/activities/base/index.js +0 -5
- package/lib/esm/src/activities/base/model/index.js +0 -6
- package/lib/esm/src/activities/base/repo/db.js +0 -518
- package/lib/esm/src/activities/base/repo/index.js +0 -2
- package/lib/esm/src/activities/base/repo/migration/factory.js +0 -21
- package/lib/esm/src/activities/base/repo/migration/types.js +0 -13
- package/lib/esm/src/activities/base/repo/migration/v0.js +0 -14
- package/lib/esm/src/activities/base/repo/migration/v1.js +0 -15
- package/lib/esm/src/activities/base/repo/migration/v2.js +0 -7
- package/lib/esm/src/activities/base/repo/migration/v3.js +0 -23
- package/lib/esm/src/activities/base/repo/types.js +0 -1
- package/lib/esm/src/activities/base/utils/activity.js +0 -324
- package/lib/esm/src/activities/base/utils/helpers.js +0 -47
- package/lib/esm/src/activities/base/utils/index.js +0 -2
- package/lib/esm/src/activities/index.js +0 -6
- package/lib/esm/src/activities/list/index.js +0 -2
- package/lib/esm/src/activities/list/service.js +0 -458
- package/lib/esm/src/activities/list/types.js +0 -1
- package/lib/esm/src/activities/list/utils.js +0 -81
- package/lib/esm/src/activities/page/index.js +0 -1
- package/lib/esm/src/activities/page/service.js +0 -173
- package/lib/esm/src/activities/page/types.js +0 -1
- package/lib/esm/src/activities/ride/duration.js +0 -136
- package/lib/esm/src/activities/ride/index.js +0 -1
- package/lib/esm/src/activities/ride/service.js +0 -1324
- package/lib/esm/src/activities/ride/stats.js +0 -189
- package/lib/esm/src/activities/ride/types.js +0 -1
- package/lib/esm/src/activities/types.js +0 -2
- package/lib/esm/src/activities/upload/factory.js +0 -90
- package/lib/esm/src/activities/upload/index.js +0 -5
- package/lib/esm/src/activities/upload/strava.js +0 -151
- package/lib/esm/src/activities/upload/types.js +0 -1
- package/lib/esm/src/activities/upload/velohero.js +0 -133
- package/lib/esm/src/api/appInfo/index.js +0 -1
- package/lib/esm/src/api/bindings/index.js +0 -74
- package/lib/esm/src/api/bindings/types.js +0 -1
- package/lib/esm/src/api/crypto/types.js +0 -1
- package/lib/esm/src/api/download/index.js +0 -1
- package/lib/esm/src/api/form/types.js +0 -1
- package/lib/esm/src/api/fs/index.js +0 -1
- package/lib/esm/src/api/index.js +0 -4
- package/lib/esm/src/api/logging/types.js +0 -1
- package/lib/esm/src/api/mq/index.js +0 -1
- package/lib/esm/src/api/path/index.js +0 -18
- package/lib/esm/src/api/repository/index.js +0 -3
- package/lib/esm/src/api/repository/json/index.js +0 -117
- package/lib/esm/src/api/repository/types.js +0 -1
- package/lib/esm/src/api/rest/RestApiClient.js +0 -12
- package/lib/esm/src/api/rest/api.js +0 -67
- package/lib/esm/src/api/rest/incyclist.js +0 -33
- package/lib/esm/src/api/rest/index.js +0 -3
- package/lib/esm/src/api/rest/types.js +0 -1
- package/lib/esm/src/api/secret/index.js +0 -1
- package/lib/esm/src/api/serial/types.js +0 -1
- package/lib/esm/src/api/types.js +0 -1
- package/lib/esm/src/api/ui/index.js +0 -1
- package/lib/esm/src/api/video/index.js +0 -1
- package/lib/esm/src/apps/base/api/base.js +0 -58
- package/lib/esm/src/apps/base/api/index.js +0 -4
- package/lib/esm/src/apps/base/api/intervals/api.js +0 -127
- package/lib/esm/src/apps/base/api/intervals/index.js +0 -2
- package/lib/esm/src/apps/base/api/intervals/types.js +0 -11
- package/lib/esm/src/apps/base/api/komoot/api.js +0 -137
- package/lib/esm/src/apps/base/api/komoot/index.js +0 -2
- package/lib/esm/src/apps/base/api/komoot/types.js +0 -1
- package/lib/esm/src/apps/base/api/strava/api.js +0 -217
- package/lib/esm/src/apps/base/api/strava/index.js +0 -2
- package/lib/esm/src/apps/base/api/strava/types.js +0 -7
- package/lib/esm/src/apps/base/api/velohero/api.js +0 -80
- package/lib/esm/src/apps/base/api/velohero/index.js +0 -2
- package/lib/esm/src/apps/base/api/velohero/types.js +0 -1
- package/lib/esm/src/apps/base/app/index.js +0 -104
- package/lib/esm/src/apps/base/index.js +0 -3
- package/lib/esm/src/apps/base/types.js +0 -1
- package/lib/esm/src/apps/googleMaps/index.js +0 -1
- package/lib/esm/src/apps/googleMaps/service.js +0 -121
- package/lib/esm/src/apps/index.js +0 -5
- package/lib/esm/src/apps/intervals/IntervalsAppConnection.js +0 -183
- package/lib/esm/src/apps/intervals/index.js +0 -0
- package/lib/esm/src/apps/intervals/types.js +0 -1
- package/lib/esm/src/apps/komoot/KomootAppConnection.js +0 -245
- package/lib/esm/src/apps/komoot/index.js +0 -2
- package/lib/esm/src/apps/komoot/types.js +0 -1
- package/lib/esm/src/apps/service.js +0 -189
- package/lib/esm/src/apps/strava/index.js +0 -2
- package/lib/esm/src/apps/strava/types.js +0 -1
- package/lib/esm/src/apps/types.js +0 -1
- package/lib/esm/src/apps/velohero/VeloHeroAppConnection.js +0 -229
- package/lib/esm/src/apps/velohero/index.js +0 -2
- package/lib/esm/src/apps/velohero/types.js +0 -1
- package/lib/esm/src/appstate/index.js +0 -2
- package/lib/esm/src/appstate/service.js +0 -107
- package/lib/esm/src/appstate/types.js +0 -1
- package/lib/esm/src/autoupdate/api.js +0 -176
- package/lib/esm/src/autoupdate/autoupdate.js +0 -21
- package/lib/esm/src/autoupdate/index.js +0 -2
- package/lib/esm/src/avatars/index.js +0 -2
- package/lib/esm/src/avatars/service.js +0 -134
- package/lib/esm/src/avatars/types.js +0 -1
- package/lib/esm/src/base/cardlist/index.js +0 -39
- package/lib/esm/src/base/cardlist/types.js +0 -1
- package/lib/esm/src/base/decorators/Injection.js +0 -23
- package/lib/esm/src/base/decorators/index.js +0 -2
- package/lib/esm/src/base/pages/index.js +0 -1
- package/lib/esm/src/base/pages/service.js +0 -124
- package/lib/esm/src/base/pages/types.js +0 -1
- package/lib/esm/src/base/service.js +0 -32
- package/lib/esm/src/base/typedefs.js +0 -1
- package/lib/esm/src/base/types/index.js +0 -3
- package/lib/esm/src/base/types/lists.js +0 -18
- package/lib/esm/src/base/types/observer.js +0 -75
- package/lib/esm/src/base/types/singleton.js +0 -20
- package/lib/esm/src/coaches/coach.js +0 -161
- package/lib/esm/src/coaches/index.js +0 -3
- package/lib/esm/src/coaches/service.js +0 -294
- package/lib/esm/src/coaches/types.js +0 -1
- package/lib/esm/src/devices/access/index.js +0 -2
- package/lib/esm/src/devices/access/model.js +0 -1
- package/lib/esm/src/devices/access/service.js +0 -512
- package/lib/esm/src/devices/configuration/index.js +0 -2
- package/lib/esm/src/devices/configuration/model/app/index.js +0 -1
- package/lib/esm/src/devices/configuration/model/index.js +0 -3
- package/lib/esm/src/devices/configuration/model/repository/index.js +0 -1
- package/lib/esm/src/devices/configuration/model/repository/legacy.js +0 -1
- package/lib/esm/src/devices/configuration/model/service/index.js +0 -1
- package/lib/esm/src/devices/configuration/service.js +0 -997
- package/lib/esm/src/devices/configuration/types.js +0 -1
- package/lib/esm/src/devices/index.js +0 -5
- package/lib/esm/src/devices/page/index.js +0 -1
- package/lib/esm/src/devices/page/logobserver.js +0 -15
- package/lib/esm/src/devices/page/service.js +0 -422
- package/lib/esm/src/devices/page/statemachine.js +0 -335
- package/lib/esm/src/devices/page/types.js +0 -1
- package/lib/esm/src/devices/pairing/index.js +0 -2
- package/lib/esm/src/devices/pairing/model.js +0 -1
- package/lib/esm/src/devices/pairing/service.js +0 -1502
- package/lib/esm/src/devices/ride/index.js +0 -1
- package/lib/esm/src/devices/ride/service.js +0 -1395
- package/lib/esm/src/devices/ride/types.js +0 -1
- package/lib/esm/src/devices/types.js +0 -1
- package/lib/esm/src/i18n/countries/countries.json +0 -255
- package/lib/esm/src/i18n/countries/index.js +0 -1
- package/lib/esm/src/i18n/countries/model.js +0 -1
- package/lib/esm/src/i18n/countries/service.js +0 -118
- package/lib/esm/src/i18n/index.js +0 -3
- package/lib/esm/src/i18n/localization/index.js +0 -2
- package/lib/esm/src/i18n/localization/service.js +0 -125
- package/lib/esm/src/i18n/localization/types.js +0 -1
- package/lib/esm/src/i18n/units/converter.js +0 -172
- package/lib/esm/src/i18n/units/index.js +0 -2
- package/lib/esm/src/i18n/units/types.js +0 -1
- package/lib/esm/src/index.js +0 -22
- package/lib/esm/src/maps/MapArea/MapArea.js +0 -396
- package/lib/esm/src/maps/MapArea/consts.js +0 -8
- package/lib/esm/src/maps/MapArea/index.js +0 -3
- package/lib/esm/src/maps/MapArea/options.js +0 -410
- package/lib/esm/src/maps/MapArea/service.js +0 -292
- package/lib/esm/src/maps/MapArea/types.js +0 -1
- package/lib/esm/src/maps/MapArea/utils.js +0 -565
- package/lib/esm/src/maps/index.js +0 -1
- package/lib/esm/src/monitoring/index.js +0 -1
- package/lib/esm/src/monitoring/online/index.js +0 -1
- package/lib/esm/src/monitoring/online/service.js +0 -113
- package/lib/esm/src/ride/base/base.js +0 -228
- package/lib/esm/src/ride/base/index.js +0 -1
- package/lib/esm/src/ride/base/types.js +0 -1
- package/lib/esm/src/ride/display/index.js +0 -1
- package/lib/esm/src/ride/display/service.js +0 -1135
- package/lib/esm/src/ride/index.js +0 -3
- package/lib/esm/src/ride/page/index.js +0 -1
- package/lib/esm/src/ride/page/service.js +0 -376
- package/lib/esm/src/ride/page/types.js +0 -1
- package/lib/esm/src/ride/route/FollowRouteDisplayService.js +0 -32
- package/lib/esm/src/ride/route/FreeRideDisplayService.js +0 -596
- package/lib/esm/src/ride/route/GpxDisplayService.js +0 -319
- package/lib/esm/src/ride/route/RLVDisplayService.js +0 -588
- package/lib/esm/src/ride/route/RouteDisplayService.js +0 -413
- package/lib/esm/src/ride/route/types.js +0 -1
- package/lib/esm/src/ride/types.js +0 -1
- package/lib/esm/src/ride/workout/WorkoutDisplayService.js +0 -94
- package/lib/esm/src/routes/base/api/consts.js +0 -9
- package/lib/esm/src/routes/base/api/index.js +0 -156
- package/lib/esm/src/routes/base/api/types.js +0 -1
- package/lib/esm/src/routes/base/model/route.js +0 -114
- package/lib/esm/src/routes/base/model/tacx.js +0 -28
- package/lib/esm/src/routes/base/model/types.js +0 -1
- package/lib/esm/src/routes/base/parsers/bikelab.js +0 -103
- package/lib/esm/src/routes/base/parsers/epm.js +0 -243
- package/lib/esm/src/routes/base/parsers/factory.js +0 -50
- package/lib/esm/src/routes/base/parsers/geometry.js +0 -130
- package/lib/esm/src/routes/base/parsers/gpx.js +0 -216
- package/lib/esm/src/routes/base/parsers/incyclist.js +0 -190
- package/lib/esm/src/routes/base/parsers/index.js +0 -50
- package/lib/esm/src/routes/base/parsers/kwt.js +0 -4
- package/lib/esm/src/routes/base/parsers/multixml.js +0 -42
- package/lib/esm/src/routes/base/parsers/tacx/TacxParser.js +0 -326
- package/lib/esm/src/routes/base/parsers/tacx/TacxReader.js +0 -79
- package/lib/esm/src/routes/base/parsers/tacx/pgmf.js +0 -65
- package/lib/esm/src/routes/base/parsers/tacx/rlv.js +0 -80
- package/lib/esm/src/routes/base/parsers/types.js +0 -1
- package/lib/esm/src/routes/base/parsers/utils.js +0 -235
- package/lib/esm/src/routes/base/parsers/xml.js +0 -354
- package/lib/esm/src/routes/base/types/index.js +0 -2
- package/lib/esm/src/routes/base/utils/index.js +0 -1
- package/lib/esm/src/routes/base/utils/localization.js +0 -35
- package/lib/esm/src/routes/base/utils/points.js +0 -296
- package/lib/esm/src/routes/base/utils/route.js +0 -558
- package/lib/esm/src/routes/download/service.js +0 -256
- package/lib/esm/src/routes/download/types.js +0 -15
- package/lib/esm/src/routes/free-ride/index.js +0 -1
- package/lib/esm/src/routes/free-ride/service.js +0 -545
- package/lib/esm/src/routes/index.js +0 -5
- package/lib/esm/src/routes/library/service.js +0 -635
- package/lib/esm/src/routes/library/types.js +0 -1
- package/lib/esm/src/routes/list/RouteListObserver.js +0 -18
- package/lib/esm/src/routes/list/cards/ActiveImportCard.js +0 -84
- package/lib/esm/src/routes/list/cards/FreeRideCard.js +0 -114
- package/lib/esm/src/routes/list/cards/RouteCard.js +0 -914
- package/lib/esm/src/routes/list/cards/RouteImportCard.js +0 -36
- package/lib/esm/src/routes/list/cards/base.js +0 -68
- package/lib/esm/src/routes/list/cards/types.js +0 -1
- package/lib/esm/src/routes/list/index.js +0 -1
- package/lib/esm/src/routes/list/lists/alternatives.js +0 -38
- package/lib/esm/src/routes/list/lists/myroutes.js +0 -55
- package/lib/esm/src/routes/list/lists/selected.js +0 -35
- package/lib/esm/src/routes/list/loaders/DBLoader.js +0 -47
- package/lib/esm/src/routes/list/loaders/LegacyDB.js +0 -138
- package/lib/esm/src/routes/list/loaders/StravaActivityLoader.js +0 -284
- package/lib/esm/src/routes/list/loaders/api.js +0 -217
- package/lib/esm/src/routes/list/loaders/db.js +0 -336
- package/lib/esm/src/routes/list/loaders/types.js +0 -114
- package/lib/esm/src/routes/list/service.js +0 -1359
- package/lib/esm/src/routes/list/types.js +0 -1
- package/lib/esm/src/routes/list/utils.js +0 -36
- package/lib/esm/src/routes/page/index.js +0 -1
- package/lib/esm/src/routes/page/service.js +0 -457
- package/lib/esm/src/routes/page/types.js +0 -1
- package/lib/esm/src/routes/sync/factory.js +0 -119
- package/lib/esm/src/routes/sync/index.js +0 -2
- package/lib/esm/src/routes/sync/komoot/provider.js +0 -362
- package/lib/esm/src/routes/sync/types.js +0 -1
- package/lib/esm/src/routes/types.js +0 -1
- package/lib/esm/src/services/index.js +0 -1
- package/lib/esm/src/services/overpass/index.js +0 -1
- package/lib/esm/src/services/overpass/overpass.js +0 -212
- package/lib/esm/src/settings/bindings/index.js +0 -1
- package/lib/esm/src/settings/bindings/json.js +0 -98
- package/lib/esm/src/settings/bindings/types.js +0 -5
- package/lib/esm/src/settings/display/index.js +0 -2
- package/lib/esm/src/settings/display/support/index.js +0 -1
- package/lib/esm/src/settings/display/support/service.js +0 -111
- package/lib/esm/src/settings/display/support/types.js +0 -1
- package/lib/esm/src/settings/display/user/index.js +0 -2
- package/lib/esm/src/settings/display/user/service.js +0 -157
- package/lib/esm/src/settings/display/user/types.js +0 -1
- package/lib/esm/src/settings/index.js +0 -2
- package/lib/esm/src/settings/service/index.js +0 -1
- package/lib/esm/src/settings/service/mock.js +0 -31
- package/lib/esm/src/settings/service/service.js +0 -228
- package/lib/esm/src/settings/types.js +0 -1
- package/lib/esm/src/types.js +0 -1
- package/lib/esm/src/ui/index.js +0 -1
- package/lib/esm/src/ui/service.js +0 -504
- package/lib/esm/src/ui/types.js +0 -1
- package/lib/esm/src/utils/calc.js +0 -34
- package/lib/esm/src/utils/clone.js +0 -5
- package/lib/esm/src/utils/fileinfo.js +0 -9
- package/lib/esm/src/utils/formatting.js +0 -73
- package/lib/esm/src/utils/geo.js +0 -131
- package/lib/esm/src/utils/index.js +0 -10
- package/lib/esm/src/utils/logging.js +0 -18
- package/lib/esm/src/utils/math.js +0 -26
- package/lib/esm/src/utils/merge.js +0 -26
- package/lib/esm/src/utils/nextTick.js +0 -1
- package/lib/esm/src/utils/sleep.js +0 -1
- package/lib/esm/src/utils/string.js +0 -4
- package/lib/esm/src/utils/time.js +0 -20
- package/lib/esm/src/utils/valid.js +0 -11
- package/lib/esm/src/utils/vector.js +0 -200
- package/lib/esm/src/utils/xml.js +0 -105
- package/lib/esm/src/video/VideoConversion.js +0 -167
- package/lib/esm/src/video/VideoSyncHelper.js +0 -661
- package/lib/esm/src/video/index.js +0 -3
- package/lib/esm/src/video/types.js +0 -1
- package/lib/esm/src/workouts/base/api/consts.js +0 -9
- package/lib/esm/src/workouts/base/api/index.js +0 -127
- package/lib/esm/src/workouts/base/model/Segment.js +0 -137
- package/lib/esm/src/workouts/base/model/Step.js +0 -158
- package/lib/esm/src/workouts/base/model/Workout.js +0 -109
- package/lib/esm/src/workouts/base/model/index.js +0 -4
- package/lib/esm/src/workouts/base/model/types.js +0 -1
- package/lib/esm/src/workouts/base/parsers/factory.js +0 -87
- package/lib/esm/src/workouts/base/parsers/incyclist/Json.js +0 -58
- package/lib/esm/src/workouts/base/parsers/index.js +0 -35
- package/lib/esm/src/workouts/base/parsers/intervals/parser.js +0 -294
- package/lib/esm/src/workouts/base/parsers/intervals/types.js +0 -6
- package/lib/esm/src/workouts/base/parsers/types.js +0 -1
- package/lib/esm/src/workouts/base/parsers/zwo/zwo.js +0 -247
- package/lib/esm/src/workouts/calendar/index.js +0 -3
- package/lib/esm/src/workouts/calendar/service.js +0 -355
- package/lib/esm/src/workouts/calendar/sync/factory.js +0 -124
- package/lib/esm/src/workouts/calendar/sync/index.js +0 -2
- package/lib/esm/src/workouts/calendar/sync/types.js +0 -1
- package/lib/esm/src/workouts/calendar/types.js +0 -1
- package/lib/esm/src/workouts/index.js +0 -3
- package/lib/esm/src/workouts/list/cards/ActiveImportCard.js +0 -68
- package/lib/esm/src/workouts/list/cards/ScheduledWorkoutCard.js +0 -38
- package/lib/esm/src/workouts/list/cards/WorkoutCard.js +0 -284
- package/lib/esm/src/workouts/list/cards/WorkoutCreateCard.js +0 -96
- package/lib/esm/src/workouts/list/cards/WorkoutImportCard.js +0 -37
- package/lib/esm/src/workouts/list/cards/base.js +0 -54
- package/lib/esm/src/workouts/list/cards/index.js +0 -4
- package/lib/esm/src/workouts/list/cards/types.js +0 -6
- package/lib/esm/src/workouts/list/index.js +0 -2
- package/lib/esm/src/workouts/list/loaders/api.js +0 -46
- package/lib/esm/src/workouts/list/loaders/db.js +0 -185
- package/lib/esm/src/workouts/list/loaders/loader.js +0 -17
- package/lib/esm/src/workouts/list/service.js +0 -658
- package/lib/esm/src/workouts/list/types.js +0 -1
- package/lib/esm/src/workouts/ride/index.js +0 -2
- package/lib/esm/src/workouts/ride/service.js +0 -608
- package/lib/esm/src/workouts/ride/types.js +0 -1
- package/lib/types/settings/display/gear/index.d.ts +0 -0
- package/lib/types/settings/display/gear/service.d.ts +0 -21
- package/lib/types/settings/display/gear/types.d.ts +0 -5
- package/lib/types/src/activities/active-rides/index.d.ts +0 -2
- package/lib/types/src/activities/active-rides/mq.d.ts +0 -28
- package/lib/types/src/activities/active-rides/service.d.ts +0 -116
- package/lib/types/src/activities/active-rides/sessions.d.ts +0 -0
- package/lib/types/src/activities/active-rides/types.d.ts +0 -103
- package/lib/types/src/activities/base/api/active-rides/api.d.ts +0 -13
- package/lib/types/src/activities/base/api/active-rides/index.d.ts +0 -2
- package/lib/types/src/activities/base/api/active-rides/types.d.ts +0 -5
- package/lib/types/src/activities/base/api/fitconvert/consts.d.ts +0 -2
- package/lib/types/src/activities/base/api/fitconvert/fitconvert.d.ts +0 -9
- package/lib/types/src/activities/base/api/fitconvert/index.d.ts +0 -1
- package/lib/types/src/activities/base/api/index.d.ts +0 -1
- package/lib/types/src/activities/base/convert/converter.d.ts +0 -7
- package/lib/types/src/activities/base/convert/factory.d.ts +0 -8
- package/lib/types/src/activities/base/convert/fit/index.d.ts +0 -2
- package/lib/types/src/activities/base/convert/fit/local-fit.d.ts +0 -16
- package/lib/types/src/activities/base/convert/fit/remote-fit.d.ts +0 -13
- package/lib/types/src/activities/base/convert/index.d.ts +0 -4
- package/lib/types/src/activities/base/convert/tcx/index.d.ts +0 -1
- package/lib/types/src/activities/base/convert/tcx/tcx.d.ts +0 -25
- package/lib/types/src/activities/base/convert/tcx/types.d.ts +0 -5
- package/lib/types/src/activities/base/convert/types.d.ts +0 -7
- package/lib/types/src/activities/base/index.d.ts +0 -5
- package/lib/types/src/activities/base/model/index.d.ts +0 -210
- package/lib/types/src/activities/base/repo/db.d.ts +0 -60
- package/lib/types/src/activities/base/repo/index.d.ts +0 -2
- package/lib/types/src/activities/base/repo/migration/factory.d.ts +0 -7
- package/lib/types/src/activities/base/repo/migration/types.d.ts +0 -15
- package/lib/types/src/activities/base/repo/migration/v0.d.ts +0 -5
- package/lib/types/src/activities/base/repo/migration/v1.d.ts +0 -5
- package/lib/types/src/activities/base/repo/migration/v2.d.ts +0 -5
- package/lib/types/src/activities/base/repo/migration/v3.d.ts +0 -5
- package/lib/types/src/activities/base/repo/types.d.ts +0 -14
- package/lib/types/src/activities/base/utils/activity.d.ts +0 -50
- package/lib/types/src/activities/base/utils/helpers.d.ts +0 -4
- package/lib/types/src/activities/base/utils/index.d.ts +0 -2
- package/lib/types/src/activities/index.d.ts +0 -6
- package/lib/types/src/activities/list/index.d.ts +0 -2
- package/lib/types/src/activities/list/service.d.ts +0 -59
- package/lib/types/src/activities/list/types.d.ts +0 -94
- package/lib/types/src/activities/list/utils.d.ts +0 -5
- package/lib/types/src/activities/page/index.d.ts +0 -1
- package/lib/types/src/activities/page/service.d.ts +0 -24
- package/lib/types/src/activities/page/types.d.ts +0 -10
- package/lib/types/src/activities/ride/duration.d.ts +0 -32
- package/lib/types/src/activities/ride/index.d.ts +0 -1
- package/lib/types/src/activities/ride/service.d.ts +0 -216
- package/lib/types/src/activities/ride/stats.d.ts +0 -37
- package/lib/types/src/activities/ride/types.d.ts +0 -47
- package/lib/types/src/activities/types.d.ts +0 -2
- package/lib/types/src/activities/upload/factory.d.ts +0 -12
- package/lib/types/src/activities/upload/index.d.ts +0 -5
- package/lib/types/src/activities/upload/intervals.d.ts +0 -18
- package/lib/types/src/activities/upload/strava.d.ts +0 -18
- package/lib/types/src/activities/upload/types.d.ts +0 -25
- package/lib/types/src/activities/upload/velohero.d.ts +0 -18
- package/lib/types/src/api/appInfo/index.d.ts +0 -17
- package/lib/types/src/api/bindings/index.d.ts +0 -40
- package/lib/types/src/api/bindings/types.d.ts +0 -14
- package/lib/types/src/api/crypto/types.d.ts +0 -46
- package/lib/types/src/api/download/index.d.ts +0 -12
- package/lib/types/src/api/form/types.d.ts +0 -6
- package/lib/types/src/api/fs/index.d.ts +0 -26
- package/lib/types/src/api/index.d.ts +0 -5
- package/lib/types/src/api/logging/types.d.ts +0 -8
- package/lib/types/src/api/mq/index.d.ts +0 -9
- package/lib/types/src/api/path/index.d.ts +0 -11
- package/lib/types/src/api/repository/index.d.ts +0 -8
- package/lib/types/src/api/repository/json/index.d.ts +0 -23
- package/lib/types/src/api/repository/types.d.ts +0 -35
- package/lib/types/src/api/rest/RestApiClient.d.ts +0 -7
- package/lib/types/src/api/rest/api.d.ts +0 -15
- package/lib/types/src/api/rest/incyclist.d.ts +0 -7
- package/lib/types/src/api/rest/index.d.ts +0 -3
- package/lib/types/src/api/rest/types.d.ts +0 -10
- package/lib/types/src/api/secret/index.d.ts +0 -6
- package/lib/types/src/api/serial/types.d.ts +0 -3
- package/lib/types/src/api/types.d.ts +0 -7
- package/lib/types/src/api/ui/index.d.ts +0 -22
- package/lib/types/src/api/video/index.d.ts +0 -21
- package/lib/types/src/apps/base/api/base.d.ts +0 -13
- package/lib/types/src/apps/base/api/index.d.ts +0 -4
- package/lib/types/src/apps/base/api/intervals/api.d.ts +0 -23
- package/lib/types/src/apps/base/api/intervals/index.d.ts +0 -2
- package/lib/types/src/apps/base/api/intervals/types.d.ts +0 -121
- package/lib/types/src/apps/base/api/komoot/api.d.ts +0 -21
- package/lib/types/src/apps/base/api/komoot/index.d.ts +0 -2
- package/lib/types/src/apps/base/api/komoot/types.d.ts +0 -94
- package/lib/types/src/apps/base/api/strava/api.d.ts +0 -40
- package/lib/types/src/apps/base/api/strava/index.d.ts +0 -2
- package/lib/types/src/apps/base/api/strava/types.d.ts +0 -143
- package/lib/types/src/apps/base/api/velohero/api.d.ts +0 -12
- package/lib/types/src/apps/base/api/velohero/index.d.ts +0 -2
- package/lib/types/src/apps/base/api/velohero/types.d.ts +0 -14
- package/lib/types/src/apps/base/app/index.d.ts +0 -20
- package/lib/types/src/apps/base/index.d.ts +0 -3
- package/lib/types/src/apps/base/types.d.ts +0 -2
- package/lib/types/src/apps/googleMaps/index.d.ts +0 -1
- package/lib/types/src/apps/googleMaps/service.d.ts +0 -18
- package/lib/types/src/apps/index.d.ts +0 -5
- package/lib/types/src/apps/intervals/IntervalsAppConnection.d.ts +0 -23
- package/lib/types/src/apps/intervals/index.d.ts +0 -0
- package/lib/types/src/apps/intervals/types.d.ts +0 -6
- package/lib/types/src/apps/komoot/KomootAppConnection.d.ts +0 -25
- package/lib/types/src/apps/komoot/index.d.ts +0 -2
- package/lib/types/src/apps/komoot/types.d.ts +0 -10
- package/lib/types/src/apps/service.d.ts +0 -38
- package/lib/types/src/apps/strava/StravaAppConnection.d.ts +0 -28
- package/lib/types/src/apps/strava/index.d.ts +0 -2
- package/lib/types/src/apps/strava/types.d.ts +0 -6
- package/lib/types/src/apps/types.d.ts +0 -16
- package/lib/types/src/apps/velohero/VeloHeroAppConnection.d.ts +0 -24
- package/lib/types/src/apps/velohero/index.d.ts +0 -2
- package/lib/types/src/apps/velohero/types.d.ts +0 -9
- package/lib/types/src/appstate/index.d.ts +0 -2
- package/lib/types/src/appstate/service.d.ts +0 -17
- package/lib/types/src/appstate/types.d.ts +0 -12
- package/lib/types/src/autoupdate/api.d.ts +0 -22
- package/lib/types/src/autoupdate/autoupdate.d.ts +0 -6
- package/lib/types/src/autoupdate/index.d.ts +0 -2
- package/lib/types/src/avatars/index.d.ts +0 -2
- package/lib/types/src/avatars/service.d.ts +0 -17
- package/lib/types/src/avatars/types.d.ts +0 -10
- package/lib/types/src/base/cardlist/index.d.ts +0 -33
- package/lib/types/src/base/cardlist/types.d.ts +0 -4
- package/lib/types/src/base/decorators/Injection.d.ts +0 -2
- package/lib/types/src/base/decorators/index.d.ts +0 -2
- package/lib/types/src/base/pages/index.d.ts +0 -2
- package/lib/types/src/base/pages/service.d.ts +0 -23
- package/lib/types/src/base/pages/types.d.ts +0 -8
- package/lib/types/src/base/service.d.ts +0 -13
- package/lib/types/src/base/typedefs.d.ts +0 -7
- package/lib/types/src/base/types/index.d.ts +0 -3
- package/lib/types/src/base/types/lists.d.ts +0 -14
- package/lib/types/src/base/types/observer.d.ts +0 -20
- package/lib/types/src/base/types/singleton.d.ts +0 -1
- package/lib/types/src/coaches/coach.d.ts +0 -37
- package/lib/types/src/coaches/index.d.ts +0 -3
- package/lib/types/src/coaches/service.d.ts +0 -39
- package/lib/types/src/coaches/types.d.ts +0 -25
- package/lib/types/src/devices/access/index.d.ts +0 -2
- package/lib/types/src/devices/access/model.d.ts +0 -37
- package/lib/types/src/devices/access/service.d.ts +0 -42
- package/lib/types/src/devices/configuration/index.d.ts +0 -2
- package/lib/types/src/devices/configuration/model/app/index.d.ts +0 -17
- package/lib/types/src/devices/configuration/model/index.d.ts +0 -3
- package/lib/types/src/devices/configuration/model/repository/index.d.ts +0 -36
- package/lib/types/src/devices/configuration/model/repository/legacy.d.ts +0 -57
- package/lib/types/src/devices/configuration/model/service/index.d.ts +0 -18
- package/lib/types/src/devices/configuration/service.d.ts +0 -102
- package/lib/types/src/devices/configuration/types.d.ts +0 -2
- package/lib/types/src/devices/index.d.ts +0 -5
- package/lib/types/src/devices/page/index.d.ts +0 -1
- package/lib/types/src/devices/page/logobserver.d.ts +0 -8
- package/lib/types/src/devices/page/service.d.ts +0 -55
- package/lib/types/src/devices/page/statemachine.d.ts +0 -47
- package/lib/types/src/devices/page/types.d.ts +0 -74
- package/lib/types/src/devices/pairing/index.d.ts +0 -2
- package/lib/types/src/devices/pairing/model.d.ts +0 -84
- package/lib/types/src/devices/pairing/service.d.ts +0 -150
- package/lib/types/src/devices/ride/index.d.ts +0 -2
- package/lib/types/src/devices/ride/service.d.ts +0 -140
- package/lib/types/src/devices/ride/types.d.ts +0 -54
- package/lib/types/src/devices/types.d.ts +0 -5
- package/lib/types/src/i18n/countries/index.d.ts +0 -1
- package/lib/types/src/i18n/countries/model.d.ts +0 -21
- package/lib/types/src/i18n/countries/service.d.ts +0 -18
- package/lib/types/src/i18n/index.d.ts +0 -3
- package/lib/types/src/i18n/localization/index.d.ts +0 -2
- package/lib/types/src/i18n/localization/service.d.ts +0 -17
- package/lib/types/src/i18n/localization/types.d.ts +0 -3
- package/lib/types/src/i18n/units/converter.d.ts +0 -17
- package/lib/types/src/i18n/units/index.d.ts +0 -2
- package/lib/types/src/i18n/units/types.d.ts +0 -17
- package/lib/types/src/index.d.ts +0 -23
- package/lib/types/src/maps/MapArea/MapArea.d.ts +0 -34
- package/lib/types/src/maps/MapArea/consts.d.ts +0 -11
- package/lib/types/src/maps/MapArea/index.d.ts +0 -3
- package/lib/types/src/maps/MapArea/options.d.ts +0 -24
- package/lib/types/src/maps/MapArea/service.d.ts +0 -55
- package/lib/types/src/maps/MapArea/types.d.ts +0 -136
- package/lib/types/src/maps/MapArea/utils.d.ts +0 -44
- package/lib/types/src/maps/index.d.ts +0 -1
- package/lib/types/src/monitoring/index.d.ts +0 -1
- package/lib/types/src/monitoring/online/index.d.ts +0 -1
- package/lib/types/src/monitoring/online/service.d.ts +0 -19
- package/lib/types/src/ride/base/base.d.ts +0 -49
- package/lib/types/src/ride/base/index.d.ts +0 -1
- package/lib/types/src/ride/base/types.d.ts +0 -183
- package/lib/types/src/ride/display/index.d.ts +0 -1
- package/lib/types/src/ride/display/service.d.ts +0 -138
- package/lib/types/src/ride/index.d.ts +0 -3
- package/lib/types/src/ride/page/index.d.ts +0 -1
- package/lib/types/src/ride/page/service.d.ts +0 -49
- package/lib/types/src/ride/page/types.d.ts +0 -45
- package/lib/types/src/ride/route/FollowRouteDisplayService.d.ts +0 -5
- package/lib/types/src/ride/route/FreeRideDisplayService.d.ts +0 -87
- package/lib/types/src/ride/route/GpxDisplayService.d.ts +0 -67
- package/lib/types/src/ride/route/RLVDisplayService.d.ts +0 -101
- package/lib/types/src/ride/route/RouteDisplayService.d.ts +0 -73
- package/lib/types/src/ride/route/types.d.ts +0 -25
- package/lib/types/src/ride/types.d.ts +0 -3
- package/lib/types/src/ride/workout/WorkoutDisplayService.d.ts +0 -15
- package/lib/types/src/routes/base/api/consts.d.ts +0 -9
- package/lib/types/src/routes/base/api/index.d.ts +0 -24
- package/lib/types/src/routes/base/api/types.d.ts +0 -77
- package/lib/types/src/routes/base/model/route.d.ts +0 -20
- package/lib/types/src/routes/base/model/tacx.d.ts +0 -92
- package/lib/types/src/routes/base/model/types.d.ts +0 -13
- package/lib/types/src/routes/base/parsers/bikelab.d.ts +0 -12
- package/lib/types/src/routes/base/parsers/epm.d.ts +0 -30
- package/lib/types/src/routes/base/parsers/factory.d.ts +0 -15
- package/lib/types/src/routes/base/parsers/geometry.d.ts +0 -31
- package/lib/types/src/routes/base/parsers/gpx.d.ts +0 -28
- package/lib/types/src/routes/base/parsers/incyclist.d.ts +0 -16
- package/lib/types/src/routes/base/parsers/index.d.ts +0 -9
- package/lib/types/src/routes/base/parsers/kwt.d.ts +0 -4
- package/lib/types/src/routes/base/parsers/multixml.d.ts +0 -15
- package/lib/types/src/routes/base/parsers/tacx/TacxParser.d.ts +0 -35
- package/lib/types/src/routes/base/parsers/tacx/TacxReader.d.ts +0 -12
- package/lib/types/src/routes/base/parsers/tacx/pgmf.d.ts +0 -8
- package/lib/types/src/routes/base/parsers/tacx/rlv.d.ts +0 -10
- package/lib/types/src/routes/base/parsers/types.d.ts +0 -29
- package/lib/types/src/routes/base/parsers/utils.d.ts +0 -28
- package/lib/types/src/routes/base/parsers/xml.d.ts +0 -36
- package/lib/types/src/routes/base/types/index.d.ts +0 -125
- package/lib/types/src/routes/base/utils/index.d.ts +0 -1
- package/lib/types/src/routes/base/utils/localization.d.ts +0 -4
- package/lib/types/src/routes/base/utils/points.d.ts +0 -24
- package/lib/types/src/routes/base/utils/route.d.ts +0 -44
- package/lib/types/src/routes/download/service.d.ts +0 -36
- package/lib/types/src/routes/download/types.d.ts +0 -8
- package/lib/types/src/routes/free-ride/index.d.ts +0 -1
- package/lib/types/src/routes/free-ride/service.d.ts +0 -58
- package/lib/types/src/routes/index.d.ts +0 -5
- package/lib/types/src/routes/library/service.d.ts +0 -44
- package/lib/types/src/routes/library/types.d.ts +0 -73
- package/lib/types/src/routes/list/RouteListObserver.d.ts +0 -13
- package/lib/types/src/routes/list/cards/ActiveImportCard.d.ts +0 -32
- package/lib/types/src/routes/list/cards/FreeRideCard.d.ts +0 -40
- package/lib/types/src/routes/list/cards/RouteCard.d.ts +0 -119
- package/lib/types/src/routes/list/cards/RouteImportCard.d.ts +0 -19
- package/lib/types/src/routes/list/cards/base.d.ts +0 -24
- package/lib/types/src/routes/list/cards/types.d.ts +0 -103
- package/lib/types/src/routes/list/index.d.ts +0 -1
- package/lib/types/src/routes/list/lists/alternatives.d.ts +0 -5
- package/lib/types/src/routes/list/lists/myroutes.d.ts +0 -10
- package/lib/types/src/routes/list/lists/selected.d.ts +0 -5
- package/lib/types/src/routes/list/loaders/DBLoader.d.ts +0 -22
- package/lib/types/src/routes/list/loaders/LegacyDB.d.ts +0 -17
- package/lib/types/src/routes/list/loaders/StravaActivityLoader.d.ts +0 -44
- package/lib/types/src/routes/list/loaders/api.d.ts +0 -28
- package/lib/types/src/routes/list/loaders/db.d.ts +0 -41
- package/lib/types/src/routes/list/loaders/types.d.ts +0 -43
- package/lib/types/src/routes/list/service.d.ts +0 -173
- package/lib/types/src/routes/list/types.d.ts +0 -93
- package/lib/types/src/routes/list/utils.d.ts +0 -5
- package/lib/types/src/routes/page/index.d.ts +0 -1
- package/lib/types/src/routes/page/service.d.ts +0 -66
- package/lib/types/src/routes/page/types.d.ts +0 -41
- package/lib/types/src/routes/sync/factory.d.ts +0 -14
- package/lib/types/src/routes/sync/index.d.ts +0 -2
- package/lib/types/src/routes/sync/komoot/provider.d.ts +0 -51
- package/lib/types/src/routes/sync/types.d.ts +0 -11
- package/lib/types/src/routes/types.d.ts +0 -9
- package/lib/types/src/services/index.d.ts +0 -1
- package/lib/types/src/services/overpass/index.d.ts +0 -1
- package/lib/types/src/services/overpass/overpass.d.ts +0 -30
- package/lib/types/src/settings/bindings/index.d.ts +0 -1
- package/lib/types/src/settings/bindings/json.d.ts +0 -15
- package/lib/types/src/settings/bindings/types.d.ts +0 -8
- package/lib/types/src/settings/display/index.d.ts +0 -2
- package/lib/types/src/settings/display/support/index.d.ts +0 -1
- package/lib/types/src/settings/display/support/service.d.ts +0 -17
- package/lib/types/src/settings/display/support/types.d.ts +0 -14
- package/lib/types/src/settings/display/user/index.d.ts +0 -2
- package/lib/types/src/settings/display/user/service.d.ts +0 -23
- package/lib/types/src/settings/display/user/types.d.ts +0 -22
- package/lib/types/src/settings/index.d.ts +0 -2
- package/lib/types/src/settings/service/index.d.ts +0 -1
- package/lib/types/src/settings/service/mock.d.ts +0 -13
- package/lib/types/src/settings/service/service.d.ts +0 -48
- package/lib/types/src/settings/types.d.ts +0 -2
- package/lib/types/src/types.d.ts +0 -8
- package/lib/types/src/ui/index.d.ts +0 -1
- package/lib/types/src/ui/service.d.ts +0 -60
- package/lib/types/src/ui/types.d.ts +0 -1
- package/lib/types/src/utils/calc.d.ts +0 -8
- package/lib/types/src/utils/clone.d.ts +0 -1
- package/lib/types/src/utils/fileinfo.d.ts +0 -2
- package/lib/types/src/utils/formatting.d.ts +0 -5
- package/lib/types/src/utils/geo.d.ts +0 -15
- package/lib/types/src/utils/index.d.ts +0 -10
- package/lib/types/src/utils/logging.d.ts +0 -2
- package/lib/types/src/utils/math.d.ts +0 -7
- package/lib/types/src/utils/merge.d.ts +0 -1
- package/lib/types/src/utils/nextTick.d.ts +0 -1
- package/lib/types/src/utils/sleep.d.ts +0 -1
- package/lib/types/src/utils/string.d.ts +0 -1
- package/lib/types/src/utils/time.d.ts +0 -4
- package/lib/types/src/utils/valid.d.ts +0 -1
- package/lib/types/src/utils/vector.d.ts +0 -25
- package/lib/types/src/utils/xml.d.ts +0 -18
- package/lib/types/src/video/VideoConversion.d.ts +0 -23
- package/lib/types/src/video/VideoSyncHelper.d.ts +0 -76
- package/lib/types/src/video/index.d.ts +0 -3
- package/lib/types/src/video/types.d.ts +0 -41
- package/lib/types/src/workouts/base/api/consts.d.ts +0 -9
- package/lib/types/src/workouts/base/api/index.d.ts +0 -17
- package/lib/types/src/workouts/base/model/Segment.d.ts +0 -18
- package/lib/types/src/workouts/base/model/Step.d.ts +0 -35
- package/lib/types/src/workouts/base/model/Workout.d.ts +0 -26
- package/lib/types/src/workouts/base/model/index.d.ts +0 -4
- package/lib/types/src/workouts/base/model/types.d.ts +0 -61
- package/lib/types/src/workouts/base/parsers/factory.d.ts +0 -11
- package/lib/types/src/workouts/base/parsers/incyclist/Json.d.ts +0 -12
- package/lib/types/src/workouts/base/parsers/index.d.ts +0 -5
- package/lib/types/src/workouts/base/parsers/intervals/parser.d.ts +0 -59
- package/lib/types/src/workouts/base/parsers/intervals/types.d.ts +0 -57
- package/lib/types/src/workouts/base/parsers/types.d.ts +0 -8
- package/lib/types/src/workouts/base/parsers/zwo/zwo.d.ts +0 -37
- package/lib/types/src/workouts/calendar/index.d.ts +0 -3
- package/lib/types/src/workouts/calendar/service.d.ts +0 -50
- package/lib/types/src/workouts/calendar/sync/factory.d.ts +0 -10
- package/lib/types/src/workouts/calendar/sync/index.d.ts +0 -2
- package/lib/types/src/workouts/calendar/sync/intervals/provider.d.ts +0 -22
- package/lib/types/src/workouts/calendar/sync/types.d.ts +0 -10
- package/lib/types/src/workouts/calendar/types.d.ts +0 -15
- package/lib/types/src/workouts/index.d.ts +0 -3
- package/lib/types/src/workouts/list/cards/ActiveImportCard.d.ts +0 -27
- package/lib/types/src/workouts/list/cards/ScheduledWorkoutCard.d.ts +0 -13
- package/lib/types/src/workouts/list/cards/WorkoutCard.d.ts +0 -45
- package/lib/types/src/workouts/list/cards/WorkoutCreateCard.d.ts +0 -21
- package/lib/types/src/workouts/list/cards/WorkoutImportCard.d.ts +0 -19
- package/lib/types/src/workouts/list/cards/base.d.ts +0 -22
- package/lib/types/src/workouts/list/cards/index.d.ts +0 -4
- package/lib/types/src/workouts/list/cards/types.d.ts +0 -56
- package/lib/types/src/workouts/list/index.d.ts +0 -2
- package/lib/types/src/workouts/list/loaders/api.d.ts +0 -11
- package/lib/types/src/workouts/list/loaders/db.d.ts +0 -27
- package/lib/types/src/workouts/list/loaders/loader.d.ts +0 -10
- package/lib/types/src/workouts/list/service.d.ts +0 -90
- package/lib/types/src/workouts/list/types.d.ts +0 -12
- package/lib/types/src/workouts/ride/index.d.ts +0 -2
- package/lib/types/src/workouts/ride/service.d.ts +0 -69
- package/lib/types/src/workouts/ride/types.d.ts +0 -25
- /package/lib/esm/{settings/display/gear → apps/base/api/trainingpeaks}/types.js +0 -0
- /package/lib/esm/{src/activities/active-rides → apps/trainingpeaks}/types.js +0 -0
|
@@ -1362,8 +1362,15 @@ let DeviceRideService = (() => {
|
|
|
1362
1362
|
canEnforceSimulator() {
|
|
1363
1363
|
const selected = (0, routes_1.getRouteList)().getSelected();
|
|
1364
1364
|
const personalApiKey = this.getGoogleMaps().hasPersonalApiKey();
|
|
1365
|
+
if (!selected?.description)
|
|
1366
|
+
return false;
|
|
1365
1367
|
if (selected?.description?.hasVideo || personalApiKey)
|
|
1366
1368
|
return true;
|
|
1369
|
+
if (!selected.description.hasVideo) {
|
|
1370
|
+
const rideView = (0, settings_1.useUserSettings)().getValue('preferences.rideView', null);
|
|
1371
|
+
if (rideView === 'map')
|
|
1372
|
+
return true;
|
|
1373
|
+
}
|
|
1367
1374
|
return (0, settings_1.useUserSettings)().isNewUser();
|
|
1368
1375
|
}
|
|
1369
1376
|
logEvent(event) {
|
|
@@ -191,7 +191,6 @@ let RideDisplayService = (() => {
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
pause(requester = 'user') {
|
|
194
|
-
console.log('# PAUSE', requester);
|
|
195
194
|
try {
|
|
196
195
|
if (this.state !== 'Active')
|
|
197
196
|
return;
|
|
@@ -378,7 +377,7 @@ let RideDisplayService = (() => {
|
|
|
378
377
|
return { ...props, ...childProps };
|
|
379
378
|
}
|
|
380
379
|
catch (err) {
|
|
381
|
-
this.logError(err, 'getDisplayProperties');
|
|
380
|
+
this.logError(err, 'getDisplayProperties', { state: this.state });
|
|
382
381
|
return { state: this.state };
|
|
383
382
|
}
|
|
384
383
|
}
|
|
@@ -426,7 +425,7 @@ let RideDisplayService = (() => {
|
|
|
426
425
|
async stopRide(props = {}) {
|
|
427
426
|
try {
|
|
428
427
|
if (this.state !== 'Starting' && this.state !== 'Idle') {
|
|
429
|
-
this.logEvent({ message: "activity stopped", activity: this.activity?.id });
|
|
428
|
+
this.logEvent({ message: "activity stopped", activity: this.activity?.id, lastState: this.state });
|
|
430
429
|
}
|
|
431
430
|
const prevState = this.state;
|
|
432
431
|
this.state = prevState === 'Starting' ? 'Closing' : 'Finished';
|
|
@@ -450,7 +449,6 @@ let RideDisplayService = (() => {
|
|
|
450
449
|
}
|
|
451
450
|
if (prevState !== 'Starting')
|
|
452
451
|
this.enableScreensaver();
|
|
453
|
-
this.state = 'Idle';
|
|
454
452
|
}
|
|
455
453
|
catch (err) {
|
|
456
454
|
this.logError(err, 'stopRide');
|
|
@@ -459,9 +457,10 @@ let RideDisplayService = (() => {
|
|
|
459
457
|
}
|
|
460
458
|
async closePrevRide() {
|
|
461
459
|
try {
|
|
462
|
-
if (this.observer || (this.state !== 'Idle')) {
|
|
460
|
+
if (this.observer || (this.state !== 'Idle' && this.state !== 'Finished')) {
|
|
463
461
|
await this.stopRide({ noStateUpdates: true });
|
|
464
462
|
}
|
|
463
|
+
this.state = 'Idle';
|
|
465
464
|
}
|
|
466
465
|
catch (err) {
|
|
467
466
|
this.logError(err, 'init');
|
|
@@ -196,6 +196,12 @@ let RidePageService = (() => {
|
|
|
196
196
|
}
|
|
197
197
|
onMenuClose() {
|
|
198
198
|
try {
|
|
199
|
+
const state = this.getRideDisplay().getState();
|
|
200
|
+
if (state === 'Finished' || this.menuProps.finished) {
|
|
201
|
+
this.moveToPreviousPage();
|
|
202
|
+
this.closePage();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
199
205
|
this.menuProps = null;
|
|
200
206
|
this.updatePageDisplay();
|
|
201
207
|
}
|
|
@@ -223,6 +229,15 @@ let RidePageService = (() => {
|
|
|
223
229
|
this.logError(err, 'onResume');
|
|
224
230
|
}
|
|
225
231
|
}
|
|
232
|
+
onFinished() {
|
|
233
|
+
try {
|
|
234
|
+
this.menuProps = { showResume: false, finished: true };
|
|
235
|
+
this.updatePageDisplay();
|
|
236
|
+
}
|
|
237
|
+
catch (err) {
|
|
238
|
+
this.logError(err, 'onResume');
|
|
239
|
+
}
|
|
240
|
+
}
|
|
226
241
|
onEndRide() {
|
|
227
242
|
try {
|
|
228
243
|
this.getRideDisplay().stop();
|
|
@@ -336,6 +351,9 @@ let RidePageService = (() => {
|
|
|
336
351
|
case 'Paused':
|
|
337
352
|
this.menuProps = { showResume: true };
|
|
338
353
|
break;
|
|
354
|
+
case 'Finished':
|
|
355
|
+
this.menuProps = { showResume: false, finished: true };
|
|
356
|
+
break;
|
|
339
357
|
case 'Active':
|
|
340
358
|
this.menuProps = null;
|
|
341
359
|
break;
|
|
@@ -40,7 +40,7 @@ const apps_1 = require("../../apps");
|
|
|
40
40
|
const decorators_1 = require("../../base/decorators");
|
|
41
41
|
const types_1 = require("../../base/types");
|
|
42
42
|
const routes_1 = require("../../routes");
|
|
43
|
-
const
|
|
43
|
+
const display_1 = require("../../settings/display");
|
|
44
44
|
const RouteDisplayService_1 = require("./RouteDisplayService");
|
|
45
45
|
const SV_UPDATE_FREQ = 3000;
|
|
46
46
|
const SV_MIN_READY = 1500;
|
|
@@ -48,18 +48,18 @@ const SV_MIN_DELAY = 1000;
|
|
|
48
48
|
let GpxDisplayService = (() => {
|
|
49
49
|
let _classSuper = RouteDisplayService_1.RouteDisplayService;
|
|
50
50
|
let _instanceExtraInitializers = [];
|
|
51
|
-
let _getUserSettings_decorators;
|
|
52
51
|
let _getGoogleMaps_decorators;
|
|
53
52
|
let _getBindings_decorators;
|
|
53
|
+
let _getRideSettingsDisplay_decorators;
|
|
54
54
|
return class GpxDisplayService extends _classSuper {
|
|
55
55
|
static {
|
|
56
56
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
57
|
-
_getUserSettings_decorators = [decorators_1.Injectable];
|
|
58
57
|
_getGoogleMaps_decorators = [decorators_1.Injectable];
|
|
59
58
|
_getBindings_decorators = [decorators_1.Injectable];
|
|
60
|
-
|
|
59
|
+
_getRideSettingsDisplay_decorators = [decorators_1.Injectable];
|
|
61
60
|
__esDecorate(this, null, _getGoogleMaps_decorators, { kind: "method", name: "getGoogleMaps", static: false, private: false, access: { has: obj => "getGoogleMaps" in obj, get: obj => obj.getGoogleMaps }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
62
61
|
__esDecorate(this, null, _getBindings_decorators, { kind: "method", name: "getBindings", static: false, private: false, access: { has: obj => "getBindings" in obj, get: obj => obj.getBindings }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
62
|
+
__esDecorate(this, null, _getRideSettingsDisplay_decorators, { kind: "method", name: "getRideSettingsDisplay", static: false, private: false, access: { has: obj => "getRideSettingsDisplay" in obj, get: obj => obj.getRideSettingsDisplay }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
63
63
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
64
64
|
}
|
|
65
65
|
mapLoaded = (__runInitializers(this, _instanceExtraInitializers), false);
|
|
@@ -78,7 +78,7 @@ let GpxDisplayService = (() => {
|
|
|
78
78
|
}
|
|
79
79
|
initView() {
|
|
80
80
|
try {
|
|
81
|
-
const rideView = this.getRideView();
|
|
81
|
+
const rideView = this.getRideSettingsDisplay().getRideView();
|
|
82
82
|
if (rideView === 'sv') {
|
|
83
83
|
const updateFreq = this.getDefaultUpdateFrequency();
|
|
84
84
|
const minimalPause = this.getMinimalPause();
|
|
@@ -121,7 +121,7 @@ let GpxDisplayService = (() => {
|
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
getStartOverlayProps() {
|
|
124
|
-
const rideView = this.getRideView();
|
|
124
|
+
const rideView = this.getRideSettingsDisplay().getRideView();
|
|
125
125
|
if (rideView === 'map' || this.isMobile()) {
|
|
126
126
|
return {
|
|
127
127
|
mapType: this.getRideViewName(),
|
|
@@ -135,7 +135,7 @@ let GpxDisplayService = (() => {
|
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
isStartRideCompleted() {
|
|
138
|
-
const rideView = this.getRideView();
|
|
138
|
+
const rideView = this.getRideSettingsDisplay().getRideView();
|
|
139
139
|
if (rideView === 'map' || this.isMobile()) {
|
|
140
140
|
this.mapLoaded = true;
|
|
141
141
|
return true;
|
|
@@ -144,7 +144,7 @@ let GpxDisplayService = (() => {
|
|
|
144
144
|
}
|
|
145
145
|
getDisplayProperties(props) {
|
|
146
146
|
let routeProps = super.getDisplayProperties(props);
|
|
147
|
-
const rideView = this.getRideView();
|
|
147
|
+
const rideView = this.getRideSettingsDisplay().getRideView();
|
|
148
148
|
if (rideView === 'sv') {
|
|
149
149
|
routeProps = { ...routeProps, ...this.getStreetViewProps(props) };
|
|
150
150
|
}
|
|
@@ -160,13 +160,10 @@ let GpxDisplayService = (() => {
|
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
162
|
getRideView() {
|
|
163
|
-
|
|
164
|
-
return 'sv';
|
|
165
|
-
const rideView = this.getUserSettings().get('preferences.rideView', 'sv');
|
|
166
|
-
return rideView;
|
|
163
|
+
return this.getRideSettingsDisplay().getRideView();
|
|
167
164
|
}
|
|
168
165
|
getRideViewName() {
|
|
169
|
-
const rideView = this.getRideView();
|
|
166
|
+
const rideView = this.getRideSettingsDisplay().getRideView();
|
|
170
167
|
const map = {
|
|
171
168
|
map: 'Map',
|
|
172
169
|
sv: 'Street View',
|
|
@@ -261,7 +258,7 @@ let GpxDisplayService = (() => {
|
|
|
261
258
|
}
|
|
262
259
|
onPositionUpdate(state) {
|
|
263
260
|
const { route, position } = state ?? {};
|
|
264
|
-
const rideView = this.getRideView();
|
|
261
|
+
const rideView = this.getRideSettingsDisplay().getRideView();
|
|
265
262
|
if (rideView === 'sv') {
|
|
266
263
|
const sincePrev = Date.now() - (this.tsPrevSVUpdate ?? 0);
|
|
267
264
|
if (sincePrev > this.getStreetViewUpdateDelay() - 25) {
|
|
@@ -308,8 +305,8 @@ let GpxDisplayService = (() => {
|
|
|
308
305
|
isMobile() {
|
|
309
306
|
return this.getBindings().appInfo?.getChannel() === 'mobile';
|
|
310
307
|
}
|
|
311
|
-
|
|
312
|
-
return (
|
|
308
|
+
isIOS() {
|
|
309
|
+
return this.getBindings().appInfo?.getOS().platform === 'ios';
|
|
313
310
|
}
|
|
314
311
|
getGoogleMaps() {
|
|
315
312
|
return (0, apps_1.useGoogleMaps)();
|
|
@@ -317,6 +314,9 @@ let GpxDisplayService = (() => {
|
|
|
317
314
|
getBindings() {
|
|
318
315
|
return (0, api_1.getBindings)();
|
|
319
316
|
}
|
|
317
|
+
getRideSettingsDisplay() {
|
|
318
|
+
return (0, display_1.useRideSettingsDisplay)();
|
|
319
|
+
}
|
|
320
320
|
};
|
|
321
321
|
})();
|
|
322
322
|
exports.GpxDisplayService = GpxDisplayService;
|
|
@@ -276,7 +276,7 @@ let RouteDisplayService = (() => {
|
|
|
276
276
|
const mode = this.getDeviceRide().getCyclingMode();
|
|
277
277
|
const isSIM = mode?.isSIM();
|
|
278
278
|
const realityFactor = this.startSettings?.realityFactor ?? 100;
|
|
279
|
-
const targetSlope = (this.position
|
|
279
|
+
const targetSlope = (this.position?.slope ?? 0) * realityFactor / 100;
|
|
280
280
|
if (props?.limits && !isSIM) {
|
|
281
281
|
delete this.prevRequestSlope;
|
|
282
282
|
return { ...props?.limits, slope: targetSlope };
|
|
@@ -83,8 +83,10 @@ let RideSettingsDisplayService = (() => {
|
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
setRideView(rideView) {
|
|
86
|
+
if (this.isRestricted())
|
|
87
|
+
return;
|
|
86
88
|
try {
|
|
87
|
-
this.getUserSettings().
|
|
89
|
+
this.getUserSettings().set('preferences.rideView', rideView);
|
|
88
90
|
}
|
|
89
91
|
catch (err) {
|
|
90
92
|
this.logError(err, 'setRideView');
|
|
@@ -95,6 +97,8 @@ let RideSettingsDisplayService = (() => {
|
|
|
95
97
|
this.observer.emit('changed', this.getDisplayProps());
|
|
96
98
|
}
|
|
97
99
|
getRideView() {
|
|
100
|
+
if (this.isRestricted())
|
|
101
|
+
return 'map';
|
|
98
102
|
if (this.isMobile() && !this.isAndroid())
|
|
99
103
|
return 'map';
|
|
100
104
|
const rideView = this.getUserSettings().get('preferences.rideView', 'sv');
|
|
@@ -102,6 +106,10 @@ let RideSettingsDisplayService = (() => {
|
|
|
102
106
|
}
|
|
103
107
|
getRideViewOptions() {
|
|
104
108
|
const map = new Map();
|
|
109
|
+
if (this.isRestricted()) {
|
|
110
|
+
map.set('map', 'Map');
|
|
111
|
+
return map;
|
|
112
|
+
}
|
|
105
113
|
if (!this.isIOS())
|
|
106
114
|
map.set('sv', 'Street View');
|
|
107
115
|
map.set('map', 'Map');
|
|
@@ -109,6 +117,13 @@ let RideSettingsDisplayService = (() => {
|
|
|
109
117
|
map.set('sat', 'Satellite View');
|
|
110
118
|
return map;
|
|
111
119
|
}
|
|
120
|
+
isRestricted() {
|
|
121
|
+
if (this.isMobile()) {
|
|
122
|
+
const secretsStatus = this.getSecretBinding()?.getSecretsStatus?.();
|
|
123
|
+
return (secretsStatus === 'stale' || secretsStatus === 'missing' || secretsStatus === undefined);
|
|
124
|
+
}
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
112
127
|
isMobile() {
|
|
113
128
|
return this.getBindings().appInfo?.getChannel() === 'mobile';
|
|
114
129
|
}
|
|
@@ -116,7 +131,7 @@ let RideSettingsDisplayService = (() => {
|
|
|
116
131
|
return this.getBindings().appInfo?.getOS()?.platform === 'android';
|
|
117
132
|
}
|
|
118
133
|
isIOS() {
|
|
119
|
-
return this.getBindings().appInfo?.getOS()?.platform === '
|
|
134
|
+
return this.getBindings().appInfo?.getOS()?.platform === 'ios';
|
|
120
135
|
}
|
|
121
136
|
getUserSettings() {
|
|
122
137
|
return (0, service_2.useUserSettings)();
|
|
@@ -124,6 +139,9 @@ let RideSettingsDisplayService = (() => {
|
|
|
124
139
|
getBindings() {
|
|
125
140
|
return (0, api_1.getBindings)();
|
|
126
141
|
}
|
|
142
|
+
getSecretBinding() {
|
|
143
|
+
return this.getBindings().secret;
|
|
144
|
+
}
|
|
127
145
|
};
|
|
128
146
|
return RideSettingsDisplayService = _classThis;
|
|
129
147
|
})();
|
|
@@ -32,110 +32,92 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
|
|
|
32
32
|
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
33
|
done = true;
|
|
34
34
|
};
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
let
|
|
35
|
+
import { Injectable } from '../../base/decorators/Injection';
|
|
36
|
+
import { IncyclistService } from '../../base/service';
|
|
37
|
+
import { Singleton } from '../../base/types';
|
|
38
|
+
import { TrainingPeaksAppConnection } from '../../apps/trainingpeaks/TrainingPeaksAppConnection';
|
|
39
|
+
import { ActivityUploadFactory } from './factory';
|
|
40
|
+
let TrainingPeaksUpload = (() => {
|
|
41
41
|
let _classDecorators = [Singleton];
|
|
42
42
|
let _classDescriptor;
|
|
43
43
|
let _classExtraInitializers = [];
|
|
44
44
|
let _classThis;
|
|
45
45
|
let _classSuper = IncyclistService;
|
|
46
46
|
let _instanceExtraInitializers = [];
|
|
47
|
-
let
|
|
48
|
-
var
|
|
47
|
+
let _getConnection_decorators;
|
|
48
|
+
var TrainingPeaksUpload = class extends _classSuper {
|
|
49
49
|
static { _classThis = this; }
|
|
50
50
|
static {
|
|
51
51
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
52
|
-
|
|
53
|
-
__esDecorate(this, null,
|
|
52
|
+
_getConnection_decorators = [Injectable];
|
|
53
|
+
__esDecorate(this, null, _getConnection_decorators, { kind: "method", name: "getConnection", static: false, private: false, access: { has: obj => "getConnection" in obj, get: obj => obj.getConnection }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
54
54
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
55
|
-
|
|
55
|
+
TrainingPeaksUpload = _classThis = _classDescriptor.value;
|
|
56
56
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
57
57
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
58
58
|
}
|
|
59
59
|
isInitialized = __runInitializers(this, _instanceExtraInitializers);
|
|
60
|
-
connection = new
|
|
60
|
+
connection = new TrainingPeaksAppConnection();
|
|
61
61
|
constructor() {
|
|
62
|
-
super('
|
|
62
|
+
super('TrainingPeaksUpload');
|
|
63
63
|
this.isInitialized = false;
|
|
64
64
|
this.init();
|
|
65
65
|
}
|
|
66
66
|
init() {
|
|
67
67
|
if (this.isInitialized)
|
|
68
68
|
return true;
|
|
69
|
-
this.isInitialized = this.
|
|
69
|
+
this.isInitialized = this.getConnection().init();
|
|
70
70
|
return this.isInitialized;
|
|
71
71
|
}
|
|
72
72
|
isConnected() {
|
|
73
|
-
return this.
|
|
73
|
+
return this.getConnection().isConnected();
|
|
74
74
|
}
|
|
75
75
|
async upload(activity, format = 'TCX') {
|
|
76
76
|
try {
|
|
77
77
|
const ok = this.ensureInitialized();
|
|
78
78
|
if (!ok) {
|
|
79
|
-
this.logEvent({ message: '
|
|
79
|
+
this.logEvent({ message: 'TrainingPeaks upload skipped', reason: 'not initialized' });
|
|
80
80
|
return false;
|
|
81
81
|
}
|
|
82
82
|
if (!this.isConnected())
|
|
83
83
|
return false;
|
|
84
84
|
const lcFormat = format.toLowerCase();
|
|
85
85
|
const ucFormat = format.toUpperCase();
|
|
86
|
-
this.logEvent({ message: '
|
|
86
|
+
this.logEvent({ message: 'TrainingPeaks upload', format: ucFormat });
|
|
87
87
|
if (!activity.links)
|
|
88
88
|
activity.links = {};
|
|
89
89
|
const fileName = activity[`${lcFormat}FileName`];
|
|
90
|
-
const res = await this.getApi().upload(fileName, {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
this.logEvent({ message: 'Intervals.icu Upload success', activityId: res.intervalsId });
|
|
96
|
-
activity.links.intervals = {
|
|
97
|
-
activity_id: res.intervalsId,
|
|
98
|
-
url: this.getUrl(res.intervalsId)
|
|
90
|
+
const res = await this.getApi().upload(fileName, { name: activity.title, description: '' });
|
|
91
|
+
this.logEvent({ message: 'TrainingPeaks upload success', activityId: res.trainingPeaksId });
|
|
92
|
+
activity.links.trainingpeaks = {
|
|
93
|
+
activity_id: String(res.trainingPeaksId),
|
|
94
|
+
url: this.getUrl(res.trainingPeaksId)
|
|
99
95
|
};
|
|
100
96
|
return true;
|
|
101
97
|
}
|
|
102
98
|
catch (err) {
|
|
103
|
-
this.logEvent({ message: '
|
|
104
|
-
activity.links.
|
|
105
|
-
error: err.message
|
|
106
|
-
};
|
|
99
|
+
this.logEvent({ message: 'TrainingPeaks upload failure', error: err.message });
|
|
100
|
+
activity.links.trainingpeaks = { error: err.message };
|
|
107
101
|
return false;
|
|
108
102
|
}
|
|
109
103
|
}
|
|
110
104
|
getUrl(activityId) {
|
|
111
|
-
return `https://
|
|
112
|
-
}
|
|
113
|
-
getIntervalsFormat(format) {
|
|
114
|
-
switch (format.toLowerCase()) {
|
|
115
|
-
case 'tcx':
|
|
116
|
-
return 'tcx';
|
|
117
|
-
case 'fit':
|
|
118
|
-
return 'fit';
|
|
119
|
-
case 'gox':
|
|
120
|
-
return 'gpx';
|
|
121
|
-
default:
|
|
122
|
-
return null;
|
|
123
|
-
}
|
|
105
|
+
return `https://www.trainingpeaks.com/athlete/workouts/${activityId}`;
|
|
124
106
|
}
|
|
125
107
|
ensureInitialized() {
|
|
126
108
|
if (!this.isInitialized)
|
|
127
109
|
this.init();
|
|
128
110
|
return this.isInitialized;
|
|
129
111
|
}
|
|
130
|
-
|
|
112
|
+
getConnection() {
|
|
131
113
|
return this.connection;
|
|
132
114
|
}
|
|
133
115
|
getApi() {
|
|
134
|
-
return this.
|
|
116
|
+
return this.getConnection().getApi();
|
|
135
117
|
}
|
|
136
118
|
};
|
|
137
|
-
return
|
|
119
|
+
return TrainingPeaksUpload = _classThis;
|
|
138
120
|
})();
|
|
139
|
-
export {
|
|
121
|
+
export { TrainingPeaksUpload };
|
|
140
122
|
const factory = new ActivityUploadFactory();
|
|
141
|
-
factory.add('
|
|
123
|
+
factory.add('trainingpeaks', new TrainingPeaksUpload());
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { EventLogger } from 'gd-eventlog';
|
|
2
|
+
import { Observer } from '../../../../base/types/observer';
|
|
3
|
+
import { valid } from '../../../../utils/valid';
|
|
4
|
+
import { sleep } from '../../../../utils/sleep';
|
|
5
|
+
import { AppApiBase } from '../base';
|
|
6
|
+
const UPLOAD_POLL_INTERVAL_MS = 2000;
|
|
7
|
+
const UPLOAD_TIMEOUT_MS = 60000;
|
|
8
|
+
export class TrainingPeaksApi extends AppApiBase {
|
|
9
|
+
config;
|
|
10
|
+
logger;
|
|
11
|
+
observer;
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.logger = new EventLogger('TrainingPeaksApi');
|
|
15
|
+
this.observer = new Observer();
|
|
16
|
+
}
|
|
17
|
+
getBaseUrl() {
|
|
18
|
+
return process.env.TRAININGPEAKS_API || 'https://api.sandbox.trainingpeaks.com';
|
|
19
|
+
}
|
|
20
|
+
getOauthBaseUrl() {
|
|
21
|
+
return process.env.TRAININGPEAKS_OAUTH_URL || 'https://oauth.sandbox.trainingpeaks.com';
|
|
22
|
+
}
|
|
23
|
+
init(config) {
|
|
24
|
+
this.config = config;
|
|
25
|
+
return this.observer;
|
|
26
|
+
}
|
|
27
|
+
update(config) {
|
|
28
|
+
if (!this.config)
|
|
29
|
+
throw new Error('update not allowed before init');
|
|
30
|
+
this.config = { ...this.config, ...config };
|
|
31
|
+
}
|
|
32
|
+
isAuthenticated() {
|
|
33
|
+
return valid(this.config?.accessToken);
|
|
34
|
+
}
|
|
35
|
+
async getLoggedInAthlete() {
|
|
36
|
+
await this.verifyAuthentication();
|
|
37
|
+
const response = await this.get('/v1/athlete/profile');
|
|
38
|
+
return response.data;
|
|
39
|
+
}
|
|
40
|
+
async getCalendarWorkouts(opts) {
|
|
41
|
+
await this.verifyAuthentication();
|
|
42
|
+
const oldest = opts?.oldest ?? new Date();
|
|
43
|
+
const newest = opts?.newest ?? new Date(oldest.valueOf() + 30 * 24 * 60 * 60 * 1000);
|
|
44
|
+
const fmt = (d) => d.toISOString().slice(0, 10);
|
|
45
|
+
const response = await this.get(`/v2/workouts/${fmt(oldest)}/${fmt(newest)}`);
|
|
46
|
+
return response.data;
|
|
47
|
+
}
|
|
48
|
+
async getWorkoutFile(id, format = 'zwo') {
|
|
49
|
+
await this.verifyAuthentication();
|
|
50
|
+
const response = await this.get(`/v2/workouts/wod/file/${id}?format=${format}`);
|
|
51
|
+
return response.data;
|
|
52
|
+
}
|
|
53
|
+
async upload(fileName, props) {
|
|
54
|
+
await this.verifyAuthentication();
|
|
55
|
+
const reqOpts = {
|
|
56
|
+
headers: { Authorization: `bearer ${this.config.accessToken}` }
|
|
57
|
+
};
|
|
58
|
+
const form = await this.createForm('/v3/file', { file: { type: 'file', fileName } }, reqOpts);
|
|
59
|
+
const response = await this.postForm(form);
|
|
60
|
+
const location = response.headers?.['location'] ?? '';
|
|
61
|
+
const trackingId = location.split('/').filter(Boolean).pop();
|
|
62
|
+
if (!trackingId) {
|
|
63
|
+
throw new Error('TrainingPeaks upload failed: no tracking ID returned');
|
|
64
|
+
}
|
|
65
|
+
return this.waitForUploadComplete(trackingId, props?.externalId);
|
|
66
|
+
}
|
|
67
|
+
async getUploadStatus(trackingId) {
|
|
68
|
+
await this.verifyAuthentication();
|
|
69
|
+
const response = await this.get(`/v3/status/${trackingId}`);
|
|
70
|
+
return response.data;
|
|
71
|
+
}
|
|
72
|
+
async verifyAuthentication() {
|
|
73
|
+
if (!this.isAuthenticated())
|
|
74
|
+
throw new Error('not authenticated');
|
|
75
|
+
await this.verifyToken();
|
|
76
|
+
}
|
|
77
|
+
async verifyToken() {
|
|
78
|
+
if (!this.isTokenStillValid()) {
|
|
79
|
+
try {
|
|
80
|
+
await this.refreshToken();
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
throw new Error('token refresh failed');
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
isTokenStillValid() {
|
|
88
|
+
if (!this.config?.expiration)
|
|
89
|
+
return false;
|
|
90
|
+
return Date.now() < this.config.expiration.valueOf();
|
|
91
|
+
}
|
|
92
|
+
async refreshToken() {
|
|
93
|
+
this.logger.logEvent({ message: 'TrainingPeaks refresh token start' });
|
|
94
|
+
try {
|
|
95
|
+
const response = await this.getApi().request({
|
|
96
|
+
method: 'post',
|
|
97
|
+
url: `${this.getOauthBaseUrl()}/oauth/token`,
|
|
98
|
+
data: new URLSearchParams({
|
|
99
|
+
grant_type: 'refresh_token',
|
|
100
|
+
refresh_token: this.config.refreshToken,
|
|
101
|
+
client_id: this.config.clientId,
|
|
102
|
+
client_secret: this.config.clientSecret,
|
|
103
|
+
}).toString(),
|
|
104
|
+
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
|
105
|
+
});
|
|
106
|
+
const data = response.data;
|
|
107
|
+
this.config.accessToken = data.access_token;
|
|
108
|
+
this.config.refreshToken = data.refresh_token;
|
|
109
|
+
this.config.expiration = new Date(Date.now() + data.expires_in * 1000);
|
|
110
|
+
this.logger.logEvent({ message: 'TrainingPeaks refresh token success' });
|
|
111
|
+
this.observer.emit('token.updated', this.config);
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
this.logger.logEvent({ message: 'TrainingPeaks refresh token error', error: err.message });
|
|
115
|
+
throw err;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
async waitForUploadComplete(trackingId, externalId) {
|
|
119
|
+
const deadline = Date.now() + UPLOAD_TIMEOUT_MS;
|
|
120
|
+
while (Date.now() < deadline) {
|
|
121
|
+
const status = await this.getUploadStatus(trackingId);
|
|
122
|
+
if (status.Completed) {
|
|
123
|
+
if (!status.WorkoutIds?.length) {
|
|
124
|
+
throw new Error(`TrainingPeaks upload failed: ${status.Status}`);
|
|
125
|
+
}
|
|
126
|
+
return { trainingPeaksId: status.WorkoutIds[0], externalId };
|
|
127
|
+
}
|
|
128
|
+
await sleep(UPLOAD_POLL_INTERVAL_MS);
|
|
129
|
+
}
|
|
130
|
+
throw new Error('TrainingPeaks upload timed out');
|
|
131
|
+
}
|
|
132
|
+
async get(url, config) {
|
|
133
|
+
const props = config ?? {};
|
|
134
|
+
const response = await this.getApi().request({
|
|
135
|
+
method: 'get',
|
|
136
|
+
url: this.getBaseUrl() + url,
|
|
137
|
+
headers: { Authorization: `bearer ${this.config.accessToken}` },
|
|
138
|
+
validateStatus: (status) => (status >= 200 && status < 300) || status === 403,
|
|
139
|
+
...props
|
|
140
|
+
});
|
|
141
|
+
return response;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TrainingPeaksApi } from './api';
|