incyclist-services 1.7.66 → 1.7.68
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/activities/base/utils/activity.js +13 -1
- package/lib/cjs/services/overpass/overpass.js +165 -13
- package/lib/cjs/{src/settings/display/support → settings/display/ride}/service.js +47 -30
- package/lib/cjs/workouts/base/parsers/zwo/zwo.js +2 -2
- package/lib/esm/activities/base/utils/activity.js +13 -1
- package/lib/esm/package.json +1 -1
- package/lib/esm/services/overpass/overpass.js +165 -13
- package/lib/{cjs/src/appstate → esm/settings/display/gear}/service.js +64 -48
- package/lib/esm/settings/display/ride/index.js +0 -0
- package/lib/{cjs/src/apps/googleMaps → esm/settings/display/ride}/service.js +72 -69
- package/lib/esm/settings/display/ride/types.js +1 -0
- package/lib/esm/src/services/overpass/overpass.js +3 -0
- package/lib/esm/workouts/base/parsers/zwo/zwo.js +2 -2
- package/lib/types/activities/base/utils/activity.d.ts +1 -0
- package/lib/types/services/overpass/overpass.d.ts +25 -0
- package/lib/types/settings/display/gear/index.d.ts +0 -0
- package/lib/types/settings/display/gear/service.d.ts +21 -0
- package/lib/types/settings/display/gear/types.d.ts +5 -0
- package/lib/types/settings/display/ride/index.d.ts +0 -0
- package/lib/types/settings/display/ride/service.d.ts +22 -0
- package/lib/types/settings/display/ride/types.d.ts +5 -0
- package/package.json +1 -1
- package/lib/cjs/api/form/index.js +0 -2
- package/lib/cjs/package.json +0 -68
- package/lib/cjs/src/activities/active-rides/index.js +0 -18
- package/lib/cjs/src/activities/active-rides/mq.js +0 -190
- package/lib/cjs/src/activities/active-rides/service.js +0 -874
- package/lib/cjs/src/activities/base/api/active-rides/api.js +0 -121
- package/lib/cjs/src/activities/base/api/active-rides/index.js +0 -18
- package/lib/cjs/src/activities/base/api/active-rides/types.js +0 -2
- package/lib/cjs/src/activities/base/api/fitconvert/consts.js +0 -5
- package/lib/cjs/src/activities/base/api/fitconvert/fitconvert.js +0 -97
- package/lib/cjs/src/activities/base/api/fitconvert/index.js +0 -17
- package/lib/cjs/src/activities/base/api/index.js +0 -17
- package/lib/cjs/src/activities/base/convert/converter.js +0 -21
- package/lib/cjs/src/activities/base/convert/factory.js +0 -75
- package/lib/cjs/src/activities/base/convert/fit/index.js +0 -18
- package/lib/cjs/src/activities/base/convert/fit/local-fit.js +0 -240
- package/lib/cjs/src/activities/base/convert/fit/remote-fit.js +0 -55
- package/lib/cjs/src/activities/base/convert/index.js +0 -20
- package/lib/cjs/src/activities/base/convert/tcx/index.js +0 -17
- package/lib/cjs/src/activities/base/convert/tcx/tcx.js +0 -210
- package/lib/cjs/src/activities/base/convert/tcx/types.js +0 -2
- package/lib/cjs/src/activities/base/convert/types.js +0 -9
- package/lib/cjs/src/activities/base/index.js +0 -21
- package/lib/cjs/src/activities/base/model/index.js +0 -9
- package/lib/cjs/src/activities/base/repo/db.js +0 -521
- package/lib/cjs/src/activities/base/repo/index.js +0 -18
- package/lib/cjs/src/activities/base/repo/migration/factory.js +0 -25
- package/lib/cjs/src/activities/base/repo/migration/types.js +0 -17
- package/lib/cjs/src/activities/base/repo/migration/v0.js +0 -18
- package/lib/cjs/src/activities/base/repo/migration/v1.js +0 -19
- package/lib/cjs/src/activities/base/repo/migration/v2.js +0 -11
- package/lib/cjs/src/activities/base/repo/migration/v3.js +0 -27
- package/lib/cjs/src/activities/base/repo/types.js +0 -2
- package/lib/cjs/src/activities/base/utils/activity.js +0 -327
- package/lib/cjs/src/activities/base/utils/helpers.js +0 -66
- package/lib/cjs/src/activities/base/utils/index.js +0 -18
- package/lib/cjs/src/activities/index.js +0 -22
- package/lib/cjs/src/activities/list/index.js +0 -18
- package/lib/cjs/src/activities/list/service.js +0 -463
- package/lib/cjs/src/activities/list/types.js +0 -2
- package/lib/cjs/src/activities/list/utils.js +0 -88
- package/lib/cjs/src/activities/page/index.js +0 -17
- package/lib/cjs/src/activities/page/service.js +0 -177
- package/lib/cjs/src/activities/page/types.js +0 -2
- package/lib/cjs/src/activities/ride/duration.js +0 -140
- package/lib/cjs/src/activities/ride/index.js +0 -17
- package/lib/cjs/src/activities/ride/service.js +0 -1331
- package/lib/cjs/src/activities/ride/stats.js +0 -197
- package/lib/cjs/src/activities/ride/types.js +0 -2
- package/lib/cjs/src/activities/types.js +0 -18
- package/lib/cjs/src/activities/upload/factory.js +0 -93
- package/lib/cjs/src/activities/upload/index.js +0 -21
- package/lib/cjs/src/activities/upload/intervals.js +0 -144
- package/lib/cjs/src/activities/upload/strava.js +0 -154
- package/lib/cjs/src/activities/upload/types.js +0 -2
- package/lib/cjs/src/activities/upload/velohero.js +0 -136
- package/lib/cjs/src/api/appInfo/index.js +0 -2
- package/lib/cjs/src/api/bindings/index.js +0 -78
- package/lib/cjs/src/api/bindings/types.js +0 -2
- package/lib/cjs/src/api/crypto/types.js +0 -2
- package/lib/cjs/src/api/download/index.js +0 -2
- package/lib/cjs/src/api/form/types.js +0 -2
- package/lib/cjs/src/api/fs/index.js +0 -2
- package/lib/cjs/src/api/index.js +0 -20
- package/lib/cjs/src/api/logging/types.js +0 -2
- package/lib/cjs/src/api/mq/index.js +0 -2
- package/lib/cjs/src/api/path/index.js +0 -21
- package/lib/cjs/src/api/repository/index.js +0 -21
- package/lib/cjs/src/api/repository/json/index.js +0 -121
- package/lib/cjs/src/api/repository/types.js +0 -2
- package/lib/cjs/src/api/rest/RestApiClient.js +0 -16
- package/lib/cjs/src/api/rest/api.js +0 -74
- package/lib/cjs/src/api/rest/incyclist.js +0 -37
- package/lib/cjs/src/api/rest/index.js +0 -19
- package/lib/cjs/src/api/rest/types.js +0 -2
- package/lib/cjs/src/api/secret/index.js +0 -2
- package/lib/cjs/src/api/serial/types.js +0 -2
- package/lib/cjs/src/api/types.js +0 -2
- package/lib/cjs/src/api/ui/index.js +0 -2
- package/lib/cjs/src/api/video/index.js +0 -2
- package/lib/cjs/src/apps/base/api/base.js +0 -62
- package/lib/cjs/src/apps/base/api/index.js +0 -20
- package/lib/cjs/src/apps/base/api/intervals/api.js +0 -131
- package/lib/cjs/src/apps/base/api/intervals/index.js +0 -18
- package/lib/cjs/src/apps/base/api/intervals/types.js +0 -15
- package/lib/cjs/src/apps/base/api/komoot/api.js +0 -141
- package/lib/cjs/src/apps/base/api/komoot/index.js +0 -18
- package/lib/cjs/src/apps/base/api/komoot/types.js +0 -2
- package/lib/cjs/src/apps/base/api/strava/api.js +0 -221
- package/lib/cjs/src/apps/base/api/strava/index.js +0 -18
- package/lib/cjs/src/apps/base/api/strava/types.js +0 -11
- package/lib/cjs/src/apps/base/api/velohero/api.js +0 -84
- package/lib/cjs/src/apps/base/api/velohero/index.js +0 -18
- package/lib/cjs/src/apps/base/api/velohero/types.js +0 -2
- package/lib/cjs/src/apps/base/app/index.js +0 -107
- package/lib/cjs/src/apps/base/index.js +0 -19
- package/lib/cjs/src/apps/base/types.js +0 -2
- package/lib/cjs/src/apps/googleMaps/index.js +0 -17
- package/lib/cjs/src/apps/index.js +0 -21
- package/lib/cjs/src/apps/intervals/IntervalsAppConnection.js +0 -186
- package/lib/cjs/src/apps/intervals/types.js +0 -2
- package/lib/cjs/src/apps/komoot/KomootAppConnection.js +0 -248
- package/lib/cjs/src/apps/komoot/index.js +0 -18
- package/lib/cjs/src/apps/komoot/types.js +0 -2
- package/lib/cjs/src/apps/service.js +0 -193
- package/lib/cjs/src/apps/strava/StravaAppConnection.js +0 -193
- package/lib/cjs/src/apps/strava/index.js +0 -18
- package/lib/cjs/src/apps/strava/types.js +0 -2
- package/lib/cjs/src/apps/types.js +0 -2
- package/lib/cjs/src/apps/velohero/VeloHeroAppConnection.js +0 -232
- package/lib/cjs/src/apps/velohero/index.js +0 -18
- package/lib/cjs/src/apps/velohero/types.js +0 -2
- package/lib/cjs/src/appstate/index.js +0 -18
- package/lib/cjs/src/appstate/types.js +0 -2
- package/lib/cjs/src/autoupdate/api.js +0 -179
- package/lib/cjs/src/autoupdate/autoupdate.js +0 -28
- package/lib/cjs/src/autoupdate/index.js +0 -18
- package/lib/cjs/src/avatars/index.js +0 -18
- package/lib/cjs/src/avatars/service.js +0 -138
- package/lib/cjs/src/avatars/types.js +0 -2
- package/lib/cjs/src/base/cardlist/index.js +0 -43
- package/lib/cjs/src/base/cardlist/types.js +0 -2
- package/lib/cjs/src/base/decorators/Injection.js +0 -28
- package/lib/cjs/src/base/decorators/index.js +0 -18
- package/lib/cjs/src/base/pages/index.js +0 -17
- package/lib/cjs/src/base/pages/service.js +0 -127
- package/lib/cjs/src/base/pages/types.js +0 -2
- package/lib/cjs/src/base/service.js +0 -36
- package/lib/cjs/src/base/typedefs.js +0 -2
- package/lib/cjs/src/base/types/index.js +0 -19
- package/lib/cjs/src/base/types/lists.js +0 -22
- package/lib/cjs/src/base/types/observer.js +0 -80
- package/lib/cjs/src/base/types/singleton.js +0 -23
- package/lib/cjs/src/coaches/coach.js +0 -165
- package/lib/cjs/src/coaches/index.js +0 -19
- package/lib/cjs/src/coaches/service.js +0 -298
- package/lib/cjs/src/coaches/types.js +0 -2
- package/lib/cjs/src/devices/access/index.js +0 -18
- package/lib/cjs/src/devices/access/model.js +0 -2
- package/lib/cjs/src/devices/access/service.js +0 -519
- package/lib/cjs/src/devices/configuration/index.js +0 -18
- package/lib/cjs/src/devices/configuration/model/app/index.js +0 -2
- package/lib/cjs/src/devices/configuration/model/index.js +0 -19
- package/lib/cjs/src/devices/configuration/model/repository/index.js +0 -17
- package/lib/cjs/src/devices/configuration/model/repository/legacy.js +0 -2
- package/lib/cjs/src/devices/configuration/model/service/index.js +0 -2
- package/lib/cjs/src/devices/configuration/service.js +0 -1004
- package/lib/cjs/src/devices/configuration/types.js +0 -2
- package/lib/cjs/src/devices/index.js +0 -21
- package/lib/cjs/src/devices/page/index.js +0 -17
- package/lib/cjs/src/devices/page/logobserver.js +0 -19
- package/lib/cjs/src/devices/page/service.js +0 -426
- package/lib/cjs/src/devices/page/statemachine.js +0 -338
- package/lib/cjs/src/devices/page/types.js +0 -2
- package/lib/cjs/src/devices/pairing/index.js +0 -18
- package/lib/cjs/src/devices/pairing/model.js +0 -2
- package/lib/cjs/src/devices/pairing/service.js +0 -1509
- package/lib/cjs/src/devices/ride/index.js +0 -17
- package/lib/cjs/src/devices/ride/service.js +0 -1402
- package/lib/cjs/src/devices/ride/types.js +0 -2
- package/lib/cjs/src/devices/types.js +0 -2
- package/lib/cjs/src/i18n/countries/countries.json +0 -255
- package/lib/cjs/src/i18n/countries/index.js +0 -17
- package/lib/cjs/src/i18n/countries/model.js +0 -2
- package/lib/cjs/src/i18n/countries/service.js +0 -125
- package/lib/cjs/src/i18n/index.js +0 -19
- package/lib/cjs/src/i18n/localization/index.js +0 -18
- package/lib/cjs/src/i18n/localization/service.js +0 -129
- package/lib/cjs/src/i18n/localization/types.js +0 -2
- package/lib/cjs/src/i18n/units/converter.js +0 -177
- package/lib/cjs/src/i18n/units/index.js +0 -18
- package/lib/cjs/src/i18n/units/types.js +0 -2
- package/lib/cjs/src/index.js +0 -40
- package/lib/cjs/src/maps/MapArea/MapArea.js +0 -403
- package/lib/cjs/src/maps/MapArea/consts.js +0 -11
- package/lib/cjs/src/maps/MapArea/index.js +0 -19
- package/lib/cjs/src/maps/MapArea/options.js +0 -417
- package/lib/cjs/src/maps/MapArea/service.js +0 -298
- package/lib/cjs/src/maps/MapArea/types.js +0 -2
- package/lib/cjs/src/maps/MapArea/utils.js +0 -601
- package/lib/cjs/src/maps/index.js +0 -17
- package/lib/cjs/src/monitoring/index.js +0 -17
- package/lib/cjs/src/monitoring/online/index.js +0 -17
- package/lib/cjs/src/monitoring/online/service.js +0 -117
- package/lib/cjs/src/ride/base/base.js +0 -231
- package/lib/cjs/src/ride/base/index.js +0 -17
- package/lib/cjs/src/ride/base/types.js +0 -2
- package/lib/cjs/src/ride/display/index.js +0 -17
- package/lib/cjs/src/ride/display/service.js +0 -1139
- package/lib/cjs/src/ride/index.js +0 -19
- package/lib/cjs/src/ride/page/index.js +0 -17
- package/lib/cjs/src/ride/page/service.js +0 -380
- package/lib/cjs/src/ride/page/types.js +0 -2
- package/lib/cjs/src/ride/route/FollowRouteDisplayService.js +0 -36
- package/lib/cjs/src/ride/route/FreeRideDisplayService.js +0 -602
- package/lib/cjs/src/ride/route/GpxDisplayService.js +0 -322
- package/lib/cjs/src/ride/route/RLVDisplayService.js +0 -591
- package/lib/cjs/src/ride/route/RouteDisplayService.js +0 -419
- package/lib/cjs/src/ride/route/types.js +0 -2
- package/lib/cjs/src/ride/types.js +0 -2
- package/lib/cjs/src/ride/workout/WorkoutDisplayService.js +0 -97
- package/lib/cjs/src/routes/base/api/consts.js +0 -12
- package/lib/cjs/src/routes/base/api/index.js +0 -158
- package/lib/cjs/src/routes/base/api/types.js +0 -2
- package/lib/cjs/src/routes/base/model/route.js +0 -120
- package/lib/cjs/src/routes/base/model/tacx.js +0 -31
- package/lib/cjs/src/routes/base/model/types.js +0 -2
- package/lib/cjs/src/routes/base/parsers/bikelab.js +0 -107
- package/lib/cjs/src/routes/base/parsers/epm.js +0 -247
- package/lib/cjs/src/routes/base/parsers/factory.js +0 -54
- package/lib/cjs/src/routes/base/parsers/geometry.js +0 -133
- package/lib/cjs/src/routes/base/parsers/gpx.js +0 -220
- package/lib/cjs/src/routes/base/parsers/incyclist.js +0 -194
- package/lib/cjs/src/routes/base/parsers/index.js +0 -69
- package/lib/cjs/src/routes/base/parsers/kwt.js +0 -8
- package/lib/cjs/src/routes/base/parsers/multixml.js +0 -46
- package/lib/cjs/src/routes/base/parsers/tacx/TacxParser.js +0 -332
- package/lib/cjs/src/routes/base/parsers/tacx/TacxReader.js +0 -83
- package/lib/cjs/src/routes/base/parsers/tacx/pgmf.js +0 -69
- package/lib/cjs/src/routes/base/parsers/tacx/rlv.js +0 -84
- package/lib/cjs/src/routes/base/parsers/types.js +0 -2
- package/lib/cjs/src/routes/base/parsers/utils.js +0 -245
- package/lib/cjs/src/routes/base/parsers/xml.js +0 -358
- package/lib/cjs/src/routes/base/types/index.js +0 -3
- package/lib/cjs/src/routes/base/utils/index.js +0 -17
- package/lib/cjs/src/routes/base/utils/localization.js +0 -40
- package/lib/cjs/src/routes/base/utils/points.js +0 -304
- package/lib/cjs/src/routes/base/utils/route.js +0 -585
- package/lib/cjs/src/routes/download/service.js +0 -260
- package/lib/cjs/src/routes/download/types.js +0 -19
- package/lib/cjs/src/routes/free-ride/index.js +0 -17
- package/lib/cjs/src/routes/free-ride/service.js +0 -552
- package/lib/cjs/src/routes/index.js +0 -21
- package/lib/cjs/src/routes/library/service.js +0 -639
- package/lib/cjs/src/routes/library/types.js +0 -2
- package/lib/cjs/src/routes/list/RouteListObserver.js +0 -22
- package/lib/cjs/src/routes/list/cards/ActiveImportCard.js +0 -88
- package/lib/cjs/src/routes/list/cards/FreeRideCard.js +0 -118
- package/lib/cjs/src/routes/list/cards/RouteCard.js +0 -917
- package/lib/cjs/src/routes/list/cards/RouteImportCard.js +0 -40
- package/lib/cjs/src/routes/list/cards/base.js +0 -72
- package/lib/cjs/src/routes/list/cards/types.js +0 -2
- package/lib/cjs/src/routes/list/index.js +0 -17
- package/lib/cjs/src/routes/list/lists/alternatives.js +0 -42
- package/lib/cjs/src/routes/list/lists/myroutes.js +0 -59
- package/lib/cjs/src/routes/list/lists/selected.js +0 -39
- package/lib/cjs/src/routes/list/loaders/DBLoader.js +0 -51
- package/lib/cjs/src/routes/list/loaders/LegacyDB.js +0 -141
- package/lib/cjs/src/routes/list/loaders/StravaActivityLoader.js +0 -287
- package/lib/cjs/src/routes/list/loaders/api.js +0 -224
- package/lib/cjs/src/routes/list/loaders/db.js +0 -343
- package/lib/cjs/src/routes/list/loaders/types.js +0 -118
- package/lib/cjs/src/routes/list/service.js +0 -1367
- package/lib/cjs/src/routes/list/types.js +0 -2
- package/lib/cjs/src/routes/list/utils.js +0 -42
- package/lib/cjs/src/routes/page/index.js +0 -17
- package/lib/cjs/src/routes/page/service.js +0 -461
- package/lib/cjs/src/routes/page/types.js +0 -2
- package/lib/cjs/src/routes/sync/factory.js +0 -122
- package/lib/cjs/src/routes/sync/index.js +0 -18
- package/lib/cjs/src/routes/sync/komoot/provider.js +0 -365
- package/lib/cjs/src/routes/sync/types.js +0 -2
- package/lib/cjs/src/routes/types.js +0 -2
- package/lib/cjs/src/services/index.js +0 -17
- package/lib/cjs/src/services/overpass/index.js +0 -17
- package/lib/cjs/src/services/overpass/overpass.js +0 -216
- package/lib/cjs/src/settings/bindings/index.js +0 -17
- package/lib/cjs/src/settings/bindings/json.js +0 -104
- package/lib/cjs/src/settings/bindings/types.js +0 -9
- package/lib/cjs/src/settings/display/index.js +0 -18
- package/lib/cjs/src/settings/display/support/index.js +0 -17
- package/lib/cjs/src/settings/display/support/types.js +0 -2
- package/lib/cjs/src/settings/display/user/index.js +0 -18
- package/lib/cjs/src/settings/display/user/service.js +0 -161
- package/lib/cjs/src/settings/display/user/types.js +0 -2
- package/lib/cjs/src/settings/index.js +0 -18
- package/lib/cjs/src/settings/service/index.js +0 -17
- package/lib/cjs/src/settings/service/mock.js +0 -36
- package/lib/cjs/src/settings/service/service.js +0 -237
- package/lib/cjs/src/settings/types.js +0 -2
- package/lib/cjs/src/types.js +0 -2
- package/lib/cjs/src/ui/index.js +0 -17
- package/lib/cjs/src/ui/service.js +0 -508
- package/lib/cjs/src/ui/types.js +0 -2
- package/lib/cjs/src/utils/calc.js +0 -39
- package/lib/cjs/src/utils/clone.js +0 -8
- package/lib/cjs/src/utils/fileinfo.js +0 -13
- package/lib/cjs/src/utils/formatting.js +0 -81
- package/lib/cjs/src/utils/geo.js +0 -141
- package/lib/cjs/src/utils/index.js +0 -49
- package/lib/cjs/src/utils/logging.js +0 -21
- package/lib/cjs/src/utils/math.js +0 -36
- package/lib/cjs/src/utils/merge.js +0 -29
- package/lib/cjs/src/utils/nextTick.js +0 -5
- package/lib/cjs/src/utils/sleep.js +0 -5
- package/lib/cjs/src/utils/string.js +0 -8
- package/lib/cjs/src/utils/time.js +0 -27
- package/lib/cjs/src/utils/valid.js +0 -14
- package/lib/cjs/src/utils/vector.js +0 -204
- package/lib/cjs/src/utils/xml.js +0 -112
- package/lib/cjs/src/video/VideoConversion.js +0 -170
- package/lib/cjs/src/video/VideoSyncHelper.js +0 -665
- package/lib/cjs/src/video/index.js +0 -19
- package/lib/cjs/src/video/types.js +0 -2
- package/lib/cjs/src/workouts/base/api/consts.js +0 -12
- package/lib/cjs/src/workouts/base/api/index.js +0 -130
- package/lib/cjs/src/workouts/base/model/Segment.js +0 -141
- package/lib/cjs/src/workouts/base/model/Step.js +0 -165
- package/lib/cjs/src/workouts/base/model/Workout.js +0 -114
- package/lib/cjs/src/workouts/base/model/index.js +0 -20
- package/lib/cjs/src/workouts/base/model/types.js +0 -2
- package/lib/cjs/src/workouts/base/parsers/factory.js +0 -90
- package/lib/cjs/src/workouts/base/parsers/incyclist/Json.js +0 -62
- package/lib/cjs/src/workouts/base/parsers/index.js +0 -39
- package/lib/cjs/src/workouts/base/parsers/intervals/parser.js +0 -297
- package/lib/cjs/src/workouts/base/parsers/intervals/types.js +0 -9
- package/lib/cjs/src/workouts/base/parsers/types.js +0 -2
- package/lib/cjs/src/workouts/base/parsers/zwo/zwo.js +0 -254
- package/lib/cjs/src/workouts/calendar/index.js +0 -19
- package/lib/cjs/src/workouts/calendar/service.js +0 -359
- package/lib/cjs/src/workouts/calendar/sync/factory.js +0 -127
- package/lib/cjs/src/workouts/calendar/sync/index.js +0 -18
- package/lib/cjs/src/workouts/calendar/sync/intervals/provider.js +0 -211
- package/lib/cjs/src/workouts/calendar/sync/types.js +0 -2
- package/lib/cjs/src/workouts/calendar/types.js +0 -2
- package/lib/cjs/src/workouts/index.js +0 -19
- package/lib/cjs/src/workouts/list/cards/ActiveImportCard.js +0 -72
- package/lib/cjs/src/workouts/list/cards/ScheduledWorkoutCard.js +0 -42
- package/lib/cjs/src/workouts/list/cards/WorkoutCard.js +0 -287
- package/lib/cjs/src/workouts/list/cards/WorkoutCreateCard.js +0 -99
- package/lib/cjs/src/workouts/list/cards/WorkoutImportCard.js +0 -41
- package/lib/cjs/src/workouts/list/cards/base.js +0 -58
- package/lib/cjs/src/workouts/list/cards/index.js +0 -20
- package/lib/cjs/src/workouts/list/cards/types.js +0 -9
- package/lib/cjs/src/workouts/list/index.js +0 -18
- package/lib/cjs/src/workouts/list/loaders/api.js +0 -50
- package/lib/cjs/src/workouts/list/loaders/db.js +0 -188
- package/lib/cjs/src/workouts/list/loaders/loader.js +0 -21
- package/lib/cjs/src/workouts/list/service.js +0 -663
- package/lib/cjs/src/workouts/list/types.js +0 -2
- package/lib/cjs/src/workouts/ride/index.js +0 -18
- package/lib/cjs/src/workouts/ride/service.js +0 -613
- package/lib/cjs/src/workouts/ride/types.js +0 -2
- package/lib/types/api/form/index.d.ts +0 -6
- /package/lib/cjs/{src/apps/intervals → settings/display/ride}/index.js +0 -0
- /package/lib/cjs/{src/activities/active-rides → settings/display/ride}/types.js +0 -0
- /package/lib/{cjs/src/activities/active-rides/sessions.js → esm/settings/display/gear/index.js} +0 -0
- /package/lib/esm/{api/form/index.js → settings/display/gear/types.js} +0 -0
|
@@ -181,7 +181,7 @@ let Activity = (() => {
|
|
|
181
181
|
try {
|
|
182
182
|
const converter = this.getActivityConverter();
|
|
183
183
|
const data = await converter.convert(this.details, format);
|
|
184
|
-
const fileName = this.
|
|
184
|
+
const fileName = await this.getExportFileName(format);
|
|
185
185
|
await fs.writeFile(fileName, Buffer.from(data));
|
|
186
186
|
this.details[`${format}FileName`] = fileName;
|
|
187
187
|
await this.save(true);
|
|
@@ -197,6 +197,18 @@ let Activity = (() => {
|
|
|
197
197
|
}
|
|
198
198
|
return success;
|
|
199
199
|
}
|
|
200
|
+
async getExportFileName(format) {
|
|
201
|
+
let fileName = this.details.fileName.replace('json', format);
|
|
202
|
+
if (fileName.startsWith('mmkv:/')) {
|
|
203
|
+
const fs = this.getBindings().fs;
|
|
204
|
+
const appDir = this.getBindings().appInfo.getAppDir();
|
|
205
|
+
const activitiesDir = this.getBindings().path.join(appDir, 'activities');
|
|
206
|
+
await fs.ensureDir(activitiesDir);
|
|
207
|
+
const baseName = fileName.split('/').pop();
|
|
208
|
+
fileName = this.getBindings().path.join(activitiesDir, baseName);
|
|
209
|
+
}
|
|
210
|
+
return fileName;
|
|
211
|
+
}
|
|
200
212
|
async upload(connectedApp, observer) {
|
|
201
213
|
let success = false;
|
|
202
214
|
let error;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
3
|
+
var useValue = arguments.length > 2;
|
|
4
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
5
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
6
|
+
}
|
|
7
|
+
return useValue ? value : void 0;
|
|
8
|
+
};
|
|
2
9
|
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
10
|
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
11
|
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
@@ -26,13 +33,6 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
|
|
|
26
33
|
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
34
|
done = true;
|
|
28
35
|
};
|
|
29
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
-
var useValue = arguments.length > 2;
|
|
31
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
-
}
|
|
34
|
-
return useValue ? value : void 0;
|
|
35
|
-
};
|
|
36
36
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
38
|
};
|
|
@@ -43,6 +43,9 @@ const types_1 = require("../../base/types");
|
|
|
43
43
|
const sleep_1 = require("../../utils/sleep");
|
|
44
44
|
const base_1 = require("../../apps/base/api/base");
|
|
45
45
|
const gd_eventlog_1 = require("gd-eventlog");
|
|
46
|
+
const decorators_1 = require("../../base/decorators");
|
|
47
|
+
const api_1 = require("../../api");
|
|
48
|
+
const settings_1 = require("../../settings");
|
|
46
49
|
const OVERPASS_URL_ALT1 = 'https://overpass.kumi.systems/api/interpreter';
|
|
47
50
|
const OVERPASS_URL_ALT2 = 'https://lz4.overpass-api.de/api/interpreter';
|
|
48
51
|
const OVERPASS_URL_ALT3 = 'https://z.overpass-api.de/api/interpreter';
|
|
@@ -53,16 +56,23 @@ let OverpassApi = (() => {
|
|
|
53
56
|
let _classExtraInitializers = [];
|
|
54
57
|
let _classThis;
|
|
55
58
|
let _classSuper = base_1.AppApiBase;
|
|
59
|
+
let _instanceExtraInitializers = [];
|
|
60
|
+
let _getUserSettings_decorators;
|
|
61
|
+
let _getBindings_decorators;
|
|
56
62
|
var OverpassApi = class extends _classSuper {
|
|
57
63
|
static { _classThis = this; }
|
|
58
64
|
static {
|
|
59
65
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
66
|
+
_getUserSettings_decorators = [decorators_1.Injectable];
|
|
67
|
+
_getBindings_decorators = [decorators_1.Injectable];
|
|
68
|
+
__esDecorate(this, null, _getUserSettings_decorators, { kind: "method", name: "getUserSettings", static: false, private: false, access: { has: obj => "getUserSettings" in obj, get: obj => obj.getUserSettings }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
69
|
+
__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);
|
|
60
70
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
61
71
|
OverpassApi = _classThis = _classDescriptor.value;
|
|
62
72
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
63
73
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
64
74
|
}
|
|
65
|
-
url;
|
|
75
|
+
url = __runInitializers(this, _instanceExtraInitializers);
|
|
66
76
|
mirrors = [];
|
|
67
77
|
logger;
|
|
68
78
|
constructor(props) {
|
|
@@ -76,6 +86,70 @@ let OverpassApi = (() => {
|
|
|
76
86
|
}
|
|
77
87
|
}
|
|
78
88
|
}
|
|
89
|
+
getOverpassHeaders() {
|
|
90
|
+
const version = this.getAppVersion();
|
|
91
|
+
const userId = this.getUserId();
|
|
92
|
+
let userAgent = `Incyclist/${version}`;
|
|
93
|
+
if (userId) {
|
|
94
|
+
try {
|
|
95
|
+
const crypto = this.getBindings()?.crypto;
|
|
96
|
+
const hashedId = crypto ? crypto.createHash('sha256').update('OAPI:' + userId).digest('hex').substring(0, 8) : undefined;
|
|
97
|
+
if (hashedId) {
|
|
98
|
+
userAgent += ` (${hashedId})`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch (err) {
|
|
102
|
+
this.logger.logEvent({ message: 'failed to hash userId', error: err.message });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
'User-Agent': userAgent,
|
|
107
|
+
'Referer': 'https://incyclist.com'
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
async post(url, data, conf) {
|
|
111
|
+
try {
|
|
112
|
+
const https = require('https');
|
|
113
|
+
return await this.postViaNodeHttps(https, url, data);
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
const cfg = conf ?? {};
|
|
117
|
+
const config = {
|
|
118
|
+
...cfg,
|
|
119
|
+
headers: this.getOverpassHeaders()
|
|
120
|
+
};
|
|
121
|
+
return await super.post(url, data, config);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
async postViaNodeHttps(https, url, data) {
|
|
125
|
+
return new Promise((resolve, reject) => {
|
|
126
|
+
const reqUrl = new URL(url);
|
|
127
|
+
const headers = this.getOverpassHeaders();
|
|
128
|
+
const queryData = typeof data === 'string' ? data : JSON.stringify(data);
|
|
129
|
+
const options = {
|
|
130
|
+
method: 'POST',
|
|
131
|
+
headers: {
|
|
132
|
+
...headers,
|
|
133
|
+
'Content-Length': Buffer.byteLength(queryData)
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const req = https.request(reqUrl, options, (res) => {
|
|
137
|
+
let body = '';
|
|
138
|
+
res.on('data', (chunk) => body += chunk);
|
|
139
|
+
res.on('end', () => {
|
|
140
|
+
resolve({
|
|
141
|
+
data: body,
|
|
142
|
+
status: res.statusCode,
|
|
143
|
+
statusText: res.statusMessage,
|
|
144
|
+
headers: res.headers
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
req.on('error', reject);
|
|
149
|
+
req.write(queryData);
|
|
150
|
+
req.end();
|
|
151
|
+
});
|
|
152
|
+
}
|
|
79
153
|
async query(queryOL, timeout) {
|
|
80
154
|
const ts = Date.now();
|
|
81
155
|
this.logger.logEvent({ message: 'query', queryOL, queryId: ts, timeout });
|
|
@@ -96,24 +170,102 @@ let OverpassApi = (() => {
|
|
|
96
170
|
getBaseUrl() {
|
|
97
171
|
return '';
|
|
98
172
|
}
|
|
173
|
+
extractErrorInfo(err, mirror) {
|
|
174
|
+
return {
|
|
175
|
+
mirror,
|
|
176
|
+
status: err?.response?.status,
|
|
177
|
+
statusText: err?.response?.statusText,
|
|
178
|
+
error: err?.message ?? 'overpass query failed'
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
logUnexpectedErrors(fn, errors) {
|
|
182
|
+
const unexpectedErrors = errors.filter(e => {
|
|
183
|
+
const status = e.status;
|
|
184
|
+
if (!status || status === 408 || status === 504)
|
|
185
|
+
return false;
|
|
186
|
+
return status >= 406 && status < 500;
|
|
187
|
+
});
|
|
188
|
+
if (unexpectedErrors.length > 0 && unexpectedErrors.length === errors.length) {
|
|
189
|
+
unexpectedErrors.forEach(err => {
|
|
190
|
+
this.logger.logEvent({
|
|
191
|
+
message: 'error',
|
|
192
|
+
fn,
|
|
193
|
+
mirror: err.mirror,
|
|
194
|
+
status: err.status,
|
|
195
|
+
statusText: err.statusText,
|
|
196
|
+
error: err.error ?? 'all mirrors failed with 4xx error'
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
99
201
|
async bulkQuery(query, timeout) {
|
|
202
|
+
const errors = [];
|
|
100
203
|
const promises = [];
|
|
101
204
|
this.mirrors.forEach(mirror => {
|
|
102
|
-
promises.push(this.post(mirror, query)
|
|
205
|
+
promises.push(this.post(mirror, query)
|
|
206
|
+
.then((res) => res?.data)
|
|
207
|
+
.catch(err => {
|
|
208
|
+
errors.push(this.extractErrorInfo(err, mirror));
|
|
209
|
+
throw err;
|
|
210
|
+
}));
|
|
103
211
|
});
|
|
104
212
|
if (timeout !== undefined && timeout !== null) {
|
|
105
213
|
promises.push((0, sleep_1.sleep)(timeout).then(() => 'timeout'));
|
|
106
214
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
215
|
+
try {
|
|
216
|
+
const res = await (0, promise_any_1.default)(promises);
|
|
217
|
+
if (res === 'timeout') {
|
|
218
|
+
return undefined;
|
|
219
|
+
}
|
|
220
|
+
return res;
|
|
221
|
+
}
|
|
222
|
+
catch (err) {
|
|
223
|
+
this.logUnexpectedErrors('bulkQuery', errors);
|
|
224
|
+
throw err;
|
|
110
225
|
}
|
|
111
|
-
|
|
226
|
+
}
|
|
227
|
+
async sequentialQuery(query, timeout) {
|
|
228
|
+
const startTime = Date.now();
|
|
229
|
+
const errors = [];
|
|
230
|
+
let lastError;
|
|
231
|
+
for (const mirror of this.mirrors) {
|
|
232
|
+
if (timeout !== undefined && timeout !== null) {
|
|
233
|
+
const elapsed = Date.now() - startTime;
|
|
234
|
+
if (elapsed >= timeout) {
|
|
235
|
+
return undefined;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
try {
|
|
239
|
+
const res = await this.post(mirror, query);
|
|
240
|
+
return res?.data;
|
|
241
|
+
}
|
|
242
|
+
catch (err) {
|
|
243
|
+
lastError = err;
|
|
244
|
+
errors.push(this.extractErrorInfo(err, mirror));
|
|
245
|
+
if (mirror !== this.mirrors[this.mirrors.length - 1]) {
|
|
246
|
+
await (0, sleep_1.sleep)(100);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
this.logUnexpectedErrors('sequentialQuery', errors);
|
|
251
|
+
throw lastError;
|
|
112
252
|
}
|
|
113
253
|
reset() {
|
|
114
254
|
this.mirrors = [OVERPASS_URL_ALT1, OVERPASS_URL_ALT2, OVERPASS_URL_ALT3];
|
|
115
255
|
this.url = this.mirrors[0];
|
|
116
256
|
}
|
|
257
|
+
getAppVersion() {
|
|
258
|
+
return this.getBindings()?.appInfo?.getAppVersion() ?? '';
|
|
259
|
+
}
|
|
260
|
+
getUserId() {
|
|
261
|
+
return this.getUserSettings().getValue('uuid', '');
|
|
262
|
+
}
|
|
263
|
+
getUserSettings() {
|
|
264
|
+
return (0, settings_1.useUserSettings)();
|
|
265
|
+
}
|
|
266
|
+
getBindings() {
|
|
267
|
+
return (0, api_1.getBindings)();
|
|
268
|
+
}
|
|
117
269
|
};
|
|
118
270
|
return OverpassApi = _classThis;
|
|
119
271
|
})();
|
|
@@ -34,19 +34,13 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
|
|
|
34
34
|
done = true;
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.
|
|
37
|
+
exports.useRideSettingsDisplay = exports.RideSettingsDisplayService = void 0;
|
|
38
38
|
const api_1 = require("../../../api");
|
|
39
39
|
const decorators_1 = require("../../../base/decorators");
|
|
40
40
|
const service_1 = require("../../../base/service");
|
|
41
41
|
const types_1 = require("../../../base/types");
|
|
42
42
|
const service_2 = require("../../service");
|
|
43
|
-
|
|
44
|
-
const DEFAULT_SLACK_URL = 'https://join.slack.com/t/incyclist/shared_invite/zt-119wcvtjn-uiZ_Pw6gh5WLc0zT8jkfTg';
|
|
45
|
-
const DEFAULT_STRAVA_URL = 'https://www.strava.com/clubs/1029407';
|
|
46
|
-
const DEFAULT_EMAIL = 'support@incyclist.com';
|
|
47
|
-
const DEFAULT_GITHUB_URL = 'https://github.com/incyclist';
|
|
48
|
-
const DEFAULT_DONATION_URL = 'https://www.paypal.com/paypalme/incyclist';
|
|
49
|
-
let SupportSettingsDisplayService = (() => {
|
|
43
|
+
let RideSettingsDisplayService = (() => {
|
|
50
44
|
let _classDecorators = [decorators_1.Singleton];
|
|
51
45
|
let _classDescriptor;
|
|
52
46
|
let _classExtraInitializers = [];
|
|
@@ -55,7 +49,7 @@ let SupportSettingsDisplayService = (() => {
|
|
|
55
49
|
let _instanceExtraInitializers = [];
|
|
56
50
|
let _getUserSettings_decorators;
|
|
57
51
|
let _getBindings_decorators;
|
|
58
|
-
var
|
|
52
|
+
var RideSettingsDisplayService = class extends _classSuper {
|
|
59
53
|
static { _classThis = this; }
|
|
60
54
|
static {
|
|
61
55
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
@@ -64,14 +58,13 @@ let SupportSettingsDisplayService = (() => {
|
|
|
64
58
|
__esDecorate(this, null, _getUserSettings_decorators, { kind: "method", name: "getUserSettings", static: false, private: false, access: { has: obj => "getUserSettings" in obj, get: obj => obj.getUserSettings }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
65
59
|
__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);
|
|
66
60
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
67
|
-
|
|
61
|
+
RideSettingsDisplayService = _classThis = _classDescriptor.value;
|
|
68
62
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
69
63
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
70
64
|
}
|
|
71
|
-
|
|
72
|
-
observer;
|
|
65
|
+
observer = __runInitializers(this, _instanceExtraInitializers);
|
|
73
66
|
constructor() {
|
|
74
|
-
super('
|
|
67
|
+
super('GearSettings');
|
|
75
68
|
}
|
|
76
69
|
open() {
|
|
77
70
|
if (this.observer)
|
|
@@ -85,21 +78,45 @@ let SupportSettingsDisplayService = (() => {
|
|
|
85
78
|
}
|
|
86
79
|
getDisplayProps() {
|
|
87
80
|
return {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
uiVersion: this.getAppInfo().getUIVersion(),
|
|
91
|
-
privacyUrl: process.env.PRIVACY_URL ?? DEFAULT_PRIVACY_URL,
|
|
92
|
-
supportUrls: [
|
|
93
|
-
{ label: 'Slack', text: 'Incyclist Slack Workspace', url: process.env.PRIVACY_URL ?? DEFAULT_SLACK_URL },
|
|
94
|
-
{ label: 'Strava', text: 'Incyclist Strava Club', url: process.env.PRIVACY_URL ?? DEFAULT_STRAVA_URL },
|
|
95
|
-
{ label: 'Email', text: process.env.SUPPORT_EMAIL ?? DEFAULT_EMAIL, url: `mailto:${process.env.SUPPORT_EMAIL ?? DEFAULT_EMAIL}` },
|
|
96
|
-
],
|
|
97
|
-
gitHubUrl: process.env.GITHUB_URL ?? DEFAULT_GITHUB_URL,
|
|
98
|
-
donationUrl: process.env.DONATION_URL ?? DEFAULT_DONATION_URL
|
|
81
|
+
rideView: this.getRideView(),
|
|
82
|
+
rideViewOptions: this.getRideViewOptions()
|
|
99
83
|
};
|
|
100
84
|
}
|
|
101
|
-
|
|
102
|
-
|
|
85
|
+
setRideView(rideView) {
|
|
86
|
+
try {
|
|
87
|
+
this.getUserSettings().get('preferences.rideView', rideView);
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
this.logError(err, 'setRideView');
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
emitChanged() {
|
|
94
|
+
if (this.observer)
|
|
95
|
+
this.observer.emit('changed', this.getDisplayProps());
|
|
96
|
+
}
|
|
97
|
+
getRideView() {
|
|
98
|
+
if (this.isMobile() && !this.isAndroid())
|
|
99
|
+
return 'map';
|
|
100
|
+
const rideView = this.getUserSettings().get('preferences.rideView', 'sv');
|
|
101
|
+
return rideView;
|
|
102
|
+
}
|
|
103
|
+
getRideViewOptions() {
|
|
104
|
+
const map = new Map();
|
|
105
|
+
if (!this.isIOS())
|
|
106
|
+
map.set('sv', 'Street View');
|
|
107
|
+
map.set('map', 'Map');
|
|
108
|
+
if (!this.isMobile())
|
|
109
|
+
map.set('sat', 'Satellite View');
|
|
110
|
+
return map;
|
|
111
|
+
}
|
|
112
|
+
isMobile() {
|
|
113
|
+
return this.getBindings().appInfo?.getChannel() === 'mobile';
|
|
114
|
+
}
|
|
115
|
+
isAndroid() {
|
|
116
|
+
return this.getBindings().appInfo?.getOS()?.platform === 'android';
|
|
117
|
+
}
|
|
118
|
+
isIOS() {
|
|
119
|
+
return this.getBindings().appInfo?.getOS()?.platform === 'darwin';
|
|
103
120
|
}
|
|
104
121
|
getUserSettings() {
|
|
105
122
|
return (0, service_2.useUserSettings)();
|
|
@@ -108,8 +125,8 @@ let SupportSettingsDisplayService = (() => {
|
|
|
108
125
|
return (0, api_1.getBindings)();
|
|
109
126
|
}
|
|
110
127
|
};
|
|
111
|
-
return
|
|
128
|
+
return RideSettingsDisplayService = _classThis;
|
|
112
129
|
})();
|
|
113
|
-
exports.
|
|
114
|
-
const
|
|
115
|
-
exports.
|
|
130
|
+
exports.RideSettingsDisplayService = RideSettingsDisplayService;
|
|
131
|
+
const useRideSettingsDisplay = () => new RideSettingsDisplayService();
|
|
132
|
+
exports.useRideSettingsDisplay = useRideSettingsDisplay;
|
|
@@ -224,7 +224,7 @@ class ZwoParser {
|
|
|
224
224
|
}
|
|
225
225
|
try {
|
|
226
226
|
this.context = {};
|
|
227
|
-
const zwoSteps = result.workout_file.workout[0].$$ ?? [];
|
|
227
|
+
const zwoSteps = result.workout_file.workout?.[0].$$ ?? [];
|
|
228
228
|
const ftpOverride = result.workout_file.ftpOverride?.[0] ?? -1;
|
|
229
229
|
if (ftpOverride !== -1) {
|
|
230
230
|
this.context.ftpOverride = Number(ftpOverride);
|
|
@@ -244,7 +244,7 @@ class ZwoParser {
|
|
|
244
244
|
resolve(workout);
|
|
245
245
|
}
|
|
246
246
|
catch (err) {
|
|
247
|
-
this.logger.logEvent({ message: 'error', fn: 'parse()', error: err.message, tag, stack: err.stack });
|
|
247
|
+
this.logger.logEvent({ message: 'error', fn: 'parse()', error: err.message, tag, stack: err.stack, zwo: data });
|
|
248
248
|
reject(new Error(`parsing error: ${err.message}`));
|
|
249
249
|
}
|
|
250
250
|
});
|
|
@@ -178,7 +178,7 @@ let Activity = (() => {
|
|
|
178
178
|
try {
|
|
179
179
|
const converter = this.getActivityConverter();
|
|
180
180
|
const data = await converter.convert(this.details, format);
|
|
181
|
-
const fileName = this.
|
|
181
|
+
const fileName = await this.getExportFileName(format);
|
|
182
182
|
await fs.writeFile(fileName, Buffer.from(data));
|
|
183
183
|
this.details[`${format}FileName`] = fileName;
|
|
184
184
|
await this.save(true);
|
|
@@ -194,6 +194,18 @@ let Activity = (() => {
|
|
|
194
194
|
}
|
|
195
195
|
return success;
|
|
196
196
|
}
|
|
197
|
+
async getExportFileName(format) {
|
|
198
|
+
let fileName = this.details.fileName.replace('json', format);
|
|
199
|
+
if (fileName.startsWith('mmkv:/')) {
|
|
200
|
+
const fs = this.getBindings().fs;
|
|
201
|
+
const appDir = this.getBindings().appInfo.getAppDir();
|
|
202
|
+
const activitiesDir = this.getBindings().path.join(appDir, 'activities');
|
|
203
|
+
await fs.ensureDir(activitiesDir);
|
|
204
|
+
const baseName = fileName.split('/').pop();
|
|
205
|
+
fileName = this.getBindings().path.join(activitiesDir, baseName);
|
|
206
|
+
}
|
|
207
|
+
return fileName;
|
|
208
|
+
}
|
|
197
209
|
async upload(connectedApp, observer) {
|
|
198
210
|
let success = false;
|
|
199
211
|
let error;
|