syncromatics-track-api

3.36.5

Track

Root of the Track API resources

new Track(options: any)

Extends Resource

Parameters
options (any)
Static Members
▸ validateJwt(jwt)
Instance Members
▸ onAutoRenew(options, user)
▸ constructor(options?)
▸ stopAutoRenew()
▸ parseToken(token)
▸ authenticateToken(token)
▸ logIn(options)
▸ logOut()
▸ renewAuthentication()
▸ customers()
▸ customer(code)
▸ externalApis()
▸ externalApi(id)
▸ roles()
▸ role(id)
▸ user(id)

Resource

Base "Resource" context type for all other resources

new Resource(client: any)
Parameters
client (any)
Instance Members
▸ constructor(client)
▸ client
▸ hydrated
▸ resource(Type, rest)

Customer

Customer resource

This acts as the context for accessing all customer-specific data.

new Customer(client: any, realTimeClient: any, customerCode: any)

Extends Resource

Parameters
client (any)
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(client, realTimeClient, customerCode)
▸ code
▸ realTime()
▸ agency(payload)
▸ area(id)
▸ areas()
▸ asset(payload)
▸ assets()
▸ assignableRoute(id)
▸ assignableRoutes()
▸ assignableStop(id)
▸ assignableStops()
▸ assignment(id)
▸ block(id)
▸ call(payload)
▸ voipCallRecord(id)
▸ voipCallRecords()
▸ callParticipant(callId, payload)
▸ dispatchMessages()
▸ dispatchMessage(id)
▸ dispatchMessageBatch(id)
▸ dispatchMessageStatus()
▸ drivers()
▸ driver(id)
▸ enplugScreenshot(serial)
▸ enplugConfiguration(configOptions?)
▸ externalApis()
▸ externalApi(id)
▸ incident(id)
▸ messageChannels()
▸ messages()
▸ message(payload)
▸ riderAppConfiguration(payload)
▸ reportingTicket()
▸ routes()
▸ route(id)
▸ patterns()
▸ pattern(id, options?)
▸ run(id)
▸ servicePackages()
▸ servicePackage(id)
▸ service(id, includeDetours)
▸ settings()
▸ signs()
▸ sign(id)
▸ stops()
▸ stop(id)
▸ tags()
▸ tag(id)
▸ trip(id)
▸ tripCancelationBatch()
▸ detours()
▸ twitterOAuth()
▸ twitterOAuthRequest()
▸ twitterUsername()
▸ users()
▸ vehicles()
▸ vehicle(id)
▸ voipTicket()

RealTimeContextFactory

A factory for creating entity-specific Real Time Contexts for a given Real Time Client. An implementation detail for providing .realTime() to the Customer resource without creating circular module imports.

new RealTimeContextFactory(realTimeClient: any, customerCode: any)
Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ onDisconnect(handler)
▸ onReconnect(handler)
▸ areas()
▸ assignments()
▸ bikeRackSlots()
▸ tripCancelations()
▸ detours()
▸ callStates()
▸ userMessages(options)
▸ userMessagesStatus()
▸ dispatchMessages()
▸ dispatchMessageStatus()
▸ enplugDetails()
▸ enplugHealths()
▸ incidents()
▸ presence()
▸ signs()
▸ stopArrivals()
▸ stops()
▸ stopTimes()
▸ vehicleArrivals()
▸ vehicles()
▸ voip(options)

AreasRealTimeContext

A real time context that can be used to generate subscriptions to Area entities.

new AreasRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forArea(area)
▸ forAreas(areas)

AssignmentsRealTimeContext

A real time context that can be used to generate subscriptions to Assignment entities.

new AssignmentsRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forVehicle(vehicle)
▸ forVehicles(vehicles)

RealTimeContext

Base "RealTimeContext" type for all other real time contexts.

new RealTimeContext(realTimeClient: any, entityName: any, customerCode: any)
Parameters
realTimeClient (any)
entityName (any)
customerCode (any)
Static Members
▸ resolveHref(resource)
Instance Members
▸ constructor(realTimeClient, entityName, customerCode)
▸ assertSubscriptionNotStarted(attemptedAction)
▸ on(event, handler)
▸ handleEvent(message)

BikeRackSlotsRealTimeContext

A real time context that can be used to generate subscriptions to Bike Rack Slot entities.

new BikeRackSlotsRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forVehicle(vehicle)
▸ forVehicles(vehicles)

CallStatesRealTimeContext

A real time context that can be used to generate subscriptions to Call State entities.

new CallStatesRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forVehicle(vehicle)
▸ forVehicles(vehicles)
▸ forUser(user)
▸ forUsers(users)

UserMessagesRealTimeContext

A context for subscribing to User Messages - ad-hoc conversations between Track users.

Subscribe without naming a room to receive messages for every room belonging to the customer, or restrict the subscription with forRoom() or forRooms().

new UserMessagesRealTimeContext(realTimeClient: any, customerCode: any, options: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
options (any = {})
Instance Members
▸ constructor(realTimeClient, customerCode, options)
▸ forRoom(room)
▸ forRooms(rooms)
▸ send(message, options)
▸ markMessagesRead(messageIds)

UserMessagesStatusRealTimeContext

A context for subscribing to the authenticated user's unread User Message counts, one entry per room.

This is the Track user-to-user equivalent of DispatchMessageStatusRealTimeContext, which reports unread counts for vehicle (dispatch) messaging instead.

The subscription is always scoped to the authenticated user - the server derives the user from the connection, so there are no filters to apply. Subscribing to a specific set of rooms isn't supported by the server yet.

new UserMessagesStatusRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Example
const end = await customer.realTime().userMessagesStatus()
    .on('update', ({ data }) => data.forEach(({ room_href, unread_count }) => {
      // { room_href: '/1/SYNC/room_messages/403', unread_count: 2 }
    }));
Instance Members
▸ constructor(realTimeClient, customerCode)

DispatchMessagesRealTimeContext

A real-time context that can be used to generate subscriptions to Dispatch Messages

new DispatchMessagesRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forDriver(driver)
▸ forDrivers(drivers)

DispatchMessageStatusRealTimeContext

A real time context that can be used to generate subscriptions to Dispatch Message Status entities.

new DispatchMessageStatusRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forUser(user)
▸ forUsers(users)

SignsRealTimeContext

A real-time context that can be used to generate subscriptions to Signs

new SignsRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forSign(sign)
▸ forSigns(signs)

StopsRealTimeContext

A real time context that can be used to generate subscriptions to Stop entities.

new StopsRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forStop(stop)
▸ forStops(stops)

StopArrivalsRealTimeContext

A real-time context that can be used to generate subscriptions to arrivals for stops

new StopArrivalsRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forStop(stop)
▸ forStops(stops)

StopTimesRealTimeContext

A real time context that can be used to generate subscriptions to Stop Time entities.

new StopTimesRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forStop(stop)
▸ forStops(stops)
▸ forTrip(trip)
▸ forTrips(trips)
▸ forVehicle(vehicle)
▸ forVehicles(vehicles)

VehicleArrivalsRealTimeContext

A real-time context that can be used to generate subscriptions to arrivals for vehicles

new VehicleArrivalsRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forVehicle(vehicle)
▸ forVehicles(vehicles)

EnplugDetailsRealTimeContext

A real-time context that can be used to generate subscriptions to enplug details for vehicles

new EnplugDetailsRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forVehicle(vehicle)
▸ forVehicles(vehicles)

EnplugHealthsRealTimeContext

A real-time context that can be used to generate subscriptions to enplug healths for vehicles

new EnplugHealthsRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forVehicle(vehicle)
▸ forVehicles(vehicles)

IncidentsRealTimeContext

A real time context that can be used to generate subscriptions to Incident entities.

new IncidentsRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forVehicle(vehicle)
▸ forVehicles(vehicles)

PresenceRealTimeContext

A real time context that can be used to generate subscriptions to user Presence entities.

Unlike other real time contexts, calling on() only registers the handler locally. Call start() once after registering your handlers to create a single PRESENCE subscription that both the update and delete handlers share:

new PresenceRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Example
const end = await customer.realTime().presence()
    .on('update', onUpdate)
    .on('delete', onDelete)
    .start();
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forUser(user)
▸ forUsers(users)
▸ on(event, handler)
▸ start()

VehiclesRealTimeContext

A real time context that can be used to generate subscriptions to Vehicle entities.

new VehiclesRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forVehicle(vehicle)
▸ forVehicles(vehicles)

VoipHeartbeatHandler

Handler for VOIP call state and receiving desired VOIP call state over heartbeats.

new VoipHeartbeatHandler(realTimeClient: any, customerCode: any, options: any)
Parameters
realTimeClient (any)
customerCode (any)
options (any = {})
Instance Members
▸ constructor(realTimeClient, customerCode, options)
▸ setCallState(callState, callHref)
▸ onDesiredCallStateChange(handler)
▸ onDisconnect(handler)
▸ onReconnect(handler)
▸ startHeartbeat()
▸ stopHeartbeat()

TripCancelationsRealTimeContext

A real time context that can be used to generate subscriptions to TripCancelation entities.

new TripCancelationsRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forCustomer(customer)

DetoursRealTimeContext

A real time context that can be used to generate subscriptions to Detour entities.

new DetoursRealTimeContext(realTimeClient: any, customerCode: any)

Extends RealTimeContext

Parameters
realTimeClient (any)
customerCode (any)
Instance Members
▸ constructor(realTimeClient, customerCode)
▸ forCustomer(customer)

Agency

Agency resource

new Agency(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode)
Instance Members
▸ constructor(client, rest)
▸ fetch()
▸ update()

Area

Area resource

new Area(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()

AreasContext

Area querying context

This is used to query the list of areas for a customer

new AreasContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ getPage()

Asset

Asset resource

new Asset(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()
▸ create()
▸ markSaved()

AssetsContext

Asset querying context

This is used to query the list of assets for a customer

new AssetsContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ withAssetType(assetType)
▸ getPage()

AssignableRoute

AssignableRoute resource

new AssignableRoute(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()

AssignableRoutesContext

AssignableRoutes querying context

This is used to query the list of Assignable Routes for a customer

new AssignableRoutesContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ getPage()

AssignableStop

AssignableStop resource

new AssignableStop(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()

AssignableStopsContext

AssignableStop querying context

This is used to query the list of Assignable Stops for a customer

new AssignableStopsContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ getPage()

Assignment

Vehicle assignment resource

new Assignment(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()
▸ update()
▸ delete()

Block

Block resource

new Block(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()

CustomerUsersContext

User querying context

This is used to query the list of users for a customer

new CustomerUsersContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ withQuery(term)
▸ getPage()

Call

Call resource

new Call(client: any, rest: any)

Extends Resource

Parameters
client (any)
rest (any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()
▸ create()
▸ end()

CallParticipant

CallParticipant resource

new CallParticipant(client: any, rest: any)

Extends Resource

Parameters
client (any)
rest (any)
Static Members
▸ makeHref(customerCode, callId, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()
▸ create()
▸ end()

DispatchMessage

DispatchMessage resource

new DispatchMessage(client: any, rest: any)

Extends Resource

Parameters
client (any)
rest (any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()
▸ create()

DispatchMessagesContext

Dispatch Message querying context

This is used to query the list of dispatch messages for a customer

new DispatchMessagesContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ withQuery(term)
▸ forDriver(driverId)
▸ forVehicle(vehicleId)
▸ sinceDate(date)
▸ beforeDate(date)
▸ getPage()

constructor

Creates a new dispatch message batch

Will populate itself with the values given to it after the client parameter

constructor(client: Client, rest: Array)
Parameters
client (Client) Instance of pre-configured client
rest (Array) Remaining arguments to use in assigning values to this instance
Example

Assigning partial dispatchMessageBatch data to a new instance

const client = new Client();
const partialData = {
  href: '/1/SYNC/dispatch_messages/batches/90892e24-5279-4066-b109-a112925edb89',
  dispatch_messages: [
    { href: '/1/SYNC/dispatch_messages/1' },
    { href: '/1/SYNC/dispatch_messages/2' }
  ]
};
const dispatchMessageBatch = new DispatchMessageBatch(client, partialData);

dispatchMessageBatch.hydrated == true

fetch

Fetches the data for this dispatch message batch via the client

fetch(): Promise
Returns
Promise: If successful, a hydrated instance of this dispatch message batch

create

Creates a new dispatch message batch via the client

create(): Promise
Returns
Promise: If successful, a hydrated instance of this dispatch message batch with id

makeHref

Makes a href for a given customer code and ID

makeHref(customerCode: string, id: string): object
Parameters
customerCode (string) Alphanumeric code of the customer
id (string) ID of the dispatch message batch
Returns
object: href object containing URL for the instance

Driver

Driver resource

new Driver(client: any, rest: any)

Extends Resource

Parameters
client (any)
rest (any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()
▸ update()

DriversContext

Driver querying context

This is used to query the list of drivers for a customer

new DriversContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ withQuery(term)
▸ getPage()

Incident

Incident resource

new Incident(client: any, rest: any)

Extends Resource

Parameters
client (any)
rest (any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ claim()
▸ addNote(note)
▸ dispose(dispositionType, incidentIds?)
▸ disposeIncident(dispositionType)

EnplugScreenshot

EnplugScreenshot resource

new EnplugScreenshot(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, deviceSerial)
Instance Members
▸ constructor(client, rest)
▸ fetch()

EnplugConfiguration

EnplugConfiguration resource

new EnplugConfiguration(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, deviceSerial)
Instance Members
▸ constructor(client, rest)
▸ update()

Message

Message resource

new Message(client: any, rest: any)

Extends Resource

Parameters
client (any)
rest (any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()
▸ create()
▸ update()

SignMessage

Sign message resource

new SignMessage(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Instance Members
▸ constructor(client, rest)

MessagesContext

Message querying context

This is used to query the list of messages for a customer

new MessagesContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ withQuery(term)
▸ getPage()

MessageChannels

MessageChannels resource

new MessageChannels(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode)
Instance Members
▸ constructor(client, rest)
▸ fetch()

DispatchMessageStatus

Dispatch Message Status resource

new DispatchMessageStatus(client: any, rest: any)

Extends Resource

Parameters
client (any)
rest (any)
Static Members
▸ makeHref(customerCode)
Instance Members
▸ constructor(client, rest)
▸ markMessagesRead(messages)

Pattern

Route resource

new Pattern(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id, options?)
Instance Members
▸ constructor(client, rest)
▸ fetch()

PatternsContext

Route querying context

This is used to query the list of patterns for a customer

new PatternsContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ withQuery(term)
▸ withExpandedProperty(propertyName)
▸ withEnabledForOperations(isEnabledForOperations)
▸ withAsOf(asOf)
▸ createDetourPattern(patternPayload)
▸ getPage()

ReportingTicket

ReportingTicket resource

new ReportingTicket(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode)
Instance Members
▸ constructor(client, rest)
▸ fetch()

RiderAppConfiguration

Rider App Configuration resource

new RiderAppConfiguration(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode)
Instance Members
▸ constructor(client, rest)
▸ fetch()
▸ update()

Route

Route resource

new Route(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()

RoutesContext

Route querying context

This is used to query the list of routes for a customer

new RoutesContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ withQuery(term)
▸ getPage()

Run

Run resource

new Run(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()

Service

Service resource

new Service(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id, includeDetours)
Instance Members
▸ constructor(client, rest)
▸ fetch()

ServicePackage

Service package resource

new ServicePackage(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()

ServicePackagesContext

ServicePackage querying context

This is used to query the list of service packages for a customer

new ServicePackagesContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ withQuery(term)
▸ asOf(date)
▸ getPage()

Settings

Settings resource

new Settings(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode)
Instance Members
▸ constructor(client, rest)
▸ fetch()

Sign

Sign resource

new Sign(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()
▸ update()

SignsContext

Sign querying context

This is used to query the list of signs for a customer

new SignsContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ withQuery(term)
▸ getPage()

Stop

Stop resource

new Stop(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch(options = {})
▸ arrivals(options = {})
▸ create()
▸ update()

StopsContext

Stop querying context

This is used to query the list of stops for a customer

new StopsContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ withQuery(term)
▸ include(term)
▸ getPage()

Tag

Tag resource

new Tag(client: any, rest: any)

Extends Resource

Parameters
client (any)
rest (any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()
▸ create()
▸ update()

TagsContext

Tag querying context

This is used to query the list of tags for a customer

new TagsContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ withQuery(term)
▸ getPage()

Trip

Trip resource

new Trip(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()

TwitterOAuth

Write-only Twitter OAuth resource

new TwitterOAuth(client: any, rest: any)

Extends Resource

Parameters
client (any)
rest (any)
Static Members
▸ makeHref(customerCode)
Instance Members
▸ constructor(client, rest)
▸ update()
▸ delete()

TwitterOAuthRequest

Get-only Twitter OAuth Request resource

new TwitterOAuthRequest(client: any, rest: any)

Extends Resource

Parameters
client (any)
rest (any)
Static Members
▸ makeHref(customerCode)
Instance Members
▸ constructor(client, rest)

TwitterUsername

Read-only Twitter Username resource.

new TwitterUsername(client: any, rest: any)

Extends Resource

Parameters
client (any)
rest (any)
Static Members
▸ makeHref(customerCode)
Instance Members
▸ constructor(client, rest)
▸ fetch()

Vehicle

Vehicle resource

new Vehicle(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()

VehicleMedia

VehicleMedia resource

new VehicleMedia(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, vehicleId, mediaId)
Instance Members
▸ constructor(client, rest)
▸ fetch()

VehiclesContext

Vehicle querying context

This is used to query the list of vehicles for a customer

new VehiclesContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ withQuery(term)
▸ getPage()

VoipTicket

VoipTicket resource

new VoipTicket(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode)
Instance Members
▸ constructor(client, rest)
▸ fetch(provisionKey)

VoipCallRecordsContext

Voip call record querying context

This is used to query the list of voip call records for a customer

new VoipCallRecordsContext(client: any, customerCode: any, params: any)

Extends PagedContext

Parameters
client (any)
customerCode (any)
params (any)
Instance Members
▸ constructor(client, customerCode, params)
▸ withQuery(term)
▸ fromDate(date)
▸ toDate(date)
▸ getPage()

VoipCallRecord

VoipCallRecord resource

new VoipCallRecord(client: any, rest: any)

Extends Resource

Parameters
client (any)
rest (any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()

constructor

Creates a new TripCancelationBatch object for fetching/saving trip cancelations

constructor(client: Client, rest: Array)
Parameters
client (Client) Instance of pre-configured client
rest (Array) Remaining arguments to use in assigning values to this instance

fetch

Fetches current trip cancelation data for customer

fetch(): Promise
Returns
Promise: If successful, a hydrated instance of this trip cancelation batch

create

Create new cancelations for customer

create(): Promise
Returns
Promise: If successful, a hydrated instance of this trip cancelation batch

makeHref

Makes a href for a given customer code

makeHref(customerCode: string): object
Parameters
customerCode (string) Alphanumeric code of the customer
Returns
object: href object containing URL for the instance

TripCancelation

TripCancelation resource

new TripCancelation(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ fetch()

Detour

Detour resource

new Detour(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(customerCode, id)
Instance Members
▸ constructor(client, rest)
▸ getHistoricalDetours(from?, until?, includeDeactivated, expandDetails, count?)
▸ fetch()
▸ create(data)
▸ deactivate(detourId)

ExternalApi

External API resource

new ExternalApi(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(id)
Instance Members
▸ constructor(client, rest)
▸ fetch()

ExternalApisContext

ExternalApi querying context

This is used to query the list of external APIs for a customer

new ExternalApisContext(client: any, params: any)

Extends PagedContext

Parameters
client (any)
params (any)
Instance Members
▸ constructor(client, params)
▸ withQuery(term)
▸ getPage()

PagedContext

Generic paged query context

new PagedContext(client: any, params: any)
Parameters
client (any)
params (any = {})
Instance Members
▸ constructor(client, params = {})
▸ withPage(page)
▸ withPerPage(perPage)
▸ sortedBy(field, direction)
▸ thenBy(field, direction)
▸ page(Type, uri, params = {})

Page

Represents a page of results

new Page(client: any, selector: any, uri: any, params: any)
Parameters
client (any)
selector (any)
uri (any)
params (any)
Instance Members
▸ pageSelector(client, selector, uri, params, item)
▸ constructor(client, selector, uri, params)
▸ list
▸ client
▸ selector
▸ uri
▸ params
▸ fetch()
▸ hasNext()
▸ next()

Role

Role resource

new Role(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(id)
Instance Members
▸ constructor(client, rest)
▸ fetch()

RolesContext

Role querying context

This is used to query the list of Roles for a Customer

new RolesContext(client: any, params: any)

Extends PagedContext

Parameters
client (any)
params (any)
Instance Members
▸ constructor(client, params)
▸ withQuery(term)
▸ getPage()

User

User resource

new User(client: any, rest: ...any)

Extends Resource

Parameters
client (any)
rest (...any)
Static Members
▸ makeHref(id)
Instance Members
▸ constructor(client, rest)
▸ fetch()
▸ create()
▸ update()

Client

Collection of functions to make HTTP requests to the Track API

new Client(options: any)
Parameters
options (any = {})
Static Members
▸ toBlobSelector(value, selector, type, object)
▸ toBlob(value, selector = x=>JSON.stringify(x,null,2), type)
Instance Members
▸ constructor(options)
▸ JWT
▸ getJwt()
▸ setJwt(jwt)
▸ resolve(uri, queryStringParams)
▸ request(method, uri, options = {})
▸ get(uri, params, args)
▸ post(args)
▸ put(args)
▸ patch(args)
▸ delete(args)
▸ setAuthenticated(user)
▸ unsetAuthenticated()

RealTimeClient

A client that can be used for creating, maintaining, and monitoring WebSocket connections to the Track Real Time API.

new RealTimeClient(client: any, options: any)
Parameters
client (any)
options (any = {})
Instance Members
▸ constructor(client, options)
▸ addEventListener(type, listener)
▸ removeEventListener(type, listener)
▸ closeConnection(options)
▸ createConnection(onInitialize?)
▸ onConnectionClosed(event?)
▸ onConnectionOpened(event?)
▸ onMessageReceived(event)
▸ sendAuthentication()
▸ sendMessage(message)
▸ startSubscription(entity, customerCode, filters, handlerFunc)
▸ stopSubscription(subscriptionContainer, subscriptionEnd)
▸ registerHeartbeatHandler(heartbeatHandler)
▸ removeHeartbeatHandler(heartbeatHandler)

createAuthRequest

Creates a Track Real Time API control message for authenticating a connection.

createAuthRequest
Parameters
jwt (string) A pre-authenticated JSON Web Token for authorizing this connection.
applicationName (string?) Optional name of the application this session belongs to (e.g. "Sync", "Sync Mobile"). Used by the PRESENCE entity to report which applications a user is online in.
Returns
Object: The created authentication request message.

createSubscriptionRequest

Creates a Track Real Time API control message for creating a subscription.

createSubscriptionRequest
Parameters
entity (string) The entity for which the subscription should be created.
customerCode (any) Customer Code for which the subscription should be created.
filters (Object<string, Href> = {}) A map that maps filter attribute names to arrays of hrefs.
Returns
Object: The created subscription request message.

ErrorResponse

Generic error response from the client

new ErrorResponse(response: any)
Parameters
response (any)
Instance Members
▸ constructor(response)
▸ status
▸ message

NotFoundResponse

Error response for "404 Not Found"

new NotFoundResponse()

Extends ErrorResponse

ForbiddenResponse

Error response for "403 Forbidden"

new ForbiddenResponse(response: any, message: any)

Extends ErrorResponse

Parameters
response (any)
message (any)
Instance Members
▸ constructor(response, message)

ServerErrorResponse

Error response for any HTTP 500 series error

new ServerErrorResponse(response: any, json: any)

Extends ErrorResponse

Parameters
response (any)
json (any)
Instance Members
▸ constructor(response, json?)
▸ message
▸ details

mapResponse

Maps a Response according to its status

mapResponse
Parameters
response (Response) Instance of Response
Returns
Promise: If successful, returns response. Otherwise, returns an ErrorResponse.