Skip to content

support all VDV-453/-454 services #4

@derhuerst

Description

@derhuerst

This client should support all VDV-453/VDV-454 services, not just those that VBB currently uses.

vdv-453-client/index.js

Lines 19 to 30 in 0ace9f3

const {
DFI,
// REF_DFI,
// ANS,
// REF_ANS,
// > Dieser Dienst wird derzeit nicht von der VBB Datendrehscheibe unterstützt.
// VIS,
// > Dieser Dienst wird derzeit nicht von der VBB Datendrehscheibe unterstützt.
// AND,
AUS,
// REF_AUS,
} = SERVICES

vdv-453-client/index.js

Lines 51 to 56 in 0ace9f3

const ABO_ANFRAGE_ROOT_SUB_TAGS_BY_SERVICE = new Map([
[DFI, 'AboAZB'],
// [REF_DFI, 'AboAZBRef'],
[AUS, 'AboAUS'],
// [REF_AUS, 'AboAUSRef'],
])

vdv-453-client/index.js

Lines 70 to 76 in 0ace9f3

const DATEN_ABRUFEN_ANTWORT_ROOT_SUB_TAGS_BY_SERVICE = new Map([
[DFI, 'AZBNachricht'],
// [REF_DFI, 'AZBNachricht'],
// todo: rather pick AUSNachricht children (FahrtVerband, Linienfahrplan, SollUmlauf, IstFahrt, IstUmlauf, GesAnschluss)? – AUSNachricht has ~500kb of children, so this would lead to smaller XML trees being read into memory
[AUS, 'AUSNachricht'],
// [REF_AUS, 'AUSNachricht'],
])

vdv-453-client/index.js

Lines 543 to 550 in 0ace9f3

_handleClientStatusAnfrage(DFI)
// _handleClientStatusAnfrage(REF_DFI)
// _handleClientStatusAnfrage(ANS)
// _handleClientStatusAnfrage(REF_ANS)
// _handleClientStatusAnfrage(VIS)
// _handleClientStatusAnfrage(AND)
_handleClientStatusAnfrage(AUS)
// _handleClientStatusAnfrage(REF_AUS)

vdv-453-client/index.js

Lines 738 to 751 in 0ace9f3

return {
logger,
sendRequest,
httpServer,
data,
dfiSubscribe,
dfiUnsubscribe,
dfiUnsubscribeAll,
dfiFetchData,
ausSubscribe,
ausUnsubscribe,
ausUnsubscribeAll,
ausFetchData,
}

// service + ':' + call -> response body's root elements
const CLIENT_RESPONSE_ROOT_ELS_BY_PATH = new Map([
[SERVICES.DFI + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
[SERVICES.DFI + ':' + SERVER_CALLS.DATEN_BEREIT, 'DatenBereitAntwort'],
// todo: other calls on DFI
[SERVICES.REF_DFI + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
[SERVICES.REF_DFI + ':' + SERVER_CALLS.DATEN_BEREIT, 'DatenBereitAntwort'],
// todo: other calls on REF_DFI
[SERVICES.ANS + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
// todo: other calls on ANS
[SERVICES.REF_ANS + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
// todo: other calls on REF_ANS
[SERVICES.VIS + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
// todo: other calls on VIS
[SERVICES.AND + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
// todo: other calls on AND
[SERVICES.AUS + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
// todo: other calls on AUS
[SERVICES.REF_AUS + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
// todo: other calls on REF_AUS
])

vdv-453-client/index.js

Lines 127 to 128 in be70352

// The VBB VDV-453 system doesn't seem to notify us about new/changed data (see _handleDatenBereitAnfrage), so we fetch the data "manually" periodically.
fetchSubscriptionsDataPeriodically: true,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions