incyclist-services 1.9.19 → 1.9.20
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.
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const CAPABILITY_TITLES = {
|
|
2
|
+
control: 'Resistance',
|
|
3
|
+
power: 'Power',
|
|
4
|
+
speed: 'Speed',
|
|
5
|
+
cadence: 'Cadence',
|
|
6
|
+
heartrate: 'Heartrate',
|
|
7
|
+
app_control: 'Controller',
|
|
8
|
+
};
|
|
9
|
+
const joinNames = (names) => {
|
|
10
|
+
if (names.length <= 1)
|
|
11
|
+
return names.join('');
|
|
12
|
+
return `${names.slice(0, -1).join(', ')} and ${names.at(-1)}`;
|
|
13
|
+
};
|
|
14
|
+
export const getCapabilityTitle = (capability) => CAPABILITY_TITLES[capability] ?? capability;
|
|
15
|
+
export const getConflictStepTitle = (deviceName) => `${deviceName} can also measure more`;
|
|
16
|
+
export const getConflictStepSubline = (origin, deviceName, filled) => {
|
|
17
|
+
const names = filled.map(getCapabilityTitle);
|
|
18
|
+
const freed = names.length > 1 ? `${joinNames(names)} were free and now use` : `${joinNames(names)} was free and now uses`;
|
|
19
|
+
if (origin === 'manual') {
|
|
20
|
+
const full = names.length > 0
|
|
21
|
+
? `Choose which device to use for each. ${freed} ${deviceName}.`
|
|
22
|
+
: 'Choose which device to use for each.';
|
|
23
|
+
return { full, short: 'Choose which device to use for each.' };
|
|
24
|
+
}
|
|
25
|
+
const short = 'Nothing changes until you choose.';
|
|
26
|
+
const full = names.length > 0
|
|
27
|
+
? `${freed} it. Choose for the rest; nothing changes until you do.`
|
|
28
|
+
: short;
|
|
29
|
+
return { full, short };
|
|
30
|
+
};
|
|
31
|
+
export const getConflictKeepLabel = (currentName) => `Keep ${currentName}`;
|
|
32
|
+
export const getConflictReplaceLabel = (deviceName) => `Use ${deviceName}`;
|
|
33
|
+
export const getConflictQueuedText = (queued) => queued > 0 ? `${queued} more` : undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SelectionConflict } from './model';
|
|
2
|
+
export declare const getCapabilityTitle: (capability: string) => string;
|
|
3
|
+
export declare const getConflictStepTitle: (deviceName: string) => string;
|
|
4
|
+
export declare const getConflictStepSubline: (origin: SelectionConflict["origin"], deviceName: string, filled: ReadonlyArray<string>) => {
|
|
5
|
+
full: string;
|
|
6
|
+
short: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const getConflictKeepLabel: (currentName: string) => string;
|
|
9
|
+
export declare const getConflictReplaceLabel: (deviceName: string) => string;
|
|
10
|
+
export declare const getConflictQueuedText: (queued: number) => string | undefined;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "incyclist-services",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.20",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"gd-eventlog": "^0.1.27"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@garmin/fitsdk": "^21.221.0",
|
|
9
9
|
"axios": "^1.21.0",
|
|
10
|
-
"incyclist-devices": "^3.0.
|
|
10
|
+
"incyclist-devices": "^3.0.45",
|
|
11
11
|
"promise.any": "^2.0.6",
|
|
12
12
|
"semver": "^7.7.4",
|
|
13
13
|
"tcx-builder": "^1.1.1",
|