incyclist-services 1.9.0 → 1.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/lib/cjs/activities/types.js +1 -0
  2. package/lib/cjs/apps/service.js +2 -2
  3. package/lib/cjs/base/pages/service.js +6 -8
  4. package/lib/cjs/devices/configuration/service.js +4 -0
  5. package/lib/cjs/devices/page/base/logobserver.js +19 -0
  6. package/lib/cjs/devices/page/base/orchestrator.js +2 -0
  7. package/lib/cjs/devices/page/base/service.js +383 -0
  8. package/lib/cjs/devices/page/base/types.js +2 -0
  9. package/lib/cjs/devices/page/base/visit-log-factory.js +41 -0
  10. package/lib/cjs/devices/page/base/visit-log.js +143 -0
  11. package/lib/cjs/devices/page/desktop/matrix.js +26 -0
  12. package/lib/cjs/devices/page/desktop/orchestrator.js +21 -0
  13. package/lib/cjs/devices/page/desktop/service.js +253 -0
  14. package/lib/cjs/devices/page/desktop/types.js +2 -0
  15. package/lib/cjs/devices/page/index.js +17 -18
  16. package/lib/cjs/devices/page/mobile/orchestrator.js +6 -0
  17. package/lib/cjs/devices/page/mobile/service.js +197 -0
  18. package/lib/cjs/devices/page/mobile/statemachine.js +348 -0
  19. package/lib/cjs/devices/pairing/guidance.js +9 -5
  20. package/lib/cjs/devices/pairing/service.js +54 -1
  21. package/lib/cjs/devices/ride/service.js +1 -22
  22. package/lib/cjs/ride/display/service.js +21 -11
  23. package/lib/cjs/ride/route/GpxDisplayService.js +3 -0
  24. package/lib/cjs/ui/service.js +20 -17
  25. package/lib/cjs/workouts/ride/service.js +8 -8
  26. package/lib/esm/activities/types.js +1 -0
  27. package/lib/esm/apps/service.js +1 -1
  28. package/lib/esm/base/pages/service.js +6 -8
  29. package/lib/esm/devices/configuration/service.js +4 -0
  30. package/lib/esm/devices/page/index.js +2 -0
  31. package/lib/esm/devices/page/service.js +6 -70
  32. package/lib/esm/devices/pairing/guidance.js +9 -5
  33. package/lib/esm/devices/ride/service.js +1 -22
  34. package/lib/esm/ride/display/service.js +13 -3
  35. package/lib/esm/ride/route/GpxDisplayService.js +3 -0
  36. package/lib/esm/workouts/ride/service.js +1 -1
  37. package/lib/types/activities/ride/service.d.ts +1 -1
  38. package/lib/types/activities/types.d.ts +1 -0
  39. package/lib/types/api/ui/index.d.ts +1 -1
  40. package/lib/types/apps/service.d.ts +1 -1
  41. package/lib/types/appstate/types.d.ts +1 -1
  42. package/lib/types/base/pages/service.d.ts +1 -1
  43. package/lib/types/devices/page/index.d.ts +5 -1
  44. package/lib/types/devices/page/service.d.ts +1 -9
  45. package/lib/types/devices/page/types.d.ts +2 -129
  46. package/lib/types/devices/ride/service.d.ts +0 -1
  47. package/lib/types/ride/base/base.d.ts +1 -2
  48. package/lib/types/ride/base/types.d.ts +1 -0
  49. package/lib/types/ride/display/service.d.ts +9 -7
  50. package/lib/types/routes/list/cards/RouteCard.d.ts +1 -1
  51. package/lib/types/workouts/ride/service.d.ts +1 -1
  52. package/package.json +1 -1
@@ -1,2 +1,3 @@
1
1
  export * from './ride/types';
2
2
  export * from './page/types';
3
+ export * from './base/model/index';
@@ -23,5 +23,5 @@ export interface INativeUI {
23
23
  showItemInFolder(fileName: string): void;
24
24
  getPathForFile(file: string): string;
25
25
  detectLanguage(): Array<string> | string;
26
- openPage(route: string): any;
26
+ openPage(route: string, state?: unknown): any;
27
27
  }
@@ -1,4 +1,4 @@
1
- import { ActivityUploadFactory } from "../activities";
1
+ import { ActivityUploadFactory } from "../activities/upload";
2
2
  import { IncyclistService } from "../base/service";
3
3
  import { AppCredentials } from "./base/types";
4
4
  import { AppDefinition, AppsIntergationSpec, AppsOperation } from "./types";
@@ -1,4 +1,4 @@
1
- export type FeatureToggle = 'NEW_SEARCH_UI' | 'WEBBLE_WINDOWS' | 'MOBILE_NEXT_VIDEO' | 'VIDEO_ROUTE' | 'SV_EAGER_INIT';
1
+ export type FeatureToggle = 'WEBBLE_WINDOWS' | 'MOBILE_NEXT_VIDEO' | 'VIDEO_ROUTE' | 'SV_EAGER_INIT';
2
2
  export type Interfaces = 'ant' | 'ble' | 'serial' | 'wifi' | 'tcpip';
3
3
  export type BLEFeatures = {
4
4
  services: Array<string>;
@@ -16,7 +16,7 @@ export declare class IncyclistPageService extends IncyclistService implements IP
16
16
  getPageObserver(): IObserver;
17
17
  protected stopObserver(): void;
18
18
  protected getPrevContentPage(): string;
19
- protected moveTo(route: string, close?: boolean): void;
19
+ protected moveTo(route: string, close?: boolean, state?: unknown): void;
20
20
  protected getUIBinding(): import("../../api").INativeUI;
21
21
  protected getBindings(): import("../../api").IncyclistBindings;
22
22
  protected getAppState(): import("../../appstate").AppStateService;
@@ -1,3 +1,7 @@
1
+ import { MobilePairingPageService } from './mobile/service';
2
+ import { DesktopPairingPageService } from './desktop/service';
1
3
  export { PairingVisitTracker } from './base/visit-log';
2
4
  export { usePairingVisitTracker, initPairingVisitTracker } from './base/visit-log-factory';
3
- export declare const getDevicesPageService: () => any;
5
+ export { MobilePairingPageService } from './mobile/service';
6
+ export { DesktopPairingPageService } from './desktop/service';
7
+ export declare const getDevicesPageService: () => MobilePairingPageService | DesktopPairingPageService;
@@ -6,8 +6,6 @@ import { PageLogObserver } from './logobserver';
6
6
  import { EnrichedInterfaceSetting, InterfaceState } from '../access';
7
7
  import { IncyclistCapability } from 'incyclist-devices';
8
8
  import { Observer } from '../../base/types';
9
- import type { PairingVisitTracker } from './visit-log';
10
- import type { PairingExitVia } from './types';
11
9
  export declare class DevicesPageService extends IncyclistPageService {
12
10
  protected promiseOpen: Promise<void> | undefined;
13
11
  protected stateMachine: PairingPageStateMachine;
@@ -16,7 +14,6 @@ export declare class DevicesPageService extends IncyclistPageService {
16
14
  protected openedInterfaceSettings: TInterface;
17
15
  protected interfaceSettingsObserver: Observer | undefined;
18
16
  protected isPairingForRide: boolean;
19
- protected isVisitOpen: boolean;
20
17
  constructor();
21
18
  openPage(forRide?: boolean): IObserver;
22
19
  closePage(): void;
@@ -30,7 +27,7 @@ export declare class DevicesPageService extends IncyclistPageService {
30
27
  reconnectInterface(i?: TInterface): void;
31
28
  refreshInterface(i?: TInterface): void;
32
29
  closeInterfaceSettings(): void;
33
- protected getCapabilityDisplayProps(data: CapabilityData, noSearch?: boolean): CapabilityDisplayProps;
30
+ protected getCapabilityDisplayProps(data: CapabilityData): CapabilityDisplayProps;
34
31
  protected mapInterfaceState(state: InterfaceState): InterfaceDisplayState;
35
32
  protected getInterfaceDisplayProps(info: EnrichedInterfaceSetting): InterfaceDisplayProps;
36
33
  protected getDeviceListDisplayProps(): DeviceSelectionProps | undefined;
@@ -44,10 +41,6 @@ export declare class DevicesPageService extends IncyclistPageService {
44
41
  protected getButtonsDisplayProps(): PairingButtonProps;
45
42
  protected getTCapability(capabability: IncyclistCapability): TIncyclistCapability;
46
43
  protected getDisplayCapability(capabability: IncyclistCapability): TDisplayCapability;
47
- protected trackVisit(fn: (tracker: PairingVisitTracker) => void, name: string): void;
48
- protected openVisit(): void;
49
- protected closeVisit(via: PairingExitVia): void;
50
- protected canStartRide(): boolean;
51
44
  protected onSkip(): void;
52
45
  protected onOK(): void;
53
46
  protected onSimulate(): void;
@@ -59,6 +52,5 @@ export declare class DevicesPageService extends IncyclistPageService {
59
52
  protected getDeviceRide(): import("../ride").DeviceRideService;
60
53
  protected getDeviceConfiguration(): import("../configuration").DeviceConfigurationService;
61
54
  protected getIncyclist(): import("../../ui").UserInterfaceServcie;
62
- protected getPairingVisitTracker(): PairingVisitTracker;
63
55
  }
64
56
  export declare const getDevicesPageService: () => DevicesPageService;
@@ -1,129 +1,2 @@
1
- import type { DevicePairingStatus } from "../pairing/model";
2
- import type { PairingStatusDisplayProps } from "../pairing/status";
3
- export type PageState = 'Idle' | 'Scanning' | 'Pairing' | 'Done' | 'Closed';
4
- export type SelectState = 'Closed' | 'Waiting' | 'Active';
5
- export type TInterface = 'ble' | 'wifi';
6
- export type PairingDisplayProps = {
7
- title: string | undefined;
8
- readyToStart?: boolean;
9
- status?: PairingStatusDisplayProps;
10
- capabilities?: {
11
- top: Array<CapabilityDisplayProps>;
12
- bottom: Array<CapabilityDisplayProps>;
13
- rowLabels?: {
14
- top: PairingRowLabelProps;
15
- bottom: PairingRowLabelProps;
16
- };
17
- };
18
- interfaces?: Array<InterfaceDisplayProps>;
19
- buttons?: PairingButtonProps;
20
- deviceSelection?: DeviceSelectionProps;
21
- showInterfaceSettings: TInterface | undefined;
22
- showExit?: boolean;
23
- onExit?: () => void;
24
- };
25
- export type DeviceSelectionProps = {
26
- capability: TIncyclistCapability;
27
- devices: Array<DeviceSelectionItemProps>;
28
- disabled: boolean;
29
- isScanning: boolean;
30
- changeForAll: boolean;
31
- canSelectAll: boolean;
32
- onClose: (enabled: boolean) => void;
33
- };
34
- export type TConnectState = 'failed' | 'connected' | 'connecting';
35
- export type DeviceSelectionItemProps = {
36
- connectState?: TConnectState;
37
- isSelected: boolean;
38
- deviceName: string;
39
- value: number;
40
- interface: string;
41
- onClick?: (addAll?: boolean) => void;
42
- onDelete?: () => void;
43
- };
44
- export type CapabilityDisplayProps = {
45
- title: string;
46
- capability: TIncyclistCapability;
47
- deviceName: string | undefined;
48
- interface?: string;
49
- connectState?: DevicePairingStatus;
50
- value?: string;
51
- unit?: string;
52
- disabled?: boolean;
53
- role?: 'required' | 'optional';
54
- helpText?: {
55
- full: string;
56
- short: string;
57
- };
58
- emptyFooter?: string;
59
- onClick: (item: CapabilityDisplayProps) => void;
60
- onUnselect?: any;
61
- };
62
- export type PairingRowLabelProps = {
63
- text: string;
64
- subtext?: string;
65
- };
66
- export type InterfaceDisplayState = 'disabled' | 'scanning' | 'idle' | 'error';
67
- export type InterfaceDisplayProps = {
68
- name: string;
69
- state: InterfaceDisplayState;
70
- error?: string;
71
- onClick: () => void;
72
- };
73
- export type InterfaceSettingsDisplayProps = {
74
- state?: InterfaceDisplayState;
75
- error?: string;
76
- enabled: boolean;
77
- };
78
- export type NextPageAction = {
79
- nextPage: string;
80
- };
81
- export type ClickAction = void | NextPageAction;
82
- type ButtonProps = {
83
- label: string;
84
- primary: boolean;
85
- onClick: () => Promise<ClickAction>;
86
- };
87
- export type PairingButtonProps = Array<ButtonProps>;
88
- export type DeviceListDisplayProps = {};
89
- export type TIncyclistCapability = 'power' | 'speed' | 'cadence' | 'heartrate' | 'control' | 'app_control';
90
- export type TDisplayCapability = 'resistance' | 'power' | 'heartrate' | 'cadence' | 'speed' | 'controller';
91
- export type PairingExitVia = 'ok' | 'skip' | 'simulate' | 'cancel' | 'app_exit';
92
- export type PreviousVisitOutcome = 'none' | 'ready' | 'skip-then-ride' | 'skip-no-ride' | 'simulate' | 'app-exit-ready' | 'app-exit-not-ready';
93
- export interface PairingVisitLast {
94
- visitId: string;
95
- sessionId: string;
96
- openedAt: number;
97
- backgroundMs: number;
98
- backgroundedAt?: number;
99
- forRide: boolean;
100
- canStartRide: boolean;
101
- visitIndexToday: number;
102
- firstEverVisit: boolean;
103
- previousVisitOutcome: PreviousVisitOutcome;
104
- previousVisitAgeMs?: number;
105
- closed: boolean;
106
- via?: PairingExitVia;
107
- inferred?: boolean;
108
- closedAt?: number;
109
- rideAfter?: 'device' | 'simulate';
110
- }
111
- export interface PairingVisitRecord {
112
- date: string;
113
- countToday: number;
114
- firstEverPending: boolean;
115
- last?: PairingVisitLast;
116
- }
117
- export interface PairingVisitStore {
118
- get(): PairingVisitRecord | undefined;
119
- set(record: PairingVisitRecord): void;
120
- }
121
- export interface PairingVisitTrackerDeps {
122
- store: PairingVisitStore;
123
- sessionId: string;
124
- platform: 'desktop' | 'mobile';
125
- now: () => number;
126
- today: () => string;
127
- log: (message: string, fields: Record<string, unknown>) => void;
128
- }
129
- export {};
1
+ export type * from './base/types';
2
+ export type * from './desktop/types';
@@ -135,7 +135,6 @@ export declare class DeviceRideService extends IncyclistService {
135
135
  protected getUserSettings(): import("../../settings").UserSettingsService;
136
136
  protected getDeviceAccess(): import("../access/service").DeviceAccessService;
137
137
  protected getGoogleMaps(): import("../../apps").GoogleMapsService;
138
- protected getWorkoutList(): import("../../workouts").WorkoutListService;
139
138
  }
140
139
  export declare const useDeviceRide: () => DeviceRideService;
141
140
  export {};
@@ -3,8 +3,7 @@ import { Observer } from "../../base/types";
3
3
  import { ActiveWorkoutLimit } from "../../workouts";
4
4
  import { CurrentRideDisplayProps, ICurrentRideService, IRideModeService, IRideModeServiceDisplayProps } from "./types";
5
5
  import { IncyclistService } from "../../base/service";
6
- import { ActivityUpdate } from "../../activities/ride/types";
7
- import { ScreenShotInfo } from "../../activities";
6
+ import type { ScreenShotInfo, ActivityUpdate } from "../../activities/types";
8
7
  import { Route } from "../../routes/base/model/route";
9
8
  export declare class RideModeService extends IncyclistService implements IRideModeService {
10
9
  protected observer: Observer;
@@ -193,5 +193,6 @@ export interface ICurrentRideService {
193
193
  getRideType(): RideType;
194
194
  getState(): CurrentRideState;
195
195
  onRouteUpdated(route: Route): void;
196
+ isSimulated(): boolean;
196
197
  }
197
198
  export {};
@@ -1,10 +1,10 @@
1
- import { ActivityDetails, ActivityUser } from "../../activities";
1
+ import { ActivityDetails, ActivityUser } from "../../activities/base/model";
2
2
  import { IncyclistService } from "../../base/service";
3
3
  import { Observer } from "../../base/types";
4
4
  import { Segment, Step, Workout } from "../../workouts";
5
5
  import { Route } from "../../routes/base/model/route";
6
6
  import { CurrentRideDeviceInfo, CurrentRideState, IRideModeService, RideType } from "../base";
7
- import { AdapterStateInfo } from "../../devices";
7
+ import { AdapterStateInfo } from "../../devices/ride";
8
8
  import { CyclingMode, DeviceData, UpdateRequest } from "incyclist-devices";
9
9
  import { INativeUI } from "../../api/ui";
10
10
  import { CurrentRideDisplayProps, ICurrentRideService, PrevRidesDisplayProps, StartOverlayProps } from "../base/types";
@@ -21,6 +21,7 @@ export declare class RideDisplayService extends IncyclistService implements ICur
21
21
  protected deviceData: DeviceData;
22
22
  protected actualWorkout: Workout;
23
23
  protected hideAll: boolean;
24
+ protected simulated: boolean;
24
25
  protected readonly onChangeState: any;
25
26
  protected startDeviceHandlers: any;
26
27
  protected isResuming: boolean;
@@ -29,6 +30,7 @@ export declare class RideDisplayService extends IncyclistService implements ICur
29
30
  constructor();
30
31
  init(): Promise<Observer>;
31
32
  start(simulate?: boolean): void;
33
+ isSimulated(): boolean;
32
34
  protected notifyPairingVisitRideStarted(simulate?: boolean): void;
33
35
  startWithMissingSensors(): void;
34
36
  startWithMapFallback(): void;
@@ -130,18 +132,18 @@ export declare class RideDisplayService extends IncyclistService implements ICur
130
132
  protected isSimulator(): boolean;
131
133
  protected getBike(): string;
132
134
  protected getBikeInterface(): string;
133
- protected getLogRideMode(): "workout" | "free-ride" | "video" | "follow-route";
135
+ protected getLogRideMode(): "video" | "workout" | "free-ride" | "follow-route";
134
136
  protected isDebug(): boolean;
135
137
  protected isVirtualShiftingEnabled(): boolean;
136
- protected getActivityRide(): import("../../activities").ActivityRideService;
138
+ protected getActivityRide(): import("../../activities/ride/service").ActivityRideService;
137
139
  protected getWorkoutRide(): import("../../workouts").WorkoutRide;
138
140
  protected getWorkoutList(): import("../../workouts").WorkoutListService;
139
141
  protected getRouteList(): import("../../routes").RouteListService;
140
- protected getDeviceRide(): import("../../devices").DeviceRideService;
142
+ protected getDeviceRide(): import("../../devices/ride").DeviceRideService;
141
143
  protected getUserSettings(): import("../../settings").UserSettingsService;
142
- protected getDeviceConfiguration(): import("../../devices").DeviceConfigurationService;
144
+ protected getDeviceConfiguration(): import("../../devices/configuration").DeviceConfigurationService;
143
145
  protected getUIBinding(): INativeUI;
144
146
  protected getCoaches(): import("../../coaches").CoachesService;
145
- protected getPairingVisitTracker(): any;
147
+ protected getPairingVisitTracker(): import("../..").PairingVisitTracker;
146
148
  }
147
149
  export declare const useRideDisplay: () => RideDisplayService;
@@ -95,7 +95,7 @@ export declare class RouteCard extends BaseCard implements Card<Route> {
95
95
  getCurrentDownload(): Observer;
96
96
  getVideoDir(): string;
97
97
  setVideoDir(dir: string): void;
98
- onVideoSelected(info: FileInfo): Promise<"Could not open file" | "Unsupported video format - Please select MP4 or AVI">;
98
+ onVideoSelected(info: FileInfo): Promise<"Unsupported video format - Please select MP4 or AVI" | "Could not open file">;
99
99
  download(): Observer;
100
100
  stopDownload(immediate?: boolean): void;
101
101
  deleteDownload(): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { IncyclistService } from "../../base/service";
2
2
  import { Observer } from "../../base/types/observer";
3
- import { DeviceRideService } from "../../devices";
3
+ import { DeviceRideService } from "../../devices/ride";
4
4
  import { Workout } from "../base/model";
5
5
  import { CurrentStep, PowerLimit, StepDefinition } from "../base/model/types";
6
6
  import { WorkoutListService } from "../list";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-services",
3
- "version": "1.9.0",
3
+ "version": "1.9.2",
4
4
  "peerDependencies": {
5
5
  "gd-eventlog": "^0.1.27"
6
6
  },