Destination

Destination

The base Destination object

Constructor

new Destination(options)

Description:
  • Construct a new empty Destination object
Source:
Parameters:
Name Type Description
options object

Classes

Destination

Methods

(async, private) _clearFunctionCache(functionName, args)

Description:
  • Clear the cache for a given meta function
Source:
Parameters:
Name Type Description
functionName string
args Array.<*>

(async) _init()

Description:
  • Instance implementation of init, implement this function for a single-execution of init()
Source:

(async) buildAttractionEntities()

Description:
  • Build the attraction entities for this destination
Source:

buildBaseEntityObject(data) → {object}

Description:
  • Build a generic base entity object
Source:
Parameters:
Name Type Description
data object
Returns:
Type
object

(async) buildDestinationEntity()

Description:
  • Build the destination entity representing this destination
Source:

(async) buildEntityLiveData()

Description:
  • Build all live data for entities - implement this function in child class
Source:

(async) buildEntityScheduleData()

Description:
  • Build all schedule data for entities - implement this function in child class Returns array of schedule objects
Source:

(async) buildParkEntities()

Description:
  • Build the park entities for this destination
Source:

(async) buildRestaurantEntities()

Description:
  • Build the restaurant entities for this destination
Source:

(async) buildShowEntities()

Description:
  • Build the show entities for this destination
Source:

calculateTimezone(longitude, latitude) → {string}

Description:
  • Given a longitude and latitude, return the timezone estimate for that location
Source:
Parameters:
Name Type Description
longitude Number
latitude Number
Returns:
Type
string

(async) forEachUpcomingDate(func, dates)

Description:
  • Helper function to call a function, passing in a date for each date x days in the future. First date will be current park date.
Source:
Parameters:
Name Type Default Description
func function
dates Number 30

(async) getAllEntities()

Description:
  • Get all entities belonging to this destination.
Source:

(async) getAndroidAPPVersion(packageId, fallbackopt) → {string|undefined}

Description:
  • Get the app version of an Android package ID Only returns a valid response for apps tracked in the appwatch tracker service
Source:
Parameters:
Name Type Attributes Description
packageId string
fallback string <optional>
Fallback version to return if no version is found
Returns:
Type
string | undefined

(async) getAttractionEntities()

Description:
  • Get all attraction entities within this destination.
Source:

(async) getDestinationEntities()

Description:
  • Get all destination entities within this destination.
Source:

(async) getDestinationEntity() → {Object}

Description:
  • Get the Entity object for this destination
Source:
Returns:
Type
Object

(async) getEntityFromId(id) → {object}

Description:
  • Given an internal entity ID, return it's full entity object
Source:
Parameters:
Name Type Description
id string
Returns:
Type
object

(async) getEntityLiveData()

Description:
  • Get all live data for entities
Source:

(async) getEntitySchedules() → {Array.<object>}

Description:
  • Get all schedules for this destination's entites
Source:
Returns:
Array of objects containing _id and schedules
Type
Array.<object>

(async) getLiveCache(id, lockopt) → {object}

Description:
  • Get the locally stored live data for an ID
Source:
Parameters:
Name Type Attributes Description
id string
lock object <optional>
Returns:
Type
object

(async, private) getLiveHash(id, lockopt)

Description:
  • Get the hash of a stored live data of an entity
Source:
Parameters:
Name Type Attributes Description
id string
lock object <optional>
Optional lock file to use for transactions

(async) getParkEntities()

Description:
  • Get all park entities within this destination.
Source:

(async) getRestaurantEntities()

Description:
  • Get all restaurant entities within this destination.
Source:

(async) getShowEntities()

Description:
  • Get all show entities within this destination.
Source:

getTimeNow() → {string}

Description:
  • Return the current time for this destination in its local timezone
Source:
Returns:
Type
string

getTimeNowMoment() → {moment}

Description:
  • Return the current time for this destination in its local timezone
Source:
Returns:
Type
moment

(async) init()

Description:
  • Initialise the object. Will only be initialised once
Source:

log(…args)

Description:
  • Debug log
Source:
Parameters:
Name Type Attributes Description
args any <repeatable>
Message to debug log

(async, private) setLiveCache(id, data, lockopt)

Description:
  • Set local live data cache for an entity
Source:
Parameters:
Name Type Attributes Description
id string
data object
lock object <optional>
Optional lock file to use for transactions

(async) updateEntityLiveData(internalId, data)

Description:
  • Update an entity with livedata
Source:
Parameters:
Name Type Description
internalId string
data object