Class default

Hierarchy

  • default

Constructors

  • Create a new DSBmobile wrapper You need to wait a short time after creating an instance of this, because the token needs to be fetched. You can also call fetchToken() by yourself.

    Parameters

    • Optional id: string

      Your DSBmobile ID

    • Optional password: string

      Your DSBmobile Password

    • Optional baseURL: string
    • Optional resourceBaseURL: string
    • Optional token: string

    Returns default

  • Create a new DSBmobile wrapper by passing a config object

    Parameters

    Returns default

Properties

baseURL: string = "https://mobileapi.dsbcontrol.de"
id: string
password: string
requester: Requester
resourceBaseURL: string = "https://light.dsbcontrol.de"
token: string

Methods

  • Check whether the token is existing and throw an Error if not

    Returns Promise<void>

  • Fetch your token. The token is stored in this object

    Throws

    WrongCredentials if the credentials aren't right

    Returns Promise<void>

  • Get your current Timetable

    Throws

    MissingToken if the token isn't declared

    Throws

    IncompatiblePlan if the format of the targeted plan is not supported

    Returns

    A new TimeTable resource

    Returns Promise<TimeTable>

  • Returns

    This object as a JSON representation

    Returns object

  • Create a new instance from JSON

    Returns

    A new Dsbmobile instance

    Parameters

    • data: object

      The JSON data

    Returns default

Generated using TypeDoc