mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-04-20 23:23:56 +03:00
refactor
This commit is contained in:
parent
b20cf1060a
commit
883eb8c8de
8 changed files with 29 additions and 12 deletions
|
@ -2,10 +2,6 @@ import {request} from '../lib/request.js';
|
||||||
import {products} from '../lib/products.js';
|
import {products} from '../lib/products.js';
|
||||||
import {ageGroup, ageGroupFromAge, ageGroupLabel} from './age-group.js';
|
import {ageGroup, ageGroupFromAge, ageGroupLabel} from './age-group.js';
|
||||||
|
|
||||||
import {formatStationBoardReq} from '../format/station-board-req.js';
|
|
||||||
import {formatTripReq} from '../format/trip-req.js';
|
|
||||||
import {formatNearbyReq} from '../format/nearby-req.js';
|
|
||||||
|
|
||||||
import {parseDateTime} from '../parse/date-time.js';
|
import {parseDateTime} from '../parse/date-time.js';
|
||||||
import {parsePlatform} from '../parse/platform.js';
|
import {parsePlatform} from '../parse/platform.js';
|
||||||
import {parseProducts} from '../parse/products.js';
|
import {parseProducts} from '../parse/products.js';
|
||||||
|
@ -61,13 +57,13 @@ const defaultProfile = {
|
||||||
logRequest,
|
logRequest,
|
||||||
logResponse,
|
logResponse,
|
||||||
|
|
||||||
formatStationBoardReq,
|
|
||||||
formatLocationsReq: notImplemented,
|
|
||||||
formatStopReq: notImplemented,
|
|
||||||
formatTripReq,
|
|
||||||
formatNearbyReq,
|
|
||||||
formatJourneysReq: notImplemented,
|
formatJourneysReq: notImplemented,
|
||||||
formatRefreshJourneyReq: notImplemented,
|
formatRefreshJourneyReq: notImplemented,
|
||||||
|
formatTripReq: notImplemented,
|
||||||
|
formatNearbyReq: notImplemented,
|
||||||
|
formatLocationsReq: notImplemented,
|
||||||
|
formatStopReq: notImplemented,
|
||||||
|
formatStationBoardReq: notImplemented,
|
||||||
transformJourneysQuery: id,
|
transformJourneysQuery: id,
|
||||||
|
|
||||||
parseDateTime,
|
parseDateTime,
|
||||||
|
|
|
@ -30,6 +30,7 @@ const tripEndpoint_dbnav = dbnavBase.tripEndpoint;
|
||||||
const tripEndpoint_dbregioguide = dbregioguideBase.tripEndpoint;
|
const tripEndpoint_dbregioguide = dbregioguideBase.tripEndpoint;
|
||||||
|
|
||||||
// arrivals(), departures()
|
// arrivals(), departures()
|
||||||
|
import {formatStationBoardReq} from '../dbregioguide/station-board-req.js';
|
||||||
const {boardEndpoint} = dbregioguideBase;
|
const {boardEndpoint} = dbregioguideBase;
|
||||||
|
|
||||||
const profile = {
|
const profile = {
|
||||||
|
@ -56,6 +57,7 @@ const profile = {
|
||||||
formatTripReq,
|
formatTripReq,
|
||||||
tripEndpoint_dbnav, tripEndpoint_dbregioguide,
|
tripEndpoint_dbnav, tripEndpoint_dbregioguide,
|
||||||
|
|
||||||
|
formatStationBoardReq,
|
||||||
boardEndpoint,
|
boardEndpoint,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import baseProfile from './base.json' with { type: 'json' };
|
import baseProfile from './base.json' with { type: 'json' };
|
||||||
import {products} from '../../lib/products.js';
|
import {products} from '../../lib/products.js';
|
||||||
import {formatTripReq} from './trip-req.js';
|
import {formatTripReq} from './trip-req.js';
|
||||||
|
import {formatStationBoardReq} from './station-board-req.js';
|
||||||
|
|
||||||
const profile = {
|
const profile = {
|
||||||
...baseProfile,
|
...baseProfile,
|
||||||
|
@ -9,6 +10,21 @@ const profile = {
|
||||||
|
|
||||||
products,
|
products,
|
||||||
formatTripReq,
|
formatTripReq,
|
||||||
|
formatStationBoardReq,
|
||||||
|
|
||||||
|
journeysOutFrwd: false,
|
||||||
|
departuresGetPasslist: false,
|
||||||
|
departuresStbFltrEquiv: true,
|
||||||
|
trip: false,
|
||||||
|
radar: false,
|
||||||
|
refreshJourney: false,
|
||||||
|
journeysFromTrip: false,
|
||||||
|
refreshJourneyUseOutReconL: false,
|
||||||
|
tripsByName: false,
|
||||||
|
remarks: false,
|
||||||
|
remarksGetPolyline: false,
|
||||||
|
reachableFrom: false,
|
||||||
|
lines: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|
|
@ -9,10 +9,9 @@ const profile = {
|
||||||
|
|
||||||
products,
|
products,
|
||||||
|
|
||||||
|
|
||||||
formatStationBoardReq,
|
formatStationBoardReq,
|
||||||
|
|
||||||
journeysOutFrwd: true,
|
journeysOutFrwd: false,
|
||||||
departuresGetPasslist: true,
|
departuresGetPasslist: true,
|
||||||
departuresStbFltrEquiv: true,
|
departuresStbFltrEquiv: true,
|
||||||
trip: false,
|
trip: false,
|
||||||
|
|
|
@ -4,6 +4,8 @@ import {formatJourneysReq, formatRefreshJourneyReq} from './journeys-req.js';
|
||||||
import {formatLocationFilter} from './location-filter.js';
|
import {formatLocationFilter} from './location-filter.js';
|
||||||
import {formatLocationsReq} from './locations-req.js';
|
import {formatLocationsReq} from './locations-req.js';
|
||||||
import {formatStationBoardReq} from './station-board-req.js';
|
import {formatStationBoardReq} from './station-board-req.js';
|
||||||
|
import {formatTripReq} from './trip-req.js';
|
||||||
|
import {formatNearbyReq} from './nearby-req.js';
|
||||||
|
|
||||||
const profile = {
|
const profile = {
|
||||||
...baseProfile,
|
...baseProfile,
|
||||||
|
@ -14,9 +16,11 @@ const profile = {
|
||||||
|
|
||||||
formatJourneysReq,
|
formatJourneysReq,
|
||||||
formatRefreshJourneyReq,
|
formatRefreshJourneyReq,
|
||||||
|
formatTripReq,
|
||||||
|
formatNearbyReq,
|
||||||
formatLocationsReq,
|
formatLocationsReq,
|
||||||
formatLocationFilter,
|
|
||||||
formatStationBoardReq,
|
formatStationBoardReq,
|
||||||
|
formatLocationFilter,
|
||||||
|
|
||||||
departuresGetPasslist: true,
|
departuresGetPasslist: true,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue