Fleet Freedom
Main Site
Overview
WebSocket
JavaScript
Behaviours
Provisioning
Pictures
Reports
Events
Return to site

JavaScript API Reference

Download JSDoc Helper
version 4.19.22
Updated Fri Nov 20 2020 11:05:46
©Trak iT Wireless Inc.
<script type="text/javascript" src="https://apis.fleetfreedom.com/js/trakit.fleetfreedom.js"></script>
  • API Utilities

    • convert
    • encoding
    • utility
    • version
    • Collection
    • Dictionary
    • SearchPattern
    • TimeSpan
    • Timezone
  • Assets, People, Vehicles, and Trailers

    • Asset
    • AssetAttribute
    • AssetPlaceStatus
    • Person
    • Trailer
    • Vehicle
    • AssetPlaceStatusType
    • AssetType
  • Behaviours

    • Behaviour
    • BehaviourLog
    • BehaviourParameter
    • BehaviourScript
    • BehaviourLogType
    • BehaviourParameterType
  • Billing

    • BillableHostingDiscount
    • BillableHostingLicense
    • BillableHostingRule
    • BillableRatePlan
    • BillableReseller
    • BillableSmsProfile
    • BillableSupport
    • BillingProfile
    • BillableHostingType
    • BillableLicenseType
    • BillingCurrency
    • BillingCycle
  • Companies / Organizations

    • Company
    • CompanyAnalytics
    • CompanyBilling
    • CompanyHoS
    • CompanyPasswords
    • CompanySessions
    • CompanyMultiUser
    • CompanyPasswordExpiryMode
  • Contacts

    • Contact
  • Devices

    • Provider
    • ProviderAttribute
    • ProviderConfig
    • ProviderConfiguration
    • ProviderConfigurationNode
    • ProviderConfigurationType
    • ProviderRegistration
    • ProviderScript
    • ProviderScriptBlock
    • ProviderScriptParameter
    • ProviderScriptParameterType
    • ProviderType
    • ProvisioningStatus
  • Dispatch and Tasks

    • Dispatch
    • DispatchTask
    • TaskStatus
  • Drawing

    • drawing
    • Point
    • Radial
    • Rectangle
    • Size
  • File Hosting

    • DashcamData
    • HostedDocument
    • DashcamDataType
  • Geography

    • geography
    • mercator
    • LatLng
    • LatLngBounds
    • Position
    • StreetAddress
  • Hours of Service

    • HosCarrier
    • HosEvent
    • HosInspection
    • HosInspectionDefect
    • HosCycle
    • HosDataTransferType
    • HosDefectArea
    • HosDefectStatus
    • HosDiagnosticCode
    • HosEventCode
    • HosEventOrigin
    • HosEventStatus
    • HosEventType
    • HosMalfunctionCode
    • HosViolationType
  • Icons

    • Icon
    • IconGlyph
    • IconLabel
    • IconLayer
  • JSON WebSocket

    • socket
    • SocketRequest
    • SocketResponse
    • SocketState
  • Label and Tag styles

    • LabelStyle
  • Maintenance

    • MaintenanceInterval
    • MaintenanceJob
    • MaintenanceSchedule
    • MaintenanceJobStatus
  • Messaging

    • Message
    • MessageStatus
    • MessageType
  • Model-View-Control

    • MVCEvent
    • MVCObject
  • Photos / Images

    • Picture
  • Places (POIs / geofences)

    • Place
    • PlaceShapeType
  • Real-time Analytics

    • AnalyticRule
    • AnalyticSummary
    • AnalyticType
  • Reports

    • reports
    • ReportNotifications
    • ReportOptions
    • ReportParameter
    • ReportRecurrence
    • ReportResult
    • ReportSchedule
    • ReportScorecard
    • ReportScorecardParameter
    • ReportScorecardRules
    • ReportTemplate
    • ReportTotal
    • ReportType
    • ReportFilterMode
    • ReportParameterType
    • ReportRecurrenceType
    • ReportStatus
  • Users and Permissions

    • authorizer
    • User
    • UserGroup
    • UserNotifications
    • UserPermission
    • UserSession
    • PermissionLevel
    • PermissionMethod
    • PermissionType
    • UserMeasurementPreference
    • UserNotificationsMethod
  • White Labelling

    • ColourStyle
    • CompanyReseller
    • NotificationServerEmail
    • NotificationServerSms
    • IncomingEmailServerType
    • OutgoingEmailServerType

API Utilities

convert object

A utility library for converting values of one measurement system to another.

Usage

var value = trakit.fleetfreedom.convert.member;
/* or */
var result = trakit.fleetfreedom.convert.member(...params);
Functions
MethodReturnsDescription
cToF(/** number */ temperature)number
Value in Celsius converted to Fahrenheit
fToC(/** number */ temperature)number
Value in Fahrenheit converted to Celsius
gToL(/** number */ volume)number
Value in US gallons converted to litres
gUKToL(/** number */ volume)number
Value in British gallons converted to litres
kgToLbs(/** number */ weight)number
Value in kilograms converted to pounds.
kmToMi(/** number */ distance)number
Value in kilometres converted to miles
kpaToPsi(/** number */ pressure)number
Value in kilo-pascals converted to pounds per square inch.
l100kmToMpg(/** number */ fuelEconomy)number
Value in miles per gallon converted to litres per 100 kilometres.
l100kmToMpgUK(/** number */ fuelEconomy)number
Value in miles per British gallon converted to litres per 100 kilometres.
lbsToKg(/** number */ weight)number
Value in pounds converted to kilograms.
lToG(/** number */ volume)number
Value in litres converted to US gallons
lToGUK(/** number */ volume)number
Value in litres converted to British gallons
miToKm(/** number */ distance)number
Value in miles converted to kilometres
mpgToL100km(/** number */ fuelEconomy)number
Value in miles per gallon converted to litres per 100 kilometres.
mpgUKToL100km(/** number */ fuelEconomy)number
Value in miles per British gallon converted to litres per 100 kilometres.
mToYd(/** number */ distance)number
Value in metres converted to yards
psiToKpa(/** number */ pressure)number
Value in pounds per square inch converted to kilo-pascals.
ydToM(/** number */ distance)number
Value in yards converted to metres

encoding object

Convenience methods for encoding to various formats.

Usage

var value = trakit.fleetfreedom.encoding.member;
/* or */
var result = trakit.fleetfreedom.encoding.member(...params);
Functions
MethodReturnsDescription
fromBase64(/** string */ base64)string
Converts a base64 encoded string back to a readable string
fromPassword(/** string */ value)string
Decodes the given Provider password as a human readable value.
fromUrl(/** string */ url)string
Decodes a URL encoded string
fromUtf8(/** string */ utf8)string
Decodes a UTF8 string
toBase64(/** string */ string)string
Converts a string to base64 encoded string
toPassword(/** string */ value)string
Encodes the given string as a Provider password.
toUrl(/** string */ string)string
Converts a string to a valid URL encoded value
toUtf8(/** string */ string)string
Encodes a string into a valid UTF8 string

utility object

A utility library for exposing handy methods and algorithms.

Usage

var value = trakit.fleetfreedom.utility.member;
/* or */
var result = trakit.fleetfreedom.utility.member(...params);
Functions
MethodReturnsDescription
arrayOfType(/** Array.<?> */ array, /** Object */ klass)boolean
Checks every object in an array for the instance type. Empty arrays are returned as true.
codify(/** string */ input)
Throws TypeError "input value is not a string".
string
Creates a searchable/coded string based on a user inputted string. Quotation marks, apostrophes, and accents are removed.
douglasPeucker(/** Array.<T> */ source, /** function */ triangleHeight, /** number */ tolerance)Array.<T>
An implementation of the Ramer-Douglas-Peucker path reduction algorithm. The source array should be more than two items in length, otherwise reduction is pointless. The callback function returns a number (greater than zero) as the triangle height as defiend by three points; first point, middle point, and last point. The "kink" threshold is set using the tolerance argument which must be a number greater than or equal to zero.
escape(/** string */ input)string
Creates an HTTP safe string for transmission similar to the escape function.
fileSize(/** number */ bytes, /** number */ places, /** number */ maxScale, /** number */ groupSize, /** string */ groupDelimiter, /** string */ decimalDelimiter, /** string */ point)string
Creates a more human readable string representation of the filesize.
guid()string
Delivers a GUID-like string with a mixed in location/refresh unique seed
inherits(/** function */ parent, /** function */ child)function
Creates a JavaScript binding for super-classes
isN(/** ? */ value)boolean
Opposite of utility#isNaN. Checks to see if the given parameter is a number object, or number literal, and that it is not NaN. This method will return false for values: "", "1234", null, undefined, true, and false.
isNaN(/** ? */ value)boolean
Similar to isNaN, it checks to see if the given parameter is not a number object, not a number literal, and that it is NaN. This method will return true for values: "", "1234", null, undefined, true, and false.
isNothing(/** ? */ value)boolean
Checks for both null and undefined
merge(/** Object */ target, /** Object */ source, /** boolean */ goDeep)Object
Does a deep copy of values from one object to another
numberGroups(/** number */ number, /** number */ size, /** string */ delimiter, /** string */ decimalDelimiter, /** string */ point)
Throws TypeError "size must be greater than zero".
string
Groups digits of a number together to make a more human readable version.
parseSearch(/** string */ expression)Array.<SearchPattern>
Creates an array of SearchPatterns for easier matching. Used for doing OR matching.
parseTime(/** string */ duration)number
Parses a serialized TimeSpan into a number representing the total seconds. For example the string "1.07:42:03.467" equals 114123.467, which is 1 day, 7 hours, 42 minutes, 3 seconds, and 467 milliseconds.
roundTo(/** number */ number, /** number */ places)number
Rounds a number to the desired number of decimal places. Using a negative places value will round to the nearest ten.
stringifyTime(/** number */ value)string
Parses a number representing the total seconds into a serialized TimeSpan string. For example the number 114123.467 would be serialized as "1.07:42:03.467".
unescape(/** string */ input)string
Similar to the unescape function, it will decode a string encoded using utility#escape.

version object

The version number of this JavaScript library.

Usage

var value = trakit.fleetfreedom.version.member;
/* or */
var result = trakit.fleetfreedom.version.member(...params);

Collection class

Similar to the ECMA6 Set class. A Collection is like an array, but without duplicate values.

Usage

var object = new trakit.fleetfreedom.Collection(/** Object */ iterable);
Properties
PropertyTypeDescription
sizenumber
The number of objects in the Collection.
Functions
MethodReturnsDescription
add(/** V */ value)boolean
Adds the value to the Collection. Returns boolean indicating whether the value was newly added.
clear()
Removes all values from the Collection.
concat(/** Collection | Set */ var_args)Collection
Creates a new Collection, and adds or overwrites the keys with the other given Collections.
filter(/** function */ predicate, /** Object */ context)Collection
Builds a new Collection with only the positive results from the predicate.
forEach(/** function */ predicate, /** Object */ context)
Iterates through all the values in the Collection.
has(/** V */ value)boolean
Returns a boolean asserting whether a value has been added to the Collection or not.
remove(/** V */ value)boolean
Removes the value in the Collection. After such a call, Collection#has(key) will return false.
toArray()Array
Returns an Array with all the values from this Collection.
toJSON()Array
Creates an Array literal of this Collection. Values use their toJSON method (if present), NaNs are converted to nulls, and "undefined"s are not added.

Dictionary class

Similar to the ECMA6 Map class. A Dictionary is like a hash-map; each unique key is an object (not just string) corresponds to a stored value.

Usage

var object = new trakit.fleetfreedom.Dictionary(/** Object */ iterable);
Properties
PropertyTypeDescription
sizenumber
The number of key/value pairs in the Dictionary.
Functions
MethodReturnsDescription
addOrReplace(/** K */ key, /** V */ value, /** function */ updateValue, /** Object */ context)
Either adds the given key/value, or replaces the value for the given key. The updateValue is invoked only for replace operations. The updateValue function is invoked with the existing value, the replacement value, the key, and itself, and returns the value to be set. The method itself returns undefined.
clear()
Removes all key/value pairs from the Dictionary.
concat(/** Dictionary | Map */ var_args)Dictionary
Creates a new Dictionary, and adds or overwrites the keys with the other given Dictionaries.
copy()Dictionary
Creates an exact copy of this Dictionary.
every(/** function */ predicate, /** Object */ context)boolean
Checks each pair in the Dictionary and returns true only if all pairs match the predicate.
filter(/** function */ predicate, /** Object */ context)Dictionary
Builds a new Dictionary with only the positive results from the predicate.
forEach(/** function */ predicate, /** Object */ context)
Iterates through all the pairs in the Dictionary.
get(/** K */ key)V | undefined
Returns the value associated to the key, or undefined if there is none.
has(/** K */ key)boolean
Returns a boolean asserting whether a value has been associated to the key in the Dictionary or not.
hasValue(/** V */ value)boolean
Returns a boolean asserting whether a value has been added to the Dictionary or not.
keys()Array.<K>
Gets an Array of keys within this Dictionary.
order(/** function */ compareFunction, /** Object */ context)Dictionary
Returns a new Dictionary whose keys are sorted based on the given predicate. Sorting a Dictionary is similar to sorting an array using Array#sort. Your compareFunction returns a number (typically 1, 0, or -1), and takes two arguments. Each argument is a "pair", an object containing a key and value; { key: K, value: V }.
remove(/** K */ key)boolean
Removes any value associated to the key. After such a call, Dictionary#has(key) will return false.
set(/** K */ key, /** V */ value)
Sets the value for the key in the Dictionary. Returns undefined.
setOrReplace(/** K */ key, /** function */ setValue, /** function */ updateValue, /** Object */ context)
Either adds the given key/value, or replaces the value for the given key. The setValue is invoked only for add operations, and the updateValue is invoked only for replace operations. The setValue function is invoked with the key, and itself, and returns the value to be set. The updateValue function is invoked with the existing value, a reference to the setValue function, the key, and itself, and returns the value to be set. The method itself returns undefined.
some(/** function */ predicate, /** Object */ context)boolean
Checks each pair in the Dictionary and returns true if one pair matches the predicate.
toArray(/** function */ predicate, /** Object */ context)Array.<?>
Builds an array out of the results of the predicate.
toDictionary(/** function */ valuePredicate, /** function */ keyPredicate, /** Object */ context)Dictionary
Builds a new Dictionary out of the results of the predicates.
toJSON()Object
Creates an Object literal of this Dictionary. Keys are set as strings. Values use their toJSON method (if present), NaNs are converted to nulls, and "undefined"s are not added.
values()Array.<V>
Gets the Array of values from this Dictionary.

SearchPattern class

A common structure used to implement searching throughout the system. The input format is described in the WebSocket reference.

Usage

var object = new trakit.fleetfreedom.SearchPattern(/** string */ pattern);
Properties
PropertyTypeDescription
operatorsDictionary.<string, Array.<string>>
To help qualify matches, all operators must match for the search to be considered matched. Operators are formatted as "operator:terms".
termsArray.<string>
If any term matches, then the search should be considered matched. Terms are any string contained by single/double-quotes or not parsed as an operator.
wildcardboolean
True when this pattern will match all.
Functions
MethodReturnsDescription
copy()SearchPattern
Returns a new, identical instance of the pattern.
toString()string
Returns a re-parseable string representation of the pattern.
Static Methods
MethodReturnsDescription
SearchPattern.parse(/** string */ expression)Array.<SearchPattern>
Creates an array of SearchPatterns for easier matching. Used for doing OR matching.
SearchPattern.stringify(/** Array.<SearchPattern> */ patterns)string
Creates a single string from the given array of SearchPatterns for easier serialization.

TimeSpan class

An object which represents an interval of time.

Usage

var object = new trakit.fleetfreedom.TimeSpan(/** string | number */ duration);
Properties
PropertyTypeDescription
daysnumber
Days component of the time-span.
hoursnumber
Hours component of the time-span.
millisecondsnumber
Millisecond component of the time-span.
minutesnumber
Minutes component of the time-span.
secondsnumber
Seconds component of the time-span.
totalDaysnumber
Total time-span value in decimal days.
totalHoursnumber
Total time-span value in decimal hours.
totalMillisecondsnumber
Total time-span value in milliseconds.
totalMinutesnumber
Total time-span value in decimal minutes.
totalSecondsnumber
Total time-span value in decimal seconds.
Functions
MethodReturnsDescription
add(/** TimeSpan | string | number */ duration, /** boolean */ subtract)number
Adds the given value to the current time-span.
subtract(/** TimeSpan | string | number */ duration, /** boolean */ add)number
Subtracts the given value from the time-span.
toString(/** string */ format)string
Parses the time-span into a serialized TimeSpan string. The format follows the trakit.socket.duration definition.
Static Methods
MethodReturnsDescription
TimeSpan.fromDays(/** number */ value)TimeSpan
Constructs a new TimeSpan with the value specified in days.
TimeSpan.fromHours(/** number */ value)TimeSpan
Constructs a new TimeSpan with the value specified in hours.
TimeSpan.fromMilliseconds(/** number */ value)TimeSpan
Constructs a new TimeSpan with the value specified in milliseconds.
TimeSpan.fromMinutes(/** number */ value)TimeSpan
Constructs a new TimeSpan with the value specified in minutes.
TimeSpan.fromSeconds(/** number */ value)TimeSpan
Constructs a new TimeSpan with the value specified in seconds.

Timezone class

Information about a specific timezone

Usage

var object = new trakit.fleetfreedom.Timezone(/** string */ code, /** string */ name, /** number */ offset, /** boolean */ dst);
Properties
PropertyTypeDescription
codestring
A short identification code for date/time conversion
dstboolean
Whether this timezone abides by daylight savings
namestring
Full name of the timezone
offsetnumber
The number of minutes offset from UTC
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

Assets, People, Vehicles, and Trailers

Asset class

Inheritance: MVCObject > Asset
An Asset is a generic representation of the real-world object being tracked.

Usage

var object = new trakit.fleetfreedom.Asset(/** Company */ company, /** trakit.socket.Asset | trakit.socket.AssetGeneral | trakit.socket.AssetAdvanced */ object);
Properties
PropertyTypeDescription
attributesDictionary.<string, AssetAttribute>
A list of properties given to this asset by a Behaviour. The dictionary key is a codified version of the AssetAttribute#name. See utility#codify.
cargoArray.<Inventory>
Inventory carried by the asset.
companyCompany
The Company to which this asset belongs.
dispatchDispatch
The list of current tasks and routes assigned to this asset.
iconIcon
The icon that represents this asset on the map and in lists.
iconIdnumber
The unique identifier of the Icon for this asset.
idnumber
Unique identifier
kindAssetType
The type of asset.
labelsArray.<string>
Codified labels. See utility#codify.
messagesArray.<Message>
Two way conversation Messages between the asset and Fleet Freedom.
messagingAddressstring
The fall-back address which is used to send Messages.
namestring
This thing's name.
notesstring
Notes about it.
odometernumber
The virtual odometer for this vehicle or trailer.
pictureIdsArray.<number>
A list of Picture#ids of this thing.
picturesArray.<Picture>
A list of Pictures of this thing.
placesDictionary.<number, AssetPlaceStatus>
Known Places this asset has interacted with.
positionPosition
The last recorded GPS coordinates for this asset.
providerIdsArray.<number>
The IDs of providers for this asset.
providersArray.<Provider>
The modems or phones providing GPS positions and other telemetry for this asset.
referencestring
Getter/setter for the references field named "reference".
referencesDictionary.<string, string>
Name/value collections of custom fields used to refer to external systems.
relationshipIdsArray.<number>
The IDs of related assets.
relationshipsArray.<Asset>
The related assets like a vehicle for a driver, or a trailer for a vehicle.
sinceDate
A timestamp that indicates when the Asset was suspended or deleted.
suspendedboolean
A flag to show that an asset is suspended from event procesing.
tagsArray.<string>
Codified status tags. See utility#codify.
versionArray.<number>
The version flags used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
createDispatchTask(/** trakit.socket.DispatchTask */ task)DispatchTask
Creates a new DispatchTask and adds it to the Dispatch#tasks array
createMessage(/** trakit.socket.Message */ message)Message
Creates a new Message and adds it to the Asset#messages array
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.Asset | trakit.socket.AssetGeneral | trakit.socket.AssetAdvanced */ json, /** boolean */ silent)Asset
Updates parameters for this Asset from the given JSON literal
getDispatchTaskById(/** number */ id)DispatchTask
Retrieves the DispatchTask with the given id or null if none found.
getMaintenanceJobs()Array.<MaintenanceJob>
Gets an Array of Maintenance Jobs for this Asset.
getMessageById(/** number */ id)Message
Retrieves the Message with the given id or null if none found.
getPictureIds()Array.<number>
Gets an Array of Picture Ids for this Asset.
getPictures()Array.<Picture>
Gets an Array of Pictures for this Asset.
getPlaces(/** Array.<AssetPlaceStatusType> */ statuses)Array.<Place>
Gets a list of Places which are being interacted with by this asset.
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this asset. Used internally by Company#findAssets.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

AssetAttribute class

A detail about an asset updated by its providers.

Usage

var object = new trakit.fleetfreedom.AssetAttribute(/** string */ name, /** string */ simple, /** string */ complex, /** Object */ raw, /** string */ unit, /** Date */ dts, /** string */ provider, /** boolean */ global);
Properties
PropertyTypeDescription
complexstring
Parse-able/formatted string for complex display.
dtsDate
The date/time when this value was set.
globalboolean
When false, indicates that this attribute is used by an internal system and should be left untouched.
namestring
Display name for the attribute.
providerstring
A note from the Behaviour as to why this was set.
rawObject
Raw value.
simplestring
Computed/contextual value from the Behaviour.
unitstring
The value's unit. IE: kilometres, degrees Fahrenheit, etc...
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

AssetPlaceStatus class

A simple status for each place an Asset visits

Usage

var object = new trakit.fleetfreedom.AssetPlaceStatus(/** string */ kind, /** string | Date */ enter, /** string | Date */ latest);
Properties
PropertyTypeDescription
enterDate
The date/time stamp for when the Asset first began interacting with the Place
kindAssetPlaceStatusType
The kind of interaction
latestDate
The most recent date/time stamp for the interaction
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

Person class

Inheritance: MVCObject > Asset > Person
A Person is a specialized kind of Asset that represents an actual person in the real-world. It has specific attributes for contact information like mobile number, email, shipping address, pictures, etc...

Usage

var object = new trakit.fleetfreedom.Person(/** Company */ company, /** trakit.socket.Person | trakit.socket.PersonGeneral | trakit.socket.AssetAdvanced */ object);
Properties
PropertyTypeDescription
attributesDictionary.<string, AssetAttribute>
A list of properties given to this asset by a Behaviour. The dictionary key is a codified version of the AssetAttribute#name. See utility#codify.
cargoArray.<Inventory>
Inventory carried by the asset.
companyCompany
The Company to which this asset belongs.
contactContact
The contact information of this Person
dispatchDispatch
The list of current tasks and routes assigned to this asset.
iconIcon
The icon that represents this asset on the map and in lists.
iconIdnumber
The unique identifier of the Icon for this asset.
idnumber
Unique identifier
kindAssetType
The type of asset.
labelsArray.<string>
Codified labels. See utility#codify.
messagesArray.<Message>
Two way conversation Messages between the asset and Fleet Freedom.
messagingAddressstring
The fall-back address which is used to send Messages.
namestring
This thing's name.
notesstring
Notes about it.
odometernumber
The virtual odometer for this vehicle or trailer.
pictureIdsArray.<number>
A list of Picture#ids of this thing.
picturesArray.<Picture>
A list of Pictures of this thing.
placesDictionary.<number, AssetPlaceStatus>
Known Places this asset has interacted with.
positionPosition
The last recorded GPS coordinates for this asset.
providerIdsArray.<number>
The IDs of providers for this asset.
providersArray.<Provider>
The modems or phones providing GPS positions and other telemetry for this asset.
referencestring
Getter/setter for the references field named "reference".
referencesDictionary.<string, string>
Name/value collections of custom fields used to refer to external systems.
relationshipIdsArray.<number>
The IDs of related assets.
relationshipsArray.<Asset>
The related assets like a vehicle for a driver, or a trailer for a vehicle.
sinceDate
A timestamp that indicates when the Asset was suspended or deleted.
suspendedboolean
A flag to show that an asset is suspended from event procesing.
tagsArray.<string>
Codified status tags. See utility#codify.
trailerTrailer
The Trailer being towed by this Person
vehicleVehicle
The vehicle currently being driven by this Person
versionArray.<number>
The version flags used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
createDispatchTask(/** trakit.socket.DispatchTask */ task)DispatchTask
Creates a new DispatchTask and adds it to the Dispatch#tasks array
createMessage(/** trakit.socket.Message */ message)Message
Creates a new Message and adds it to the Asset#messages array
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.Asset | trakit.socket.AssetGeneral | trakit.socket.AssetAdvanced */ json, /** boolean */ silent)Person
Updates parameters for this Person from the given JSON literal
getDispatchTaskById(/** number */ id)DispatchTask
Retrieves the DispatchTask with the given id or null if none found.
getMaintenanceJobs()Array.<MaintenanceJob>
Gets an Array of Maintenance Jobs for this Asset.
getMessageById(/** number */ id)Message
Retrieves the Message with the given id or null if none found.
getPictureIds()Array.<number>
Gets an Array of Picture Ids for this Person.
getPictures()Array.<Picture>
Gets an Array of Pictures for this Person.
getPlaces(/** Array.<AssetPlaceStatusType> */ statuses)Array.<Place>
Gets a list of Places which are being interacted with by this asset.
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this asset. Used internally by Company#findAssets.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

Trailer class

Inheritance: MVCObject > Asset > Trailer
A Trailer is a specialized kind of Asset that represents an actual trailer or chassis in the real-world. It has specific attributes like license plate, make, model, year, hitched vehicle, mounted container bin, etc...

Usage

var object = new trakit.fleetfreedom.Trailer(/** Company */ company, /** trakit.socket.Trailer | trakit.socket.TrailerGeneral | trakit.socket.AssetAdvanced */ object);
Properties
PropertyTypeDescription
attributesDictionary.<string, AssetAttribute>
A list of properties given to this asset by a Behaviour. The dictionary key is a codified version of the AssetAttribute#name. See utility#codify.
binInventoryContainer
The bin this trailer/chassis is hauling
cargoArray.<Inventory>
Inventory carried by the asset.
colourstring
The main colour of this vehicle
companyCompany
The Company to which this asset belongs.
dispatchDispatch
The list of current tasks and routes assigned to this asset.
iconIcon
The icon that represents this asset on the map and in lists.
iconIdnumber
The unique identifier of the Icon for this asset.
idnumber
Unique identifier
kindAssetType
The type of asset.
labelsArray.<string>
Codified labels. See utility#codify.
makestring
Name of manufacturer
messagesArray.<Message>
Two way conversation Messages between the asset and Fleet Freedom.
messagingAddressstring
The fall-back address which is used to send Messages.
modelstring
Manufacturer model name
namestring
This thing's name.
notesstring
Notes about it.
odometernumber
The virtual odometer for this vehicle or trailer.
personPerson
The person driving this trailer
pictureIdsArray.<number>
A list of Picture#ids of this thing.
picturesArray.<Picture>
A list of Pictures of this thing.
placesDictionary.<number, AssetPlaceStatus>
Known Places this asset has interacted with.
platestring
The license plate
positionPosition
The last recorded GPS coordinates for this asset.
providerIdsArray.<number>
The IDs of providers for this asset.
providersArray.<Provider>
The modems or phones providing GPS positions and other telemetry for this asset.
referencestring
Getter/setter for the references field named "reference".
referencesDictionary.<string, string>
Name/value collections of custom fields used to refer to external systems.
relationshipIdsArray.<number>
The IDs of related assets.
relationshipsArray.<Asset>
The related assets like a vehicle for a driver, or a trailer for a vehicle.
serialstring
The unique serial number on the trailer (for your reference)
sinceDate
A timestamp that indicates when the Asset was suspended or deleted.
suspendedboolean
A flag to show that an asset is suspended from event procesing.
tagsArray.<string>
Codified status tags. See utility#codify.
vehicleVehicle
The vehicle currently towing this trailer
versionArray.<number>
The version flags used to ensure sync operations are done in order.
yearnumber
The year this vehicle was manufactured
Functions
MethodReturnsDescription
createDispatchTask(/** trakit.socket.DispatchTask */ task)DispatchTask
Creates a new DispatchTask and adds it to the Dispatch#tasks array
createMessage(/** trakit.socket.Message */ message)Message
Creates a new Message and adds it to the Asset#messages array
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.Asset | trakit.socket.TrailerGeneral | trakit.socket.AssetAdvanced */ json, /** boolean */ silent)Trailer
Updates parameters for this Trailer from the given JSON literal.
getDispatchTaskById(/** number */ id)DispatchTask
Retrieves the DispatchTask with the given id or null if none found.
getMaintenanceJobs()Array.<MaintenanceJob>
Gets an Array of Maintenance Jobs for this Asset.
getMessageById(/** number */ id)Message
Retrieves the Message with the given id or null if none found.
getPictureIds()Array.<number>
Gets an Array of Picture Ids for this Asset.
getPictures()Array.<Picture>
Gets an Array of Pictures for this Asset.
getPlaces(/** Array.<AssetPlaceStatusType> */ statuses)Array.<Place>
Gets a list of Places which are being interacted with by this asset.
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this asset. Used internally by Company#findAssets.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

Vehicle class

Inheritance: MVCObject > Asset > Vehicle
A Vehicle is a specialized kind of Asset that represents an actual vehicle in the real-world. It has specific attributes like license plate, make, model, year, colour, odometer, driver, trailer, etc...

Usage

var object = new trakit.fleetfreedom.Vehicle(/** Company */ company, /** trakit.socket.Vehicle | trakit.socket.VehicleGeneral | trakit.socket.VehicleAdvanced */ object);
Properties
PropertyTypeDescription
attributesDictionary.<string, AssetAttribute>
A list of properties given to this asset by a Behaviour. The dictionary key is a codified version of the AssetAttribute#name. See utility#codify.
cargoArray.<Inventory>
Inventory carried by the asset.
colourstring
The main colour of this vehicle
companyCompany
The Company to which this asset belongs.
dispatchDispatch
The list of current tasks and routes assigned to this asset.
engineHoursnumber
The number of hours the engine has been running
iconIcon
The icon that represents this asset on the map and in lists.
iconIdnumber
The unique identifier of the Icon for this asset.
idnumber
Unique identifier
kindAssetType
The type of asset.
labelsArray.<string>
Codified labels. See utility#codify.
makestring
Name of manufacturer
messagesArray.<Message>
Two way conversation Messages between the asset and Fleet Freedom.
messagingAddressstring
The fall-back address which is used to send Messages.
modelstring
Manufacturer model name
namestring
This thing's name.
notesstring
Notes about it.
odometernumber
The virtual odometer for this vehicle or trailer.
personPerson
The Person driving
pictureIdsArray.<number>
A list of Picture#ids of this thing.
picturesArray.<Picture>
A list of Pictures of this thing.
placesDictionary.<number, AssetPlaceStatus>
Known Places this asset has interacted with.
platestring
The license plate
positionPosition
The last recorded GPS coordinates for this asset.
providerIdsArray.<number>
The IDs of providers for this asset.
providersArray.<Provider>
The modems or phones providing GPS positions and other telemetry for this asset.
referencestring
Getter/setter for the references field named "reference".
referencesDictionary.<string, string>
Name/value collections of custom fields used to refer to external systems.
relationshipIdsArray.<number>
The IDs of related assets.
relationshipsArray.<Asset>
The related assets like a vehicle for a driver, or a trailer for a vehicle.
sinceDate
A timestamp that indicates when the Asset was suspended or deleted.
suspendedboolean
A flag to show that an asset is suspended from event procesing.
tagsArray.<string>
Codified status tags. See utility#codify.
trailerTrailer
The Trailer being towed
versionArray.<number>
The version flags used to ensure sync operations are done in order.
vinstring
The unique Vehicle Identification Number
yearnumber
The year this vehicle was manufactured
Functions
MethodReturnsDescription
createDispatchTask(/** trakit.socket.DispatchTask */ task)DispatchTask
Creates a new DispatchTask and adds it to the Dispatch#tasks array
createMessage(/** trakit.socket.Message */ message)Message
Creates a new Message and adds it to the Asset#messages array
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.Asset | trakit.socket.VehicleGeneral | trakit.socket.VehicleAdvanced */ json, /** boolean */ silent)Vehicle
Updates parameters for this Vehicle from the given JSON literal
getDispatchTaskById(/** number */ id)DispatchTask
Retrieves the DispatchTask with the given id or null if none found.
getMaintenanceJobs()Array.<MaintenanceJob>
Gets an Array of Maintenance Jobs for this Asset.
getMessageById(/** number */ id)Message
Retrieves the Message with the given id or null if none found.
getPictureIds()Array.<number>
Gets an Array of Picture Ids for this Asset.
getPictures()Array.<Picture>
Gets an Array of Pictures for this Asset.
getPlaces(/** Array.<AssetPlaceStatusType> */ statuses)Array.<Place>
Gets a list of Places which are being interacted with by this asset.
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this asset. Used internally by Company#findAssets.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

AssetPlaceStatusType enum (string)

The kinds of interactions had with a Place.
Values
ValueDescription
enter
Occurs when an asset is outside a Place, then goes inside the boundary.
exit
Occurs when an asset was inside the boundary of a Place, but then moves outside the boundary.
inside
Occurs when the asset has was inside the boundary before, and is still inside the boundary now.

AssetType enum (string)

The kinds of Assets supported by the system. Every Asset is one of these types.
Values
ValueDescription
asset
Anything being tracked which isn't one of the other types.
person
Represents an actual person with contact information.
trailer
Something pulled around by a vehicle.
vehicle
A truck, car, bulldozer, motorcycle, star-ship, etc...

Behaviours

Behaviour class

Inheritance: MVCObject > Behaviour
A configured and targeted BehaviourScript.

Usage

var object = new trakit.fleetfreedom.Behaviour(/** Company */ company, /** trakit.socket.Behaviour */ object);
Properties
PropertyTypeDescription
filtersstring
A search pattern used to filter the providers which can implement this behaviour.
idnumber
Unique identifier
messagesArray.<BehaviourLog>
A log of recent messages generated by the BehaviourScript's calling console functions.
namestring
Name of this configuration
notesstring
Notes about this configuration
parametersObject.<string, string>
Defined variable name/value pairs for the BehaviourScript used
prioritynumber
The Behaviour's execution order
scriptBehaviourScript
The BehaviourScript to which these variables apply.
scriptIdnumber
The unique identifier of the BehaviourScript to which these variables apply.
targetsstring
The search pattern used to target the assets which will embed this behaviour in their execution context.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
createLog(/** trakit.socket.BehaviourLog */ log)BehaviourLog
Creates a new BehaviourLog and adds it to the Behaviour#messages array.
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** Behaviour */ json, /** boolean */ silent)Behaviour
Updates parameters for this Behaviour from the given JSON literal
getLogById(/** number */ id)BehaviourLog
Retrieves the BehaviourLog with the given id or null if none found.
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this behaviour. Used internally by Company#findBehaviours.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

BehaviourLog class

A debug message generated from a Behaviour and/or a BehaviourScript.

Usage

var object = new trakit.fleetfreedom.BehaviourLog(/** Company */ company, /** trakit.socket.BehaviourLog */ object);
Properties
PropertyTypeDescription
assetAsset
The Asset whose behaviours created this debug entry.
assetIdnumber
The unique identifier of the Asset whose behaviours created this debug entry.
behaviourBehaviour
The configured Behaviour from which this debug message was invoked.
behaviourIdnumber
The unique identifier of the Behaviour to which this debug belongs.
characternumber
Relevant character index if available
companyCompany
The Company to which the debug message's Behaviour and/or a BehaviourScript belongs.
dtsDate
When the debug message was generated.
idnumber
Unique identifier of this debug message.
kindBehaviourLogType
Type of debug message that was generated.
linenumber
Relevant line number if available
messagestring
Message data saved to the debug message.
scriptBehaviourScript
The BehaviourScript in question which logged this message.
scriptIdnumber
The unique identifier of the BehaviourScript to which this debug belongs.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
fromJSON(/** trakit.socket.BehaviourLog */ json)
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

BehaviourParameter class

Definition of an argument passed to a Behaviour Script.

Usage

var object = new trakit.fleetfreedom.BehaviourParameter(/** BehaviourParameterType */ type, /** string */ value, /** string */ notes, /** string */ context);
Properties
PropertyTypeDescription
contextstring
Gives a hint to the client on the best UI to use for editing. For example, "checkbox" is a good UI hint for boolean parameter types.
notesstring
Usage notes.
typeBehaviourParameterType
Simple type information for the compiler.
valuestring
The value is given as a string, but parsed into native type when compiled.
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

BehaviourScript class

Inheritance: MVCObject > BehaviourScript
The 800lbs gorilla! These scripts determine how the system reacts for each customer.

Usage

var object = new trakit.fleetfreedom.BehaviourScript(/** Company */ company, /** trakit.socket.BehaviourScript */ object);
Properties
PropertyTypeDescription
compilesboolean
A flag set by the compiler if this code compiles
fillstring
The colour filling the background of the display icon.
filtersstring
Default expression(s) used as a hint for configured Behaviours.
globalboolean
When true, this script is available to all child Companys.
graphicstring
The name of the icon used for display purposes.
idnumber
Unique identifier of this script
messagesArray.<BehaviourLog>
List of warnings and errors while trying to compile this script.
namestring
Name for this script
notesstring
Usage notes
parametersDictionary.<string, BehaviourParameter>
Arguments given to this script.
sourcestring
The raw source code
strokestring
The colour of the outline for the display icon.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
createLog(/** trakit.socket.BehaviourLog */ log)BehaviourLog
Creates a new BehaviourLog and adds it to the BehaviourScript#messages array.
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** BehaviourScript */ json, /** boolean */ silent)BehaviourScript
Updates parameters for this BehaviourScript from the given JSON literal
getBehaviours()Array.<Behaviour>
Retrieves the Behaviours using this script.
getLogById(/** number */ id)BehaviourLog
Retrieves the BehaviourLog with the given id or null if none found.
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this script. Used internally by Company#findBehaviourScripts.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

BehaviourLogType enum (string)

Defines the kinds of log messages for a BehaviourLog.
Values
ValueDescription
err
Exception message
info
Higher importance message
log
Regular log message
warn
Warning message

BehaviourParameterType enum (string)

The possible types given to BehaviourParameters
Values
ValueDescription
boolean
True or false.
json
Object or array literal.
number
Numeric value (signed double-precision floating point number).
string
Text.

Billing

BillableHostingDiscount class

Inheritance: MVCObject > BillableHostingDiscount
A billing rule for assets

Usage

var object = new trakit.fleetfreedom.BillableHostingDiscount(/** BillingProfile */ profile, /** trakit.socket.BillableHostingDiscount */ object);
Properties
PropertyTypeDescription
amountstring
Cost per Asset.
limitnumber
The number of units to which this billing rule applies.
namestring
The name of this billing rule.
notesstring
Notes about billing this rule.
percentageboolean
When true, the amount is used as a percentage value instead of a currency values.
referencestring
A custom field used to refer to an external system. Examples are a cost codes, SOCs, discount plans...
servicesArray.<BillableHostingType>
The type of services being discounted.
suspendedboolean
Does this hosting rule apply to suspended resources.
targetsArray.<SearchPattern>
Which assets are targetted by this hosting rule.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** BillableHostingDiscount */ json, /** boolean */ silent)BillableHostingDiscount
Updates parameters for this BillableHostingDiscount from the given JSON literal
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

BillableHostingLicense class

Inheritance: MVCObject > BillableHostingLicense
A billing rule for assets

Usage

var object = new trakit.fleetfreedom.BillableHostingLicense(/** BillingProfile */ profile, /** trakit.socket.BillableHostingLicense */ object);
Properties
PropertyTypeDescription
amountstring
Cost per Asset.
kindBillableLicenseType
The type of hardware license.
limitnumber
The number of units to which this billing rule applies.
namestring
The name of this billing rule.
notesstring
Notes about billing this rule.
referencestring
A custom field used to refer to an external system. Examples are a cost codes, SOCs, discount plans...
suspendedboolean
Does this hosting rule apply to suspended resources.
targetsArray.<SearchPattern>
Which assets are targetted by this hosting rule.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** BillableHostingLicense */ json, /** boolean */ silent)BillableHostingLicense
Updates parameters for this BillableHostingLicense from the given JSON literal
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

BillableHostingRule class

Inheritance: MVCObject > BillableHostingRule
A billing rule for assets

Usage

var object = new trakit.fleetfreedom.BillableHostingRule(/** BillingProfile */ profile, /** trakit.socket.BillableHostingRule */ object);
Properties
PropertyTypeDescription
amountstring
Cost per Asset.
limitnumber
The number of units to which this billing rule applies.
namestring
The name of this billing rule.
notesstring
Notes about billing this rule.
referencestring
A custom field used to refer to an external system. Examples are a cost codes, SOCs, discount plans...
serviceBillableHostingType
The type of service being billed.
suspendedboolean
Does this hosting rule apply to suspended resources.
targetsArray.<SearchPattern>
Which assets are targetted by this hosting rule.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** BillableHostingRule */ json, /** boolean */ silent)BillableHostingRule
Updates parameters for this BillableHostingRule from the given JSON literal
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

BillableRatePlan class

Inheritance: MVCObject > BillableRatePlan
A cellular/data rate plan

Usage

var object = new trakit.fleetfreedom.BillableRatePlan(/** BillingProfile */ profile, /** trakit.socket.BillableRatePlan */ object);
Properties
PropertyTypeDescription
amountOverageKBnumber
Cost per kilobytes over the included volume.
amountOverageSMSnumber
Cost per message over the included volume.
namestring
The name of this billing rule.
notesstring
Notes about billing this rule.
referencestring
A custom field used to refer to an external system. Examples are a cost codes, SOCs, discount plans...
volumeKBnumber
The volume of data (in kilobytes) included with this plan.
volumeSMSnumber
The number of SMS messages included with the plan.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** BillableRatePlan */ json, /** boolean */ silent)BillableRatePlan
Updates parameters for this BillableRatePlan from the given JSON literal
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

BillableReseller class

Inheritance: MVCObject > BillableReseller
Custom portal service details

Usage

var object = new trakit.fleetfreedom.BillableReseller(/** BillingProfile */ profile, /** trakit.socket.BillableReseller */ object);
Properties
PropertyTypeDescription
billingSystemboolean
Is this company allowed to use the billing system
instancesnumber
Number of websites hosted.
namestring
The name of this billing rule.
notesstring
Notes about billing this rule.
referencestring
A custom field used to refer to an external system. Examples are a cost codes, SOCs, discount plans...
virtualSMSnumber
Number of virtual numbers used to send/receive SMS messages.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** BillableReseller */ json, /** boolean */ silent)BillableReseller
Updates parameters for this BillableReseller from the given JSON literal
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

BillableSmsProfile class

Description of a tiered SMS messaging limit

Usage

var object = new trakit.fleetfreedom.BillableSmsProfile(/** trakit.socket.BillableSmsProfile */ object);
Properties
PropertyTypeDescription
amountnumber
Cost per SMS message sent. Received messages are free.
limitnumber
The maximum number of messages sent per cycle

BillableSupport class

Inheritance: MVCObject > BillableSupport
Support contract details

Usage

var object = new trakit.fleetfreedom.BillableSupport(/** BillingProfile */ profile, /** trakit.socket.BillableSupport */ object);
Properties
PropertyTypeDescription
amountOveragenumber
Cost (per hour) over the included amount.
includednumber
Amount of included time for this customer/technical support package.
namestring
The name of this billing rule.
notesstring
Notes about billing this rule.
referencestring
A custom field used to refer to an external system. Examples are a cost codes, SOCs, discount plans...
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** BillableSupport */ json, /** boolean */ silent)BillableSupport
Updates parameters for this BillableSupport from the given JSON literal
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

BillingProfile class

The billing policies and details for a specific Company

Usage

var object = new trakit.fleetfreedom.BillingProfile(/** trakit.socket.BillingProfile */ object);
Properties
PropertyTypeDescription
billeenumber
Unique identifier of the Company receiving the bill. Most of the time, this value is the same as the BillingProfile#company.
companynumber
Company that owns this profile and is sending the bill.
currencyBillingCurrency
Kind of money
cycleBillingCycle
How many times should we create a bill
cycleEndDate
When should the cycle end (customer cancelled)
cyclePostDatedbool
Pro-rated, or post-dated.
cycleStartDate
When is the first day of the billing cycle
googleServicesEnabledbool
Are the Google services available to be proxied by the service?
idnumber
Unique identifier of this billing profile
messagesArray.<BillableSmsProfile>
SMS messaging tiers
namestring
The name of this billing profile.
notesstring
Notes about billing this profile.
targetnumber
Unique identifier of the Company to which this rule pertains.
Functions
MethodReturnsDescription
fromJSON(/** BillingProfile */ json, /** boolean */ silent)BillingProfile
Updates parameters for this BillingProfile from the given JSON literal
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

BillableHostingType enum (string)

Defines the kind of service being billed.
Values
ValueDescription
asset
Generic dot-on-a-map tracking
cargo
Cargo and delivery audit
dispatch
Tasks assignable to vehicles or persons
elogs
FMCSA compliant E-Logs and Hours of Service
forms
Mobile forms
inventory
Inventory management
mobile
Employee/driver tracking
streetview
Dashcam and live images hosting
vehicle
Vehicle tracking (includes VBus data, and engine hours)

BillableLicenseType enum (string)

The kind of license being billed.
Values
ValueDescription
bewhere
BeWhere license fee
calamp
CalAmp PULS fee
smartwitness
SmartWitness data hosting fee

BillingCurrency enum (string)

Defines password expiration behaviour for the Company.
Values
ValueDescription
CAD
Canadian dollars
EURO
Eurozone currency
USD
American dollars

BillingCycle enum (string)

The type of repeating cycle used for generating bills.
Values
ValueDescription
annually
Once per year
daily
Every day
monthly
Once a month
quarterly
Every three months
weekly
Each week

Companies / Organizations

Company class

Inheritance: MVCObject > Company
A Company is an organization which contains everything belonging to the customer. This includes Assets, Places, Users, Behaviours, Reports, Maintenance, etc...

Usage

var object = new trakit.fleetfreedom.Company(/** trakit.socket.Company | trakit.socket.CompanyGeneral | trakit.socket.CompanyLabels | trakit.socket.CompanyPolicies | trakit.socket.CompanyReseller */ object);
Properties
PropertyTypeDescription
analyticsCompanyAnalytics
Real-time analytic rules and summaries for assets
assetsArray.<Asset>
List or virtual assets, persons, vehicles, and trailers
behavioursArray.<Behaviour>
Configured Behaviour Scripts
behaviourScriptsArray.<BehaviourScript>
Behaviours authored by a company user
billingCompanyBilling
Billing contacts, rules, limits, and notes
contactsArray.<Contact>
Business contacts
directoryDictionary.<string, Array.<Contact>>
Directory of Contacts for various business reasons
documentsArray.<HostedDocument>
Temporarily hosted documents for this Company
hosCompanyHoS
Hours of Service carriers, daily log, and trip inspections
iconsArray.<Icon>
Icons belonging to objects for this Company as well as global Icons
idnumber
Unique identifier of a company (value is NaN for unsaved Company)
labelsDictionary.<string, LabelStyle>
Labels for categorizing things within this Company
maintenanceJobsArray.<MaintenanceJob>
Historical maintenance for Assets
maintenanceSchedulesArray.<MaintenanceSchedule>
Recurring maintenance rules for Assets
namestring
Operating name of the organization
notesstring
A text field used to add miscellaneous notes to a Company object
parentnumber
Parent organization's Company#id
passwordPolicyCompanyPasswords
Policy for passwords requirements and expiration
picturesArray.<Picture>
Photos belonging to objects for this Company
placesArray.<Place>
List of saved locations
providerConfigsArray.<ProviderConfig>
Configured ProviderScripts for this company's providers.
providerConfigurationsArray.<ProviderConfiguration>
Configured ProviderConfigurations for this company's providers.
providerRegistrationsArray.<ProviderRegistration>
Providers that are being provisioned, but have not yet been added to the syste.
providersArray.<Provider>
Company owned modems, apps, and other event providers
providerScriptsArray.<ProviderScript>
The list of provider logics for this company.
reportResultsArray.<ReportResult>
Results from run templates which are saved or expiring
reportSchedulesArray.<ReportSchedule>
Schedules to automatically run reports overnight
reportTemplatesArray.<ReportTemplate>
Report templates
sessionPolicyCompanySessions
Policy regarding session expiration
sessionsArray.<UserSession>
Active and idling sessions for this Company
tagsDictionary.<string, LabelStyle>
Status tag styles for Assets
userGroupsArray.<UserGroup>
List of user permission groups
usersArray.<User>
List of system users
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
createAnalyticRule(/** trakit.socket.AnalyticRule */ json)AnalyticRule
Creates a new AnalyticRule and adds it to the CompanyHoS#inspections array.
createAnalyticSummary(/** trakit.socket.AnalyticSummary */ json)AnalyticSummary
Creates a new AnalyticSummary and adds it to the CompanyHoS#inspections array.
createAsset(/** trakit.socket.Asset | trakit.socket.AssetGeneral | trakit.socket.AssetAdvanced */ json)Asset
Creates a new Asset and adds it to the Company#assets array
createBehaviour(/** trakit.socket.Behaviour */ json)Behaviour
Creates a new Behaviour and adds it to the Company#behaviours array.
createBehaviourScript(/** trakit.socket.BehaviourScript */ json)BehaviourScript
Creates a new BehaviourScript and adds it to the Company#behaviourScripts array.
createContact(/** trakit.socket.Contact */ json)Contact
Creates a new Contact and adds it to the Company#contacts array
createDocument(/** trakit.socket.Document */ json)HostedDocument
Creates a new HostedDocument and adds it to the Company#documents array
createHosCarrier(/** trakit.socket.HosCarrier */ json)HosCarrier
Creates a new HosCarrier and adds it to the CompanyHoS#carriers array.
createHosEvent(/** trakit.socket.HosEvent */ json)HosEvent
Creates a new HosEvent and adds it to the CompanyHoS#events array.
createHosInspection(/** trakit.socket.HosInspection */ json)HosInspection
Creates a new HosInspection and adds it to the CompanyHoS#inspections array.
createIcon(/** trakit.socket.Icon */ json)Icon
Creates a new Icon and adds it to the Company#icons array.
createLabel(/** trakit.socket.LabelStyle */ json)LabelStyle
Creates a new LabelStyle and adds it to the Company#labels array
createMaintenanceJob(/** trakit.socket.MaintenanceJob */ json)MaintenanceJob
Creates a new MaintenanceJob and adds it to the Company#maintenanceJobs array.
createMaintenanceSchedule(/** trakit.socket.MaintenanceSchedule */ json)MaintenanceSchedule
Creates a new MaintenanceSchedule and adds it to the Company#maintenanceSchedules array.
createPerson(/** trakit.socket.Asset | trakit.socket.AssetGeneral | trakit.socket.AssetAdvanced */ json)Person
Creates a new Person and adds it to the Company#assets array.
createPicture(/** trakit.socket.Picture */ json)Picture
Creates a new Picture and adds it to the Company#pictures array
createPlace(/** trakit.socket.PlaceGeneral */ json)Place
Creates a new Place and adds it to the Company#places array.
createProvider(/** trakit.socket.Provider */ json)Provider
Creates a new Provider and adds it to the Company#providers array.
createProviderConfig(/** trakit.socket.ProviderConfig */ json)ProviderConfig
Creates a new ProviderConfig and adds it to the Company#providerConfigs array.
createProviderConfiguration(/** trakit.socket.ProviderConfiguration */ json)ProviderConfiguration
Creates a new ProviderConfiguration and adds it to the Company#providerConfigurations array.
createProviderRegistration(/** trakit.socket.ProviderRegistration */ json)ProviderRegistration
Creates a new ProviderRegistration and adds it to the Company#providerRegistrations array.
createProviderScript(/** trakit.socket.ProviderScript */ json)ProviderScript
Creates a new ProviderScript and adds it to the Company#providerScripts array.
createReportResult(/** trakit.socket.ReportResult */ json)ReportResult
Creates a new ReportResult and adds it to the Company#reportResults array.
createReportSchedule(/** trakit.socket.ReportSchedule */ json)ReportSchedule
Creates a new ReportSchedule and adds it to the Company#reportSchedules array.
createReportTemplate(/** trakit.socket.ReportTemplate */ json)ReportTemplate
Creates a new ReportTemplate and adds it to the Company#reportTemplates array.
createSession(/** trakit.socket.SessionHandle */ json)UserSession
Creates a new UserSession and adds it to the Company#sessions array.
createTrailer(/** trakit.socket.Asset | trakit.socket.AssetGeneral | trakit.socket.AssetAdvanced */ json)Trailer
Creates a new Trailer and adds it to the Company#assets array.
createUser(/** trakit.socket.User */ json)User
Creates a new User and adds it to the Company#users array
createUserGroup(/** trakit.socket.UserGroup */ json)UserGroup
Creates a new UserGroup and adds it to the Company#userGroups array
createVehicle(/** trakit.socket.Asset | trakit.socket.AssetGeneral | trakit.socket.AssetAdvanced */ json)Vehicle
Creates a new Vehicle and adds it to the Company#assets array
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
findAssets(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<Asset>
Finds all the Assets that match the given search expression. Internally, this method invokes Asset#isMatch.
findBehaviours(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<Behaviour>
Finds all the Behaviours that match the given search expression. Internally, this method invokes Behaviour#isMatch.
findBehaviourScripts(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<BehaviourScript>
Finds all the BehaviourScripts that match the given search expression. Internally, this method invokes BehaviourScript#isMatch.
findBillingBundles(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<BillingBundle>
Finds all the BillingBundles that match the given search expression. Internally, this method invokes BillingBundle#isMatch.
findBillingRules(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<BillingRule>
Finds all the BillingRules that match the given search expression. Internally, this method invokes BillingRule#isMatch.
findContacts(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<Contact>
Finds all the Contacts that match the given search expression. Internally, this method invokes Contact#isMatch.
findDocuments(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<HostedDocument>
Finds all the HostedDocuments that match the given search expression. Internally, this method invokes HostedDocument#isMatch.
findIcons(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<Icon>
Finds all the Icons that match the given search expression. Internally, this method invokes Icon#isMatch.
findMaintenanceJobs(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<MaintenanceJob>
Finds all the MaintenanceJobs that match the given search expression. Internally, this method invokes MaintenanceJob#isMatch.
findMaintenanceSchedules(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<MaintenanceSchedule>
Finds all the MaintenanceSchedules that match the given search expression. Internally, this method invokes MaintenanceSchedule#isMatch.
findPlaces(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<Place>
Finds all the Places that match the given search expression. Internally, this method invokes Place#isMatch.
findProviderConfigs(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<ProviderConfig>
Finds all the ProviderConfigs that match the given search expression. Internally, this method invokes ProviderConfig#isMatch.
findProviderConfigurations(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<ProviderConfiguration>
Finds all the ProviderConfigurations that match the given search expression. Internally, this method invokes ProviderConfiguration#isMatch.
findProviderRegistrations(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<ProviderRegistration>
Finds all the ProviderRegistrations that match the given search expression. Internally, this method invokes ProviderRegistration#isMatch.
findProviders(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<Provider>
Finds all the Providers that match the given search expression. Internally, this method invokes Provider#isMatch.
findProviderScripts(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<ProviderScript>
Finds all the ProviderScripts that match the given search expression. Internally, this method invokes ProviderScript#isMatch.
findReportResults(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<ReportResult>
Finds all the ReportResults that match the given search expression. Internally, this method invokes ReportResult#isMatch.
findReportSchedules(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<ReportSchedule>
Finds all the ReportSchedules that match the given search expression. Internally, this method invokes ReportSchedule#isMatch.
findReportTemplates(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<ReportTemplate>
Finds all the ReportTemplates that match the given search expression. Internally, this method invokes ReportTemplate#isMatch.
findUserGroups(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<UserGroup>
Finds all the UserGroups that match the given search expression. Internally, this method invokes UserGroup#isMatch.
findUsers(/** string | SearchPattern | Array.<SearchPattern> */ expression)Array.<User>
Finds all the Users that match the given search expression. Internally, this method invokes User#isMatch.
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.Company | trakit.socket.CompanyGeneral | trakit.socket.CompanyLabels | trakit.socket.CompanyPolicies | trakit.socket.CompanyReseller */ json, /** boolean */ silent)Company
Updates parameters for this Company from the given JSON literal
getAnalyticRuleById(/** number */ id)AnalyticRule
Retrieves the AnalyticRule with the given id or null if none found
getAnalyticSummaryById(/** number */ id)AnalyticSummary
Retrieves the AnalyticSummary with the given id or null if none found
getAssetById(/** number */ id)Asset
Retrieves the Asset with the given id or null if none found
getBehaviourById(/** number */ id)Behaviour
Retrieves the Behaviour with the given id or null if none found.
getBehaviourScriptById(/** number */ id)BehaviourScript
Retrieves the BehaviourScript with the given id or null if none found.
getContactById(/** number */ id)Contact
Retrieves the Contact with the given id or null if none found
getDispatchTaskById(/** number */ id)DispatchTask
Searches the assets for the DispatchTask with the given id or null if none found.
getDocumentById(/** number */ id)HostedDocument
Retrieves the HostedDocument with the given id or null if none found
getGenerics()Array.<Asset>
Filters the assets collection by kind
getHosCarrierById(/** number */ id)HosCarrier
Retrieves the HosCarrier with the given id or null if none found
getHosEventById(/** number */ id)HosEvent
Retrieves the HosEvent with the given id or null if none found
getHosInspectionById(/** number */ id)HosInspection
Retrieves the HosInspection with the given id or null if none found
getIconById(/** number */ id)Icon
Retrieves the Icon with the given id or null if none found
getMaintenanceJobById(/** number */ id)MaintenanceJob
Retrieves the MaintenanceJob with the given id or null if none found
getMaintenanceScheduleById(/** number */ id)MaintenanceSchedule
Retrieves the MaintenanceSchedule with the given id or null if none found
getMessageById(/** number */ id)Message
Searches the assets for the Message with the given id or null if none found.
getPersons()Array.<Person>
Filters the assets collection by kind
getPictureById(/** number */ id)Picture
Retrieves the Picture with the given id or null if none found
getPlaceById(/** number */ id)Place
Retrieves the Place with the given id or null if none found
getProviderById(/** string */ id)Provider
Retrieves the Provider with the given id or null if none found
getProviderConfigById(/** number */ id)ProviderConfig
Retrieves the ProviderConfig with the given id or null if none found
getProviderConfigurationById(/** number */ id)ProviderConfiguration
Retrieves the ProviderConfiguration with the given id or null if none found
getProviderRegistrationById(/** number | string */ code)ProviderRegistration
Retrieves the ProviderRegistration with the given id or null if none found
getProviderScriptById(/** number */ id)ProviderScript
Retrieves the ProviderScript with the given id or null if none found
getReportResultById(/** number */ id)ReportResult
Retrieves the ReportResult with the given id or null if none found
getReportScheduleById(/** number */ id)ReportSchedule
Retrieves the ReportSchedule with the given id or null if none found
getReportTemplateById(/** number */ id)ReportTemplate
Retrieves the ReportTemplate with the given id or null if none found
getSessionById(/** string */ handle)UserSession
Retrieves the UserSession with the given handle or null if none found.
getTrailers()Array.<Trailer>
Filters the assets collection by kind
getUserById(/** string */ login)User
Retrieves the User with the given login or null if none found
getUserGroupById(/** number */ id)UserGroup
Retrieves the UserTemplate with the given id or null if none found
getVehicles()Array.<Vehicle>
Filters the assets collection by kind
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
removeAnalyticRule(/** number */ id)AnalyticRule
Finds and removes the AnalyticRule from the CompanyHoS#inspections array.
removeAnalyticSummary(/** number */ id)AnalyticSummary
Finds and removes the AnalyticSummary from the CompanyHoS#inspections array.
removeAsset(/** number */ id)Asset
Finds and removes the Asset from the Company#assets array
removeBehaviour(/** number */ id)Behaviour
Finds and removes the Behaviour from the Company#behaviours array.
removeBehaviourScript(/** number */ id)BehaviourScript
Finds and removes the BehaviourScript from the Company#behaviourScripts array.
removeContact(/** number */ id)Contact
Finds and removes the Contact from the Company#contacts array
removeDocument(/** number */ id)HostedDocument
Finds and removes the HostedDocument from the Company#documents array.
removeHosCarrier(/** number */ id)HosCarrier
Finds and removes the HosCarrier from the CompanyHoS#carriers array.
removeHosEvent(/** number */ id)HosEvent
Finds and removes the HosEvent from the CompanyHoS#events array.
removeHosInspection(/** number */ id)HosInspection
Finds and removes the HosInspection from the CompanyHoS#inspections array.
removeIcon(/** number */ id)Icon
Finds and removes the Icon from the Company#icons array.
removeLabel(/** string */ name)LabelStyle
Finds and removes the LabelStyle from the Company#labels array
removeMaintenanceJob(/** number */ id)MaintenanceJob
Finds and removes the MaintenanceJob from the Company#maintenanceJobs array.
removeMaintenanceSchedule(/** number */ id)MaintenanceSchedule
Finds and removes the MaintenanceSchedule from the Company#maintenanceSchedules array.
removePicture(/** number */ id)Picture
Finds and removes the Picture from the Company#pictures array
removePlace(/** number */ id)Place
Finds and removes the Place from the Company#places array.
removeProvider(/** string */ id)Provider
Finds and removes the Provider from the Company#providers array.
removeProviderConfig(/** number */ id)ProviderConfig
Finds and removes the ProviderConfig from the Company#providerConfigs array.
removeProviderConfiguration(/** number */ id)ProviderConfiguration
Finds and removes the ProviderConfiguration from the Company#providerConfigurations array.
removeProviderRegistration(/** number | string */ code)ProviderRegistration
Finds and removes the ProviderRegistration from the Company#providerRegistrations array.
removeProviderScript(/** number */ id)ProviderScript
Finds and removes the ProviderScript from the Company#providerScripts array.
removeReportResult(/** number */ id)ReportResult
Finds and removes the ReportResult from the Company#reportResults array.
removeReportSchedule(/** number */ id)ReportSchedule
Finds and removes the ReportSchedule from the Company#reportSchedules array.
removeReportTemplate(/** number */ id)ReportTemplate
Finds and removes the ReportTemplate from the Company#reportTemplates array.
removeSession(/** string */ handle)UserSession
Finds and removes the UserSession from the Company#sessions array.
removeUser(/** string */ login)User
Finds and removes the User from the Company#users array
removeUserGroup(/** number */ id)UserGroup
Finds and removes the UserGroup from the Company#userGroups array
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

CompanyAnalytics class

Container for Real-time analytic information related to the company

Usage

var object = /** Company */ companyInstance.fromJSON(/** trakit.socket.Company | trakit.socket.CompanyGeneral | trakit.socket.CompanyLabels | trakit.socket.CompanyPolicies | trakit.socket.CompanyReseller */ json, /** boolean */ silent);
Properties
PropertyTypeDescription
companyCompany
The Company to which this object belongs
rulesArray.<AnalyticRule>
summariesArray.<AnalyticSummary>
Functions
MethodReturnsDescription
fromJSON(/** trakit.socket.getAnalyticSummaryListResponse */ json)CompanyAnalytics
Updates parameters for this CompanyAnalytics from the given JSON literal
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

CompanyBilling class

Billing rules and policies this company uses to target its child companies.

Usage

var object = /** Company */ companyInstance.fromJSON(/** trakit.socket.Company | trakit.socket.CompanyGeneral | trakit.socket.CompanyLabels | trakit.socket.CompanyPolicies | trakit.socket.CompanyReseller */ json, /** boolean */ silent);
Properties
PropertyTypeDescription
bundlesArray.<BillingBundle>
List of application identifiers for which Users are allowed.
companyCompany
The Company to which this object belongs
policyArray.<BillingRule>
Ranges of IPv4 addresses (using Cisco notation) to limit session creation to certain IPs.
Functions
MethodReturnsDescription
fromJSON(/** trakit.socket.SessionPolicy */ json)CompanyBilling
Updates parameters for this CompanyBilling from the given JSON literal
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

CompanyHoS class

Container for Hours of Service information related to the company

Usage

var object = /** Company */ companyInstance.fromJSON(/** trakit.socket.Company | trakit.socket.CompanyGeneral | trakit.socket.CompanyLabels | trakit.socket.CompanyPolicies | trakit.socket.CompanyReseller */ json, /** boolean */ silent);
Properties
PropertyTypeDescription
carriersArray.<HosCarrier>
A list of carriers under which this company operates
companyCompany
The Company to which this object belongs
eventsArray.<HosEvent>
The daily log for assets in this company
inspectionsArray.<HosInspection>
Trip inspections logged for drivers and tractors of one of this company's carriers.
Functions
MethodReturnsDescription
fromJSON(/** trakit.socket.getHosCarriersListResponse | trakit.socket.getHosEventsListResponse | trakit.socket.getHosInspectionsListResponse */ json)CompanyHoS
Updates parameters for this CompanyHoS from the given JSON literal
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

CompanyPasswords class

Password Policy for the Company

Usage

var object = /** Company */ companyInstance.fromJSON(/** trakit.socket.Company | trakit.socket.CompanyGeneral | trakit.socket.CompanyLabels | trakit.socket.CompanyPolicies | trakit.socket.CompanyReseller */ json, /** boolean */ silent);
Properties
PropertyTypeDescription
companyCompany
The Company to which this policy relates
expireModeCompanyPasswordExpiryMode
Determines how the system will expire User passwords.
expireThresholdnumber
Specified in days; minimum values is 14.
includeLettersboolean
Alphabet characters required in passwords.
includeNumbersboolean
Numeric characters are required.
includeSpecialboolean
Require non-alphanumeric characters.
includeUpperLowerboolean
Big and small letters required.
minimumLengthnumber
Minimum length for a password (System restricted to minimum of 8)
Functions
MethodReturnsDescription
fromJSON(/** trakit.socket.PasswordPolicy */ json)CompanyPasswords
Updates parameters for this CompanyPasswords from the given JSON literal
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

CompanySessions class

Session creation, expiration, and restriction policy.

Usage

var object = /** Company */ companyInstance.fromJSON(/** trakit.socket.Company | trakit.socket.CompanyGeneral | trakit.socket.CompanyLabels | trakit.socket.CompanyPolicies | trakit.socket.CompanyReseller */ json, /** boolean */ silent);
Properties
PropertyTypeDescription
applicationsArray.<string>
List of application identifiers for which Users are allowed.
companyCompany
The Company to which this object belongs
expireTimeoutnumber
The absolute duration a session can last (in minutes). This value has no effect if idleAllowed is false. Maximum value is two weeks.
idleAllowedboolean
If false, sessions are invalidated as soon as the user disconnects.
ipv4RangesArray.<string>
Ranges of IPv4 addresses (using Cisco notation) to limit session creation to certain IPs.
maxSessionsnumber
The maximum number of simultaneous sessions allowed per User.
multiUserCompanyMultiUser
Defines how to handle multiple concurrent session from a single user.
Functions
MethodReturnsDescription
fromJSON(/** trakit.socket.SessionPolicy */ json)CompanySessions
Updates parameters for this CompanySessions from the given JSON literal
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

CompanyMultiUser enum (string)

Defines session behaviour to limit Fleet Freedom sessions to one at a time.
Values
ValueDescription
allow
Allow multiple concurrent sessions per user
deny
Disallow new sessions if a user already has an active session
replace
If a user has an active session, it is cancelled and the new session takes over as the only active session

CompanyPasswordExpiryMode enum (string)

Defines password expiration behaviour for the Company.
Values
ValueDescription
days
Disable passwords every X number of days
never
Passwords never expire
sessions
Disable passwords every X number of sign-ins

Contacts

Contact class

Inheritance: MVCObject > Contact
A Contact is an employee of a Company, but who may also perform other roles in other companies.

Usage

var object = new trakit.fleetfreedom.Contact(/** Company */ company, /** trakit.socket.Contact */ object);
Properties
PropertyTypeDescription
addressstring
A physical mail location.
addressesDictionary.<string, string>
Mailing addresses for this contact.
companyCompany
The Company which employs this contact
datesDictionary.<string, Date>
Inportant contact dates like birthdays.
emailstring
Primary email address.
emailsDictionary.<string, string>
Email addresses used for this contact.
faxnumber
Why can't we get rid of these damn machines?
idnumber
Unique identifier
mobilenumber
A cellular phone number.
namestring
This person's name.
notesstring
Miscellaneous notes for this person.
officenumber
A workplace landline phone number.
optionsDictionary.<string, string>
Additional information not easily categorized.
otherNamesDictionary.<string, string>
Other names for this contact.
phonesDictionary.<string, number>
Phone numbers for this contact including cell, office, home, fax, etc.
pictureIdsArray.<number>
A list of Picture#ids of this person.
picturesArray.<Picture>
A list of Pictures of this person.
rolesArray.<string>
The types of jobs this person performs for this company
urlstring
Website.
urlsDictionary.<string, string>
Websites and online resources of this contact.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** Contact */ json, /** boolean */ silent)Contact
Updates parameters for this Contact from the given JSON literal
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this contact. Used internally by Company#findContacts.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

Devices

Provider class

Inheritance: MVCObject > Provider
A Provider is a device or modem which provides events for an Asset

Usage

var object = new trakit.fleetfreedom.Provider(/** Company */ company, /** trakit.socket.Provider */ object);
Properties
PropertyTypeDescription
assetAsset
The Asset for which this hardware generates data.
assetIdnumber
The Asset#id for which this hardware generates data.
attributesDictionary.<!string, Dictionary.<string, ProviderAttribute>>
A list of constantly changing values given by the hardware as GPS, wiring, power, and other factors change.
companyCompany
The Company to which this Provider belongs
configProviderConfiguration
Current programmed configuration.
firmwarestring
Firmware version information.
geofenceLastDate
A timestamp from when the geofence list was successfully updated on the provider.
geofenceStatusProvisioningStatus
Geofence programming status set by the Provisioner.
idstring
Unique identifier. The unique value the modem uses to identify itself.
informationDictionary.<string, string>
A list of read-only values given by the hardware.
kindProviderType
The manufacturer and class of device.
namestring
Nickname given to the hardware.
notesstring
Notes about the hardware.
passwordstring
For security, most hardware platforms can be programmed with a unique password so that only authorized applications can make changes.
phoneNumbernumber
Programmed phone number
pndstring
The kind of Personal Navigation Device attached to the modem. Supported devices are Magellan and Garmin.
scriptLastDate
A timestamp from when the script successfully updated on the provider.
scriptStatusProvisioningStatus
Configuration script programming status set by the Provisioner.
simstring
ICCID of the SIM card currently installed.
sinceDate
A timestamp that indicates when the Provider was suspended or deleted.
suspendedboolean
Indicates whether this Provider is suspended from event processing.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
decodePassword()string
Decodes this Provider's password to a human readable version.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
encodePassword(/** string */ value)string
Encodes a new password for this Provider.
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.Provider */ json, /** boolean */ silent)Provider
Updates parameters for this Provider from the given JSON literal
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this provider. Used internally by Company#findProviders.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

ProviderAttribute class

A detail about a provider updated by the gateway.

Usage

var object = new trakit.fleetfreedom.ProviderAttribute(/** Object */ value, /** string */ unit, /** Date */ dts);
Properties
PropertyTypeDescription
dtsDate
The date/time when this value was set.
unitstring
The units used for this value. IE: knots, hectometres per hour, miles per gallon, etc...
valueObject
The raw value; usually numeric.
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

ProviderConfig class

Inheritance: MVCObject > ProviderConfig
The configured script loaded onto the provider over-the-air to control it's reporting schedule and behaviour.

Usage

var object = new trakit.fleetfreedom.ProviderConfig(/** Company */ company, /** trakit.socket.ProviderConfig */ object);
Properties
PropertyTypeDescription
companyCompany
The company to which this configuration belongs.
geofencesArray.<SearchPattern>
A search pattern used to filter which Places' geometry are used as geofences. Use null to disable. Use "*" to match all the Places the Provider's Asset can match. Or use "#123456" or "label:term" like other Place search patterns.
idnumber
Unique identifier of this configuration.
namestring
The nickname given to this configuration
notesstring
Simple details about how the providers are expected to behave.
parametersDictionary.<string, string>
The list of defined variable name/value pairs that the script requires.
scriptProviderScript
The ProviderScript which this configuration implements.
scriptIdnumber
Unique identifier of the ProviderScript this config inmplements.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.ProviderConfig */ json, /** boolean */ silent)ProviderConfig
Updates parameters for this ProviderConfig from the given JSON literal
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this provider. Used internally by Company#findProviders.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

ProviderConfiguration class

Inheritance: MVCObject > ProviderConfiguration
A Script is something loaded onto a Provider device to configure its programming

Usage

var object = new trakit.fleetfreedom.ProviderConfiguration(/** Company */ company, /** trakit.socket.ProviderConfiguration */ object);
Properties
PropertyTypeDescription
companyCompany
The Company to which this ProviderConfiguration belongs
geofenceIdsArray.<number>
List of configured geofence IDs (taken from known Place#ids).
geofencesArray.<Place>
List of configured geofences (taken from known Places).
idnumber
Unique identifier
namestring
Nickname given to the config.
notesstring
Details about which Providers should be using this config.
scriptParametersDictionary.<string, Object>
List of configured options.
templateIdnumber
The identifier of the logic used by the modem or phone.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.ProviderConfiguration */ json, /** boolean */ silent)ProviderConfiguration
Updates parameters for this ProviderConfiguration from the given JSON literal
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this configuration. Used internally by Company#findProviderConfigurations.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

ProviderConfigurationNode class

Details about a provider configuration options node.

Usage

var object = new trakit.fleetfreedom.ProviderConfigurationNode(/** string */ id, /** string */ notes, /** boolean */ isAdvanced, /** string */ type);
Properties
PropertyTypeDescription
maxObject
Maximum value which can be configured.
minObject
Minimum value which can be configured.
nodesDictionary.<string, ProviderConfigurationNode>
List of child-config nodes.
unitstring
The unit used for configuration.
valueObject
The configured value.

ProviderConfigurationType class

Inheritance: MVCObject > ProviderConfigurationType
A template to create Provider Configurations

Usage

var object = new trakit.fleetfreedom.ProviderConfigurationType(/** trakit.socket.ProviderConfigurationType */ object);
Properties
PropertyTypeDescription
geofencesTypesArray.<PlaceShapeTypes>
Supported geofence types.
idnumber
Unique identifier
maxGeofencesnumber
Maximum number of geofences allowed.
minGeofencesnumber
Minimum number of geofences required by the script.
namestring
Nickname given to the modem.
notesstring
Details about the value setting.
providerTypeProviderType
Type of providers this config can be applied to.
scriptOptionsDictionary.<string, ProviderConfigurationNode>
List of options to be configured.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.ProviderConfigurationType */ json, /** boolean */ silent)ProviderConfigurationType
Updates parameters for this ProviderConfigurationType from the given JSON literal
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

ProviderRegistration class

Inheritance: MVCObject > ProviderRegistration
The temporary reference to a device whose ownership is pending.

Usage

var object = new trakit.fleetfreedom.ProviderRegistration(/** Company */ company, /** trakit.socket.ProviderRegistration */ object);
Properties
PropertyTypeDescription
assetAsset
The Asset for which this device will provide data.
assetIdnumber
The unique identifier of the Asset for which this device will provide data.
codestring
Unique identifier of this registration.
companyCompany
The company to which this registration belongs.
completedDate
Date/time stamp of when this registration ended successfully.
configProviderConfig | ProviderConfiguration
The predefined configuration this device will use.
configIdnumber
Unique identifier of the configuration this device will use.
expiresDate
The expiry date for this registration.
identifierstring
The unique identifier of the device that completed this registration.
kindProviderType
The kind of protocol this device supports.
loginstring
The unique identifier the user who generated this registration.
namestring
A nickname given to the device once it has been provisioned.
notesstring
Notes!
passwordstring
The password programmed on the device used to ensure the system is the only client authorized to make changes.
phonenumber
The phone number of the device being provisioned.
sinceDate
Date/time stamp of when this registration began.
userUser
The user who generated this registration.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.ProviderRegistration */ json, /** boolean */ silent)ProviderRegistration
Updates parameters for this ProviderRegistration from the given JSON literal
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this provider. Used internally by Company#findProviderRegistration.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

ProviderScript class

Inheritance: MVCObject > ProviderScript
This class describes a type of logic applied to a provider. A script will generate a file which is loaded onto a provider in the field.

Usage

var object = new trakit.fleetfreedom.ProviderScript(/** Company */ company, /** trakit.socket.ProviderScript */ object);
Properties
PropertyTypeDescription
blocksArray.<ProviderScriptBlock>
Blocks of file data which are (optionally) included in the script data file.
companyCompany
The Company to which this ProviderScript belongs
fillstring
Hex colour value for fills and backgrounds.
globalboolean
When true, this script is available to all child Companys.
graphicstring
Short string with an icon-code for display purposes.
idnumber
Unique identifier. The unique value the modem uses to identify itself.
kindProviderType
The manufacturer and class of device.
namestring
Nickname given to the hardware.
notesstring
Notes about the hardware.
parametersDictionary.<string, ProviderScriptParameter>
Parameter definitions for this script, including type-hints and default values. Since the gateways use case insensitive parameter matching, the keys are all converted to lower-case.
strokestring
Hex colour value for text and outlines.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.ProviderScript */ json, /** boolean */ silent)ProviderScript
Updates parameters for this ProviderScript from the given JSON literal
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this provider. Used internally by Company#findProviders.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

ProviderScriptBlock class

A chunk of script and variables used to assemble a working ProviderScript.

Usage

var object = new trakit.fleetfreedom.ProviderScriptBlock(/** string */ content, /** string */ replace, /** string */ condition, /** string */ validate);
Properties
PropertyTypeDescription
conditionstring
When defined, this condition matches a ProviderScriptParameter defined in the ProviderConfig to include or exclude this chunk from the script.
contentstring
A chunk of the file loaded onto a provider with it's variables replaced with configurable variables. Trailing or leading whitespace should be included here, so when blocks are merged, so too is the newline characters.
replaceRegExp
A regular expression used to match variables in the content. RegExp is case insensitive and multiline.
validatestring
Used in conjunction with condition, this value must match the given ProviderScriptParameter value to have the chunk included.
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

ProviderScriptParameter class

Definition of an argument passed to a ProviderScript.

Usage

var object = new trakit.fleetfreedom.ProviderScriptParameter(/** ProviderScriptParameterType */ type, /** string */ value, /** string */ notes, /** string */ context, /** boolean */ advanced);
Properties
PropertyTypeDescription
advancedboolean
Used as a hint that this parameter controls an advanced script option and should only be set if you really know what you're doing.
contextstring
Gives a hint to the client on the best UI to use for editing. For example, "checkbox" is a good UI hint for boolean parameter types.
notesstring
Usage notes.
typeProviderScriptParameterType
Simple type information for the gateway to process.
valuestring
The value is given as a string, but parsed into native type when used by the gateway.
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

ProviderScriptParameterType enum (string)

Possible data-types given to ProviderScriptParameter.
Values
ValueDescription
boolean
True or false.
number
Numeric value (double-precision floating point number).
text
Text.

ProviderType enum (string)

The types of providers supported by Fleet Freedom.
Values
ValueDescription
airlink
Sierra Wireless RAP compatible modems (AirLink)
atrack
ATrack Technology AX9 and AK11 modems
bewhere
BeWhere asset trackers
bluetree
BlueTree and Sixnet BT series modems (Red Lion)
calamp
CalAmp series modems
datatrans
TachWest DT series modems
enfora
Novatel series modems (Enfora)
genx
GenX Mobile GNX series modems
json
Fleet Freedom JSON protocol
lbs
Bell Mobility user-plane LBS compatible phones
mobile
Android, iOS, and Blackberry apps
smartwitness
SmartWitness dashcam formats
titan
Certified Tracking Solutions Titan series modems
unknown
Undefined type
xirgo
Xirgo modems

ProvisioningStatus enum (string)

Progress lifetime of changing the on-board information on a provider.
Values
ValueDescription
cancelled
Sending of the new configuration was halted by a user.
completed
New configuration successfully sent to provider.
created
The new configuration has been created, but not yet sent to the provider.
error
Something went wrong while trying to send configuration.
inProgress
Currently sending configuration over-the-air to the provider.
maxRetries
The maximum number of retries were attempted before giving up.
otaSent
A message was sent to the provider asking it to check in.
partial
Only a partial configuration was sent to the provider.
pending
Provider is notified of new configuration, but has not yet checked in.
unknown
Your guess is as good as mine. It should never be this.

Dispatch and Tasks

Dispatch class

A Dispatch is a list of tasks and directions assigned to an Asset

Usage

var object = new trakit.fleetfreedom.Dispatch(/** Asset */ asset, /** Dispatch */ object);
Properties
PropertyTypeDescription
assetAsset
The Asset to which this Dispatch is assigned
colourstring
The hex colour of the polyline
directionsArray.<string>
Instructions on how to travel between Tasks
polylineArray.<LatLng>
The shape of the turn-by-turn directions
tasksArray.<DispatchTask>
List of tasks to perform during this Dispatch
Functions
MethodReturnsDescription
fromJSON(/** Dispatch */ json)Dispatch
Updates parameters for this Dispatch from the given JSON literal
getBounds()LatLngBounds
Gets a latlng bounding box for the tasks (and optional directions)
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

DispatchTask class

Inheritance: MVCObject > DispatchTask
A task is a piece of a Dispatch which must be completed

Usage

var object = new trakit.fleetfreedom.DispatchTask(/** Asset */ asset, /** trakit.socket.DispatchTask */ object);
Properties
PropertyTypeDescription
addressstring
The address of the task's location.
arrivedDate
A flag set by the system if the Asset has arrived at this task's location.
assetAsset
The Asset to which this object relates
attachmentIdsArray.<number>
A list of hosted HostedDocument#identifiers attached to this task.
attachmentsArray.<HostedDocument>
A list of hosted HostedDocuments attached to this task.
completedDate
Flag set by the system when the task is completed (usually behaviour and mobile provider working together).
createdDate
When this task was first assigned.
durationnumber
The expected time-on-site (in seconds; affects ETAs for other tasks in a Dispatch).
etaDate
Expected Time of Arrival.
idnumber
Unique identifier
instructionsstring
Details about how to go about performing this task.
latlngLatLng
GPS coordinates of this task.
namestring
Short description of this task.
notesstring
Notes filled out by field-employee.
placePlace
The Place related to this task if applicable.
placeIdnumber
The Place#id related to this task if applicable.
referencestring
Getter/setter for the references field named "reference".
referencesDictionary.<string, string>
Name/value collections of custom fields used to refer to external systems.
signatorystring
The name filled out by the person who signed.
signatureboolean
When true, a signature was captured and can be retrieved using the Pictures API.
statusTaskStatus
The status of this task. See TaskStatus for details.
timeOnSiteTimeSpan
The duration as a TimeSpan.
updatedstring
Timestamp from the last change made to this task.
updaterstring
Either the login of the user or the identifier of the provider that changed this task.
versionArray.<number>
The version flags used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.DispatchTask */ json, /** boolean */ silent)DispatchTask
Updates parameters for this DispatchTask from the given JSON literal
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

TaskStatus enum (string)

Values
ValueDescription
arrived
The Asset has arrived at the destination.
cancelled
The DispatchTask has been cancelled either by the driver or the dispatcher.
completed
The DispatchTask has been completed (and signature captured).
created
The DispatchTask has been created, but not yet delivered to the remote device.
damaged
An item associated with this DispatchTask is damaged.
droppedOff
An item was dropped-off for this DispatchTask.
onRoute
The Asset is now on its way to the destination.
pickedUp
An item was picked-up for this DispatchTask.
queued
The DispatchTask has been delivered to the remote device, or was created on the remote device.
unsuccessful
The DispatchTask couldn't be completed by the Asset.
waiting
The Asset is waiting and can't complete the DispatchTask.

Drawing

drawing object

A utility library exposing algorithms for a flat plane.

Usage

var value = trakit.fleetfreedom.drawing.member;
/* or */
var result = trakit.fleetfreedom.drawing.member(...params);
Functions
MethodReturnsDescription
pathLength(/** Array.<Point> */ path)number
Calculates the total length of the given path
pathReduce(/** Array.<Point> */ path, /** number */ tolerance)Array.<Point>
Performs a Douglas-Peucker path reduction based on the given tolerance.
pointAngle(/** number */ startingX, /** number */ startingY, /** number */ endingX, /** number */ endingY)number
Calculates the starting angle (in degrees) between two Points using the top as zero. Does not return negative values.
pointDistance(/** number */ startingX, /** number */ startingY, /** number */ endingX, /** number */ endingY)number
Calculates the distance between two points using Pythagorean theorem.
pointOrthogonal(/** number */ firstX, /** number */ firstY, /** number */ midX, /** number */ midY, /** number */ lastX, /** number */ lastY)
Calculates the orthogonal height of a triangle. The orthogonal height is calculated by drawing a line between the firstPoint and lastPoint, then getting the length of a line drawn up from the line to the midPoint at a 90 degree angle.
pointPythagora(/** number */ width, /** number */ height)number
Calculates the Pythagorean length of a triangle given the length of the other two sides.
pointVector(/** number */ distance, /** number */ degrees)Point
Calculates the vector which can be used to find the point based on the given direction and distance
polyArea(/** Array.<Point> */ path)number
Calculates the total area occupied by the given path. Treats non-closed paths as closed paths.
polyContains(/** Array.<Point> */ poly, /** number */ pointX, /** number */ pointY)boolean
A utility function to determine if a given point is inside the given polygon path.
polyReduce(/** Array.<Point> */ path, /** number */ tolerance)Array.<Point>
Performs a Douglas-Peucker path reduction on a polygon for the given tolerance. The start/end points are variable and the end point is trimmed from the result.
polyWrapper(/** Array.<Point> */ points)Array.<Point>
Wraps the given points into a polygonal path. The given points do not need to be a path. The returned path is not closed.
radialArea(/** number */ radius)number
Calculates the area of a circle based on the given radius.
radialCircumference(/** number */ radius)number
Calculates the circumference of a circle based on the given radius.
radialSmallest(/** Array.<Point> */ points, /** number */ iterations)Radial
Solves the Minimum Enclosing Circle problem using Badoiu Clarkson's algorithm.

Point class

An x/y coordinate

Usage

var object = new trakit.fleetfreedom.Point(/** number */ x, /** number */ y);
Properties
PropertyTypeDescription
xnumber
Left coordinate
ynumber
Top coordinate
Functions
MethodReturnsDescription
angleTo(/** Point */ point)number
Calculates the angle (in degrees) to the given point
distanceTo(/** Point */ point)number
Calculates the distance between two points
equals(/** Point */ point, /** number */ precision)boolean
Compares this Point to another to see if they are equal
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
toOffset(/** Point */ offset)Point
Creates a new Point based on the given offset
toString(/** string */ delimiter)string
Returns a string representation
toTranslated(/** number */ distance, /** number */ degrees)Point
Creates a new Point at the given angle and distance

Radial class

A boundary based on a centre point and a radius

Usage

var object = new trakit.fleetfreedom.Radial(/** number */ x, /** number */ y, /** number */ radius);
Properties
PropertyTypeDescription
rnumber
The radial distance
xnumber
Left coordinate
ynumber
Top coordinate
Functions
MethodReturnsDescription
contains(/** Point */ point)boolean
Determines if the given Point is contained by this Radial
copy()Radial
Creates a duplicate of this Radial
equals(/** Radial */ radial, /** number */ precision)boolean
Compares this Point to another to see if they are equal
extend(/** Point | Array.<Point> */ object)Radial
Extends the boundary to envelop the given point(s)
getCentre()Point
Returns the centre point representation
getSize()Size
Returns the centre point representation
grow(/** number */ length)Radial
Increases the boundary radius
overlaps(/** Radial */ bound)boolean
Determines if the given Radial is overlaps this Radial in any way
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
toOffset(/** Point */ point)Radial
Moves the Radial by the given offset
toRectangle(/** boolean */ clip)Rectangle
Converts this radial boundary into a square boundary
toString(/** string */ delimiter)string
Returns a string representation
toTranslated(/** number */ distance, /** number */ degrees)Radial
Moves the Radial by the given angle and distance

Rectangle class

A four-sided box

Usage

var object = new trakit.fleetfreedom.Rectangle(/** Point | Rectangle | Object */ topleft, /** Point | Rectangle | Object */ bottomright);
Properties
PropertyTypeDescription
bottomnumber
The bottom-most coordinate
heightnumber
The absolute height of this Rectangle
leftnumber
The left-most coordinate
rightnumber
The right-most coordinate
topnumber
The top-most coordinate
widthnumber
The absolute width of this Rectangle
Functions
MethodReturnsDescription
contains(/** Point */ point)boolean
Determines if the given Point is contained by this Rectangle
copy()Rectangle
Validates the boundary and creates a duplicate of this Rectangle
equals(/** Rectangle */ rectangle, /** number */ precision)boolean
Compares this Rectangle to another to see if they are equal
expand(/** Point | Rectangle | Array.<(Point | Rectangle)> */ object)Rectangle
Extends the boundary to envelop the given point(s) but does not automatically validate. This comes in efficient when doing many operations on a single Rectangle
extend(/** Point | Rectangle | Array.<(Point | Rectangle)> */ object)Rectangle
Extends the boundary to envelop the given point(s) and automatically validates
getBottomLeft()Point
Returns the Point at the bottom-most/left-most corner.
getBottomRight()Point
Returns the Point at the bottom-most/right-most corner.
getCentre()Point
Returns the Point at the centre.
getSize()Size
Validates the boundary and creates a Size representation
getTopLeft()Point
Returns the Point at the top-most/left-most corner.
getTopRight()Point
Returns the Point at the top-most/right-most corner.
grow(/** number */ width, /** number */ height, /** string */ direction)Rectangle
Increases the size of the boundary by the given width and height
isEmpty()boolean
Checks to see if the bounds are valid, and that the corners are different coordinates.
isValid()boolean
Checks to see if the bounds are valid (not inside-out).
overlaps(/** Rectangle */ rectangle)boolean
Determines if the given Rectangle is overlaps this Rectangle in any way
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
toOffset(/** Point */ point)Rectangle
Creates a new Rectangle at the given angle and distance
toRadial(/** boolean */ clip)Radial
Validates the boundary and returns a Radial
toString(/** string */ delimiter)string
Validates the boundary and returns a string representation
toTranslated(/** number */ distance, /** number */ degrees)Shape
Creates a new Rectangle at the given angle and distance
validate()Rectangle
Validates the boundary by ensuring the top value is less than the bottom value, and the left value is less than the right value. Also adjusts the width and height values

Size class

Size object for width/height/depth

Usage

var object = new trakit.fleetfreedom.Size(/** number */ width, /** number */ height);
Properties
PropertyTypeDescription
heightnumber
widthnumber
Functions
MethodReturnsDescription
equals(/** Size */ size, /** number */ precision)boolean
Compares this Size to another to see if they are equal
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
toString(/** string */ delimiter)string
Returns a string representation

File Hosting

DashcamData class

Inheritance: MVCObject > DashcamData
A DashcamData is an employee of a Company, but who may also perform other roles in other companies.

Usage

var object = new trakit.fleetfreedom.DashcamData(/** Company */ company, /** trakit.socket.DashcamData */ json);
Properties
PropertyTypeDescription
altitudenumber
Altitude of the coordinates at the start of the dachcam data.
assetAsset
The asset tied to the provider at the time.
assetIdnumber
Unique identifier of the asset tied to the provider at the time.
cameranumber
Number assigned to the camera that took the image/video.
companyCompany
The Company to which this data belongs.
endDate
Timestamp of when this dachcam data ended. For images, the start and end and the same.
guidstring
Unique identifier
headingnumber
Bearing of the coordinates at the start of the dachcam data.
kindDashcamDataType
The type of data being hosted.
latlngLatLng
Coordinates of the start of the dachcam data.
providerProvider
The provider that sent the data.
providerIdstring
Unique identifier of the provider that sent the data.
speednumber
Speed of the coordinates at the start of the dachcam data.
startDate
Timestamp of when this dachcam data started. For images, the start and end and the same.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this dashcam data. Used internally by Company#findDashcamDatas.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

HostedDocument class

Inheritance: MVCObject > HostedDocument
A HostedDocument is a file stored temporarily by the system.

Usage

var object = new trakit.fleetfreedom.HostedDocument(/** Company */ company, /** trakit.socket.Document */ object);
Properties
PropertyTypeDescription
bytesnumber
The file's size on the disk.
companyCompany
The Company to which this HostedDocument belongs.
expiryDate
The date and time this file will be automatically purged from our system.
idnumber
Unique identifier
mimestring
MIME type of this file.
namestring
The filename or a nickname given to this file.
notesstring
Miscellaneous notes for file.
srcstring
The relative path used to retrieve this file.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.Document */ json, /** boolean */ silent)HostedDocument
Updates parameters for this HostedDocument from the given JSON literal
getDispatchTasks()Array.<DispatchTask>
Returns an array of DispatchTasks to which this document is attached.
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this HostedDocument. Used internally by Company#findDocuments.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
prettySize(/** number */ places, /** number */ maxScale, /** number */ groupSize, /** string */ groupDelimiter, /** string */ decimalDelimiter, /** string */ point)string
Creates a more human readable string representation of the filesize.
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

DashcamDataType enum (string)

The kinds of DashcamDatas supported by the system. Every DashcamData is one of these types.
Values
ValueDescription
image
Image
unknown
Unknown or other.
video
Video

Geography

geography object

A utility library exposing algorithms for calculations on a sphere.

Usage

var value = trakit.fleetfreedom.geography.member;
/* or */
var result = trakit.fleetfreedom.geography.member(...params);
Values
PropertyTypeDefaultDescription
earthRadiusnumber6378137
The radius of the Earth in meters taken from the GRS-80, NAD83, and WGS-84 standards.
Functions
MethodReturnsDescription
clampLat(/** number */ latitude, /** number */ edge)number
Normalizes a latitude value between +/- 90. Values of greater than 90 are returned as 90, and values less than -90 are returned as -90.
clampLng(/** number */ longitude)number
Normalizes a longitude value between +/- 180. Values of greater than 180 are returned as a negative difference of 360, and values less than -180 are returned as a positive difference of 360.
pathDecode(/** string */ route, /** number */ precision)Array.<LatLng>
An implementation of Google's Decoded Polyline Algorithm format. https://developers.google.com/maps/documentation/utilities/polylinealgorithm
pathEncode(/** Array.<LatLng> */ route, /** number */ precision)string
An implementation of Google's Encoded Polyline Algorithm format. https://developers.google.com/maps/documentation/utilities/polylinealgorithm
pathLength(/** Array.<LatLng> */ route, /** number */ radius)number
Calculates the length of the given route.
pathReduce(/** Array.<LatLng> */ route, /** number */ tolerance)Array.<LatLng>
Performs a Douglas-Peucker path reduction based on the given tolerance.
pointAngle(/** number */ aLat, /** number */ aLng, /** number */ bLat, /** number */ bLng)number
Bearing from coordinate A to coordinate B in degrees from North
pointDistance(/** number */ aLat, /** number */ aLng, /** number */ bLat, /** number */ bLng, /** number */ radius)number
Calculates the distance between two coordinates on a sphere.
pointMiddle(/** number */ aLat, /** number */ aLng, /** number */ bLat, /** number */ bLng)
Throws Error "Either latitude or longitude is NaN".
LatLng
Calculates the mid-point between to given coordinate
pointOrthogonal(/** number */ aLat, /** number */ aLng, /** number */ midLat, /** number */ midLng, /** number */ bLat, /** number */ bLng, /** number */ radius)number
Calculates the orthogonal height of a triangle. The orthogonal height is calculated by drawing a line between the coordinate A and coordinate B, then getting the length of a line drawn up from the line to the mid coordinate at a 90 degree angle.
pointTranslate(/** number */ lat, /** number */ lng, /** number */ meters, /** number */ bearing, /** number */ radius)
Throws Error "Either latitude or longitude is NaN".
LatLng
Calculates the final coordinate based on the given starting coordinate and vector
pointVincenty(/** number */ aLat, /** number */ aLng, /** number */ bLat, /** number */ bLng)number
Calculates the distance between two coordinates on a Bessel 1841 ellipsoid.
polyArea(/** Array.<LatLng> */ route, /** number */ radius)
Throws Error "Not enough coordinates".
number
Calculates the total area occupied by the given geofence.
polyContains(/** Array.<LatLng> */ route, /** number */ lat, /** number */ lng)boolean
A utility function to determine if a given coordinate is inside the given geofence.
polyReduce(/** Array.<LatLng> */ route, /** number */ tolerance)Array.<LatLng>
Performs a Douglas-Peucker path reduction on a polygon for the given tolerance. The start/end coordinates are variable and the end coordinate is trimmed from the result.
polyWidest(/** Array.<LatLng> */ route)Array.<number>
Finds the widest section of the given route. This is useful for path reduction and reorientation.
radialArea(/** number */ radius)number
Calculates the spherical-cap area occupied by the given radial distance.

mercator object

A utility library for Mercator Projection; converting coordiantes on a an elliptical surface to a flat surface.

Usage

var value = trakit.fleetfreedom.mercator.member;
/* or */
var result = trakit.fleetfreedom.mercator.member(...params);
Values
PropertyTypeDefaultDescription
majorRadiusnumber6378137
The radius of the Earth in meters taken from the GRS-80, NAD83, and WGS-84 standards.
minorRadiusnumber~6356752.3142
The minor axis radius of an ellipsoid Earth as per WGS-84.
Functions
MethodReturnsDescription
latlngToPixel(/** number */ lat, /** number */ lng, /** number */ zoom, /** number */ tileSize)Point
Converts a LatLng into a pixel coordinate at a specified level of detail.
metresPerPixel(/** number */ lat, /** number */ zoom, /** number */ tileSize)number
Returns the number of meters per pixel at the given latitude and zoom level.
pixelToBounds(/** number */ pixelX, /** number */ pixelY, /** number */ zoom, /** number */ tileSize, /** number */ grow)LatLngBounds
Converts pixel coordinates of a tile into a lat/lng boundary.
pixelToLatlng(/** number */ pixelX, /** number */ pixelY, /** number */ zoom, /** number */ tileSize)LatLng
Converts a pixel coordinate into a LatLng at a specified level of detail.
pixelToTile(/** number */ pixelX, /** number */ pixelY, /** number */ tileSize)Point
Converts pixel coordinates into tile coordinates of the tile containing the specified pixel.
tileMapSize(/** number */ zoom, /** number */ tileSize)number
Determines the map width and height (in pixels) at a specified level of detail.
tileToBounds(/** number */ tileX, /** number */ tileY, /** number */ zoom, /** number */ tileSize, /** number */ grow)LatLngBounds
Converts tile coordinates into a lat/lng boundary representing a complete tile.
tileToLatlng(/** number */ tileX, /** number */ tileY, /** number */ tileSize)LatLng
tileToPixel(/** number */ tileX, /** number */ tileY, /** number */ tileSize)Point
Converts tile coordinates into pixel coordinates of the upper-left pixel of the specified tile.

LatLng class

A simple latitude/longitude pair. All LatLng objects use geography.earthRadius for internal calculations.

Usage

var object = new trakit.fleetfreedom.LatLng(/** number */ lat, /** number */ lng);
Properties
PropertyTypeDescription
latnumber
Latitude (normalized between -180 and +180)
lngnumber
Longitude (normalized between -90 and +90)
Functions
MethodReturnsDescription
bearingTo(/** LatLng */ latlng)number
Bearing from this LatLng to the given position in degrees from North
distanceTo(/** LatLng */ latlng)number
Returns the distance to the given LatLng in meters
equals(/** LatLng */ latlng, /** number */ tolerance)boolean
Compares this LatLng to another to see if they are equivalent.
toBetween(/** LatLng */ latlng)LatLng
Returns a new LatLng at the half-way point between this and the given LatLng.
toBounds(/** number */ radius)LatLngBounds
Creates a square LatLngBounds centred around this LatLng.
toJSON()Object | null
Creates a literal of this object. Used internally by JSON.stringify.
toRadians(/** number */ magnifier)Point
Creates a Point based on the given magnifier
toString(/** string */ delimiter)string
Creates string representation of this coordinate
toTranslated(/** number */ meters, /** number */ bearing)LatLng
Returns a new LatLng based on the given distance and bearing from the this position
Static Methods
MethodReturnsDescription
LatLng.parse(/** string */ latlng, /** string */ comma)LatLng
Creates a LatLng from the given string.

LatLngBounds class

A bounding box of latitudes and longitudes

Usage

var object = new trakit.fleetfreedom.LatLngBounds(/** LatLng | LatLngBounds | Array.<LatLng> | Array.<LatLngBounds>= */ ne, /** LatLng | LatLngBounds | Array.<LatLng> | Array.<LatLngBounds>= */ sw);
Properties
PropertyTypeDescription
eastnumber
Eastern edge
northnumber
Latitude at the Northern corners; not necessarily the Northern-most value.
southnumber
Latitude at the Southern corners; not necessarily the Southern-most value.
westnumber
Western edge
Functions
MethodReturnsDescription
contains(/** LatLng */ latlng)boolean
Checks if a LatLng is contained within this boundary.
copy()LatLngBounds
Creates a duplicate of this LatLngBounds
encloses(/** LatLngBounds */ bounds)boolean
Checks if a LatLngBounds is contained within this boundary.
equals(/** LatLngBounds */ bounds)boolean
Compares this LatLngBounds to another to see if they are equal
expand(/** LatLng | LatLngBounds | Array.<(LatLng | LatLngBounds)> */ latlngs)LatLngBounds
Extends the boundary to envelop the given point(s) but does not automatically validate. This comes in efficient when doing many operations on a single PointBounds
extend(/** LatLng | LatLngBounds | Array.<(LatLng | LatLngBounds)> */ latlngs)LatLngBounds
Extends the boundary to envelop the given point(s) and automatically validates
getCentre()LatLng
Returns the centre point of the boundary.
getDiagonalDistance()number
The distance in meters between the north-east corner and the south-west corner.
getEastMiddle()LatLng
The mid-point coordinate between the north east and north west corners.
getLatitudinalDistance()number
The distance in meters between the north-most border and the south-most border.
getLongitudinalDistance()number
The distance in meters between the east-most and the west-most points along the border closest to the equator.
getNorthEast()LatLng
The coordinate of the north east corner.
getNorthMiddle()LatLng
The mid-point coordinate between the north east and north west corners.
getNorthWest()LatLng
The coordinate of the north west corner.
getSouthEast()LatLng
The coordinate of the south east corner.
getSouthMiddle()LatLng
The mid-point coordinate between the south east and south west corners.
getSouthWest()LatLng
The coordinate of the south west corner.
getWestMiddle()LatLng
The mid-point coordinate between the south east and south west corners.
isEmpty()boolean
Checks to see if the bounds are valid, and that the corners are different coordinates.
isValid()boolean
Checks to see if the bounds are valid (not inside-out and lat/lngs are normalized).
overlaps(/** LatLngBounds */ other)boolean
Checks if a LatLngBounds overlaps this boundary. Also returns true if either boundary's LatLngBounds#encloses returns true.
toJSON()Object | null
Creates a literal of this object. Used internally by JSON.stringify.
toString(/** string */ delimiter)string
Creates string representation of this coordinate
validate()LatLngBounds
Validates the boundary by ensuring the top value is less than the bottom value, and the left value is less than the right value. Also adjusts the width and height values

Position class

Inheritance: LatLng > Position
GPS Position details

Usage

var object = new trakit.fleetfreedom.Position(/** number */ lat, /** number */ lng, /** number */ speed, /** number */ bearing, /** number */ accuracy, /** string | Date */ dts, /** string */ address, /** number */ limit, /** number */ altitude, /** StreetAddress */ street);
Properties
PropertyTypeDescription
accuracynumber
Estimated accuracy for this GPS fix
addressstring
Approximate street address
altitudenumber
Altitude (in meters above sea level)
bearingnumber
Bearing (in degrees from north)
dateDate
Data/time of this GPS fix
latnumber
Latitude (normalized between -180 and +180)
lngnumber
Longitude (normalized between -90 and +90)
radiusnumber
Equatorial radius of the planet; value is geography.earthRadius
speednumber
Speed (in Km/h)
speedLimitnumber
Speed limit in Km/h
streetStreetAddress
A reverse-geocoded breakdown of all geographic information available at the lat/long coordinates.
Functions
MethodReturnsDescription
bearingTo(/** LatLng */ latlng)number
Bearing from this LatLng to the given position in degrees from North
distanceTo(/** LatLng */ latlng)number
Returns the distance to the given LatLng in meters
equals(/** Position */ position)boolean
Compares this Position to another to see if they are equal
predictNext(/** number */ seconds)LatLng
Predicts a new Position based on current location and speed added by the given seconds
toBetween(/** LatLng */ latlng)LatLng
Returns a new LatLng at the half-way point between this and the given LatLng.
toBounds()LatLngBounds
Creates a square LatLngBounds centred around this LatLng.
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
toLatLng()LatLng
Returns a new LatLng using this position's coordinates.
toRadians(/** number */ magnifier)Point
Creates a Point based on the given magnifier
toString()string
Creates JSON-string representation of this coordinate
toTranslated(/** number */ meters, /** number */ bearing)LatLng
Returns a new LatLng based on the given distance and bearing from the this position

StreetAddress class

Represents all the pieces of a reverse-geocoded address.

Usage

var object = new trakit.fleetfreedom.StreetAddress(/** string */ number, /** string */ street, /** string */ city, /** string */ region, /** string */ province, /** string */ country, /** string */ postal, /** boolean */ toll);
Properties
PropertyTypeDescription
citystring
City name
countrystring
Country code
numberstring
House number
postalstring
Postal or zip code
provincestring
Province or state code
regionstring
Region name
streetstring
Full street name
tollboolean
Indicates that there is a toll for the current road segment
Functions
MethodReturnsDescription
toString()string
Creates string representation of this address.
Static Methods
MethodReturnsDescription
StreetAddress.parse(/** trakit.socket.StreetAddress */ json)StreetAddress
Creates a StreetAddress out of a trakit.socket.StreetAddress.

Hours of Service

HosCarrier class

Inheritance: MVCObject > HosCarrier
An operator registered to transport goods or people.

Usage

var object = new trakit.fleetfreedom.HosCarrier(/** Company */ company, /** trakit.socket.HosCarrier */ object);
Properties
PropertyTypeDescription
addressStreetAddress
The carrier's physical or incorporated address.
codesDictionary.<string, string>
Identity codes supplied by a regulatory/government body such as DOT ID.
companyCompany
The Company to which this asset belongs.
contactContact
Main contact information
contactIdnumber
The Contact#id of the carrier's main contact information.
idnumber
Unique identifier
logoPicture
Carrier logo (appears on trip inspection logs)
logoIdnumber
The Picture#id of the carrier's logo.
namestring
Carrier's distinct name (may be different from Company#name)
notesstring
Notes.
shiftCycleHosCycle
Default shift cycle used by the drivers.
timezonestring
The local timezone of the carrier's address.
versionArray.<number>
The version flags used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.HosCarrier */ json, /** boolean */ silent)HosCarrier
Updates parameters for this HosCarrier from the given JSON literal
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

HosEvent class

Inheritance: MVCObject > HosEvent
This event represents the daily log for the driver.

Usage

var object = new trakit.fleetfreedom.HosEvent(/** Company */ company, /** trakit.socket.HosEvent */ object);
Properties
PropertyTypeDescription
addressStreetAddress
Geolocation/Written address by driver of where the event took place
carrierHosCarrier
The carrier information to which this event belongs.
carrierIdnumber
Unique identifier of the carrier information
certificationDateDate
Date of the records being certified or re-certified by the driver
codeHosEventCode
This code is used in conjunction with the type to determine the specific event
companyCompany
The Company to which this asset belongs.
diagnosticCodeHosDiagnosticCode
Data Diagnostic Event Code
diagnosticStatusboolean
Data Diagnostic Event Indicator Status
distanceSinceGPSFixstring
Distance since last valid coordinates. An integer value between 0 and 6
dtsDate
When the event took place
engineHoursnumber
Engine hours of the tractor at the time of the event
idnumber
Unique Identifier
isCoDriverboolean
Driver status - Primary/Co-driver
latitudestring
Single character 'X', single character 'M', single character 'E', or 2-decimal point precision value between -90.00 and 90.00
longitudestring
Single character 'X', single character 'M', single character 'E', or 2-decimal point precision value between -179.99 and 180.00
malfunctionCodeHosMalfunctionCode
Malfunction Indicator Code
malfunctionStatusboolean
Malfunction Indicator Status
notesstring
Comments/Annotations entered by the driver/user
odometernumber
Odometer reading of the tractor at the time of the event
originHosEventOrigin
Event Record origin
personPerson
Driver associated with this event
personIdnumber
Unique identifier of the driver
seqNostring
Event Sequence Id Number
shiftCycleHosCycle
Driver's shift cycle
statusHosEventStatus
Event Record status
typeHosEventType
Event type used to determine the record type
vehiclenumber
Vehicle associated with this event
vehicleIdVehicle
Unique identifier of the vehicle
versionArray.<number>
The version flags used to ensure sync operations are done in order.
violationStatusboolean
Violation Status
violationTypeHosViolationType
Type of violation
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.HosEvent */ json, /** boolean */ silent)HosEvent
Updates parameters for this HosEvent from the given JSON literal
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

HosInspection class

Inheritance: MVCObject > HosInspection
A pre- or post-Trip inspection report.

Usage

var object = new trakit.fleetfreedom.HosInspection(/** Company */ company, /** trakit.socket.HosInspection */ object);
Properties
PropertyTypeDescription
addressStreetAddress
Street address where the inspection took place
carrierHosCarrier
The carrier information to which this inspection report belongs.
carrierIdnumber
Unique identifier of the carrier information
companyCompany
The Company which logged this inspection report.
defectsArray.<HosInspectionDefect>
List of all defects
idnumber
Unique identifier
inspectedOnDate
Timestamp from when the inspection took place.
latlngLatLng
Coordinates where the inspection took place
odometernumber
Recorded odometer at time of inspection
personPerson
Driver who conducted the inspection
personIdnumber
Unique identifier of the driver
statusHosDefectStatus
Status of all defects
technicianstring
Name of the (optional) mechanic/technician who performed repairs or inspection.
techSignedDate
Timestamp from when a mechanic/technician (optionally) signed off on the inspection.
trailersArray.<Trailer>
Between 0 and 2 trailers being inspected
vehicleVehicle
Tractor being inspected
vehicleIdVehicle
Unique identifier of the vehicle
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.HosInspection */ json, /** boolean */ silent)HosInspection
Updates parameters for this HosInspection from the given JSON literal
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

HosInspectionDefect class

Details of a defect found during a trip inspection

Usage

var object = new trakit.fleetfreedom.HosInspectionDefect(/** HosDefectArea */ area, /** string */ category, /** string */ description, /** Array.<string> */ major, /** Array.<string> */ minor);
Properties
PropertyTypeDescription
areaHosDefectArea
Shows where a defect was located on the rig.
categorystring
The kind of defect
descriptionstring
A text description of the defect.
majorArray.<string>
A list of major flaws as noted for Canadian standards
minorArray.<string>
A list of minor flaws as noted for Canadian standards
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

HosCycle enum (string)

Driving cycle behaviour.
Values
ValueDescription
canada120h14d
Canada South 120 hour / 14 day (Cycle 2)
canada120h14dN
Canada North 120 hour / 14 day (Cycle 2)
canada70h7d
Canada South 70 hour / 7 day (Cycle 1)
canada80h7d
Canada North 80 hour / 7 days (Cycle 1)
canadaOilGas
Canada Oil and Gas
usa60h7d
USA Federal 60 hour / 7 days
usa60h7d_p
USA Federal 60 hour / 7 days (passenger)
usa70h8d
USA Federal 70 hour / 8 days
usa70h8d_p
USA Federal 70 hour / 8 days (passenger)
usaAlaska70h7d
USA Alaska 70 hour / 7 days
usaAlaska70h7d_p
USA Alaska 70 hour / 7 days (passenger)
usaAlaska80h8d
USA Alaska 80 hour / 8 days
usaAlaska80h8d_p
USA Alaska 80 hour / 8 days (passenger)
usaCalifornia112h8d
USA California 112 hours / 8 days (farm products)
usaCalifornia112h8d_p
USA California 112 hours / 8 days (passenger)
usaCalifornia80h8d
USA California 80 hour / 8 days
usaCalifornia80h8d_p
USA California 80 hour / 8 days (passenger)
usaTexas70h7d
USA Texas 70 hour / 7 day

HosDataTransferType enum (string)

Method of transferring E-Logs to the authorities
Values
ValueDescription
canadaEmail
MTO via Email
usaEmail
FMCSA via Email
usaWebservice
FMCSA via Webservice portal

HosDefectArea enum (string)

Shows where a defect was located on the rig.
Values
ValueDescription
tractor
Defect on the vehicle.
trailer
Defect on one of the trailers.

HosDefectStatus enum (string)

Resolution status for trip inspection defects
Values
ValueDescription
corrected
Issue fixed or resolved
harmless
Issue does not affect operation
satisfactory
No correction required

HosDiagnosticCode enum (string)

Data diagnostic events
Values
ValueDescription
dataTransfer
Data transfer data diagnostic event
engine
Engine synchronization data diagnostic event
missingData
Missing required data elements data diagnostic event
other
Other ELD identified diagnostic event
power
Power data diagnostic event
unidentified
Unidentified driving records data diagnostic event

HosEventCode enum (string)

Specifies the nature of the change indicated but the HosEventType.
Values
ValueDescription
diagnosticCleared
Diagnostic: An data diagnostic event cleared
diagnosticLogged
Diagnostic: A data diagnostic event logged
driving
Duty Status: Driver's duty status changed to "Driving"
intermediateConventional
Intermediate: log with conventional location precision
intermediateReduced
Intermediate: log with reduced location precision
login
Login: Authenticated driver's ELD login activity
logout
Login: Authenticated driver's ELD logout activity
malfunctionCleared
Diagnostic: An ELD malfunction cleared
malfunctionLogged
Engine Power: An ELD malfunction logged
none
Other: Driver indication for PC, YM and WT cleared
offDuty
Duty Status: Driver's duty status changed to "Off-duty"
onDuty
Duty Status: Driver's duty status changed to "On-duty not driving"
personalConveyance
Other: Driver indicates "Authorized Personal use of CMV"
powerupConventional
Engine Power: Engine power-up with conventional location precision
powerupReduced
Engine Power: Engine power-up with reduced location precision
shutdownConventional
Engine Power: Engine shut-down with conventional location precision
shutdownReduced
Engine Power: Engine shut-down with reduced location precision
sleeperBerth
Duty Status: Driver's duty status changed to "Sleeper Berth"
yardMoves
Other: Driver indicates "Yard moves"

HosEventOrigin enum (string)

Event record origin
Values
ValueDescription
automatic
Automatically recorded by ELD
driver
Entered or edited by driver
unidentified
Assumed from unidentified driver profile
user
Edit requested by an authenticated user other than driver

HosEventStatus enum (string)

Event record status
Values
ValueDescription
active
Active
inactiveChanged
Inactive - changed
inactiveChangeRejected
Inactive - change rejected
inactiveChangeRequested
Inactive - change requested

HosEventType enum (string)

Event record type
Values
ValueDescription
certification
A driver's certification/re-certification of records
diagnostic
A malfunction or data diagnostic detection occurence
dutyStatus
A change in driver's duty-status
enginePower
CMV's engine power up/shutdown activity
intermediate
An intermediate log
login
A driver's login/logout activity
other
A change in driver's indication of authorized personal use of CMV or yard moves
unknown
Unknown

HosMalfunctionCode enum (string)

Data diagnostic events
Values
ValueDescription
dataRecording
Data recording compliance malfunction
dataTransfer
Data transfer compliance malfunction
engine
Engine synchronization compliance malfunction
other
Other ELD detected malfunction
position
Positioning compliance malfunction
power
Power compliance malfunction
timing
Timing compliance malfunction

HosViolationType enum (string)

Types of violation
Values
ValueDescription
break_24
24 Hour Break Required
break_30
30 Minute Break Required
cycle_120
120 Hour Cycle Limit
cycle_60
60 Hour Cycle Limit
cycle_70
70 Hour Cycle Limit
daily_break_10
Daily 10 Hour Off-Duty Required
daily_driving_13
Daily 13 Hour Driving Limit
daily_duty_14
Daily 14 Hour On-Duty Limit
driving_10
10 Hour Driving Limit
driving_11
11 Hour Driving Limit
driving_13
13 Hour Driving Limit
duty_14
14 Hour Shift Limit
duty_15
15 Hour On-Duty Limit
duty_16
16 Hour Shift Limit
none
No violation

Icons

Icon class

Inheritance: MVCObject > Icon
A mapped iconic representation of an Asset

Usage

var object = new trakit.fleetfreedom.Icon(/** Company */ company, /** trakit.socket.Icon */ object);
Properties
PropertyTypeDescription
categorystring
The category of icon like "Truck" or "Building".
companyCompany
The Company to which this icon relates.
globalboolean
Indicates that the icon can be used, and is available to child companies.
glyphsArray.<IconGlyph>
The glyphs used to show detail on this icon.
idnumber
Unique identifier of an Icon (value is NaN for unsaved).
labelIconLabel
Definition for the on-map label.
namestring
Descriptive name of the icon.
notesstring
Notes about this icon or uses.
usageArray.<string>
Tag-style list of objects this icon should be used for.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
copy()Icon
Creates a duplicate of this Icon
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
equals(/** Icon */ icon)boolean
Compares this Icon to another to see if they are equal
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.Icon */ json, /** boolean */ silent)Icon
Updates parameters for this Icon from the given JSON literal
getBaseGlyph()IconGlyph
Gets the first glyph to use as the standard icon.
getGlyphs(/** string */ tag)Array.<IconGlyph>
Compares this Icon to another to see if they are equal
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this icon. Used internally by Company#findIcons.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

IconGlyph class

Icon details which are status-tag specific

Usage

var object = new trakit.fleetfreedom.IconGlyph(/** Icon */ icon, /** Array.<string> */ tags, /** string */ src, /** Size */ size, /** Point */ anchor, /** IconLayer */ layer, /** number */ zIndex, /** boolean */ rotates);
Properties
PropertyTypeDescription
anchorPoint
The offset from the LatLng in pixels
iconIcon
The Icon to which this glyph relates.
layerIconLayer
Mapped icons are layered, on which layer does this glyph display.
rotatesboolean
When true, the icon should be rotated to match the direction of travel for the position it represents.
sizeSize
Size of the glyph in pixels
srcstring
URL for the image using the Pictures API for icons.
tagsArray.<string>
Tags which must be present to use this glyph.
zIndexnumber
The z-order of this glyph compared to other glyphs for the same layer.
Functions
MethodReturnsDescription
copy()IconGlyph
Creates a duplicate of this IconGlyph
equals(/** IconGlyph */ glyph)boolean
Compares this IconGlyph to another to see if they are equal
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

IconLabel class

An Icon's label definition

Usage

var object = new trakit.fleetfreedom.IconLabel(/** Icon */ icon, /** string */ align, /** Point */ anchor, /** string */ colour);
Properties
PropertyTypeDescription
alignstring
Determines which corner the label is attached with
anchorPoint
The offset from the LatLng in pixels
colourstring
Background colour of the label (foreground calculated automatically)
iconIcon
The Icon to which this label relates
Functions
MethodReturnsDescription
copy()IconLabel
Creates a duplicate of this IconLabel
equals(/** IconLabel */ label)boolean
Compares this IconLabel to another to see if they are equal
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

IconLayer enum (string)

The kinds of shapes used for places on the map.
Values
ValueDescription
fills
SVG layer used for the fill of a Place or the accuracy radius of an Asset. Fleet Freedom automatically sets any element applied here to 25% opacity.
labels
HTML layer for all marker labels.
markers
HTML layer for all marker images.
outlines
SVG layer used for the outline of a Place or the accuracy radius of an Asset.
shadows
HTML layer for shadows from all markers. Fleet Freedom automatically sets any element applied here to 40% opacity.

JSON WebSocket

socket object

This WebSocket synchronizes objects between the browser and server side

Usage

var value = trakit.fleetfreedom.socket.member;
/* or */
var result = trakit.fleetfreedom.socket.member(...params);
Properties
PropertyTypeDescription
lastRequestDate
A date/time stamp from the last moment a command was sent from the client.
lastResponseDate
A date/time stamp from the last moment a message was received by the client.
policiesObject
Object with two keys for the current User's Company's policy information.
policies.passwordsCompanyPasswords
The CompanyPasswords informs you on password requirements for changing passwords.
policies.sessionsCompanySessions
The CompanySessions provides behaviour information for maintaining a session.
sessionUserSession
A JSON equivalent UserSession for the current connection.
stateSocketState
The WebScoket's current connection state.
Functions
MethodReturnsDescription
close()boolean
Closes the WebSocket connection.
dispose()
Closes the WebSocket connection, unbinds all event handlers, and prepares the object for the garbage collector.
open(/** string */ url, /** string */ ghostId, /** boolean */ keepAlive)boolean
Opens a WebSocket connection to the Fleet Freedom service.
send(/** string */ command, /** SocketRequest */ object, /** function */ callback, /** number */ timeout)number
Sends a command an parameters object.
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
mapper(/** Object */ obj)
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

SocketRequest class

Treat the socket request object like a literal, but make sure to include the "reqId" property. The WebSocket will respond to each request with the reqId it was given so you can correlate responses.

Usage

var object = new trakit.fleetfreedom.SocketRequest(/** number */ reqId);
Properties
PropertyTypeDescription
reqIdnumber

SocketResponse class

Treat the socket response object like a literal. It will always have the reqId, errorCode, and message properties, but can also contain any number of other properties.

Usage

var object = new trakit.fleetfreedom.SocketResponse(/** number */ errorCode, /** string */ message, /** number */ reqId);
Properties
PropertyTypeDescription
errorCodenumber
messagestring
reqIdnumber

SocketState enum (string)

Defines socket connection states.
Values
ValueDescription
closed
The connection is closed. This is the initial state.
closing
The underlying TCP connection may still be open, but the server is no longer accepting commands.
open
The connection to the server is open and ready.
opening
The underlying TCP connection is open, but the server has not yet identified that it is ready.
unknown
Your guess is as good as mine. It should never be this.

Label and Tag styles

LabelStyle class

Inheritance: MVCObject > LabelStyle
Labels are styled based on the available style definition

Usage

var object = /** Company */ companyInstance.createLabel(/** trakit.socket.LabelStyle */ json);
Properties
PropertyTypeDescription
codestring
The codified name. See utility#codify.
companyCompany
The Company to which this contact relates.
fillstring
Hex colour value for fills and backgrounds.
graphicstring
Short string with an icon-code for display purposes.
namestring
The un-codifed name with special characters and upper-case/lower-case preserved.
notesstring
Notes for label uses.
strokestring
Hex colour value for text and outlines.
Functions
MethodReturnsDescription
copy()LabelStyle
Creates a duplicate of this LabelStyle
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
equals(/** LabelStyle */ label)boolean
Compares this LatLng to another to see if they are equal
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.LabelStyle */ json)LabelStyle
Updates parameters for this LabelStyle from the given JSON literal
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

Maintenance

MaintenanceInterval class

Inheritance: MVCObject > MaintenanceInterval
The details of an Asset's usage used to calculate the next Maintenance Job for the given schedule.

Usage

var object = new trakit.fleetfreedom.MaintenanceInterval(/** MaintenanceSchedule */ schedule, /** number */ assetId, /** Date */ date, /** number */ odometer, /** number */ engineHours, /** number */ lastJobId);
Properties
PropertyTypeDescription
assetAsset
The Vehicle or Trailer being used for this schedule
assetIdnumber
Unique identifier of the asset being used for this schedule
dateDate
Initial date to use for the schedule's Date Recurrence pattern
engineHoursnumber
Initial engine hours value (in decimal hours) for the schedule's Engine Hours Recurrence pattern
lastJobnumber
The most recent completed job for the asset using the schedule.
lastJobIdnumber
Unique identifier of the last completed job for the asset.
odometernumber
Initial odometer value (in Km) for the schedule's Odometer Recurrence pattern
scheduleMaintenanceSchedule
The Maintenance Schedule to which this recurrence definition refers
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
predict()Date
Tries to predict the next lapse for this interval.
predictByDate()Date
Tries to predict the next lapse for this interval based on the date.
predictByEngineHours()Date
Tries to predict the next lapse for this interval by averaging the engine hours.
predictByOdometer()Date
Tries to predict the next lapse for this interval by averaging the odometer.
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

MaintenanceJob class

Inheritance: MVCObject > MaintenanceJob
A log of maintenance to perform on an Asset

Usage

var object = new trakit.fleetfreedom.MaintenanceJob(/** Company */ company, /** trakit.socket.MaintenanceJob */ object);
Properties
PropertyTypeDescription
assetAsset
The Asset to which this Job relates.
assetIdnumber
The Asset#id to which this Job relates.
companyCompany
The Company to which the Job's Asset relates.
completedDate
Time-stamp from the Job's status change (or creation).
costnumber
Estimated cost for these jobs.
createdDate
The time-stamp from this Job's creation.
durationnumber
The amount of time (in seconds) spent performing the work.
engineHoursnumber
The recorded engine hours reading from the vehicle at the time of doing the work.
garagestring
The Service Centre used for these jobs.
idnumber
Unique identifier
namestring
Repair or service task.
notesstring
Instructions for these jobs.
odometernumber
The recorded odometer reading from the vehicle at the time of doing the work.
picturesArray.<Picture>
Images taken while performing the work.
referencestring
Reference code used to track these jobs.
scheduleMaintenanceSchedule
MaintenanceSchedule to which this Job relates.
scheduleIdnumber
MaintenanceSchedule#id to which this Job relates.
statusMaintenanceJobStatus
The progress on the service work.
technicianstring
The mechanic who performed the work.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.MaintenanceJob */ json, /** boolean */ silent)MaintenanceJob
Updates parameters for this MaintenanceJob from the given JSON literal
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this job. Used internally by Company#findMaintenanceJobs.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

MaintenanceSchedule class

Inheritance: MVCObject > MaintenanceSchedule
A schedule for recurring MaintenanceJobs

Usage

var object = new trakit.fleetfreedom.MaintenanceSchedule(/** Company */ company, /** trakit.socket.MaintenanceSchedule */ object);
Properties
PropertyTypeDescription
companyCompany
The Company to which this MaintenanceSchedule relates
costnumber
Estimated cost for these jobs
durationnumber
Estimated amount of time (in seconds) to complete the work.
fillstring
Hex colour value for fills and backgrounds.
garagestring
The Service Centre used for these jobs
graphicstring
Short string with an icon-code for display purposes.
idnumber
Unique identifier
intervalsDictionary.<number, MaintenanceInterval>
The per-asset details calculated by the system to help predict the creation of Maintenance Jobs.
namestring
Repair or service task
notesstring
Instructions for these jobs
notifyArray.<string>
A list of User#logins who are notified when the schedule predicts a job will need to be completed soon, and/or when it has elapsed.
predictionDaysnumber
The number of days in advance to predict a job will become pending.
recurDaysnumber
The maximum number of days between service stops
recurDistancenumber
The minimum distance (in Km) between service stops
recurEngineHoursnumber
The minimum running engine hours (in decimal hours) between service stops
referencestring
Reference code used to track these jobs
strokestring
Hex colour value for text and outlines.
targetsstring
Targeting expression for selecting Vehicle and Trailer type assets.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.MaintenanceSchedule */ json, /** boolean */ silent)MaintenanceSchedule
Updates parameters for this MaintenanceSchedule from the given JSON literal
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this schedule. Used internally by Company#findMaintenanceSchedules.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

MaintenanceJobStatus enum (string)

The status of a pending or historical maintenance job
Values
ValueDescription
cancelled
The work was not done, and the job has been cancelled.
completed
The work was done.
pastdue
The job needs to be done as soon as possible.
pending
The job has to be done within the next two weeks.

Messaging

Message class

Inheritance: MVCObject > Message
An SMS or Email Message

Usage

var object = new trakit.fleetfreedom.Message(/** Asset */ asset, /** trakit.socket.Message */ object);
Properties
PropertyTypeDescription
assetAsset
The Asset to which this object relates.
assetIdnumber
The identifier of the Asset to which this message belongs.
bodystring
Message text
deliveredDate
When the message was received or sent by the system.
folderstring
Can be "Inbox" and "Archive"
fromstring
Sender's address; either email or phone number
idnumber
Unique identifier of the message.
incomingboolean
True when message was received by Fleet Freedom, and False when sent by Fleet Freedom.
kindstring
MessageTypes used are SMS and Email.
processedDate
When the message was processed by the system.
readBystring
The User who read this message. Blank if unread.
statusMessageStatus
Shows message processing status.
subjectstring
Email subject. For SMS messages, this is left blank.
tostring
Recipient's address; either email or phone number
userUser
The User who sent or received the message.
userLoginstring
The User#login who sent or received the message.
versionArray.<number>
The version flags used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.Message */ json, /** boolean */ silent)Message
Updates parameters for this Message from the given JSON literal
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

MessageStatus enum (string)

Messages have a lifetime and each status represents a memos's progress through it's life.
Values
ValueDescription
acknowledged
Sent and has been responded to or acknowledged by the recipient.
bounceback
Sent but returned with error (applies to MessageType#email).
created
Created, but not yet sent to the recipient.
failed
Failed to send.
processed
Sent or received without error.
throttled
Failed to send because too many messages sent to the specified recipient.

MessageType enum (string)

The types of messages supported by Fleet Freedom.
Values
ValueDescription
apn
iOS App Message
email
By email
gcm
Android App Message
pnd
Personal Navigation Device (Garmin/Magellan/etc)
sms
By phone
socket
WebSocket alert message
unknown
If the type of memo has not yet been determined, or there was an error determining its type.

Model-View-Control

MVCEvent class

An event object used by classes instead of DOM objects

Usage

var object = /** MVCObject */ mvcobjectInstance.fire(/** string */ type, /** ? */ detail);
Properties
PropertyTypeDescription
detail?
An optional value or object used for custom extensions (read-only)
firedboolean
Indicates whether this event was fired or not
stoppedboolean
Indicates whether this event is being stopped
targetMVCObject
The object from which this event is fired (read-only)
typestring
The event type name (read-only)
Functions
MethodReturnsDescription
stop()boolean
Stops/prevents default action for this event

MVCObject class

A class with which pseudo-MVC functionality is replicated

Usage

var object = new trakit.fleetfreedom.MVCObject();
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

Photos / Images

Picture class

Inheritance: MVCObject > Picture
Pictures are just what they sound like; a photo or image.

Usage

var object = new trakit.fleetfreedom.Picture(/** Company */ company, /** trakit.socket.Picture */ object);
Properties
PropertyTypeDescription
bytesnumber
The image's filesize on the disk.
companyCompany
The Company to which this contact relates
focalsArray.<Rectangle>
A list of focal points like faces.
idnumber
Unique identifier
namestring
The name of the picture or its contents.
notesstring
Notes about the picture or contents.
sizeSize
The size in pixels of this image.
srcstring
URL for the image using the Pictures API.
usesnumber
The number of items (assets, contact, tasks, etc) using this image. (updated hourly)
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
copy()Picture
Creates a duplicate of this Picture
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
equals(/** Picture */ photo)boolean
Compares this Picture to another to see if they are equal
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.Picture */ json, /** boolean */ silent)Picture
Updates parameters for this Picture from the given JSON literal
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this picture. Used internally by Company#findPictures.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
prettySize(/** number */ places, /** number */ maxScale, /** number */ groupSize, /** string */ groupDelimiter, /** string */ decimalDelimiter, /** string */ point)string
Creates a more human readable string representation of the filesize.
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

Places (POIs / geofences)

Place class

Inheritance: MVCObject > Place
A Place is a POI, a geofence, a region, or some other geographic area of interest.

Usage

var object = new trakit.fleetfreedom.Place(/** Company */ company, /** trakit.socket.PlaceGeneral */ object);
/* or */
var object = /** Company */ companyInstance.createPlace(/** trakit.socket.PlaceGeneral */ json);
Properties
PropertyTypeDescription
anchorLatLng
The centre coordinate.
colourstring
Hex colour for this place's area
companyCompany
The Company to which this asset belongs.
detailstring
The full street address.
iconIcon
The icon used to mark the centre coordinate.
iconIdnumber
The unique identifier of the Icon for this place.
idnumber
Unique identifier.
kindPlaceShapeType
The type of shape to draw around the centre coordinate.
labelsArray.<string>
Codified labels. See utility#codify.
namestring
Friendly searchable name.
notesstring
Any area specific notes
pictureIdsArray.<number>
Picture#ids taken for this location.
picturesArray.<Picture>
Pictures taken for this location.
radiusnumber
When drawing a PlaceShapeType#radial, this specifies how large the circle must be in meters.
referencestring
Customizable field used to refer this place an external system.
shapeArray.<LatLng>
When drawing a PlaceShapeType#polygon or PlaceShapeType#rectangle, the coordinates given represent the outlined shape.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.PlaceGeneral */ json, /** boolean */ silent)Place
Updates parameters for this Place from the given JSON literal
getAssets(/** Array.<AssetPlaceStatusType> */ statuses)Array.<Asset>
Gets a list of Assets which are interacting with this place.
getBounds()LatLngBounds
Returns a valid LatLngBounds that contains the shape of this place.
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this place. Used internally by Company#findPlaces.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

PlaceShapeType enum (string)

The kinds of shapes used for places on the map.
Values
ValueDescription
point
A LatLng only. These types of places do not interact with Assets.
polygon
A non-self-intersecting polygon of more than 2 unique LatLng coordinates. When an Asset is contained, it will interact with the Place.
radial
A LatLng with a radius. When an Asset is within the radius, it will interact with the Place.
rectangle
A LatLngBounds, not a true "rectangle". When an Asset is contained, it will interact with the Place.

Real-time Analytics

AnalyticRule class

Inheritance: MVCObject > AnalyticRule

Usage

var object = new trakit.fleetfreedom.AnalyticRule(/** Company */ company, /** trakit.socket.AnalyticRule */ object);
Properties
PropertyTypeDescription
companyCompany
The Company to which this asset belongs.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.AnalyticRule */ json, /** boolean */ silent)AnalyticRule
Updates parameters for this AnalyticRule from the given JSON literal
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

AnalyticSummary class

Inheritance: MVCObject > AnalyticSummary
Analysis for an asset of a specific type and instance.

Usage

var object = new trakit.fleetfreedom.AnalyticSummary(/** Company */ company, /** trakit.socket.AnalyticSummary */ object);
Properties
PropertyTypeDescription
assetAsset
The Asset to which this asset belongs.
companyCompany
The Company to which this asset belongs.
completeboolean
Denotes that an event has been processed to invalidate the sequence and end the summary.
distancenumber
The distance travelled in kilometres by the asset.
durationnumber
The amount of time that passed.
eventCountnumber
The number of events included in the calculation.
firstDateDate
Timestamp from the first event in the sequence.
firstStatetrakit.socket.AssetAdvanced
The first asset state which begins this summary instance.
idnumber
Unique identifier
kindAnalyticType
The type of analysis done.
lastDateDate
Timestamp from the last event in the sequence.
lastStatetrakit.socket.AssetAdvanced
The asset state that ended this summary instance.
polylineArray.<LatLng>
A path created from all the asset's positions in sequence.
statestring
Code given to this analysis for the asset.
versionArray.<number>
The version flags used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.AnalyticSummary */ json, /** boolean */ silent)AnalyticSummary
Updates parameters for this AnalyticSummary from the given JSON literal
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

AnalyticType enum (string)

The types an analyses being performed.
Values
ValueDescription
places
All Places visited.
regions
Every geographic region such as cities, provinces/states, and countries.
tags
Analysis for each Status Tag applied to each asset.
tasks
Life-time of each Task assigned to each asset.

Reports

reports object

Utility object for referencing static content.

Usage

var value = trakit.fleetfreedom.reports.member;
/* or */
var result = trakit.fleetfreedom.reports.member(...params);
Values
PropertyTypeDefaultDescription
typesArray.<ReportType>undefined
Array of supported ReportTypes

ReportNotifications class

A group of users and targeted assets which also receive report notifications

Usage

var object = new trakit.fleetfreedom.ReportNotifications(/** Array.<string> */ users, /** string */ assets);
Properties
PropertyTypeDescription
assetsstring
Targeting expressions for sending report results to targeted assets (only about themselves).
usersArray.<string>
List of users from the target company who will receive report results (via email only) for scheduled reports.
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

ReportOptions class

The options and settings used by the report runner to create results.

Usage

var object = new trakit.fleetfreedom.ReportOptions(/** string */ targets, /** Array.<ReportParameter> */ parameters, /** ReportFilterMode */ filtering, /** string */ places, /** Array.<string> */ regions, /** ReportScorecardRules */ scorecardRules);
Properties
PropertyTypeDescription
filteringReportFilterMode
The method by which results will be filtered
parametersArray.<ReportParameter>
Configured values used to execute the results.
placesstring
The SearchPattern used to filter results based on Places.
regionsArray.<string>
Configured values used to execute the results.
scorecardRulesReportScorecardRules
Rules used to generate scorecard for this report.
targetsstring
The SearchPattern used to target the results.
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

ReportParameter class

Usage

var object = new trakit.fleetfreedom.ReportParameter(/** ReportParameterType */ type, /** string */ value);
Properties
PropertyTypeDescription
typeReportParameterType
The kind of parameter.
valuestring
The value given to the report processor.
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

ReportRecurrence class

A recurring Report and schedule

Usage

var object = new trakit.fleetfreedom.ReportRecurrence(/** trakit.socket.ReportRecurrence */ object);
Properties
PropertyTypeDescription
endDate
Local date/time on which the recurring pattern ends (not UTC).
iterationsnumber
The number of times this schedule has been invoked to generate results.
kindReportRecurrenceType
Pattern used to re-create ReportResults.
lastEndDateDate
Last start date/time range of the schedule.
lastResultnumber
Unique identifier of the most recent ReportResult for this schedule's template.
lastStartDateDate
Last start date/time range of the schedule.
nextEndDateDate
Ending date/time range predicted for the next occurrence.
nextStartDateDate
Starting date/time range predicted for the next occurrence.
startDate
Local date/time from which the recurring pattern begins (not UTC).
timezonestring
The local timezone used to calculate recurring date/time ranges.
weekdaynumber
A number between 0 and 6 representing the day of the week starting with Sunday.
weekdaysArray.<boolean>
Seven (7) booleans which denote the applicable days of the week starting with Sunday.
Functions
MethodReturnsDescription
calculateNextRange()Array.<Date>
Calculates the next recurring date range for the schedule. Returns an array of zero or two Dates. If the schedule will not allow the template to run again, the array is empty. Otherwise, the first element is the next starting date, and the second element is the ending date.
fromJSON(/** trakit.socket.ReportRecurrence */ json)ReportRecurrence
Updates parameters for this ReportRecurrence from the given JSON literal
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

ReportResult class

Inheritance: MVCObject > ReportResult
The results of a canned report. The full summary and breakdown can be accessed through the Reports API.

Usage

var object = new trakit.fleetfreedom.ReportResult(/** Company */ company, /** trakit.socket.ReportResult */ object);
Properties
PropertyTypeDescription
archiveboolean
A flag to show whether the ReportResult has been archived.
boundsLatLngBounds
The boundary containing the results of this report.
companyCompany
The Company to which this object belongs
completedDate
The date/time when the results were done processing.
createdDate
When the results were originally requested from the report processor.
errorstring
A message to describe why the report failed.
filteredArray.<Place>
Collection of Places that were used for filtering the results.
filterIdsArray.<number>
A list of Place#ids that were used for filtering the results.
idnumber
Unique identifier
namestring
Saved name of the results
notesstring
Saved notes for the results, and possibly the appended error message if the ReportResult#status is ReportStatus.failed
optionsReportOptions
The list of options and parameters for processing.
progressnumber
The progress in running and saving the results.
runBystring
The User who originally created these results.
scheduleReportSchedule
If created on a nightly schedule, this will be the ReportSchedule that created the report result.
scheduleIdnumber
The ReportSchedule#id used to create this report result.
scorecardsArray.<ReportScorecard>
Scorecards for all the targeted assets based on the scorecard rules.
statusReportStatus
Processing status. See ReportStatus for details.
targetedArray.<Asset>
Collection of targeted Assets that were used to calculate the results.
targetIdsArray.<number>
A list of Asset#ids that were used to calculate the results.
templateReportTemplate
An optional template to fill in any missing options.
templateIdnumber
The ReportTemplate#id used to create this report result.
timezonestring
The assumed timezone under which the dates are calculated.
totalsArray.<ReportTotal>
A summed list of totals for the results.
typeReportType
The kind of logic used to process the results.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.ReportResult */ json, /** boolean */ silent)ReportResult
Updates parameters for this ReportResult from the given JSON literal
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this report. Used internally by Company#findReportResults.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

ReportSchedule class

Determines when and how often a report schedule runs automatically.

Usage

var object = new trakit.fleetfreedom.ReportSchedule(/** Company */ company, /** trakit.socket.ReportSchedule */ object);
Properties
PropertyTypeDescription
companyCompany
The Company to which this object belongs
idnumber
Unique identifier
namestring
Saved name of the schedule
notesstring
Saved notes for the schedule
notifyReportNotifications
A group of users and targeted assets which also receive report notifications
optionsReportOptions
The list of options and parameters for processing
scheduleReportRecurrence
A pattern for automatically re-running the report template
templateReportTemplate
The report template for which this schedule runs
templateIdnumber
ID of the report template for which this schedule runs
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
fromJSON(/** trakit.socket.ReportSchedule */ json, /** boolean */ silent)ReportSchedule
Updates parameters for this ReportSchedule from the given JSON literal
getNotifyAssets()Array.<Asset>
Returns a list of assets who will receive notification of new report results (for themselves only) from this schedule.
getNotifyUsers()Array.<User>
Returns a list of users who will receive notification of new report results from this schedule.
getOwner()User
Returns the User who owns this schedule. When results are generated, this user's permissions and settings are used.
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this schedule. Used internally by Company#findReportSchedules.
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

ReportScorecard class

Infraction parameter used to generate scorecard.

Usage

var object = new trakit.fleetfreedom.ReportScorecard(/** Object */ json);
Properties
PropertyTypeDescription
conditionstring
Type of exception, example speeding, idling, etc...
durationTimeSpan
Threshold per instance. If the threshold is 0, each instance is used in the calculation.
pointsnumber
Points applied against the base score per instance.
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

ReportScorecardParameter class

Infraction parameter used to generate scorecard.

Usage

var object = new trakit.fleetfreedom.ReportScorecardParameter(/** string */ condition, /** string | number | TimeSpan */ duration, /** number */ points);
Properties
PropertyTypeDescription
conditionstring
Type of exception, example speeding, idling, etc...
durationTimeSpan
Threshold per instance. If the threshold is 0, each instance is used in the calculation.
pointsnumber
Points applied against the base score per instance.
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

ReportScorecardRules class

Rules used for generating a scorecard.

Usage

var object = new trakit.fleetfreedom.ReportScorecardRules(/** number */ baseScore, /** Array.<ReportScorecardParameter> */ parameters);
Properties
PropertyTypeDescription
baseScorenumber
Base score for the scorecard.
parametersArray.<ReportScorecardParameter>
Infraction parameters used to generate the final score.
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

ReportTemplate class

Inheritance: MVCObject > ReportTemplate
A Report with all the necessary parameters pre-configured in a ReportType

Usage

var object = new trakit.fleetfreedom.ReportTemplate(/** Company */ company, /** trakit.socket.ReportTemplate */ object);
Properties
PropertyTypeDescription
companyCompany
The Company to which this object belongs
fillstring
The colour filling the background of the display icon.
graphicstring
The name of the icon used for display purposes.
idnumber
Unique identifier
namestring
Saved name of the template
notesstring
Saved notes for the template
optionsReportOptions
The list of options and parameters for processing.
strokestring
The colour of the outline for the display icon.
typeReportType
The kind of logic used to process the results.
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.ReportTemplate */ json, /** boolean */ silent)ReportTemplate
Updates parameters for this ReportTemplate from the given JSON literal
getReportResults()Array.<ReportResult>
Retrieves the ReportResults using this template.
getReportSchedules()Array.<ReportSchedule>
Retrieves the ReportSchedules for this template.
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this template. Used internally by Company#findReportTemplates.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

ReportTotal class

Totalled information from all the results of the report.

Usage

var object = new trakit.fleetfreedom.ReportTotal(/** ReportResult */ result, /** trakit.socket.ReportTotal */ json);
Properties
PropertyTypeDescription
assetAsset
The Asset to which this total refers.
assetIdnumber
Asset's Unique identifier
distancenumber
The total distance travelled of all summary instances.
durationnumber
The total duration of all summary instances.
resultReportResult
The ReportResult to which this total belongs.
stateDetailstring
Unique code given to the report total.
summaryCountnumber
The number of summary instances included in this total.
valuenumber
The total value of all summary instances.
valueTypestring
The type of totalled value.
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

ReportType class

A definition for the type of report logic used.

Usage

var object = /** ReportTemplate */ reporttemplateInstance.type();
Properties
PropertyTypeDescription
idstring
Constant identifier. One of the ReportType values.
namestring
Name of this logic type.
notesstring
Notes about this type of report logic.
optionalArray.<ReportParameterType>
Optionally available parameters when creating results.
parametersArray.<ReportParameterType>
List of mandatory and optional parameters available.
requiredArray.<ReportParameterType>
Mandatory parameters when creating results.
templateArray.<ReportParameterType>
Parameters available for creating a ReportTemplate.

ReportFilterMode enum (string)

Drill-down mechanism for highlighting only those places and regions desired in ReportResults.
Values
ValueDescription
exclusive
Exclude all results except those whose filters match.
inclusive
Include any results for those whose filters match.
none
Filtering is not enabled for the report.

ReportParameterType enum (string)

The kinds of parameters used for a given report.
Values
ValueDescription
attributes
A list of attribute names an Asset must have to be included in the results. Should be a comma separated string of codified tag names.
collate
A choice in the method used to calculate a Summary Instance's values. For an attribute report, the possible values are "instance" where if the attribute is present it is included, and "value" where each attribute's simple value becomes it's own summary instance. For a Tag Summary report, the possible values are "inclusive" where any of the given tags must match, and "exclusive" where all the given tags must match.
distance
A number of seconds representing the minimum distance travelled in a Summary Instance before it is included in the results.
duration
A number of seconds representing the minimum amount of time for a Summary Instance before it is included in the results.
endDate
Ending date/time for the historical data range. The date should be a valid ISO-8601 string.
prolonged
A number of meters representing the maximum amount of time in a Summary Instance before it is split into two and the latter marked as an exception in the results.
rubicon
A number of meters representing the maximum distance travelled in a Summary Instance before it is split into two and the latter marked as an exception in the results.
startDate
Starting date/time for the historical data range. The date should be a valid ISO-8601 string.
tags
The list of tags an Asset must have to be included in the results. Should be a comma separated string of codified tag names.
timeOfDay
Time-span processed on each day. Only data within the time-span is included in the results. The times should be 2 space separated duration strings; see utility#parseTime for an example.

ReportRecurrenceType enum (string)

The pattern used to re-run this report on a schedule.
Values
ValueDescription
annually
Yearly based on the ReportRecurrence#start.
daily
Runs once a day at midnight in the local timezone for the previous day.
monthly
Runs once per month in the local timezone for the previous month.
once
Run only once. This type is used for large reports which need to run overnight.
quarterly
Per quarter on the date specified. Used in conjunction with the ReportRecurrence#start to determine which months are included.
weekly
Runs on Sunday at midnight in the local timezone for the previous 7 days.

ReportStatus enum (string)

Describes the progress of the report processor working on this ReportResult.
Values
ValueDescription
completed
The ReportResult is completed and ready to view.
created
The ReportResult has been created, but not yet begun processing.
failed
There was a failure during processing. See ReportResult#notes for details.
queued
The system is waiting for resources before processing the report.
running
The report processor has begun processing the results.
saving
Processing of the results is completed and is now being saved for viewing.

Users and Permissions

authorizer object

A collection of utility methods that allows you to check a user's permission to objects within the system. The most common functions you should use are authorizer.hasSimple and authorizer.hasComplex.

Usage

var value = trakit.fleetfreedom.authorizer.member;
/* or */
var result = trakit.fleetfreedom.authorizer.member(...params);
Properties
PropertyTypeDescription
complexArray.<PermissionType>
The PermissionTypes which are calculated using labels.
impliedArray.<PermissionType>
A list of PermissionTypes which are implied for each user's own company.
simpleArray.<PermissionType>
PermissionTypes which do not use labels to calculate access.
Functions
MethodReturnsDescription
compute(/** number */ userCompanyId, /** Array.<UserPermission> */ fromGroups, /** Array.<UserPermission> */ fromUser, /** number */ targetCompanyId)Array.<UserPermission>
Creates a well ordered array of UserPermissions which can be used to further calculate a user's permissions for the target company.
computeAll(/** number */ userCompanyId, /** Array.<UserPermission> */ fromGroups, /** Array.<UserPermission> */ fromUser)Dictionary.<number, Array.<UserPermission>>
Creates a Dictionary where the key is a Company#id and the values are well ordered arrays of UserPermissions which can be used to further calculate a user's permissions.
computeAllComplex(/** number */ userCompanyId, /** Array.<UserPermission> */ fromGroups, /** Array.<UserPermission> */ fromUser)Dictionary.<number, Array.<UserPermission>>
Creates a Dictionary where the key is a Company#id and the values are well ordered arrays of complex UserPermissions which can be used to further calculate a user's permissions.
computeAllSimple(/** number */ userCompanyId, /** Array.<UserPermission> */ fromGroups, /** Array.<UserPermission> */ fromUser)Dictionary.<number, Array.<UserPermission>>
Creates a Dictionary where the key is a Company#id and the values are well ordered arrays of simple UserPermissions which can be used to further calculate a user's permissions.
computeComplex(/** number */ userCompanyId, /** Array.<UserPermission> */ fromGroups, /** Array.<UserPermission> */ fromUser, /** number */ targetCompanyId)Array.<UserPermission>
Creates a well ordered array of complex UserPermissions which can be used to further calculate a user's permissions.
computeSimple(/** number */ userCompanyId, /** Array.<UserPermission> */ fromGroups, /** Array.<UserPermission> */ fromUser, /** number */ targetCompanyId)Array.<UserPermission>
Creates a well ordered array of simple UserPermissions which can be used to further calculate a user's permissions.
computeSimpleLevels(/** number */ userCompanyId, /** Array.<UserPermission> */ fromGroups, /** Array.<UserPermission> */ fromUser, /** number */ targetCompanyId)Dictionary.<PermissionType, PermissionLevel>
Creates a Dictionary where the key is a PermissionType and the values are PermissionLevels.
findAllEscalations(/** number */ userCompanyId, /** Dictionary.<number|Array.<UserPermission>> */ before, /** Dictionary.<number|Array.<UserPermission>> */ after, /** Dictionary.<number|Array.<string>> */ targetCompaniesLabels)Dictionary.<number, Array.<UserPermission>>
Generates a Dictionary (company identifier as the key) of permissions being escalated between two computed permission states.
findAnyComplex(/** number */ userCompanyId, /** Array.<UserPermission> */ permissions, /** PermissionType */ targetType, /** PermissionLevel */ targetLevel)boolean
Checks a specific complex permission type, level, but not the labels, and returns true if access is granted. This method can be used as a short-circuit to diving deeper into check label specific permissions.
findComplex(/** number */ userCompanyId, /** Array.<UserPermission> */ permissions, /** Array.<string> */ targetCompanyLabels, /** PermissionType */ targetType, /** Array.<string> */ targetLabels, /** PermissionLevel */ targetLevel)boolean
Checks a specific complex permission type, level, and labels from a pre-computed array of permissions, and returns true if access is granted.
findComplexLevel(/** number */ userCompanyId, /** Array.<UserPermission> */ permissions, /** Array.<string> */ targetCompanyLabels, /** PermissionType */ targetType, /** Array.<string> */ targetLabels)PermissionLevel | undefined
Retrieves the specified complex permission level from a pre-computed array of permissions. If the permission type specified is not found, undefined is returned instead.
findEscalations(/** number */ userCompanyId, /** Array.<UserPermission> */ before, /** Array.<UserPermission> */ after, /** Array.<string> */ targetCompanyLabels)Array.<UserPermission>
Generates an array of permissions being escalated between two computed permission states for a target company.
findSimple(/** number */ userCompanyId, /** Array.<UserPermission> */ permissions, /** PermissionType */ targetType, /** PermissionLevel */ targetLevel)boolean
Checks a specific simple permission type and level from a pre-computed array of permissions, and returns true if access is granted.
findSimpleLevel(/** number */ userCompanyId, /** Array.<UserPermission> */ permissions, /** PermissionType */ targetType)PermissionLevel | undefined
Retrieves the specified simple permission level from a pre-computed array of permissions. If the permission type specified is not found, undefined is returned instead.
getComplexLevel(/** number */ userCompanyId, /** Array.<UserPermission> */ fromGroups, /** Array.<UserPermission> */ fromUser, /** number */ targetCompanyId, /** Array.<string> */ targetCompanyLabels, /** PermissionType */ targetType, /** Array.<string> */ targetLabels)PermissionLevel | undefined
Gets the permission level of the given complex permission type. If the permission type specified is not found, undefined is returned instead.
getSimpleLevel(/** number */ userCompanyId, /** Array.<UserPermission> */ fromGroups, /** Array.<UserPermission> */ fromUser, /** number */ targetCompanyId, /** PermissionType */ targetType)PermissionLevel | undefined
Gets the permission level of the given simple permission type. If the permission type specified is not found, undefined is returned instead.
hasAnyComplex(/** number */ userCompanyId, /** Array.<UserPermission> */ fromGroups, /** Array.<UserPermission> */ fromUser, /** number */ targetCompanyId, /** PermissionType */ targetType, /** PermissionLevel */ targetLevel)boolean
Checks a specific complex permission type, level, but not the labels, and returns true if access is granted. This method can be used as a short-circuit to diving deeper into check label specific permissions.
hasComplex(/** number */ userCompanyId, /** Array.<UserPermission> */ fromGroups, /** Array.<UserPermission> */ fromUser, /** number */ targetCompanyId, /** Array.<string> */ targetCompanyLabels, /** PermissionType */ targetType, /** Array.<string> */ targetLabels, /** PermissionLevel */ targetLevel)boolean
Checks a specific complex permission type, level, and labels, and returns true if access is granted.
hasSimple(/** number */ userCompanyId, /** Array.<UserPermission> */ fromGroups, /** Array.<UserPermission> */ fromUser, /** number */ targetCompanyId, /** PermissionType */ targetType, /** PermissionLevel */ targetLevel)boolean
Checks a specific simple permission type and level, and returns true if access is granted.

User class

Inheritance: MVCObject > User
A user of Fleet Freedom services

Usage

var object = /** Company */ companyInstance.createUser(/** trakit.socket.User */ json);
Properties
PropertyTypeDescription
companyCompany
The Company which employs the User for this Session
contactContact
The full Contact details of this User.
contactIdnumber
The ID of the contact with the full details for this User.
enabledboolean
Ability to disable this User. Affects ability to login and notifications.
formatDatestring
Format definition for displaying dates. (Deprecated; use User#formats["date"] instead)
formatsDictionary.<string, string>
The format strings defining the preferred way to display ambiguous values.
formatTimestring
Format definition for displaying times. (Deprecated; use User#formats["time"] instead)
groupIdsArray.<number>
List of UserGroup#ids for which this user is a member.
groupsArray.<UserGroup>
Groups of which this User is a member
languagestring
User's preferred region and language
loginstring
The unique username used to login
measureDistanceUserMeasurementPreference
Preferred method of displaying distances and speed. (Deprecated; use User#measurements["distance"] instead)
measurementsDictionary.<string, UserMeasurementPreference>
Preferred way of displaying ambiguous numbers in the context of measurements.
measureVolumeUserMeasurementPreference
Preferred method of displaying volumes. (Deprecated; use User#measurements["volume"] instead)
nicknamestring
Friendly search-able name for this user.
notificationsArray.<UserNotifications>
Notification schedule preferences.
notifyUserNotifications
First notification schedule preferences (Deprecated; use User#notifications[0] instead).
optionsDictionary.<string, string>
Additional options which do not fit in with the formats or measurements preferences.
passwordExpiredboolean
Flags if the user needs to change their password on the next login.
permissionsArray.<UserPermission>
Individual permissions assigned to this User
timezonestring
User's native Timezone
versionArray.<number>
The version flag used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** trakit.socket.User */ json, /** boolean */ silent)User
Updates parameters for this User from the given JSON literal
getName()string
Get's the best choice for display name.
getPictures()Array.<Picture>
Gets an Array of Pictures for this User.
getSessions()Array.<UserSession>
Gets an Array of UserSessions which this User has created.
getUserGroups()Array.<UserGroup>
Gets an Array of UserGroups to which this User belongs.
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this user. Used internally by Company#findUsers.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

UserGroup class

Inheritance: MVCObject > UserGroup
A group of permissions for Users

Usage

var object = /** Company */ companyInstance.createUserGroup(/** trakit.socket.UserGroup */ json);
Properties
PropertyTypeDescription
idnumber
Unique identifier.
namestring
Easily identifiable name for this group of permissions.
notesstring
Detailed notes about which type of Users should be granted access to this group.
permissionsArray.<UserPermission>
Permissions assigned to Users in this group.
versionArray.<number>
The version flags used to ensure sync operations are done in order.
Functions
MethodReturnsDescription
debug(/** RegExp */ pattern)boolean
Invokes the debugger when MVCObject#fire is called for a matching RegExp.
dispose()
Unbinds all event handlers and prepares the object for disposal by the garbage collector
fire(/** string */ type, /** ? */ detail)MVCEvent
Creates an MVCEvent and raises it with the optional detail MVCEvent#detail
fromJSON(/** UserGroup */ json, /** boolean */ silent)UserGroup
Updates parameters for this UserGroup from the given JSON literal
getUsers()Array.<User>
Returns a list of Users that belong to this group.
isMatch(/** SearchPattern */ pattern)boolean
Checks the given SearchPattern for a match to this group. Used internally by Company#findUserGroups.
off(/** string */ type, /** function */ handler)boolean
Removes an event handler
on(/** string */ type, /** function */ handler)boolean
Adds an event handler
once(/** string */ type, /** function */ handler)boolean
Adds an event handler that fires once, then unbinds itself
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.
trace(/** RegExp */ pattern)boolean
Writes all calls to MVCObject#fire to the console.info matching the given RegExp.
uses(/** string */ type, /** function */ handler)boolean
Checks to see if the given type/handler is bound for this object

UserNotifications class

User notification preferences

Usage

var object = new trakit.fleetfreedom.UserNotifications(/** string */ name, /** boolean */ enabled, /** Array.<boolean> */ weekdays, /** string */ start, /** string */ end, /** string */ email, /** number */ sms, /** Array.<UserNotificationsMethod> */ online, /** Array.<UserNotificationsMethod> */ offline);
Properties
PropertyTypeDescription
emailstring
When provided, email notifications are sent to this address instead of the Contact#email or User#login.
enabledboolean
Flags whether this schedule is in use.
endTimeSpan
Time-stamp to denote when notifications should no longer be sent.
namestring
Nickname for this schedule
offlineArray.<UserNotificationsMethod>
The types of notifications to send while this User's session is inactive.
onlineArray.<UserNotificationsMethod>
The types of notifications to send while this User's session has an active WebSocket connection.
smsnumber
When provided, SMS notifications are sent to this phone number instead of the Contact#mobile.
startTimeSpan
Starting time-stamp for when notifications should be sent.
weekdaysArray.<boolean>
A seven item, boolean array identifying the days of the weeks for which notifications should be sent.
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

UserPermission class

Individual permissions.

Usage

var object = new trakit.fleetfreedom.UserPermission(/** number */ company, /** PermissionMethod */ method, /** PermissionType */ type, /** PermissionLevel */ level, /** Array.<string> */ labels);
Properties
PropertyTypeDescription
companynumber
The unique identifier of the company for which this permission applies.
labelsArray.<string>
The Company#labels names used to apply this permission. So far, this only applies to assetGeneral, assetAdvanced, and placeGeneral.
levelPermissionLevel
The amount of access granted or revoked.
methodPermissionMethod
Whether the permission is given or taken away.
typePermissionType
The kind of permission assigned. Please see the permissions documentation.
Functions
MethodReturnsDescription
equals(/** UserPermission */ other)boolean
Compares this UserPermission to another to see if they are equivalent.
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

UserSession class

An active or idling user session

Usage

var object = /** Company */ companyInstance.getSessions,();
Properties
PropertyTypeDescription
activeboolean
True when an active WebSocket connection exists.
companyCompany
The Company which employs the User for this Session.
createdDate
The time-stamp from this session's first login.
handlestring
A unique key to identify this Session. This is not the SessionID.
ipAddressstring
Client's IP address.
lastActivityDate
The time-stamp of the last command executed by this session.
lastCommandstring
The last socket command or RESTful route invoked by the session.
socketsnumber
The number of active WebSocket connections in use by this session.
userUser
The User associated with this Session.
userAgentstring
The client software identification string.
Functions
MethodReturnsDescription
equals(/** UserSession */ other)boolean
Compares this UserSession to another to see if they are equivalent.
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

PermissionLevel enum (string)

Defines the amount of access granted or revoked.
Values
ValueDescription
full
Read, update, and create/delete.
read
Read-only access.
update
Read and update access; does not allow for create or delete.

PermissionMethod enum (string)

The two types of permission assignment
Values
ValueDescription
grant
Give access
revoke
Take access away

PermissionType enum (string)

The kinds of permissions available for UserPermissions.
Values
ValueDescription
assetAdvanced
Assets' advanced properties such as position, attributes, and status tags.
assetGeneral
Assets' general properties such as name, icon, and labels.
assetMessage
Messages from assets and Alerts to the session user.
behaviour
Configured behaviours.
behaviourLog
View and clear the log of debug messages for a behaviour or script.
behaviourScript
Behaviour script logic.
billingDiscount
Discount rule for assets.
billingHosting
Billing rule for assets.
billingLicense
Hardware License for providers.
billingProfile
Profile used to generate billable orders for a customer.
billingReport
Generated bill for a customer.
companyCreate
Access to add a new child company.
companyGeneral
Basic information about the company. This permissions is required to have access to other aspects of the company.
companyLabels
Company's label and tag styles.
companyPolicies
Company's SessionPolicy and PasswordPolicy.
companyReseller
Reseller and white-labeler specific settings.
contact
Contact information.
dispatchTask
Assets' tasks information.
document
Hosted document information.
hosCarrier
Hours of Service Carriers.
hosEvent
Driver's E-log event records.
hosInspection
Driver vehicle inspection reports.
icon
Icon information.
maintenanceJob
Historical vehicle and trailer maintenance work.
maintenanceSchedule
Recurring maintenance work for vehicles and trailers.
picture
Picture information.
placeGeneral
Place information.
providerAdvanced
Raw provider (device) data like GPS coordinates and parsed ODB-II values.
providerConfigType
Allows read-only access to the logic types for provider configuration.
providerConfiguration
Provider (device) configurations.
providerGeneral
Provider (device) information like name, notes, and selected asset.
providerScript
Allows access to Provider (device) logic scripts.
reportResult
Historical asset details like breadcrumb trails.
reportSchedule
Schedules used to automatically create report results overnight.
reportTemplate
Report configurations.
session
Access to retrieve a list of active sessions and kill sessions.
userAdvanced
User information such as permissions and group membership.
userGeneral
General user information such as name, contact information, and preferences.
userGroup
Group information for easy access control.

UserMeasurementPreference enum (string)

Exposes the different kinds of measurement system we can use.
Values
ValueDescription
british
Use British Standard always.
metric
Use metric always.
native
Show the measurements in the local format.
standard
Use US Standard always.

UserNotificationsMethod enum (string)

Exposes the different kinds of notification methods we can use.
Values
ValueDescription
email
Send an Email
popup
Show a pop-up message in the Fleet Freedom UI
sms
Send an SMS message

White Labelling

ColourStyle class

Definition of a colour pair for colouring and outlining.

Usage

var object = new trakit.fleetfreedom.ColourStyle(/** string */ fill, /** string */ stroke);
Properties
PropertyTypeDescription
fillstring
Hex colour value for fills and backgrounds.
strokestring
Hex colour value for text and outlines.
Functions
MethodReturnsDescription
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

CompanyReseller class

Defines the seller company's details for white-labelling.

Usage

var object = /** Company */ companyInstance.fromJSON(/** trakit.socket.Company | trakit.socket.CompanyGeneral | trakit.socket.CompanyLabels | trakit.socket.CompanyPolicies | trakit.socket.CompanyReseller */ json, /** boolean */ silent);
Properties
PropertyTypeDescription
companyCompany
The Company that is the reseller.
contactInfoDictionary.<string, number>
A list of Contacts for company specific things like Technical Support, Billing, etc...
domainstring
The domain to the instance of v4. It does not contain the protocol because all instances are required to be HTTPS.
favouritestring
The name of the image uploaded as the icon (for bookmarks).
gamutDictionary.<string, ColourStyle>
Colours used as templates for status tags, labels, and places.
graphicsDictionary.<string, string>
A list of symbol names and their corresponding FontAwesome icon names.
iconstring
The name of the image uploaded as the logo (for mobile).
languagesArray.<string>
A list of supported languages for your customers.
logostring
The name of the image uploaded as the logo.
notifyEmailNotificationServerEmail
The server used for notification and conversational email messages sent and received by the system.
notifySmsNotificationServerSms
Definition for load-balanced outbound SMS numbers for the reseller.
recoverBodystring
The body of the email sent to a user requesting a password reset.
recoverIsHtmlstring
When true, sends the password reset email as an HTML email instead of plain text.
recoverSubjectstring
The subject of the email sent to a user requesting a password reset.
serviceNamestring
The name of the branded service being provided to the seller's customers.
termsPreamblestring
A preamble to the general terms and conditions offered by Fleet Freedom.
termsUpdatedDate
The date and time when the terms were updated. This will promt users who are logging-in to re-agree to the new terms
versionArray.<number>
The version flag used to ensure sync operations are done in order.
websiteDictionary.<string, string>
Themed colours used in the web-based UI.
Functions
MethodReturnsDescription
fromJSON(/** trakit.socket.CompanyReseller */ json)CompanyReseller
Updates parameters for this CompanyReseller from the given JSON literal
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

NotificationServerEmail class

The server used for notification and conversational email messages sent and received by the system.

Usage

var object = /** CompanyReseller */ companyresellerInstance.fromJSON(/** trakit.socket.CompanyReseller */ json);
Properties
PropertyTypeDescription
incomingAddressstring
The domain or IP address of the incoming email server.
incomingLoginstring
The username used to login to the incoming email server.
incomingMessageNumbernumber
IMAP message sequence number so only recent messages are retrieved.
incomingPortnumber
The port number of the incoming email server.
incomingSecureboolean
Is the incoming email server using a secure SSL/TLS connection (it should).
incomingTypeIncomingEmailServerType
The type of incoming protocol to use (IMAP or POP3).
outgoingAddressstring
The domain or IP address of the outgoing email server.
outgoingLoginstring
The username used to login to the outgoing email server.
outgoingPortnumber
The port number of the outgoing email server.
outgoingReplyTostring
An optional field which can be set as the "sent from" and/or "reply-to" address.
outgoingSecureboolean
Is the outgoing email server using a secure SSL/TLS connection (it should).
outgoingTypeOutgoingEmailServerType
The type of outgoing protocol to use (only SMTP).
resellerCompanyReseller
The CompanyReseller to which this object belongs
Functions
MethodReturnsDescription
fromJSON(/** trakit.socket.NotificationServerEmail */ json)NotificationServerEmail
Updates parameters for this NotificationServerEmail from the given JSON literal
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

NotificationServerSms class

Definition for load-balanced outbound SMS numbers for the White-labelling profile.

Usage

var object = /** CompanyReseller */ companyresellerInstance.fromJSON(/** trakit.socket.CompanyReseller */ json);
Properties
PropertyTypeDescription
notifyLimitCompanyReseller
A per-number/per-day limit on the amount of Notifications sent.
phoneNumbersDictionary.<string, Array>
All phone numbers listed by the country (using two-digit ISO 3166-1 alpha-2 country codes) they each serve.
resellerCompanyReseller
The CompanyReseller to which this object belongs
Functions
MethodReturnsDescription
fromJSON(/** trakit.socket.NotificationServerSms */ json)NotificationServerSms
Updates parameters for this NotificationServerSms from the given JSON literal
toJSON()Object
Creates a literal of this object. Used internally by JSON.stringify.

IncomingEmailServerType enum (string)

The types of email protocols supported for incoming mail servers.
Values
ValueDescription
IMAP
Internet Message Access Protocol (default)
POP3
Post Office Protocol v3

OutgoingEmailServerType enum (string)

The types of email protocols supported for sending messages.
Values
ValueDescription
SMTP
Simple Mail Transfer Protocol
Trak iT® Wireless and Fleet Freedom® are Trademarks of Trak iT® Wireless Inc.
All content contained within this site is the property of Trak iT® Wireless unless otherwise stated.