Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TrapezeApiClient

Hierarchy

  • TrapezeApiClient

Index

Constructors

constructor

  • new TrapezeApiClient(endpoint: string, proxies?: string | string[], randomUserAgent?: boolean): TrapezeApiClient
  • since

    1.0.0

    Parameters

    • endpoint: string

      the endpoint base Url to query

    • Optional proxies: string | string[]
    • Default value randomUserAgent: boolean = false

    Returns TrapezeApiClient

Properties

endpoint

endpoint: string

the endpoint base Url to query

Private httpClient

httpClient: req.RequestAPI<reqp.RequestPromise<any>, reqp.RequestPromiseOptions, req.UriOptions>

Optional proxies

proxies: string | string[]

randomUserAgent

randomUserAgent: boolean

Methods

getProxy

  • getProxy(): string | undefined

getRouteByRouteId

  • getRouteByRouteId(routeId: RouteId, direction: string): reqp.RequestPromise<IVehiclePathInfo>
  • since

    3.0.0

    Parameters

    • routeId: RouteId

      the route id

    • direction: string

    Returns reqp.RequestPromise<IVehiclePathInfo>

getRouteByTripId

  • getRouteByTripId(tripId: TripId): reqp.RequestPromise<IVehiclePathInfo>
  • since

    1.0.0

    Parameters

    • tripId: TripId

      tripId to query

    Returns reqp.RequestPromise<IVehiclePathInfo>

getRouteByVehicleId

  • getRouteByVehicleId(vehicleId: VehicleId): reqp.RequestPromise<IVehiclePathInfo>
  • since

    1.0.0

    Parameters

    • vehicleId: VehicleId

      the vehicleId

    Returns reqp.RequestPromise<IVehiclePathInfo>

getSettings

  • getSettings(): reqp.RequestPromise<ISettings>

getStopInfo

  • getStopInfo(stopId: StopId): reqp.RequestPromise<IStopInfo>

getStopLocations

  • getStopLocations(box?: IBoundingBox): reqp.RequestPromise<IStopLocations>
  • since

    1.4.0

    Parameters

    • Default value box: IBoundingBox = {bottom: -324000000,left: -648000000,right: 648000000,top: 324000000,}

    Returns reqp.RequestPromise<IStopLocations>

getStopPassages

  • getStopPassages(stopId: StopId, mode?: StopMode, startTime?: undefined | number, timeFrame?: undefined | number): reqp.RequestPromise<IStopPassage>
  • since

    2.3.0

    Parameters

    • stopId: StopId
    • Default value mode: StopMode = "departure"
    • Optional startTime: undefined | number

      milliseconds since epoch. now if undefined

    • Optional timeFrame: undefined | number

      time frame from startTime in minutes

    Returns reqp.RequestPromise<IStopPassage>

getStopPointInfo

  • getStopPointInfo(stopPointId: string): reqp.RequestPromise<IStopPointInfo>
  • since

    1.0.0

    Parameters

    • stopPointId: string

    Returns reqp.RequestPromise<IStopPointInfo>

getStopPointLocations

  • getStopPointLocations(box?: IBoundingBox): reqp.RequestPromise<IStopPointLocations>
  • since

    1.4.0

    Parameters

    • Default value box: IBoundingBox = {bottom: -324000000,left: -648000000,right: 648000000,top: 324000000,}

    Returns reqp.RequestPromise<IStopPointLocations>

getStopPointPassages

  • getStopPointPassages(stopId: StopId, mode?: StopMode, startTime?: undefined | number, timeFrame?: undefined | number): reqp.RequestPromise<IStopPassage>
  • since

    3.0.0

    Parameters

    • stopId: StopId
    • Default value mode: StopMode = "departure"
    • Optional startTime: undefined | number

      milliseconds since epoch. now if undefined

    • Optional timeFrame: undefined | number

      time frame from startTime in minutes

    Returns reqp.RequestPromise<IStopPassage>

getTripPassages

  • getTripPassages(tripId: TripId, mode?: StopMode): reqp.RequestPromise<ITripPassages>

getVehicleLocations

  • getVehicleLocations(positionType?: PositionType, lastUpdate?: string | number): reqp.RequestPromise<IVehicleLocationList>
  • Correct

    Parameters

    • Default value positionType: PositionType = "CORRECTED"

      coordinate type

    • Optional lastUpdate: string | number

      timestamp of last update

    Returns reqp.RequestPromise<IVehicleLocationList>

request

  • request<T>(reqOpts: req.OptionsWithUri): reqp.RequestPromise<T>
  • Type parameters

    • T

    Parameters

    • reqOpts: req.OptionsWithUri

    Returns reqp.RequestPromise<T>

Generated using TypeDoc