mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
remove unused code, minor changes
This commit is contained in:
parent
b37bedba26
commit
e98cec1734
5 changed files with 3 additions and 191 deletions
|
@ -46,6 +46,7 @@ With `opt`, you can override the default options, which look like this:
|
|||
|
||||
earlierThan: null, // ref to get journeys earlier than the last query
|
||||
laterThan: null, // ref to get journeys later than the last query
|
||||
|
||||
results: 5, // how many journeys?
|
||||
via: null, // let journeys pass this station
|
||||
stopovers: false, // return stations on the way?
|
||||
|
|
2
index.js
2
index.js
|
@ -445,7 +445,7 @@ const createClient = (profile, userAgent, request = _request) => {
|
|||
}
|
||||
})
|
||||
.then((d) => {
|
||||
if (!Array.isArray(d.jnyL)) return []
|
||||
if (!Array.isArray(d.jnyL) || d.jnyL.length === 0) return []
|
||||
|
||||
const parse = profile.parseMovement(profile, opt, {
|
||||
locations: d.locations,
|
||||
|
|
|
@ -28,7 +28,7 @@ const md5 = input => createHash('md5').update(input).digest()
|
|||
|
||||
const request = (profile, userAgent, opt, data) => {
|
||||
const body = profile.transformReqBody({
|
||||
lang: opt.language || 'en',
|
||||
lang: opt.language || 'en', // todo: is it `eng` actually?
|
||||
svcReqL: [data]
|
||||
})
|
||||
const req = profile.transformReq({
|
||||
|
|
188
parse/hint.js
188
parse/hint.js
|
@ -1,193 +1,5 @@
|
|||
'use strict'
|
||||
|
||||
const hints = Object.assign(Object.create(null), {
|
||||
fb: {
|
||||
type: 'hint',
|
||||
code: 'bicycle-conveyance',
|
||||
summary: 'bicycles conveyed'
|
||||
},
|
||||
fr: {
|
||||
type: 'hint',
|
||||
code: 'bicycle-conveyance-reservation',
|
||||
summary: 'bicycles conveyed, subject to reservation'
|
||||
},
|
||||
nf: {
|
||||
type: 'hint',
|
||||
code: 'no-bicycle-conveyance',
|
||||
summary: 'bicycles not conveyed'
|
||||
},
|
||||
k2: {
|
||||
type: 'hint',
|
||||
code: '2nd-class-only',
|
||||
summary: '2. class only'
|
||||
},
|
||||
eh: {
|
||||
type: 'hint',
|
||||
code: 'boarding-ramp',
|
||||
summary: 'vehicle-mounted boarding ramp available'
|
||||
},
|
||||
ro: {
|
||||
type: 'hint',
|
||||
code: 'wheelchairs-space',
|
||||
summary: 'space for wheelchairs'
|
||||
},
|
||||
oa: {
|
||||
type: 'hint',
|
||||
code: 'wheelchairs-space-reservation',
|
||||
summary: 'space for wheelchairs, subject to reservation'
|
||||
},
|
||||
wv: {
|
||||
type: 'hint',
|
||||
code: 'wifi',
|
||||
summary: 'WiFi available'
|
||||
},
|
||||
wi: {
|
||||
type: 'hint',
|
||||
code: 'wifi',
|
||||
summary: 'WiFi available'
|
||||
},
|
||||
sn: {
|
||||
type: 'hint',
|
||||
code: 'snacks',
|
||||
summary: 'snacks available for purchase'
|
||||
},
|
||||
mb: {
|
||||
type: 'hint',
|
||||
code: 'snacks',
|
||||
summary: 'snacks available for purchase'
|
||||
},
|
||||
mp: {
|
||||
type: 'hint',
|
||||
code: 'snacks',
|
||||
summary: 'snacks available for purchase at the seat'
|
||||
},
|
||||
bf: {
|
||||
type: 'hint',
|
||||
code: 'barrier-free',
|
||||
summary: 'barrier-free'
|
||||
},
|
||||
rg: {
|
||||
type: 'hint',
|
||||
code: 'barrier-free-vehicle',
|
||||
summary: 'barrier-free vehicle'
|
||||
},
|
||||
bt: {
|
||||
type: 'hint',
|
||||
code: 'on-board-bistro',
|
||||
summary: 'Bordbistro available'
|
||||
},
|
||||
br: {
|
||||
type: 'hint',
|
||||
code: 'on-board-restaurant',
|
||||
summary: 'Bordrestaurant available'
|
||||
},
|
||||
ki: {
|
||||
type: 'hint',
|
||||
code: 'childrens-area',
|
||||
summary: `children's area available`
|
||||
},
|
||||
kk: {
|
||||
type: 'hint',
|
||||
code: 'parents-childrens-compartment',
|
||||
summary: `parent-and-children compartment available`
|
||||
},
|
||||
kr: {
|
||||
type: 'hint',
|
||||
code: 'kids-service',
|
||||
summary: 'DB Kids Service available'
|
||||
},
|
||||
ls: {
|
||||
type: 'hint',
|
||||
code: 'power-sockets',
|
||||
summary: 'power sockets available'
|
||||
},
|
||||
ev: {
|
||||
type: 'hint',
|
||||
code: 'replacement-service',
|
||||
summary: 'replacement service'
|
||||
},
|
||||
kl: {
|
||||
type: 'hint',
|
||||
code: 'air-conditioned',
|
||||
summary: 'air-conditioned vehicle'
|
||||
},
|
||||
r0: {
|
||||
type: 'hint',
|
||||
code: 'upward-escalator',
|
||||
summary: 'upward escalator'
|
||||
},
|
||||
au: {
|
||||
type: 'hint',
|
||||
code: 'elevator',
|
||||
summary: 'elevator available'
|
||||
},
|
||||
ck: {
|
||||
type: 'hint',
|
||||
code: 'komfort-checkin',
|
||||
summary: 'Komfort-Checkin available'
|
||||
},
|
||||
it: {
|
||||
type: 'hint',
|
||||
code: 'ice-sprinter',
|
||||
summary: 'ICE Sprinter service'
|
||||
},
|
||||
rp: {
|
||||
type: 'hint',
|
||||
code: 'compulsory-reservation',
|
||||
summary: 'compulsory seat reservation'
|
||||
},
|
||||
rm: {
|
||||
type: 'hint',
|
||||
code: 'optional-reservation',
|
||||
summary: 'optional seat reservation'
|
||||
},
|
||||
scl: {
|
||||
type: 'hint',
|
||||
code: 'all-2nd-class-seats-reserved',
|
||||
summary: 'all 2nd class seats reserved'
|
||||
},
|
||||
acl: {
|
||||
type: 'hint',
|
||||
code: 'all-seats-reserved',
|
||||
summary: 'all seats reserved'
|
||||
},
|
||||
sk: {
|
||||
type: 'hint',
|
||||
code: 'oversize-luggage-forbidden',
|
||||
summary: 'oversize luggage not allowed'
|
||||
},
|
||||
hu: {
|
||||
type: 'hint',
|
||||
code: 'animals-forbidden',
|
||||
summary: 'animals not allowed, except guide dogs'
|
||||
},
|
||||
ik: {
|
||||
type: 'hint',
|
||||
code: 'baby-cot-required',
|
||||
summary: 'baby cot/child seat required'
|
||||
},
|
||||
ee: {
|
||||
type: 'hint',
|
||||
code: 'on-board-entertainment',
|
||||
summary: 'on-board entertainment available'
|
||||
},
|
||||
toilet: {
|
||||
type: 'hint',
|
||||
code: 'toilet',
|
||||
summary: 'toilet available'
|
||||
},
|
||||
oc: {
|
||||
type: 'hint',
|
||||
code: 'wheelchair-accessible-toilet',
|
||||
summary: 'wheelchair-accessible toilet available'
|
||||
},
|
||||
iz: {
|
||||
type: 'hint',
|
||||
code: 'intercity-2',
|
||||
summary: 'Intercity 2'
|
||||
}
|
||||
})
|
||||
|
||||
const codesByIcon = Object.assign(Object.create(null), {
|
||||
cancel: 'cancelled'
|
||||
})
|
||||
|
|
|
@ -41,7 +41,6 @@ const applyRemarks = (leg, hints, warnings, refs) => {
|
|||
|
||||
const createParseJourneyLeg = (profile, opt, data) => {
|
||||
const {locations, lines, hints, warnings, polylines} = data
|
||||
// todo: pt.status
|
||||
// todo: pt.status, pt.isPartCncl
|
||||
// todo: pt.isRchbl, pt.chRatingRT, pt.chgDurR, pt.minChg
|
||||
// todo: pt.sDays
|
||||
|
|
Loading…
Add table
Reference in a new issue