incyclist-services 1.7.42 → 1.7.44
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/list/service.js +7 -7
- package/lib/cjs/activities/list/utils.js +35 -3
- package/lib/cjs/activities/page/service.js +12 -4
- package/lib/cjs/activities/ride/service.js +0 -1
- package/lib/cjs/devices/ride/service.js +1 -1
- package/lib/cjs/routes/download/service.js +205 -148
- package/lib/cjs/routes/page/service.js +73 -2
- package/lib/esm/activities/list/service.js +4 -4
- package/lib/esm/activities/list/utils.js +32 -1
- package/lib/esm/activities/page/service.js +12 -4
- package/lib/esm/activities/ride/service.js +0 -1
- package/lib/esm/devices/ride/service.js +1 -1
- package/lib/esm/routes/download/service.js +204 -147
- package/lib/esm/routes/page/service.js +73 -2
- package/lib/esm/src/activities/active-rides/index.js +2 -0
- package/lib/esm/src/activities/active-rides/mq.js +187 -0
- package/lib/esm/src/activities/active-rides/service.js +870 -0
- package/lib/esm/src/activities/active-rides/sessions.js +1 -0
- package/lib/esm/src/activities/active-rides/types.js +1 -0
- package/lib/esm/src/activities/base/api/active-rides/api.js +118 -0
- package/lib/esm/src/activities/base/api/active-rides/index.js +2 -0
- package/lib/esm/src/activities/base/api/active-rides/types.js +1 -0
- package/lib/esm/src/activities/base/api/fitconvert/consts.js +2 -0
- package/lib/esm/src/activities/base/api/fitconvert/fitconvert.js +94 -0
- package/lib/esm/src/activities/base/api/fitconvert/index.js +1 -0
- package/lib/esm/src/activities/base/api/index.js +1 -0
- package/lib/esm/src/activities/base/convert/converter.js +17 -0
- package/lib/esm/src/activities/base/convert/factory.js +72 -0
- package/lib/esm/src/activities/base/convert/fit/index.js +1 -0
- package/lib/esm/src/activities/base/convert/fit/remote-fit.js +51 -0
- package/lib/esm/src/activities/base/convert/index.js +4 -0
- package/lib/esm/src/activities/base/convert/tcx/index.js +1 -0
- package/lib/esm/src/activities/base/convert/tcx/tcx.js +197 -0
- package/lib/esm/src/activities/base/convert/tcx/types.js +1 -0
- package/lib/esm/src/activities/base/convert/types.js +5 -0
- package/lib/esm/src/activities/base/index.js +5 -0
- package/lib/esm/src/activities/base/model/index.js +1 -0
- package/lib/esm/src/activities/base/repo/db.js +518 -0
- package/lib/esm/src/activities/base/repo/index.js +2 -0
- package/lib/esm/src/activities/base/repo/migration/factory.js +21 -0
- package/lib/esm/src/activities/base/repo/migration/types.js +13 -0
- package/lib/esm/src/activities/base/repo/migration/v0.js +14 -0
- package/lib/esm/src/activities/base/repo/migration/v1.js +15 -0
- package/lib/esm/src/activities/base/repo/migration/v2.js +7 -0
- package/lib/esm/src/activities/base/repo/migration/v3.js +23 -0
- package/lib/esm/src/activities/base/repo/types.js +1 -0
- package/lib/esm/src/activities/base/utils/activity.js +324 -0
- package/lib/esm/src/activities/base/utils/helpers.js +46 -0
- package/lib/esm/src/activities/base/utils/index.js +2 -0
- package/lib/esm/src/activities/index.js +6 -0
- package/lib/esm/src/activities/list/index.js +2 -0
- package/lib/esm/src/activities/list/service.js +458 -0
- package/lib/esm/src/activities/list/types.js +1 -0
- package/lib/esm/src/activities/list/utils.js +81 -0
- package/lib/esm/src/activities/page/index.js +1 -0
- package/lib/esm/src/activities/page/service.js +173 -0
- package/lib/esm/src/activities/page/types.js +1 -0
- package/lib/esm/src/activities/ride/duration.js +136 -0
- package/lib/esm/src/activities/ride/index.js +1 -0
- package/lib/esm/src/activities/ride/service.js +1284 -0
- package/lib/esm/src/activities/ride/stats.js +189 -0
- package/lib/esm/src/activities/ride/types.js +1 -0
- package/lib/esm/src/activities/types.js +2 -0
- package/lib/esm/src/activities/upload/factory.js +90 -0
- package/lib/esm/src/activities/upload/index.js +5 -0
- package/lib/esm/src/activities/upload/intervals.js +141 -0
- package/lib/esm/src/activities/upload/strava.js +151 -0
- package/lib/esm/src/activities/upload/types.js +1 -0
- package/lib/esm/src/activities/upload/velohero.js +133 -0
- package/lib/esm/src/api/appInfo/index.js +1 -0
- package/lib/esm/src/api/bindings/index.js +74 -0
- package/lib/esm/src/api/bindings/types.js +1 -0
- package/lib/esm/src/api/crypto/types.js +1 -0
- package/lib/esm/src/api/download/index.js +1 -0
- package/lib/esm/src/api/form/types.js +1 -0
- package/lib/esm/src/api/fs/index.js +1 -0
- package/lib/esm/src/api/index.js +4 -0
- package/lib/esm/src/api/logging/types.js +1 -0
- package/lib/esm/src/api/mq/index.js +1 -0
- package/lib/esm/src/api/path/index.js +18 -0
- package/lib/esm/src/api/repository/index.js +3 -0
- package/lib/esm/src/api/repository/json/index.js +90 -0
- package/lib/esm/src/api/repository/types.js +1 -0
- package/lib/esm/src/api/rest/RestApiClient.js +12 -0
- package/lib/esm/src/api/rest/api.js +64 -0
- package/lib/esm/src/api/rest/incyclist.js +32 -0
- package/lib/esm/src/api/rest/index.js +3 -0
- package/lib/esm/src/api/rest/types.js +1 -0
- package/lib/esm/src/api/secret/index.js +1 -0
- package/lib/esm/src/api/serial/types.js +1 -0
- package/lib/esm/src/api/types.js +1 -0
- package/lib/esm/src/api/ui/index.js +1 -0
- package/lib/esm/src/api/video/index.js +1 -0
- package/lib/esm/src/apps/base/api/base.js +58 -0
- package/lib/esm/src/apps/base/api/index.js +4 -0
- package/lib/esm/src/apps/base/api/intervals/api.js +127 -0
- package/lib/esm/src/apps/base/api/intervals/index.js +2 -0
- package/lib/esm/src/apps/base/api/intervals/types.js +11 -0
- package/lib/esm/src/apps/base/api/komoot/api.js +137 -0
- package/lib/esm/src/apps/base/api/komoot/index.js +2 -0
- package/lib/esm/src/apps/base/api/komoot/types.js +1 -0
- package/lib/esm/src/apps/base/api/strava/api.js +217 -0
- package/lib/esm/src/apps/base/api/strava/index.js +2 -0
- package/lib/esm/src/apps/base/api/strava/types.js +7 -0
- package/lib/esm/src/apps/base/api/velohero/api.js +80 -0
- package/lib/esm/src/apps/base/api/velohero/index.js +2 -0
- package/lib/esm/src/apps/base/api/velohero/types.js +1 -0
- package/lib/esm/src/apps/base/app/index.js +104 -0
- package/lib/esm/src/apps/base/index.js +3 -0
- package/lib/esm/src/apps/base/types.js +1 -0
- package/lib/esm/src/apps/googleMaps/index.js +1 -0
- package/lib/esm/src/apps/googleMaps/service.js +121 -0
- package/lib/esm/src/apps/index.js +5 -0
- package/lib/esm/src/apps/intervals/IntervalsAppConnection.js +183 -0
- package/lib/esm/src/apps/intervals/index.js +1 -0
- package/lib/esm/src/apps/intervals/types.js +1 -0
- package/lib/esm/src/apps/komoot/KomootAppConnection.js +245 -0
- package/lib/esm/src/apps/komoot/index.js +2 -0
- package/lib/esm/src/apps/komoot/types.js +1 -0
- package/lib/esm/src/apps/service.js +188 -0
- package/lib/esm/src/apps/strava/StravaAppConnection.js +190 -0
- package/lib/esm/src/apps/strava/index.js +2 -0
- package/lib/esm/src/apps/strava/types.js +1 -0
- package/lib/esm/src/apps/types.js +1 -0
- package/lib/esm/src/apps/velohero/VeloHeroAppConnection.js +229 -0
- package/lib/esm/src/apps/velohero/index.js +2 -0
- package/lib/esm/src/apps/velohero/types.js +1 -0
- package/lib/esm/src/appstate/index.js +2 -0
- package/lib/esm/src/appstate/service.js +106 -0
- package/lib/esm/src/appstate/types.js +1 -0
- package/lib/esm/src/autoupdate/api.js +176 -0
- package/lib/esm/src/autoupdate/autoupdate.js +21 -0
- package/lib/esm/src/autoupdate/index.js +2 -0
- package/lib/esm/src/avatars/index.js +2 -0
- package/lib/esm/src/avatars/service.js +134 -0
- package/lib/esm/src/avatars/types.js +1 -0
- package/lib/esm/src/base/cardlist/index.js +39 -0
- package/lib/esm/src/base/cardlist/types.js +1 -0
- package/lib/esm/src/base/decorators/Injection.js +23 -0
- package/lib/esm/src/base/decorators/index.js +2 -0
- package/lib/esm/src/base/pages/index.js +1 -0
- package/lib/esm/src/base/pages/service.js +124 -0
- package/lib/esm/src/base/pages/types.js +1 -0
- package/lib/esm/src/base/service.js +32 -0
- package/lib/esm/src/base/typedefs.js +1 -0
- package/lib/esm/src/base/types/index.js +3 -0
- package/lib/esm/src/base/types/lists.js +18 -0
- package/lib/esm/src/base/types/observer.js +75 -0
- package/lib/esm/src/base/types/singleton.js +20 -0
- package/lib/esm/src/coaches/coach.js +161 -0
- package/lib/esm/src/coaches/index.js +3 -0
- package/lib/esm/src/coaches/service.js +294 -0
- package/lib/esm/src/coaches/types.js +1 -0
- package/lib/esm/src/devices/access/index.js +2 -0
- package/lib/esm/src/devices/access/model.js +1 -0
- package/lib/esm/src/devices/access/service.js +512 -0
- package/lib/esm/src/devices/configuration/index.js +2 -0
- package/lib/esm/src/devices/configuration/model/app/index.js +1 -0
- package/lib/esm/src/devices/configuration/model/index.js +3 -0
- package/lib/esm/src/devices/configuration/model/repository/index.js +1 -0
- package/lib/esm/src/devices/configuration/model/repository/legacy.js +1 -0
- package/lib/esm/src/devices/configuration/model/service/index.js +1 -0
- package/lib/esm/src/devices/configuration/service.js +993 -0
- package/lib/esm/src/devices/configuration/types.js +1 -0
- package/lib/esm/src/devices/index.js +5 -0
- package/lib/esm/src/devices/page/index.js +1 -0
- package/lib/esm/src/devices/page/logobserver.js +15 -0
- package/lib/esm/src/devices/page/service.js +410 -0
- package/lib/esm/src/devices/page/statemachine.js +335 -0
- package/lib/esm/src/devices/page/types.js +1 -0
- package/lib/esm/src/devices/pairing/index.js +2 -0
- package/lib/esm/src/devices/pairing/model.js +1 -0
- package/lib/esm/src/devices/pairing/service.js +1496 -0
- package/lib/esm/src/devices/ride/index.js +1 -0
- package/lib/esm/src/devices/ride/service.js +1373 -0
- package/lib/esm/src/devices/ride/types.js +1 -0
- package/lib/esm/src/devices/types.js +1 -0
- package/lib/esm/src/i18n/countries/countries.json +255 -0
- package/lib/esm/src/i18n/countries/index.js +115 -0
- package/lib/esm/src/i18n/countries/model.js +1 -0
- package/lib/esm/src/i18n/index.js +3 -0
- package/lib/esm/src/i18n/localization/index.js +2 -0
- package/lib/esm/src/i18n/localization/service.js +125 -0
- package/lib/esm/src/i18n/localization/types.js +1 -0
- package/lib/esm/src/i18n/units/converter.js +172 -0
- package/lib/esm/src/i18n/units/index.js +2 -0
- package/lib/esm/src/i18n/units/types.js +1 -0
- package/lib/esm/src/index.js +22 -0
- package/lib/esm/src/maps/MapArea/MapArea.js +396 -0
- package/lib/esm/src/maps/MapArea/consts.js +8 -0
- package/lib/esm/src/maps/MapArea/index.js +3 -0
- package/lib/esm/src/maps/MapArea/options.js +402 -0
- package/lib/esm/src/maps/MapArea/service.js +276 -0
- package/lib/esm/src/maps/MapArea/types.js +1 -0
- package/lib/esm/src/maps/MapArea/utils.js +563 -0
- package/lib/esm/src/maps/index.js +1 -0
- package/lib/esm/src/monitoring/index.js +1 -0
- package/lib/esm/src/monitoring/online/index.js +1 -0
- package/lib/esm/src/monitoring/online/service.js +113 -0
- package/lib/esm/src/ride/base/base.js +227 -0
- package/lib/esm/src/ride/base/index.js +1 -0
- package/lib/esm/src/ride/base/types.js +1 -0
- package/lib/esm/src/ride/display/index.js +1 -0
- package/lib/esm/src/ride/display/service.js +1111 -0
- package/lib/esm/src/ride/index.js +3 -0
- package/lib/esm/src/ride/page/index.js +1 -0
- package/lib/esm/src/ride/page/service.js +362 -0
- package/lib/esm/src/ride/page/types.js +1 -0
- package/lib/esm/src/ride/route/FollowRouteDisplayService.js +32 -0
- package/lib/esm/src/ride/route/FreeRideDisplayService.js +578 -0
- package/lib/esm/src/ride/route/GpxDisplayService.js +316 -0
- package/lib/esm/src/ride/route/RLVDisplayService.js +575 -0
- package/lib/esm/src/ride/route/RouteDisplayService.js +406 -0
- package/lib/esm/src/ride/route/types.js +1 -0
- package/lib/esm/src/ride/types.js +1 -0
- package/lib/esm/src/ride/workout/WorkoutDisplayService.js +94 -0
- package/lib/esm/src/routes/base/api/consts.js +9 -0
- package/lib/esm/src/routes/base/api/index.js +156 -0
- package/lib/esm/src/routes/base/api/types.js +1 -0
- package/lib/esm/src/routes/base/model/route.js +117 -0
- package/lib/esm/src/routes/base/model/tacx.js +28 -0
- package/lib/esm/src/routes/base/model/types.js +1 -0
- package/lib/esm/src/routes/base/parsers/bikelab.js +103 -0
- package/lib/esm/src/routes/base/parsers/epm.js +240 -0
- package/lib/esm/src/routes/base/parsers/factory.js +45 -0
- package/lib/esm/src/routes/base/parsers/geometry.js +125 -0
- package/lib/esm/src/routes/base/parsers/gpx.js +210 -0
- package/lib/esm/src/routes/base/parsers/incyclist.js +191 -0
- package/lib/esm/src/routes/base/parsers/index.js +46 -0
- package/lib/esm/src/routes/base/parsers/kwt.js +4 -0
- package/lib/esm/src/routes/base/parsers/multixml.js +34 -0
- package/lib/esm/src/routes/base/parsers/tacx/TacxParser.js +249 -0
- package/lib/esm/src/routes/base/parsers/tacx/TacxReader.js +79 -0
- package/lib/esm/src/routes/base/parsers/tacx/pgmf.js +65 -0
- package/lib/esm/src/routes/base/parsers/tacx/rlv.js +80 -0
- package/lib/esm/src/routes/base/parsers/types.js +1 -0
- package/lib/esm/src/routes/base/parsers/utils.js +130 -0
- package/lib/esm/src/routes/base/parsers/xml.js +342 -0
- package/lib/esm/src/routes/base/types/index.js +2 -0
- package/lib/esm/src/routes/base/utils/index.js +1 -0
- package/lib/esm/src/routes/base/utils/localization.js +35 -0
- package/lib/esm/src/routes/base/utils/points.js +296 -0
- package/lib/esm/src/routes/base/utils/route.js +558 -0
- package/lib/esm/src/routes/download/service.js +225 -0
- package/lib/esm/src/routes/download/types.js +15 -0
- package/lib/esm/src/routes/free-ride/index.js +1 -0
- package/lib/esm/src/routes/free-ride/service.js +507 -0
- package/lib/esm/src/routes/index.js +5 -0
- package/lib/esm/src/routes/list/RouteListObserver.js +18 -0
- package/lib/esm/src/routes/list/cards/ActiveImportCard.js +84 -0
- package/lib/esm/src/routes/list/cards/FreeRideCard.js +114 -0
- package/lib/esm/src/routes/list/cards/RouteCard.js +884 -0
- package/lib/esm/src/routes/list/cards/RouteImportCard.js +36 -0
- package/lib/esm/src/routes/list/cards/base.js +68 -0
- package/lib/esm/src/routes/list/cards/types.js +1 -0
- package/lib/esm/src/routes/list/index.js +1 -0
- package/lib/esm/src/routes/list/lists/alternatives.js +38 -0
- package/lib/esm/src/routes/list/lists/myroutes.js +55 -0
- package/lib/esm/src/routes/list/lists/selected.js +35 -0
- package/lib/esm/src/routes/list/loaders/DBLoader.js +47 -0
- package/lib/esm/src/routes/list/loaders/LegacyDB.js +138 -0
- package/lib/esm/src/routes/list/loaders/StravaActivityLoader.js +284 -0
- package/lib/esm/src/routes/list/loaders/api.js +218 -0
- package/lib/esm/src/routes/list/loaders/db.js +335 -0
- package/lib/esm/src/routes/list/loaders/types.js +114 -0
- package/lib/esm/src/routes/list/service.js +1306 -0
- package/lib/esm/src/routes/list/types.js +1 -0
- package/lib/esm/src/routes/list/utils.js +36 -0
- package/lib/esm/src/routes/page/index.js +1 -0
- package/lib/esm/src/routes/page/service.js +432 -0
- package/lib/esm/src/routes/page/types.js +1 -0
- package/lib/esm/src/routes/sync/factory.js +119 -0
- package/lib/esm/src/routes/sync/index.js +2 -0
- package/lib/esm/src/routes/sync/komoot/provider.js +362 -0
- package/lib/esm/src/routes/sync/types.js +1 -0
- package/lib/esm/src/routes/types.js +1 -0
- package/lib/esm/src/services/index.js +1 -0
- package/lib/esm/src/services/overpass/index.js +1 -0
- package/lib/esm/src/services/overpass/overpass.js +108 -0
- package/lib/esm/src/settings/bindings/index.js +1 -0
- package/lib/esm/src/settings/bindings/json.js +98 -0
- package/lib/esm/src/settings/bindings/types.js +5 -0
- package/lib/esm/src/settings/display/index.js +2 -0
- package/lib/esm/src/settings/display/support/index.js +1 -0
- package/lib/esm/src/settings/display/support/service.js +111 -0
- package/lib/esm/src/settings/display/support/types.js +1 -0
- package/lib/esm/src/settings/display/user/index.js +2 -0
- package/lib/esm/src/settings/display/user/service.js +158 -0
- package/lib/esm/src/settings/display/user/types.js +1 -0
- package/lib/esm/src/settings/index.js +2 -0
- package/lib/esm/src/settings/service/index.js +1 -0
- package/lib/esm/src/settings/service/mock.js +31 -0
- package/lib/esm/src/settings/service/service.js +228 -0
- package/lib/esm/src/settings/types.js +1 -0
- package/lib/esm/src/types.js +1 -0
- package/lib/esm/src/ui/index.js +1 -0
- package/lib/esm/src/ui/service.js +479 -0
- package/lib/esm/src/ui/types.js +1 -0
- package/lib/esm/src/utils/calc.js +34 -0
- package/lib/esm/src/utils/clone.js +5 -0
- package/lib/esm/src/utils/fileinfo.js +9 -0
- package/lib/esm/src/utils/formatting.js +73 -0
- package/lib/esm/src/utils/geo.js +130 -0
- package/lib/esm/src/utils/index.js +10 -0
- package/lib/esm/src/utils/logging.js +18 -0
- package/lib/esm/src/utils/math.js +26 -0
- package/lib/esm/src/utils/merge.js +26 -0
- package/lib/esm/src/utils/nextTick.js +1 -0
- package/lib/esm/src/utils/sleep.js +1 -0
- package/lib/esm/src/utils/string.js +4 -0
- package/lib/esm/src/utils/time.js +20 -0
- package/lib/esm/src/utils/valid.js +11 -0
- package/lib/esm/src/utils/vector.js +200 -0
- package/lib/esm/src/utils/xml.js +105 -0
- package/lib/esm/src/video/VideoConversion.js +167 -0
- package/lib/esm/src/video/VideoSyncHelper.js +650 -0
- package/lib/esm/src/video/index.js +3 -0
- package/lib/esm/src/video/types.js +1 -0
- package/lib/esm/src/workouts/base/api/consts.js +9 -0
- package/lib/esm/src/workouts/base/api/index.js +127 -0
- package/lib/esm/src/workouts/base/model/Segment.js +137 -0
- package/lib/esm/src/workouts/base/model/Step.js +158 -0
- package/lib/esm/src/workouts/base/model/Workout.js +109 -0
- package/lib/esm/src/workouts/base/model/index.js +4 -0
- package/lib/esm/src/workouts/base/model/types.js +1 -0
- package/lib/esm/src/workouts/base/parsers/factory.js +87 -0
- package/lib/esm/src/workouts/base/parsers/incyclist/Json.js +56 -0
- package/lib/esm/src/workouts/base/parsers/index.js +35 -0
- package/lib/esm/src/workouts/base/parsers/intervals/parser.js +292 -0
- package/lib/esm/src/workouts/base/parsers/intervals/types.js +6 -0
- package/lib/esm/src/workouts/base/parsers/types.js +1 -0
- package/lib/esm/src/workouts/base/parsers/zwo/zwo.js +244 -0
- package/lib/esm/src/workouts/calendar/index.js +3 -0
- package/lib/esm/src/workouts/calendar/service.js +355 -0
- package/lib/esm/src/workouts/calendar/sync/factory.js +124 -0
- package/lib/esm/src/workouts/calendar/sync/index.js +2 -0
- package/lib/esm/src/workouts/calendar/sync/intervals/provider.js +208 -0
- package/lib/esm/src/workouts/calendar/sync/types.js +1 -0
- package/lib/esm/src/workouts/calendar/types.js +1 -0
- package/lib/esm/src/workouts/index.js +3 -0
- package/lib/esm/src/workouts/list/cards/ActiveImportCard.js +68 -0
- package/lib/esm/src/workouts/list/cards/ScheduledWorkoutCard.js +38 -0
- package/lib/esm/src/workouts/list/cards/WorkoutCard.js +284 -0
- package/lib/esm/src/workouts/list/cards/WorkoutCreateCard.js +96 -0
- package/lib/esm/src/workouts/list/cards/WorkoutImportCard.js +37 -0
- package/lib/esm/src/workouts/list/cards/base.js +54 -0
- package/lib/esm/src/workouts/list/cards/index.js +4 -0
- package/lib/esm/src/workouts/list/cards/types.js +6 -0
- package/lib/esm/src/workouts/list/index.js +2 -0
- package/lib/esm/src/workouts/list/loaders/api.js +46 -0
- package/lib/esm/src/workouts/list/loaders/db.js +185 -0
- package/lib/esm/src/workouts/list/loaders/loader.js +17 -0
- package/lib/esm/src/workouts/list/service.js +658 -0
- package/lib/esm/src/workouts/list/types.js +1 -0
- package/lib/esm/src/workouts/ride/index.js +2 -0
- package/lib/esm/src/workouts/ride/service.js +607 -0
- package/lib/esm/src/workouts/ride/types.js +1 -0
- package/lib/types/activities/list/utils.d.ts +1 -0
- package/lib/types/activities/page/service.d.ts +1 -0
- package/lib/types/routes/download/service.d.ts +5 -0
- package/lib/types/routes/page/service.d.ts +15 -1
- package/lib/types/routes/page/types.d.ts +8 -0
- package/lib/types/src/activities/active-rides/index.d.ts +2 -0
- package/lib/types/src/activities/active-rides/mq.d.ts +28 -0
- package/lib/types/src/activities/active-rides/service.d.ts +116 -0
- package/lib/types/src/activities/active-rides/sessions.d.ts +0 -0
- package/lib/types/src/activities/active-rides/types.d.ts +103 -0
- package/lib/types/src/activities/base/api/active-rides/api.d.ts +13 -0
- package/lib/types/src/activities/base/api/active-rides/index.d.ts +2 -0
- package/lib/types/src/activities/base/api/active-rides/types.d.ts +5 -0
- package/lib/types/src/activities/base/api/fitconvert/consts.d.ts +2 -0
- package/lib/types/src/activities/base/api/fitconvert/fitconvert.d.ts +9 -0
- package/lib/types/src/activities/base/api/fitconvert/index.d.ts +1 -0
- package/lib/types/src/activities/base/api/index.d.ts +1 -0
- package/lib/types/src/activities/base/convert/converter.d.ts +7 -0
- package/lib/types/src/activities/base/convert/factory.d.ts +8 -0
- package/lib/types/src/activities/base/convert/fit/index.d.ts +1 -0
- package/lib/types/src/activities/base/convert/fit/remote-fit.d.ts +13 -0
- package/lib/types/src/activities/base/convert/index.d.ts +4 -0
- package/lib/types/src/activities/base/convert/tcx/index.d.ts +1 -0
- package/lib/types/src/activities/base/convert/tcx/tcx.d.ts +23 -0
- package/lib/types/src/activities/base/convert/tcx/types.d.ts +5 -0
- package/lib/types/src/activities/base/convert/types.d.ts +7 -0
- package/lib/types/src/activities/base/index.d.ts +5 -0
- package/lib/types/src/activities/base/model/index.d.ts +206 -0
- package/lib/types/src/activities/base/repo/db.d.ts +60 -0
- package/lib/types/src/activities/base/repo/index.d.ts +2 -0
- package/lib/types/src/activities/base/repo/migration/factory.d.ts +7 -0
- package/lib/types/src/activities/base/repo/migration/types.d.ts +15 -0
- package/lib/types/src/activities/base/repo/migration/v0.d.ts +5 -0
- package/lib/types/src/activities/base/repo/migration/v1.d.ts +5 -0
- package/lib/types/src/activities/base/repo/migration/v2.d.ts +5 -0
- package/lib/types/src/activities/base/repo/migration/v3.d.ts +5 -0
- package/lib/types/src/activities/base/repo/types.d.ts +14 -0
- package/lib/types/src/activities/base/utils/activity.d.ts +50 -0
- package/lib/types/src/activities/base/utils/helpers.d.ts +4 -0
- package/lib/types/src/activities/base/utils/index.d.ts +2 -0
- package/lib/types/src/activities/index.d.ts +6 -0
- package/lib/types/src/activities/list/index.d.ts +2 -0
- package/lib/types/src/activities/list/service.d.ts +59 -0
- package/lib/types/src/activities/list/types.d.ts +94 -0
- package/lib/types/src/activities/list/utils.d.ts +5 -0
- package/lib/types/src/activities/page/index.d.ts +1 -0
- package/lib/types/src/activities/page/service.d.ts +24 -0
- package/lib/types/src/activities/page/types.d.ts +10 -0
- package/lib/types/src/activities/ride/duration.d.ts +32 -0
- package/lib/types/src/activities/ride/index.d.ts +1 -0
- package/lib/types/src/activities/ride/service.d.ts +248 -0
- package/lib/types/src/activities/ride/stats.d.ts +37 -0
- package/lib/types/src/activities/ride/types.d.ts +31 -0
- package/lib/types/src/activities/types.d.ts +2 -0
- package/lib/types/src/activities/upload/factory.d.ts +12 -0
- package/lib/types/src/activities/upload/index.d.ts +5 -0
- package/lib/types/src/activities/upload/intervals.d.ts +18 -0
- package/lib/types/src/activities/upload/strava.d.ts +18 -0
- package/lib/types/src/activities/upload/types.d.ts +25 -0
- package/lib/types/src/activities/upload/velohero.d.ts +18 -0
- package/lib/types/src/api/appInfo/index.d.ts +17 -0
- package/lib/types/src/api/bindings/index.d.ts +40 -0
- package/lib/types/src/api/bindings/types.d.ts +14 -0
- package/lib/types/src/api/crypto/types.d.ts +46 -0
- package/lib/types/src/api/download/index.d.ts +11 -0
- package/lib/types/src/api/form/types.d.ts +6 -0
- package/lib/types/src/api/fs/index.d.ts +15 -0
- package/lib/types/src/api/index.d.ts +5 -0
- package/lib/types/src/api/logging/types.d.ts +8 -0
- package/lib/types/src/api/mq/index.d.ts +7 -0
- package/lib/types/src/api/path/index.d.ts +11 -0
- package/lib/types/src/api/repository/index.d.ts +8 -0
- package/lib/types/src/api/repository/json/index.d.ts +22 -0
- package/lib/types/src/api/repository/types.d.ts +36 -0
- package/lib/types/src/api/rest/RestApiClient.d.ts +7 -0
- package/lib/types/src/api/rest/api.d.ts +15 -0
- package/lib/types/src/api/rest/incyclist.d.ts +7 -0
- package/lib/types/src/api/rest/index.d.ts +3 -0
- package/lib/types/src/api/rest/types.d.ts +9 -0
- package/lib/types/src/api/secret/index.d.ts +6 -0
- package/lib/types/src/api/serial/types.d.ts +3 -0
- package/lib/types/src/api/types.d.ts +7 -0
- package/lib/types/src/api/ui/index.d.ts +21 -0
- package/lib/types/src/api/video/index.d.ts +21 -0
- package/lib/types/src/apps/base/api/base.d.ts +13 -0
- package/lib/types/src/apps/base/api/index.d.ts +4 -0
- package/lib/types/src/apps/base/api/intervals/api.d.ts +23 -0
- package/lib/types/src/apps/base/api/intervals/index.d.ts +2 -0
- package/lib/types/src/apps/base/api/intervals/types.d.ts +121 -0
- package/lib/types/src/apps/base/api/komoot/api.d.ts +21 -0
- package/lib/types/src/apps/base/api/komoot/index.d.ts +2 -0
- package/lib/types/src/apps/base/api/komoot/types.d.ts +94 -0
- package/lib/types/src/apps/base/api/strava/api.d.ts +40 -0
- package/lib/types/src/apps/base/api/strava/index.d.ts +2 -0
- package/lib/types/src/apps/base/api/strava/types.d.ts +143 -0
- package/lib/types/src/apps/base/api/velohero/api.d.ts +12 -0
- package/lib/types/src/apps/base/api/velohero/index.d.ts +2 -0
- package/lib/types/src/apps/base/api/velohero/types.d.ts +14 -0
- package/lib/types/src/apps/base/app/index.d.ts +20 -0
- package/lib/types/src/apps/base/index.d.ts +3 -0
- package/lib/types/src/apps/base/types.d.ts +2 -0
- package/lib/types/src/apps/googleMaps/index.d.ts +1 -0
- package/lib/types/src/apps/googleMaps/service.d.ts +18 -0
- package/lib/types/src/apps/index.d.ts +5 -0
- package/lib/types/src/apps/intervals/IntervalsAppConnection.d.ts +23 -0
- package/lib/types/src/apps/intervals/index.d.ts +0 -0
- package/lib/types/src/apps/intervals/types.d.ts +6 -0
- package/lib/types/src/apps/komoot/KomootAppConnection.d.ts +25 -0
- package/lib/types/src/apps/komoot/index.d.ts +2 -0
- package/lib/types/src/apps/komoot/types.d.ts +10 -0
- package/lib/types/src/apps/service.d.ts +38 -0
- package/lib/types/src/apps/strava/StravaAppConnection.d.ts +28 -0
- package/lib/types/src/apps/strava/index.d.ts +2 -0
- package/lib/types/src/apps/strava/types.d.ts +6 -0
- package/lib/types/src/apps/types.d.ts +16 -0
- package/lib/types/src/apps/velohero/VeloHeroAppConnection.d.ts +25 -0
- package/lib/types/src/apps/velohero/index.d.ts +2 -0
- package/lib/types/src/apps/velohero/types.d.ts +9 -0
- package/lib/types/src/appstate/index.d.ts +2 -0
- package/lib/types/src/appstate/service.d.ts +17 -0
- package/lib/types/src/appstate/types.d.ts +12 -0
- package/lib/types/src/autoupdate/api.d.ts +22 -0
- package/lib/types/src/autoupdate/autoupdate.d.ts +6 -0
- package/lib/types/src/autoupdate/index.d.ts +2 -0
- package/lib/types/src/avatars/index.d.ts +2 -0
- package/lib/types/src/avatars/service.d.ts +17 -0
- package/lib/types/src/avatars/types.d.ts +10 -0
- package/lib/types/src/base/cardlist/index.d.ts +33 -0
- package/lib/types/src/base/cardlist/types.d.ts +4 -0
- package/lib/types/src/base/decorators/Injection.d.ts +2 -0
- package/lib/types/src/base/decorators/index.d.ts +2 -0
- package/lib/types/src/base/pages/index.d.ts +2 -0
- package/lib/types/src/base/pages/service.d.ts +23 -0
- package/lib/types/src/base/pages/types.d.ts +8 -0
- package/lib/types/src/base/service.d.ts +13 -0
- package/lib/types/src/base/typedefs.d.ts +7 -0
- package/lib/types/src/base/types/index.d.ts +3 -0
- package/lib/types/src/base/types/lists.d.ts +14 -0
- package/lib/types/src/base/types/observer.d.ts +21 -0
- package/lib/types/src/base/types/singleton.d.ts +1 -0
- package/lib/types/src/coaches/coach.d.ts +37 -0
- package/lib/types/src/coaches/index.d.ts +3 -0
- package/lib/types/src/coaches/service.d.ts +39 -0
- package/lib/types/src/coaches/types.d.ts +25 -0
- package/lib/types/src/devices/access/index.d.ts +2 -0
- package/lib/types/src/devices/access/model.d.ts +37 -0
- package/lib/types/src/devices/access/service.d.ts +42 -0
- package/lib/types/src/devices/configuration/index.d.ts +2 -0
- package/lib/types/src/devices/configuration/model/app/index.d.ts +17 -0
- package/lib/types/src/devices/configuration/model/index.d.ts +3 -0
- package/lib/types/src/devices/configuration/model/repository/index.d.ts +36 -0
- package/lib/types/src/devices/configuration/model/repository/legacy.d.ts +57 -0
- package/lib/types/src/devices/configuration/model/service/index.d.ts +18 -0
- package/lib/types/src/devices/configuration/service.d.ts +102 -0
- package/lib/types/src/devices/configuration/types.d.ts +2 -0
- package/lib/types/src/devices/index.d.ts +5 -0
- package/lib/types/src/devices/page/index.d.ts +1 -0
- package/lib/types/src/devices/page/logobserver.d.ts +8 -0
- package/lib/types/src/devices/page/service.d.ts +54 -0
- package/lib/types/src/devices/page/statemachine.d.ts +47 -0
- package/lib/types/src/devices/page/types.d.ts +74 -0
- package/lib/types/src/devices/pairing/index.d.ts +2 -0
- package/lib/types/src/devices/pairing/model.d.ts +84 -0
- package/lib/types/src/devices/pairing/service.d.ts +150 -0
- package/lib/types/src/devices/ride/index.d.ts +2 -0
- package/lib/types/src/devices/ride/service.d.ts +139 -0
- package/lib/types/src/devices/ride/types.d.ts +54 -0
- package/lib/types/src/devices/types.d.ts +3 -0
- package/lib/types/src/i18n/countries/index.d.ts +17 -0
- package/lib/types/src/i18n/countries/model.d.ts +18 -0
- package/lib/types/src/i18n/index.d.ts +3 -0
- package/lib/types/src/i18n/localization/index.d.ts +2 -0
- package/lib/types/src/i18n/localization/service.d.ts +17 -0
- package/lib/types/src/i18n/localization/types.d.ts +3 -0
- package/lib/types/src/i18n/units/converter.d.ts +17 -0
- package/lib/types/src/i18n/units/index.d.ts +2 -0
- package/lib/types/src/i18n/units/types.d.ts +17 -0
- package/lib/types/src/index.d.ts +23 -0
- package/lib/types/src/maps/MapArea/MapArea.d.ts +34 -0
- package/lib/types/src/maps/MapArea/consts.d.ts +11 -0
- package/lib/types/src/maps/MapArea/index.d.ts +3 -0
- package/lib/types/src/maps/MapArea/options.d.ts +24 -0
- package/lib/types/src/maps/MapArea/service.d.ts +54 -0
- package/lib/types/src/maps/MapArea/types.d.ts +132 -0
- package/lib/types/src/maps/MapArea/utils.d.ts +44 -0
- package/lib/types/src/maps/index.d.ts +1 -0
- package/lib/types/src/monitoring/index.d.ts +1 -0
- package/lib/types/src/monitoring/online/index.d.ts +1 -0
- package/lib/types/src/monitoring/online/service.d.ts +19 -0
- package/lib/types/src/ride/base/base.d.ts +49 -0
- package/lib/types/src/ride/base/index.d.ts +1 -0
- package/lib/types/src/ride/base/types.d.ts +181 -0
- package/lib/types/src/ride/display/index.d.ts +1 -0
- package/lib/types/src/ride/display/service.d.ts +136 -0
- package/lib/types/src/ride/index.d.ts +3 -0
- package/lib/types/src/ride/page/index.d.ts +1 -0
- package/lib/types/src/ride/page/service.d.ts +51 -0
- package/lib/types/src/ride/page/types.d.ts +44 -0
- package/lib/types/src/ride/route/FollowRouteDisplayService.d.ts +5 -0
- package/lib/types/src/ride/route/FreeRideDisplayService.d.ts +85 -0
- package/lib/types/src/ride/route/GpxDisplayService.d.ts +62 -0
- package/lib/types/src/ride/route/RLVDisplayService.d.ts +99 -0
- package/lib/types/src/ride/route/RouteDisplayService.d.ts +69 -0
- package/lib/types/src/ride/route/types.d.ts +25 -0
- package/lib/types/src/ride/types.d.ts +3 -0
- package/lib/types/src/ride/workout/WorkoutDisplayService.d.ts +15 -0
- package/lib/types/src/routes/base/api/consts.d.ts +9 -0
- package/lib/types/src/routes/base/api/index.d.ts +24 -0
- package/lib/types/src/routes/base/api/types.d.ts +77 -0
- package/lib/types/src/routes/base/model/route.d.ts +20 -0
- package/lib/types/src/routes/base/model/tacx.d.ts +92 -0
- package/lib/types/src/routes/base/model/types.d.ts +13 -0
- package/lib/types/src/routes/base/parsers/bikelab.d.ts +12 -0
- package/lib/types/src/routes/base/parsers/epm.d.ts +28 -0
- package/lib/types/src/routes/base/parsers/factory.d.ts +14 -0
- package/lib/types/src/routes/base/parsers/geometry.d.ts +28 -0
- package/lib/types/src/routes/base/parsers/gpx.d.ts +26 -0
- package/lib/types/src/routes/base/parsers/incyclist.d.ts +16 -0
- package/lib/types/src/routes/base/parsers/index.d.ts +9 -0
- package/lib/types/src/routes/base/parsers/kwt.d.ts +4 -0
- package/lib/types/src/routes/base/parsers/multixml.d.ts +13 -0
- package/lib/types/src/routes/base/parsers/tacx/TacxParser.d.ts +27 -0
- package/lib/types/src/routes/base/parsers/tacx/TacxReader.d.ts +12 -0
- package/lib/types/src/routes/base/parsers/tacx/pgmf.d.ts +8 -0
- package/lib/types/src/routes/base/parsers/tacx/rlv.d.ts +10 -0
- package/lib/types/src/routes/base/parsers/types.d.ts +15 -0
- package/lib/types/src/routes/base/parsers/utils.d.ts +24 -0
- package/lib/types/src/routes/base/parsers/xml.d.ts +33 -0
- package/lib/types/src/routes/base/types/index.d.ts +135 -0
- package/lib/types/src/routes/base/utils/index.d.ts +1 -0
- package/lib/types/src/routes/base/utils/localization.d.ts +4 -0
- package/lib/types/src/routes/base/utils/points.d.ts +24 -0
- package/lib/types/src/routes/base/utils/route.d.ts +44 -0
- package/lib/types/src/routes/download/service.d.ts +34 -0
- package/lib/types/src/routes/download/types.d.ts +8 -0
- package/lib/types/src/routes/free-ride/index.d.ts +1 -0
- package/lib/types/src/routes/free-ride/service.d.ts +54 -0
- package/lib/types/src/routes/index.d.ts +5 -0
- package/lib/types/src/routes/list/RouteListObserver.d.ts +13 -0
- package/lib/types/src/routes/list/cards/ActiveImportCard.d.ts +32 -0
- package/lib/types/src/routes/list/cards/FreeRideCard.d.ts +40 -0
- package/lib/types/src/routes/list/cards/RouteCard.d.ts +117 -0
- package/lib/types/src/routes/list/cards/RouteImportCard.d.ts +19 -0
- package/lib/types/src/routes/list/cards/base.d.ts +24 -0
- package/lib/types/src/routes/list/cards/types.d.ts +101 -0
- package/lib/types/src/routes/list/index.d.ts +1 -0
- package/lib/types/src/routes/list/lists/alternatives.d.ts +5 -0
- package/lib/types/src/routes/list/lists/myroutes.d.ts +10 -0
- package/lib/types/src/routes/list/lists/selected.d.ts +5 -0
- package/lib/types/src/routes/list/loaders/DBLoader.d.ts +22 -0
- package/lib/types/src/routes/list/loaders/LegacyDB.d.ts +17 -0
- package/lib/types/src/routes/list/loaders/StravaActivityLoader.d.ts +44 -0
- package/lib/types/src/routes/list/loaders/api.d.ts +28 -0
- package/lib/types/src/routes/list/loaders/db.d.ts +40 -0
- package/lib/types/src/routes/list/loaders/types.d.ts +43 -0
- package/lib/types/src/routes/list/service.d.ts +164 -0
- package/lib/types/src/routes/list/types.d.ts +93 -0
- package/lib/types/src/routes/list/utils.d.ts +5 -0
- package/lib/types/src/routes/page/index.d.ts +1 -0
- package/lib/types/src/routes/page/service.d.ts +60 -0
- package/lib/types/src/routes/page/types.d.ts +45 -0
- package/lib/types/src/routes/sync/factory.d.ts +14 -0
- package/lib/types/src/routes/sync/index.d.ts +2 -0
- package/lib/types/src/routes/sync/komoot/provider.d.ts +51 -0
- package/lib/types/src/routes/sync/types.d.ts +11 -0
- package/lib/types/src/routes/types.d.ts +7 -0
- package/lib/types/src/services/index.d.ts +1 -0
- package/lib/types/src/services/overpass/index.d.ts +1 -0
- package/lib/types/src/services/overpass/overpass.d.ts +14 -0
- package/lib/types/src/settings/bindings/index.d.ts +1 -0
- package/lib/types/src/settings/bindings/json.d.ts +15 -0
- package/lib/types/src/settings/bindings/types.d.ts +8 -0
- package/lib/types/src/settings/display/index.d.ts +2 -0
- package/lib/types/src/settings/display/support/index.d.ts +1 -0
- package/lib/types/src/settings/display/support/service.d.ts +17 -0
- package/lib/types/src/settings/display/support/types.d.ts +14 -0
- package/lib/types/src/settings/display/user/index.d.ts +2 -0
- package/lib/types/src/settings/display/user/service.d.ts +23 -0
- package/lib/types/src/settings/display/user/types.d.ts +22 -0
- package/lib/types/src/settings/index.d.ts +2 -0
- package/lib/types/src/settings/service/index.d.ts +1 -0
- package/lib/types/src/settings/service/mock.d.ts +13 -0
- package/lib/types/src/settings/service/service.d.ts +48 -0
- package/lib/types/src/settings/types.d.ts +2 -0
- package/lib/types/src/types.d.ts +8 -0
- package/lib/types/src/ui/index.d.ts +1 -0
- package/lib/types/src/ui/service.d.ts +56 -0
- package/lib/types/src/ui/types.d.ts +1 -0
- package/lib/types/src/utils/calc.d.ts +8 -0
- package/lib/types/src/utils/clone.d.ts +1 -0
- package/lib/types/src/utils/fileinfo.d.ts +2 -0
- package/lib/types/src/utils/formatting.d.ts +5 -0
- package/lib/types/src/utils/geo.d.ts +15 -0
- package/lib/types/src/utils/index.d.ts +10 -0
- package/lib/types/src/utils/logging.d.ts +2 -0
- package/lib/types/src/utils/math.d.ts +7 -0
- package/lib/types/src/utils/merge.d.ts +1 -0
- package/lib/types/src/utils/nextTick.d.ts +1 -0
- package/lib/types/src/utils/sleep.d.ts +1 -0
- package/lib/types/src/utils/string.d.ts +1 -0
- package/lib/types/src/utils/time.d.ts +4 -0
- package/lib/types/src/utils/valid.d.ts +1 -0
- package/lib/types/src/utils/vector.d.ts +25 -0
- package/lib/types/src/utils/xml.d.ts +18 -0
- package/lib/types/src/video/VideoConversion.d.ts +23 -0
- package/lib/types/src/video/VideoSyncHelper.d.ts +76 -0
- package/lib/types/src/video/index.d.ts +3 -0
- package/lib/types/src/video/types.d.ts +41 -0
- package/lib/types/src/workouts/base/api/consts.d.ts +9 -0
- package/lib/types/src/workouts/base/api/index.d.ts +17 -0
- package/lib/types/src/workouts/base/model/Segment.d.ts +18 -0
- package/lib/types/src/workouts/base/model/Step.d.ts +35 -0
- package/lib/types/src/workouts/base/model/Workout.d.ts +26 -0
- package/lib/types/src/workouts/base/model/index.d.ts +4 -0
- package/lib/types/src/workouts/base/model/types.d.ts +61 -0
- package/lib/types/src/workouts/base/parsers/factory.d.ts +11 -0
- package/lib/types/src/workouts/base/parsers/incyclist/Json.d.ts +12 -0
- package/lib/types/src/workouts/base/parsers/index.d.ts +5 -0
- package/lib/types/src/workouts/base/parsers/intervals/parser.d.ts +59 -0
- package/lib/types/src/workouts/base/parsers/intervals/types.d.ts +57 -0
- package/lib/types/src/workouts/base/parsers/types.d.ts +8 -0
- package/lib/types/src/workouts/base/parsers/zwo/zwo.d.ts +37 -0
- package/lib/types/src/workouts/calendar/index.d.ts +3 -0
- package/lib/types/src/workouts/calendar/service.d.ts +50 -0
- package/lib/types/src/workouts/calendar/sync/factory.d.ts +10 -0
- package/lib/types/src/workouts/calendar/sync/index.d.ts +2 -0
- package/lib/types/src/workouts/calendar/sync/intervals/provider.d.ts +22 -0
- package/lib/types/src/workouts/calendar/sync/types.d.ts +10 -0
- package/lib/types/src/workouts/calendar/types.d.ts +15 -0
- package/lib/types/src/workouts/index.d.ts +3 -0
- package/lib/types/src/workouts/list/cards/ActiveImportCard.d.ts +27 -0
- package/lib/types/src/workouts/list/cards/ScheduledWorkoutCard.d.ts +13 -0
- package/lib/types/src/workouts/list/cards/WorkoutCard.d.ts +45 -0
- package/lib/types/src/workouts/list/cards/WorkoutCreateCard.d.ts +21 -0
- package/lib/types/src/workouts/list/cards/WorkoutImportCard.d.ts +19 -0
- package/lib/types/src/workouts/list/cards/base.d.ts +22 -0
- package/lib/types/src/workouts/list/cards/index.d.ts +4 -0
- package/lib/types/src/workouts/list/cards/types.d.ts +56 -0
- package/lib/types/src/workouts/list/index.d.ts +2 -0
- package/lib/types/src/workouts/list/loaders/api.d.ts +11 -0
- package/lib/types/src/workouts/list/loaders/db.d.ts +27 -0
- package/lib/types/src/workouts/list/loaders/loader.d.ts +10 -0
- package/lib/types/src/workouts/list/service.d.ts +90 -0
- package/lib/types/src/workouts/list/types.d.ts +12 -0
- package/lib/types/src/workouts/ride/index.d.ts +2 -0
- package/lib/types/src/workouts/ride/service.d.ts +69 -0
- package/lib/types/src/workouts/ride/types.d.ts +25 -0
- package/package.json +10 -10
|
@@ -42,10 +42,10 @@ const types_1 = require("../../base/types");
|
|
|
42
42
|
const observer_1 = require("../../base/types/observer");
|
|
43
43
|
const i18n_1 = require("../../i18n");
|
|
44
44
|
const routes_1 = require("../../routes");
|
|
45
|
-
const
|
|
45
|
+
const sleep_1 = require("../../utils/sleep");
|
|
46
46
|
const base_1 = require("../base");
|
|
47
47
|
const upload_1 = require("../upload");
|
|
48
|
-
const
|
|
48
|
+
const utils_1 = require("./utils");
|
|
49
49
|
let ActivityListService = (() => {
|
|
50
50
|
let _classDecorators = [types_1.Singleton];
|
|
51
51
|
let _classDescriptor;
|
|
@@ -104,13 +104,13 @@ let ActivityListService = (() => {
|
|
|
104
104
|
this.logEvent({ message: 'preload activity list completed', cnt: this.activities?.length });
|
|
105
105
|
this.initialized = true;
|
|
106
106
|
this.emitLists('loaded');
|
|
107
|
-
|
|
107
|
+
(0, sleep_1.sleep)(5).then(() => { delete this.observers.preload; });
|
|
108
108
|
});
|
|
109
109
|
})
|
|
110
110
|
.catch((err) => {
|
|
111
111
|
this.logError(err, 'preload');
|
|
112
112
|
this.initialized = false;
|
|
113
|
-
|
|
113
|
+
(0, sleep_1.sleep)(5).then(() => { delete this.observers.preload; });
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
else {
|
|
@@ -162,7 +162,7 @@ let ActivityListService = (() => {
|
|
|
162
162
|
try {
|
|
163
163
|
const activity = this.getActivity(id);
|
|
164
164
|
if (activity.details) {
|
|
165
|
-
(0,
|
|
165
|
+
(0, sleep_1.sleep)(5).then(() => observer.emit('loaded', activity.details));
|
|
166
166
|
return observer;
|
|
167
167
|
}
|
|
168
168
|
this.getRepo().getWithDetails(id).then(ai => {
|
|
@@ -375,12 +375,12 @@ let ActivityListService = (() => {
|
|
|
375
375
|
const loading = this.isStillLoading();
|
|
376
376
|
const observer = loading ? this.getListObserver() : undefined;
|
|
377
377
|
const activities = loading ? undefined : this.getPastActivities();
|
|
378
|
-
const activitiesUI = activities === undefined ? undefined : activities.map(
|
|
378
|
+
const activitiesUI = activities === undefined ? undefined : activities.map(utils_1.createUIActivityInfo);
|
|
379
379
|
const filter = this.filter;
|
|
380
380
|
return { filter, activities: activitiesUI, loading, observer };
|
|
381
381
|
}
|
|
382
382
|
getSelectedActivityDisplayProps() {
|
|
383
|
-
const activity = (0,
|
|
383
|
+
const activity = (0, utils_1.createUIActivityDetails)(this.selected.details);
|
|
384
384
|
const [C, U] = this.getUnitConverter().getUnitConversionShortcuts();
|
|
385
385
|
const logs = activity?.logs ?? [];
|
|
386
386
|
const points = logs.map(p => ({ lat: p.lat, lng: p.lng ?? p.lon }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createUIActivityDetails = exports.createUIActivitySummary = exports.createUIActivityInfo = void 0;
|
|
3
|
+
exports._createUIActivityDetails = exports.createUIActivityDetails = exports.createUIActivitySummary = exports.createUIActivityInfo = void 0;
|
|
4
4
|
const i18n_1 = require("../../i18n");
|
|
5
5
|
const createUIActivityInfo = (a) => {
|
|
6
6
|
if (!a)
|
|
@@ -8,7 +8,7 @@ const createUIActivityInfo = (a) => {
|
|
|
8
8
|
const { summary, details } = a;
|
|
9
9
|
return {
|
|
10
10
|
summary: (0, exports.createUIActivitySummary)(summary),
|
|
11
|
-
details:
|
|
11
|
+
details: undefined
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
exports.createUIActivityInfo = createUIActivityInfo;
|
|
@@ -25,6 +25,38 @@ const createUIActivitySummary = (summary) => {
|
|
|
25
25
|
};
|
|
26
26
|
exports.createUIActivitySummary = createUIActivitySummary;
|
|
27
27
|
const createUIActivityDetails = (details) => {
|
|
28
|
+
if (!details)
|
|
29
|
+
return details;
|
|
30
|
+
const ui = { ...details };
|
|
31
|
+
const [C, U] = (0, i18n_1.getUnitConversionShortcuts)();
|
|
32
|
+
const formatSpeed = (v) => {
|
|
33
|
+
return { value: C(v, 'speed', { digits: 1 }), unit: U('speed') };
|
|
34
|
+
};
|
|
35
|
+
if (details.stats?.speed) {
|
|
36
|
+
ui.stats = {
|
|
37
|
+
...details.stats,
|
|
38
|
+
speed: { ...details.stats.speed }
|
|
39
|
+
};
|
|
40
|
+
const fields = ['min', 'max', 'avg'];
|
|
41
|
+
for (const field of fields) {
|
|
42
|
+
ui.stats.speed[field] = formatSpeed(ui.stats.speed[field]);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
ui.distance = { value: C(details.distance, 'distance', { digits: 1 }), unit: U('distance') };
|
|
46
|
+
ui.totalElevation = { value: C(details.totalElevation, 'elevation', { digits: 0 }), unit: U('elevation') };
|
|
47
|
+
ui.logs = (details.logs ?? []).map(log => {
|
|
48
|
+
const { speed, distance, elevation } = log;
|
|
49
|
+
return {
|
|
50
|
+
...log,
|
|
51
|
+
speed: C(speed, 'speed', { digits: 1 }),
|
|
52
|
+
distance: C(distance, 'distance', { digits: 2 }),
|
|
53
|
+
elevation: C(elevation, 'elevation', { digits: 0 }),
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
return ui;
|
|
57
|
+
};
|
|
58
|
+
exports.createUIActivityDetails = createUIActivityDetails;
|
|
59
|
+
const _createUIActivityDetails = (details) => {
|
|
28
60
|
if (!details)
|
|
29
61
|
return details;
|
|
30
62
|
const ui = structuredClone(details);
|
|
@@ -53,4 +85,4 @@ const createUIActivityDetails = (details) => {
|
|
|
53
85
|
}
|
|
54
86
|
return ui;
|
|
55
87
|
};
|
|
56
|
-
exports.
|
|
88
|
+
exports._createUIActivityDetails = _createUIActivityDetails;
|
|
@@ -62,17 +62,23 @@ let ActivitiesPageService = (() => {
|
|
|
62
62
|
updateStateHandler = (__runInitializers(this, _instanceExtraInitializers), this.onStateUpdate.bind(this));
|
|
63
63
|
listState;
|
|
64
64
|
detailActivityId;
|
|
65
|
+
isOpen = false;
|
|
65
66
|
constructor() {
|
|
66
67
|
super('ActivitiesPage');
|
|
67
68
|
}
|
|
68
69
|
openPage() {
|
|
70
|
+
if (this.isOpen) {
|
|
71
|
+
this.getActivityList().closeList();
|
|
72
|
+
this.stopEventListener();
|
|
73
|
+
}
|
|
69
74
|
try {
|
|
70
|
-
this.logEvent({ message: 'page shown', page: '
|
|
71
|
-
gd_eventlog_1.EventLogger.setGlobalConfig('page', '
|
|
75
|
+
this.logEvent({ message: 'page shown', page: 'Activities' });
|
|
76
|
+
gd_eventlog_1.EventLogger.setGlobalConfig('page', 'Activities');
|
|
72
77
|
super.openPage();
|
|
73
78
|
const service = this.getActivityList();
|
|
74
79
|
this.listState = service.openList();
|
|
75
80
|
this.startEventListener();
|
|
81
|
+
this.isOpen = true;
|
|
76
82
|
(0, sleep_1.sleep)(5).then(() => {
|
|
77
83
|
this.updatePageDisplay();
|
|
78
84
|
});
|
|
@@ -85,9 +91,10 @@ let ActivitiesPageService = (() => {
|
|
|
85
91
|
closePage() {
|
|
86
92
|
try {
|
|
87
93
|
gd_eventlog_1.EventLogger.setGlobalConfig('page', null);
|
|
88
|
-
this.logEvent({ message: 'page closed', page: '
|
|
94
|
+
this.logEvent({ message: 'page closed', page: 'Activities' });
|
|
89
95
|
this.getActivityList().closeList();
|
|
90
96
|
this.stopEventListener();
|
|
97
|
+
this.isOpen = false;
|
|
91
98
|
super.closePage();
|
|
92
99
|
}
|
|
93
100
|
catch (err) {
|
|
@@ -122,6 +129,7 @@ let ActivitiesPageService = (() => {
|
|
|
122
129
|
}
|
|
123
130
|
onOpenActivity(id) {
|
|
124
131
|
try {
|
|
132
|
+
this.getActivityList().select(id);
|
|
125
133
|
this.detailActivityId = id === null ? undefined : id;
|
|
126
134
|
this.updatePageDisplay();
|
|
127
135
|
}
|
|
@@ -131,7 +139,7 @@ let ActivitiesPageService = (() => {
|
|
|
131
139
|
}
|
|
132
140
|
onCloseActivity() {
|
|
133
141
|
try {
|
|
134
|
-
|
|
142
|
+
this.detailActivityId = null;
|
|
135
143
|
this.updatePageDisplay();
|
|
136
144
|
}
|
|
137
145
|
catch (err) {
|
|
@@ -256,7 +256,6 @@ let ActivityRideService = (() => {
|
|
|
256
256
|
}
|
|
257
257
|
catch { }
|
|
258
258
|
if (showLog) {
|
|
259
|
-
console.log('# here', this.state);
|
|
260
259
|
this.logEvent({ message: 'Dashboard update', items: info.map(i => `${i.title}:${i.data[0]?.value ?? ''}:${i.data[1]?.value ?? ''}${i.data[1]?.label ? '(' + i.data[1]?.label + ')' : ''}`).join('|') });
|
|
261
260
|
}
|
|
262
261
|
return info;
|
|
@@ -631,7 +631,7 @@ let DeviceRideService = (() => {
|
|
|
631
631
|
if (modes.length > 0) {
|
|
632
632
|
mode = new modes[0](bike);
|
|
633
633
|
const modeInfo = config.getModeSettings(ai.udid, mode);
|
|
634
|
-
settings = modeInfo
|
|
634
|
+
settings = modeInfo?.settings;
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
637
|
if (!isControlDisabled) {
|
|
@@ -1,172 +1,229 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
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
|
+
};
|
|
2
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RouteDownloadService = void 0;
|
|
37
|
+
exports.useRouteDownload = exports.RouteDownloadService = void 0;
|
|
4
38
|
const api_1 = require("../../api");
|
|
39
|
+
const decorators_1 = require("../../base/decorators");
|
|
5
40
|
const service_1 = require("../../base/service");
|
|
6
41
|
const settings_1 = require("../../settings");
|
|
7
42
|
const utils_1 = require("../../utils");
|
|
8
43
|
const api_2 = require("../list/loaders/api");
|
|
9
44
|
const db_1 = require("../list/loaders/db");
|
|
10
45
|
const types_1 = require("./types");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const fs = (0, api_1.getBindings)().fs;
|
|
47
|
-
fs.unlink(file);
|
|
46
|
+
let RouteDownloadService = (() => {
|
|
47
|
+
let _classDecorators = [decorators_1.Singleton];
|
|
48
|
+
let _classDescriptor;
|
|
49
|
+
let _classExtraInitializers = [];
|
|
50
|
+
let _classThis;
|
|
51
|
+
let _classSuper = service_1.IncyclistService;
|
|
52
|
+
var RouteDownloadService = class extends _classSuper {
|
|
53
|
+
static { _classThis = this; }
|
|
54
|
+
static {
|
|
55
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
56
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
57
|
+
RouteDownloadService = _classThis = _classDescriptor.value;
|
|
58
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
59
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
60
|
+
}
|
|
61
|
+
downloads;
|
|
62
|
+
progressLogTs;
|
|
63
|
+
constructor() {
|
|
64
|
+
super('Routes');
|
|
65
|
+
this.progressLogTs = {};
|
|
66
|
+
this.downloads = [];
|
|
67
|
+
}
|
|
68
|
+
getRepo() {
|
|
69
|
+
return new db_1.RoutesDbLoader();
|
|
70
|
+
}
|
|
71
|
+
getRoutesApi() {
|
|
72
|
+
return new api_2.RoutesApiLoader();
|
|
73
|
+
}
|
|
74
|
+
getActiveDownloads() {
|
|
75
|
+
return this.downloads;
|
|
76
|
+
}
|
|
77
|
+
download(route) {
|
|
78
|
+
const running = this.getObserver(route);
|
|
79
|
+
if (running) {
|
|
80
|
+
return running;
|
|
48
81
|
}
|
|
49
|
-
|
|
50
|
-
|
|
82
|
+
const observer = new types_1.DownloadObserver(this._download(route));
|
|
83
|
+
this.downloads.push({ route, observer });
|
|
84
|
+
this.emit('download-started', route, observer);
|
|
85
|
+
return observer;
|
|
86
|
+
}
|
|
87
|
+
stopDownload(route) {
|
|
88
|
+
const idx = this.downloads.findIndex(d => d.route.description.id === route.description.id);
|
|
89
|
+
if (idx === -1)
|
|
90
|
+
return;
|
|
91
|
+
const info = this.downloads[idx];
|
|
92
|
+
info.observer.stop();
|
|
93
|
+
this.downloads.splice(idx, 1);
|
|
94
|
+
}
|
|
95
|
+
async deleteIncompleteFile(route, videoDir) {
|
|
96
|
+
const { file } = await this.getDownloadFileName(route, videoDir);
|
|
97
|
+
if (file) {
|
|
98
|
+
try {
|
|
99
|
+
const fs = (0, api_1.getBindings)().fs;
|
|
100
|
+
fs.unlink(file);
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
this.logError(err, 'deleteIncompleteFile');
|
|
104
|
+
}
|
|
51
105
|
}
|
|
52
106
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return info?.observer;
|
|
57
|
-
}
|
|
58
|
-
async _download(route) {
|
|
59
|
-
await (0, utils_1.waitNextTick)();
|
|
60
|
-
const observer = this.getObserver(route);
|
|
61
|
-
try {
|
|
62
|
-
const videoDir = await this.waitForVideoDir(observer);
|
|
63
|
-
observer.once('stopped', () => {
|
|
64
|
-
this.deleteIncompleteFile(route, videoDir);
|
|
65
|
-
});
|
|
66
|
-
this.downloadRoute(route, videoDir, observer);
|
|
67
|
-
}
|
|
68
|
-
catch (err) {
|
|
69
|
-
observer.emit('error', err);
|
|
107
|
+
getObserver(route) {
|
|
108
|
+
const info = this.downloads.find(d => d.route.description.id === route.description.id);
|
|
109
|
+
return info?.observer;
|
|
70
110
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
observer?.emit('videoDir.unknown');
|
|
79
|
-
return new Promise(done => {
|
|
80
|
-
settingsObserver.on('changed', (dir) => {
|
|
81
|
-
observer?.emit('videoDir.ok');
|
|
82
|
-
settings.stopNotifyOnChange(reqId);
|
|
83
|
-
done(dir);
|
|
111
|
+
async _download(route) {
|
|
112
|
+
await (0, utils_1.waitNextTick)();
|
|
113
|
+
const observer = this.getObserver(route);
|
|
114
|
+
try {
|
|
115
|
+
const videoDir = await this.waitForVideoDir(observer);
|
|
116
|
+
observer.once('stopped', () => {
|
|
117
|
+
this.deleteIncompleteFile(route, videoDir);
|
|
84
118
|
});
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
return videoDir;
|
|
88
|
-
}
|
|
89
|
-
async getDownloadFileName(route, targetDir) {
|
|
90
|
-
let url, file, error;
|
|
91
|
-
try {
|
|
92
|
-
const { path } = (0, api_1.getBindings)();
|
|
93
|
-
url = route?.description?.downloadUrl || route?.description?.videoUrl;
|
|
94
|
-
if (!url) {
|
|
95
|
-
url = await this.restoreFromRepo(route);
|
|
96
|
-
}
|
|
97
|
-
if (!url || !path) {
|
|
98
|
-
return { error: 'download not supported' };
|
|
119
|
+
this.downloadRoute(route, videoDir, observer);
|
|
99
120
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const logInfo = { ...route.description };
|
|
103
|
-
delete logInfo.points;
|
|
104
|
-
this.logEvent({ message: 'no URL specified', logInfo });
|
|
105
|
-
return { error: 'no URL specified' };
|
|
121
|
+
catch (err) {
|
|
122
|
+
observer.emit('error', err);
|
|
106
123
|
}
|
|
107
|
-
file = path.join(targetDir, info.base);
|
|
108
124
|
}
|
|
109
|
-
|
|
110
|
-
|
|
125
|
+
waitForVideoDir(observer) {
|
|
126
|
+
const settings = (0, settings_1.useUserSettings)();
|
|
127
|
+
const videoDir = settings.get('videos.directory', null);
|
|
128
|
+
if (!videoDir) {
|
|
129
|
+
const reqId = Date.now().toString();
|
|
130
|
+
const settingsObserver = settings.requestNotifyOnChange(reqId, 'videos.directory');
|
|
131
|
+
observer?.emit('videoDir.unknown');
|
|
132
|
+
return new Promise(done => {
|
|
133
|
+
settingsObserver.on('changed', (dir) => {
|
|
134
|
+
observer?.emit('videoDir.ok');
|
|
135
|
+
settings.stopNotifyOnChange(reqId);
|
|
136
|
+
done(dir);
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return videoDir;
|
|
111
141
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
142
|
+
async getDownloadFileName(route, targetDir) {
|
|
143
|
+
let url, file, error;
|
|
144
|
+
try {
|
|
145
|
+
const { path } = (0, api_1.getBindings)();
|
|
146
|
+
url = route?.description?.downloadUrl || route?.description?.videoUrl;
|
|
147
|
+
if (!url) {
|
|
148
|
+
url = await this.restoreFromRepo(route);
|
|
149
|
+
}
|
|
150
|
+
if (!url || !path) {
|
|
151
|
+
return { error: 'download not supported' };
|
|
152
|
+
}
|
|
153
|
+
const info = path.parse(url);
|
|
154
|
+
if (!info) {
|
|
155
|
+
const logInfo = { ...route.description };
|
|
156
|
+
delete logInfo.points;
|
|
157
|
+
this.logEvent({ message: 'no URL specified', logInfo });
|
|
158
|
+
return { error: 'no URL specified' };
|
|
159
|
+
}
|
|
160
|
+
file = path.join(targetDir, info.base);
|
|
122
161
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (!downloadManager) {
|
|
126
|
-
observer.emit('error', new Error('download not supported'));
|
|
127
|
-
return;
|
|
162
|
+
catch {
|
|
163
|
+
return {};
|
|
128
164
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
165
|
+
return { file, url };
|
|
166
|
+
}
|
|
167
|
+
async downloadRoute(route, targetDir, observer) {
|
|
168
|
+
let urlLog;
|
|
169
|
+
try {
|
|
170
|
+
const { file, url, error } = await this.getDownloadFileName(route, targetDir);
|
|
171
|
+
urlLog = url;
|
|
172
|
+
if (!file || error) {
|
|
173
|
+
observer.emit('error', new Error(error ?? 'download not supported'));
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
const { id, title } = route.description;
|
|
177
|
+
const { downloadManager } = (0, api_1.getBindings)();
|
|
178
|
+
if (!downloadManager) {
|
|
179
|
+
observer.emit('error', new Error('download not supported'));
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const session = downloadManager.createSession(url, file);
|
|
183
|
+
if (!session) {
|
|
184
|
+
observer.emit('error', new Error(error ?? 'download not supported'));
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
observer.setSession(session);
|
|
188
|
+
const onError = (err) => {
|
|
189
|
+
this.logEvent({ message: 'download failed ', title, id, url, reason: err.message });
|
|
190
|
+
observer.emit('error', err);
|
|
191
|
+
};
|
|
192
|
+
const onProgress = (pct, speed, bytes) => { this.onDownloadProgress(id, observer, pct, speed, bytes); };
|
|
193
|
+
this.logEvent({ message: 'start download', title, id, url });
|
|
194
|
+
session.on('started', () => { observer.emit('started'); });
|
|
195
|
+
session.on('close', () => { });
|
|
196
|
+
session.on('progress', onProgress);
|
|
197
|
+
session.on('error', onError);
|
|
198
|
+
session.once('done', () => {
|
|
199
|
+
this.logEvent({ message: 'download finished ', title, id, url });
|
|
200
|
+
observer.emit('done', `video:///${file}`);
|
|
201
|
+
});
|
|
202
|
+
session.start();
|
|
133
203
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
this.logEvent({ message: 'download failed ', title, id, url, reason: err.message });
|
|
204
|
+
catch (err) {
|
|
205
|
+
this.logError(err, 'downloadRoute', { url: urlLog });
|
|
137
206
|
observer.emit('error', err);
|
|
138
|
-
}
|
|
139
|
-
const onProgress = (pct, speed, bytes) => { this.onDownloadProgress(id, observer, pct, speed, bytes); };
|
|
140
|
-
this.logEvent({ message: 'start download', title, id, url });
|
|
141
|
-
session.on('started', () => { observer.emit('started'); });
|
|
142
|
-
session.on('close', () => { });
|
|
143
|
-
session.on('progress', onProgress);
|
|
144
|
-
session.on('error', onError);
|
|
145
|
-
session.once('done', () => {
|
|
146
|
-
this.logEvent({ message: 'download finished ', title, id, url });
|
|
147
|
-
observer.emit('done', `video:///${file}`);
|
|
148
|
-
});
|
|
149
|
-
session.start();
|
|
150
|
-
}
|
|
151
|
-
catch (err) {
|
|
152
|
-
this.logError(err, 'downloadRoute', { url: urlLog });
|
|
153
|
-
observer.emit('error', err);
|
|
207
|
+
}
|
|
154
208
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
209
|
+
async restoreFromRepo(route) {
|
|
210
|
+
await this.getRoutesApi().loadDetails([{ route, added: false }], true);
|
|
211
|
+
await (0, utils_1.waitNextTick)();
|
|
212
|
+
const descr = this.getRepo().getDescription(route.description.id);
|
|
213
|
+
return descr?.downloadUrl || descr?.videoUrl;
|
|
214
|
+
}
|
|
215
|
+
onDownloadProgress(id, observer, pct, speed, downloaded) {
|
|
216
|
+
const prev = this.progressLogTs[id] || 0;
|
|
217
|
+
const ts = Date.now();
|
|
218
|
+
if (ts - prev > 1000) {
|
|
219
|
+
this.logEvent({ message: 'download progress', pctComplete: pct, downloaded, downloadSpeed: speed });
|
|
220
|
+
this.progressLogTs[id] = ts;
|
|
221
|
+
}
|
|
222
|
+
observer.emit('progress', Number(pct));
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
return RouteDownloadService = _classThis;
|
|
226
|
+
})();
|
|
172
227
|
exports.RouteDownloadService = RouteDownloadService;
|
|
228
|
+
const useRouteDownload = () => new RouteDownloadService();
|
|
229
|
+
exports.useRouteDownload = useRouteDownload;
|