incyclist-services 1.9.7 → 1.9.8
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/api/rest/api.js +7 -3
- package/lib/cjs/api/rest/external.js +26 -0
- package/lib/cjs/apps/googleMaps/service.js +2 -0
- package/lib/cjs/apps/service.js +4 -1
- package/lib/cjs/devices/pairing/service.js +0 -1
- package/lib/cjs/i18n/countries/service.js +2 -2
- package/lib/cjs/routes/base/api/api.js +196 -0
- package/lib/cjs/routes/base/api/factory.js +93 -0
- package/lib/cjs/routes/base/api/index.js +14 -184
- package/lib/cjs/routes/base/parsers/tacx/TacxParser.js +1 -1
- package/lib/cjs/routes/free-ride/service.js +41 -0
- package/lib/cjs/routes/list/loaders/DBLoader.js +0 -1
- package/lib/cjs/routes/list/loaders/api.js +270 -176
- package/lib/cjs/routes/list/service.js +401 -357
- package/lib/cjs/ui/service.js +1 -2
- package/lib/cjs/utils/string.js +21 -1
- package/lib/esm/api/rest/api.js +7 -3
- package/lib/esm/api/rest/external.js +22 -0
- package/lib/esm/api/rest/incyclist copy.js +33 -0
- package/lib/esm/apps/googleMaps/service.js +2 -0
- package/lib/esm/apps/service.js +4 -1
- package/lib/esm/devices/configuration/model/add/index.js +1 -0
- package/lib/esm/devices/configuration/model/exclusion/index.js +1 -0
- package/lib/esm/devices/pairing/capability.js +1 -0
- package/lib/esm/devices/pairing/service.js +0 -1
- package/lib/esm/i18n/countries/service.js +2 -2
- package/lib/esm/routes/base/api/api.js +194 -0
- package/lib/esm/routes/base/api/factory.js +86 -0
- package/lib/esm/routes/base/api/index.js +2 -186
- package/lib/esm/routes/base/parsers/tacx/TacxParser.js +1 -1
- package/lib/esm/routes/free-ride/service.js +41 -0
- package/lib/esm/routes/list/loaders/DBLoader.js +0 -1
- package/lib/esm/routes/list/loaders/api.js +272 -174
- package/lib/esm/routes/list/service.js +401 -357
- package/lib/esm/ui/service.js +2 -3
- package/lib/esm/utils/string.js +18 -0
- package/lib/types/api/rest/api.d.ts +2 -2
- package/lib/types/api/rest/external.d.ts +7 -0
- package/lib/types/api/rest/incyclist copy.d.ts +7 -0
- package/lib/types/api/rest/types.d.ts +5 -3
- package/lib/types/apps/service.d.ts +1 -0
- package/lib/types/devices/configuration/model/add/index.d.ts +10 -0
- package/lib/types/devices/configuration/model/exclusion/index.d.ts +19 -0
- package/lib/types/devices/pairing/capability.d.ts +10 -0
- package/lib/types/routes/base/api/api.d.ts +23 -0
- package/lib/types/routes/base/api/factory.d.ts +7 -0
- package/lib/types/routes/base/api/index.d.ts +2 -26
- package/lib/types/routes/base/api/types.d.ts +10 -0
- package/lib/types/routes/base/parsers/tacx/TacxParser.d.ts +1 -1
- package/lib/types/routes/base/types/index.d.ts +1 -0
- package/lib/types/routes/free-ride/service.d.ts +6 -0
- package/lib/types/routes/list/loaders/api.d.ts +6 -3
- package/lib/types/routes/list/service.d.ts +37 -29
- package/lib/types/utils/string.d.ts +2 -0
- package/package.json +1 -1
package/lib/esm/ui/service.js
CHANGED
|
@@ -45,7 +45,7 @@ import { useDevicePairing } from "../devices/pairing";
|
|
|
45
45
|
import { initPairingVisitTracker, usePairingVisitTracker } from "../devices/page/base/visit-log-factory";
|
|
46
46
|
import { useFreeRideService, useRouteList } from "../routes";
|
|
47
47
|
import { useWorkoutList } from "../workouts";
|
|
48
|
-
import {
|
|
48
|
+
import { useActivityList } from "../activities";
|
|
49
49
|
import { useOnlineStatusMonitoring } from "../monitoring";
|
|
50
50
|
import { useAppState, useFeatureToggleSync } from "../appstate";
|
|
51
51
|
import { IncyclistPageService } from "../base/pages";
|
|
@@ -485,10 +485,9 @@ let UserInterfaceServcie = (() => {
|
|
|
485
485
|
const freeRide = useFreeRideService();
|
|
486
486
|
const workouts = useWorkoutList();
|
|
487
487
|
const activities = useActivityList();
|
|
488
|
-
const activeRides = useActiveRides();
|
|
489
488
|
const promises = [
|
|
490
489
|
routes.preload().wait(),
|
|
491
|
-
freeRide.
|
|
490
|
+
freeRide.init(),
|
|
492
491
|
workouts.preload().wait(),
|
|
493
492
|
activities.preload().wait()
|
|
494
493
|
];
|
package/lib/esm/utils/string.js
CHANGED
|
@@ -2,3 +2,21 @@ export const ignoreEmpty = (str) => {
|
|
|
2
2
|
if (str?.length)
|
|
3
3
|
return str;
|
|
4
4
|
};
|
|
5
|
+
export const camelCase = (str) => {
|
|
6
|
+
if (!str?.length)
|
|
7
|
+
return str;
|
|
8
|
+
return str
|
|
9
|
+
.toLowerCase()
|
|
10
|
+
.split(/[^a-z0-9]+/)
|
|
11
|
+
.map((word, i) => i === 0 ? word : word.charAt(0).toUpperCase() + word.slice(1))
|
|
12
|
+
.join('');
|
|
13
|
+
};
|
|
14
|
+
export const pascalCase = (str) => {
|
|
15
|
+
if (!str?.length)
|
|
16
|
+
return str;
|
|
17
|
+
return str
|
|
18
|
+
.toLowerCase()
|
|
19
|
+
.replace(new RegExp(/[-_ ]+/, 'g'), ' ')
|
|
20
|
+
.replace(/(?:^\w|\b\w)/g, letter => letter.toUpperCase())
|
|
21
|
+
.replaceAll(' ', '');
|
|
22
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
2
|
import { EventLogger } from 'gd-eventlog';
|
|
3
|
-
import { ApiClientInitProps } from './types';
|
|
3
|
+
import { ApiClientInitProps, ExternalApiClientInitProps } from './types';
|
|
4
4
|
export declare class ApiClient {
|
|
5
5
|
protected axios: AxiosInstance;
|
|
6
6
|
protected logger: EventLogger;
|
|
@@ -8,7 +8,7 @@ export declare class ApiClient {
|
|
|
8
8
|
tid: string;
|
|
9
9
|
ts: number;
|
|
10
10
|
}>;
|
|
11
|
-
init(props: ApiClientInitProps): void;
|
|
11
|
+
init(props: ApiClientInitProps | ExternalApiClientInitProps): void;
|
|
12
12
|
client(): AxiosInstance;
|
|
13
13
|
protected onRequest(req: any): any;
|
|
14
14
|
protected onResponse(res: any): any;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { AppChannel } from "../appInfo";
|
|
2
|
-
export type
|
|
3
|
-
uuid: string;
|
|
4
|
-
apiKey: string;
|
|
2
|
+
export type ExternalApiClientInitProps = {
|
|
5
3
|
version: string;
|
|
6
4
|
appVersion: string;
|
|
7
5
|
requestLog?: boolean;
|
|
8
6
|
channel?: AppChannel;
|
|
9
7
|
platform?: string;
|
|
10
8
|
};
|
|
9
|
+
export type ApiClientInitProps = ExternalApiClientInitProps & {
|
|
10
|
+
uuid: string;
|
|
11
|
+
apiKey: string;
|
|
12
|
+
};
|
|
@@ -23,6 +23,7 @@ export declare class AppsService extends IncyclistService {
|
|
|
23
23
|
isEnabled(app: string, operation: AppsOperation): boolean;
|
|
24
24
|
getAppOperationSettings(app: string): any[];
|
|
25
25
|
getConnectedServices(operation: AppsOperation): Array<AppDefinition>;
|
|
26
|
+
getAvailableServices(operation: AppsOperation): Array<string>;
|
|
26
27
|
getName(key: string): string;
|
|
27
28
|
getKey(name: string): string;
|
|
28
29
|
protected getAppDisplayProps(key: string): {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IncyclistCapability } from "incyclist-devices";
|
|
2
|
+
export type AutoSelectRule = 'control' | 'heartrate' | 'new-rule';
|
|
3
|
+
export interface AddDeviceResult {
|
|
4
|
+
udid?: string;
|
|
5
|
+
newlyKnown: IncyclistCapability[];
|
|
6
|
+
autoSelected: Array<{
|
|
7
|
+
capability: IncyclistCapability;
|
|
8
|
+
rule: AutoSelectRule;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IncyclistCapability } from "incyclist-devices";
|
|
2
|
+
export type ExclusionReason = 'not-available' | 'user';
|
|
3
|
+
export type ExclusionScope = 'until-next-pairing' | 'app-session';
|
|
4
|
+
export interface CapabilityExclusion {
|
|
5
|
+
capability: IncyclistCapability;
|
|
6
|
+
udid: string;
|
|
7
|
+
reason: ExclusionReason;
|
|
8
|
+
scope: ExclusionScope;
|
|
9
|
+
wasConnected: boolean;
|
|
10
|
+
since: number;
|
|
11
|
+
}
|
|
12
|
+
export type ExclusionOptions = Pick<CapabilityExclusion, 'reason' | 'scope'> & {
|
|
13
|
+
wasConnected?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export interface ExclusionFilter {
|
|
16
|
+
capability?: IncyclistCapability;
|
|
17
|
+
udid?: string;
|
|
18
|
+
scope?: ExclusionScope;
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ExclusionReason, ExclusionScope } from '../configuration/model/exclusion';
|
|
2
|
+
export interface ActivatableCapability {
|
|
3
|
+
selected?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
excluded?: {
|
|
6
|
+
reason: ExclusionReason;
|
|
7
|
+
scope: ExclusionScope;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare const isCapabilityActive: (c: ActivatableCapability | undefined) => boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EventLogger } from 'gd-eventlog';
|
|
2
|
+
import { IIncyclistRoutesApi, RouteApiDescription, RouteApiDetail, RouteDescriptionQuery } from "./types";
|
|
3
|
+
import { AxiosInstance } from "axios";
|
|
4
|
+
import { LatLng } from '../../../utils/geo';
|
|
5
|
+
export default class IncyclistRoutesApi implements IIncyclistRoutesApi {
|
|
6
|
+
protected logger: EventLogger;
|
|
7
|
+
protected api: AxiosInstance;
|
|
8
|
+
protected baseUrl?: string;
|
|
9
|
+
protected isExternal: boolean;
|
|
10
|
+
protected source?: string;
|
|
11
|
+
constructor(baseUrl?: string);
|
|
12
|
+
setSource(source: string): void;
|
|
13
|
+
protected logError(err: Error, fn: string, logInfo?: any): void;
|
|
14
|
+
protected getApi(): AxiosInstance;
|
|
15
|
+
protected getBaseUrl(): any;
|
|
16
|
+
getRouteDescriptions(query: RouteDescriptionQuery, throws?: boolean): Promise<Array<RouteApiDescription>>;
|
|
17
|
+
getRouteDetails(routeId: string): Promise<RouteApiDetail>;
|
|
18
|
+
getRoutePreview(routeId: string): Promise<string>;
|
|
19
|
+
getCountry(query: LatLng | Array<LatLng>): Promise<string | undefined>;
|
|
20
|
+
reload(): Promise<void>;
|
|
21
|
+
protected _get(url: string, ...args: any[]): Promise<import("axios").AxiosResponse<any, any, {}, any>>;
|
|
22
|
+
getUserSettings(): import("../../../settings").UserSettingsService;
|
|
23
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IIncyclistRoutesApi } from "./types";
|
|
2
|
+
export declare class IncyclistRoutesApiFactory {
|
|
3
|
+
protected apis: Map<string, IIncyclistRoutesApi>;
|
|
4
|
+
create(key?: string): IIncyclistRoutesApi;
|
|
5
|
+
protected getUserSettings(): import("../../../settings").UserSettingsService;
|
|
6
|
+
}
|
|
7
|
+
export declare const useIncyclistRoutesApi: () => IncyclistRoutesApiFactory;
|
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { AxiosInstance } from "axios";
|
|
4
|
-
import { RoutePoint } from '../types';
|
|
5
|
-
import { LatLng } from '../../../utils/geo';
|
|
6
|
-
export default class IncyclistRoutesApi {
|
|
7
|
-
protected static _instance: any;
|
|
8
|
-
static getInstance(): IncyclistRoutesApi;
|
|
9
|
-
protected logger: EventLogger;
|
|
10
|
-
protected api: AxiosInstance;
|
|
11
|
-
constructor();
|
|
12
|
-
protected logError(err: Error, fn: string, logInfo?: any): void;
|
|
13
|
-
protected getApi(): AxiosInstance;
|
|
14
|
-
protected getBaseUrl(): any;
|
|
15
|
-
getRouteDescriptions(query: RouteDescriptionQuery, throws?: boolean): Promise<Array<RouteApiDescription>>;
|
|
16
|
-
static verify(route: any): void;
|
|
17
|
-
protected static fixMissingRouteDistances(points: Array<RoutePoint>): void;
|
|
18
|
-
getRouteDetails(routeId: string): Promise<RouteApiDetail>;
|
|
19
|
-
getRoutePreview(routeId: string): Promise<string>;
|
|
20
|
-
getCountry(query: LatLng | Array<LatLng>): Promise<string | undefined>;
|
|
21
|
-
reload(): Promise<void>;
|
|
22
|
-
protected _get(url: string, ...args: any[]): Promise<import("axios").AxiosResponse<any, any, {}, any>>;
|
|
23
|
-
protected _reset(): void;
|
|
24
|
-
protected getSetting(key: string, def: any): any;
|
|
25
|
-
getUserSettings(): import("../../../settings").UserSettingsService;
|
|
26
|
-
}
|
|
1
|
+
export * from './api';
|
|
2
|
+
export * from './factory';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LocalizedText } from "../../../i18n";
|
|
2
|
+
import { LatLng } from "../../../utils/geo";
|
|
2
3
|
import { DaumEpp, RouteBase, RouteCategory, RouteInfoText, RoutePoint, RouteProvider, RouteSegment, RouteType, VideoDescription } from "../types";
|
|
3
4
|
export type RouteDescriptionQuery = {
|
|
4
5
|
category?: string;
|
|
@@ -28,6 +29,7 @@ export interface RouteApiDescription extends RouteBase {
|
|
|
28
29
|
requiresDownload?: boolean;
|
|
29
30
|
isDeleted?: boolean;
|
|
30
31
|
selectableSegments?: Array<RouteSegment>;
|
|
32
|
+
apiServer?: string;
|
|
31
33
|
}
|
|
32
34
|
export type LegacyRouteGpxRepoDescription = {
|
|
33
35
|
id: string;
|
|
@@ -76,3 +78,11 @@ export type RouteApiDetail = {
|
|
|
76
78
|
next?: string;
|
|
77
79
|
selectableSegments?: Array<RouteSegment>;
|
|
78
80
|
};
|
|
81
|
+
export interface IIncyclistRoutesApi {
|
|
82
|
+
getRouteDescriptions(query: RouteDescriptionQuery, throws: boolean): Promise<Array<RouteApiDescription>>;
|
|
83
|
+
getRouteDetails(routeId: string): Promise<RouteApiDetail>;
|
|
84
|
+
getRoutePreview(routeId: string): Promise<string>;
|
|
85
|
+
getCountry?(query: LatLng | Array<LatLng>): Promise<string | undefined>;
|
|
86
|
+
reload(): Promise<void>;
|
|
87
|
+
setSource?(source: string): void;
|
|
88
|
+
}
|
|
@@ -13,7 +13,7 @@ export interface TacxParserContext {
|
|
|
13
13
|
}
|
|
14
14
|
export declare class TacxParser implements Parser<ArrayBuffer, RouteApiDetail> {
|
|
15
15
|
protected logger: EventLogger;
|
|
16
|
-
import(file: FileInfo,
|
|
16
|
+
import(file: FileInfo, _data?: ArrayBuffer): Promise<ParseResult<RouteApiDetail>>;
|
|
17
17
|
getData(info: FileInfo, _data?: ArrayBuffer): Promise<ArrayBuffer>;
|
|
18
18
|
supportsContent(data: ArrayBuffer): boolean;
|
|
19
19
|
supportsExtension(extension: string): boolean;
|
|
@@ -9,7 +9,12 @@ export declare class FreeRideService extends IncyclistService {
|
|
|
9
9
|
protected options: FreeRideContinuation[];
|
|
10
10
|
protected currentSegment: FreeRideContinuation;
|
|
11
11
|
protected lastOptionsQueryValid: boolean;
|
|
12
|
+
protected initialized: boolean;
|
|
13
|
+
protected ivInit?: NodeJS.Timeout;
|
|
14
|
+
protected cntInitRetry: number;
|
|
12
15
|
constructor();
|
|
16
|
+
init(): void;
|
|
17
|
+
isInitialized(): boolean;
|
|
13
18
|
selectStartPosition(position?: LatLng | undefined): Promise<{
|
|
14
19
|
position: IncyclistNode;
|
|
15
20
|
options: FreeRideOption[];
|
|
@@ -22,6 +27,7 @@ export declare class FreeRideService extends IncyclistService {
|
|
|
22
27
|
getNextOptions(forStart?: boolean): Promise<FreeRideContinuation[]>;
|
|
23
28
|
getCurrentSegment(): FreeRideContinuation;
|
|
24
29
|
setCurrentSegment(segment: FreeRideContinuation): void;
|
|
30
|
+
protected setInitialized(): void;
|
|
25
31
|
protected getOption(option: FreeRideOption): FreeRideContinuation;
|
|
26
32
|
private loadNextOptions;
|
|
27
33
|
private evaluateOptions;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { EventLogger } from "gd-eventlog";
|
|
2
2
|
import { Observer, PromiseObserver } from "../../../base/types/observer";
|
|
3
|
-
import
|
|
4
|
-
import { RouteApiDescription, RouteApiDetail } from "../../base/api/types";
|
|
3
|
+
import { IIncyclistRoutesApi, RouteApiDescription, RouteApiDetail } from "../../base/api/types";
|
|
5
4
|
import { Route } from "../../base/model/route";
|
|
6
5
|
import { RouteInfo } from "../../base/types";
|
|
7
6
|
import { Loader, LoadDetailsTargets } from "./types";
|
|
8
7
|
export declare class RoutesApiLoader extends Loader<RouteApiDescription> {
|
|
9
|
-
protected api:
|
|
8
|
+
protected api: IIncyclistRoutesApi;
|
|
10
9
|
protected saveObserver: PromiseObserver<void>;
|
|
11
10
|
protected logger: EventLogger;
|
|
11
|
+
protected processed: Array<string>;
|
|
12
12
|
constructor();
|
|
13
13
|
load(): Observer;
|
|
14
|
+
protected getExternalRouteServers(): Array<IIncyclistRoutesApi>;
|
|
14
15
|
private onLoadDone;
|
|
15
16
|
private processRouteFromApi;
|
|
16
17
|
private emitAndPrepareLoadDetails;
|
|
@@ -25,4 +26,6 @@ export declare class RoutesApiLoader extends Loader<RouteApiDescription> {
|
|
|
25
26
|
private processLoadDetailsResult;
|
|
26
27
|
protected getDetails(route: Route): Promise<void>;
|
|
27
28
|
protected buildRouteInfo(descr: RouteApiDescription, isLocal?: boolean): RouteInfo;
|
|
29
|
+
protected getIncyclistRoutesApi(): import("../../base/api/factory").IncyclistRoutesApiFactory;
|
|
30
|
+
protected getUserSettings(): import("../../../settings").UserSettingsService;
|
|
28
31
|
}
|
|
@@ -101,39 +101,21 @@ export declare class RouteListService extends IncyclistService implements IRoute
|
|
|
101
101
|
setFiltersExpanded(expanded: boolean): void;
|
|
102
102
|
getFiltersExpanded(): boolean;
|
|
103
103
|
isStillLoading(): boolean;
|
|
104
|
-
private applyRouteTypeFilter;
|
|
105
|
-
private applySourceFilter;
|
|
106
|
-
private applyContentTypeFilter;
|
|
107
|
-
private applyCountryFilter;
|
|
108
104
|
getFilterValue(filters: SearchFilter, scope: 'distance' | 'elevation', minMax: 'min' | 'max'): number;
|
|
109
|
-
private applyElevationFilter;
|
|
110
|
-
private applyDistanceFilter;
|
|
111
|
-
private applyTitleFilter;
|
|
112
105
|
stopSearch(): void;
|
|
113
106
|
getFilterOptions(filters?: SearchFilter): SearchFilterOptions;
|
|
114
|
-
private getRoutesForFilterOptions;
|
|
115
107
|
onResize(): void;
|
|
116
108
|
onCarouselInitialized(list: CardList<Route>, item: any, itemsInSlide: any): void;
|
|
117
109
|
onCarouselUpdated(list: any): void;
|
|
118
110
|
preload(): PromiseObserver<void>;
|
|
119
|
-
private createRoutesLogEntry;
|
|
120
111
|
getLists(forUi?: boolean): Array<CardList<Route>>;
|
|
121
112
|
getRouteDetails(id: string, expectLocal?: boolean): Promise<RouteDetailUIItem>;
|
|
122
113
|
requestRouteDetails(id: string, onResult: (details?: RouteDetailUIItem) => void): () => void;
|
|
123
114
|
loadRouteShape(id: string): Promise<RouteShape | undefined>;
|
|
124
|
-
protected backfillRouteShape(route: Route): void;
|
|
125
115
|
getRouteDescription(id: string): RouteInfo;
|
|
126
116
|
getRoute(id: string): Route;
|
|
127
117
|
getRideRoute(id?: string): Route;
|
|
128
118
|
getAppliedSmoothingLevel(): number;
|
|
129
|
-
protected logNoiseStats(route: Route): void;
|
|
130
|
-
protected buildRideRoute(route: Route): {
|
|
131
|
-
route: Route;
|
|
132
|
-
level: number;
|
|
133
|
-
};
|
|
134
|
-
protected smoothRoute(route: Route, level: number): Route;
|
|
135
|
-
protected isRideRouteValid(original: Route, candidate: Route): boolean;
|
|
136
|
-
protected readSmoothingLevel(settings: RouteStartSettings): number;
|
|
137
119
|
getSelectedRouteDetails(): Promise<RouteApiDetail>;
|
|
138
120
|
unselect(): void;
|
|
139
121
|
select(route: Route): void;
|
|
@@ -144,7 +126,6 @@ export declare class RouteListService extends IncyclistService implements IRoute
|
|
|
144
126
|
importId?: string;
|
|
145
127
|
observer?: IObserver;
|
|
146
128
|
}): void;
|
|
147
|
-
private importOneFile;
|
|
148
129
|
pauseListUpdates(): void;
|
|
149
130
|
resumeListUpdates(): void;
|
|
150
131
|
emitLists(event: 'loaded' | 'updated', props?: {
|
|
@@ -153,18 +134,48 @@ export declare class RouteListService extends IncyclistService implements IRoute
|
|
|
153
134
|
}): void;
|
|
154
135
|
getCard(id: string): RouteCard;
|
|
155
136
|
addCardAgain(card: RouteCard): void;
|
|
137
|
+
existsBySourceUri(uri: string): boolean;
|
|
138
|
+
getBySourceUri(uri: string): Route;
|
|
139
|
+
isFreeRideSupported(): boolean;
|
|
140
|
+
addRoute(route: Route, source?: 'user' | 'system' | 'import'): void;
|
|
141
|
+
forgetRoute(target: Route | string): void;
|
|
142
|
+
createPreview(descr: RouteInfo): Promise<unknown>;
|
|
143
|
+
findCard(target: Route | string): {
|
|
144
|
+
card: RouteCard;
|
|
145
|
+
list: CardList<Route>;
|
|
146
|
+
};
|
|
147
|
+
getExternalApiProviders(): Map<string, string> | null;
|
|
148
|
+
addExternalApiProvider(key: string, url: string): void;
|
|
149
|
+
deleteExternalApiProvider(key: string): void;
|
|
150
|
+
private applyRouteTypeFilter;
|
|
151
|
+
private applySourceFilter;
|
|
152
|
+
private applyContentTypeFilter;
|
|
153
|
+
private applyCountryFilter;
|
|
154
|
+
private applyElevationFilter;
|
|
155
|
+
private applyDistanceFilter;
|
|
156
|
+
private applyTitleFilter;
|
|
157
|
+
private getRoutesForFilterOptions;
|
|
158
|
+
private createRoutesLogEntry;
|
|
159
|
+
protected backfillRouteShape(route: Route): void;
|
|
160
|
+
protected logNoiseStats(route: Route): void;
|
|
161
|
+
protected buildRideRoute(route: Route): {
|
|
162
|
+
route: Route;
|
|
163
|
+
level: number;
|
|
164
|
+
};
|
|
165
|
+
protected smoothRoute(route: Route, level: number): Route;
|
|
166
|
+
protected isRideRouteValid(original: Route, candidate: Route): boolean;
|
|
167
|
+
protected readSmoothingLevel(settings: RouteStartSettings): number;
|
|
168
|
+
private importOneFile;
|
|
156
169
|
protected addImportCard(file: FileInfo): ActiveImportCard;
|
|
157
170
|
protected getFilterContentTypes(filters?: SearchFilter): Array<string>;
|
|
158
171
|
protected getFilterRouteTypes(filters?: SearchFilter): Array<string>;
|
|
159
172
|
protected getFilterRouteSources(filters?: SearchFilter): Array<string>;
|
|
173
|
+
private getAllAppSources;
|
|
174
|
+
private getAllExternalRouteSources;
|
|
160
175
|
protected getFilterCountries(filters?: SearchFilter): Array<string>;
|
|
161
|
-
existsBySourceUri(uri: string): boolean;
|
|
162
|
-
getBySourceUri(uri: string): Route;
|
|
163
|
-
addRoute(route: Route, source?: 'user' | 'system' | 'import'): void;
|
|
164
176
|
protected hasAttachedCard(route: Route): boolean;
|
|
165
|
-
forgetRoute(target: Route | string): void;
|
|
166
177
|
protected addFromApi(route: Route): Promise<void>;
|
|
167
|
-
protected update(route: Route,
|
|
178
|
+
protected update(route: Route, _source?: 'user' | 'system'): Promise<void>;
|
|
168
179
|
protected loadRoutes(): Promise<void>;
|
|
169
180
|
protected preloadDetails(): Promise<void>;
|
|
170
181
|
protected startSync(): void;
|
|
@@ -187,14 +198,9 @@ export declare class RouteListService extends IncyclistService implements IRoute
|
|
|
187
198
|
private selectListForVideo;
|
|
188
199
|
private selectListForSource;
|
|
189
200
|
private addCustomList;
|
|
190
|
-
createPreview(descr: RouteInfo): Promise<unknown>;
|
|
191
201
|
protected checkExistingPreviewFiles(descr: RouteInfo): Promise<string | undefined>;
|
|
192
202
|
protected doCreatePreview(descr: RouteInfo): Promise<string>;
|
|
193
203
|
protected processPreviewQueue(): PromiseObserver<void>;
|
|
194
|
-
findCard(target: Route | string): {
|
|
195
|
-
card: RouteCard;
|
|
196
|
-
list: CardList<Route>;
|
|
197
|
-
};
|
|
198
204
|
protected resetCards(): void;
|
|
199
205
|
protected invalidateSearchCache(): void;
|
|
200
206
|
protected getAllSearchCards(): RouteCard[];
|
|
@@ -225,6 +231,8 @@ export declare class RouteListService extends IncyclistService implements IRoute
|
|
|
225
231
|
protected getPreviewStore(): import("../previews/store").PreviewStore;
|
|
226
232
|
protected getRouteShapeStore(): import("../shapes/store").RouteShapeStore;
|
|
227
233
|
protected getRouteLibraryScanner(): import("../library/service").RouteLibraryScannerService;
|
|
234
|
+
protected getIncyclistRoutesApi(): import("../base/api/factory").IncyclistRoutesApiFactory;
|
|
235
|
+
protected getFreeRideService(): import("../free-ride").FreeRideService;
|
|
228
236
|
reset(): void;
|
|
229
237
|
}
|
|
230
238
|
export declare const useRouteList: () => RouteListService;
|