Park

Park

Base Park Object

Constructor

new Park(options)

Description:
  • Create a new park object
Source:
Parameters:
Name Type Description
options object

Classes

Park

Methods

(async) _buildAttractionObject(attractionID) → {object}

Description:
  • Build an object representing an attraction from sourced data This object should not contain any "state" data, just static information about the attraction
Source:
Parameters:
Name Type Description
attractionID string Unique Attraction ID
Returns:
Object containing at least 'name'. Also accepts 'type', which is an attractionType
Type
object

(async) _checkDate()

Description:
  • Check if the park's "active date" has changed
Source:

(async, abstract) _dateRefresh(newDate, oldDate)

Description:
  • Called when the park's date changes Eg. when passing midnight in the park's local timezone or if late opening hours finish the morning after (eg. open until 2am, will be called just after 2am)
Source:
Parameters:
Name Type Description
newDate string Current Park Date
oldDate string The previous date for this park before the update (can be null if park just initialised)

(async, private) _findAttractionByID(attractionID) → {object}

Description:
  • Get data about a attraction from its ID
Source:
Parameters:
Name Type Description
attractionID string Unique Attraction ID
Returns:
The attraction object for the given ID, or undefined
Type
object

(private) _getAttractionByIDInternal(attractionID) → {object}

Description:
  • Get the attraction object for a given ID (skips all generation/safety checks etc,)
Source:
Parameters:
Name Type Description
attractionID string
Returns:
Type
object

(async, abstract, private) _getOperatingHoursForDate(date)

Description:
  • Given a moment date, return an array of opening hours for this park, or undefined Each entry should contain openingTime, closingTime, and type (of scheduleType)
Source:
Parameters:
Name Type Description
date moment

(async) _getRestaurantOperatingHoursForDate(date)

Description:
  • Given a moment date, return an array of opening hours for the restaurants in this park, or undefined Ech entry should contain openingTime closingTime
Source:
Parameters:
Name Type Description
date moment

(async, abstract, private) _init()

Description:
  • Internal function Called by init() to initialise the object
Source:

(async, abstract, private) _postInit()

Description:
  • Internal function Called by init() to initialise the object
Source:

(async) _postOfflineLoad()

Source:

(async, private) _runInit()

Description:
  • Run all the internal stages of the init process
Source:

(async, private) _runUpdate()

Description:
  • Internal method to actually run our update
Source:

(async, abstract, private) _update()

Description:
  • Update function the park object calls on interval to update internal state
Source:

(async) cacheAttractionObject(attractionID)

Description:
  • Cache an attraction
Source:
Parameters:
Name Type Description
attractionID string ID of the attraction to be cached

(async) ensureReady() → {Promise}

Description:
  • Awaits until park is initalised and has run at least one update.
Source:
Returns:
Type
Promise

(async) findAttractionByID(attractionID) → {object}

Description:
  • Get data about a attraction from its ID
Source:
Parameters:
Name Type Description
attractionID string Unique Attraction ID
Returns:
The attraction object for the given ID, or undefined
Type
object

(async) getActiveParkDate()

Description:
  • Get the current park date, taking into consideration park hours past midnight etc. Eg. if the park is open past midnight, return yesterday's date.
Source:

(async) getActiveParkDateMoment()

Description:
  • Get the current park date, taking into consideration park hours past midnight etc. Eg. if the park is open past midnight, return yesterday's date.
Source:

(async) getAttractions()

Description:
  • Get Park Attractions
Source:

(async) getCalendar()

Description:
  • Get Operating Calendar for this park
Source:

(async) getCalendarForToday()

Description:
  • Get the park opening hours for today
Source:

(async) getCalendarForTomorrow()

Description:
  • Get the park opening hours for tomorrow
Source:

(async) getNextClosingTime() → {number}

Description:
  • Return the number of milliseconds until closing time. Or 0 if already closed.
Source:
Returns:
Type
number

(async) getNextOpeningTime()

Description:
  • Return the number of milliseconds until the next time the park is open. Will return 0 if park is already open.
Source:

(async) getNextOpeningTimeMomentDuration()

Description:
  • Return the time until the park is open.
Source:

(async) getOperatingHoursForDate(date) → {object}

Description:
  • Get the operating hours for the supplied date Will return undefined if the park API cannot return data for this date (park is closed, too far in future, too far in past, etc.)
Source:
Parameters:
Name Type Description
date moment A momentjs object
Returns:
Type
object

getParkUniqueID() → {string}

Description:
  • Get a globally unique ID for this park
Source:
Returns:
Type
string

(async) getRestaurantOperatingHoursForDate(date)

Description:
  • Get the restaurant operating hours for the supplied date
Source:
Parameters:
Name Type Description
date moment

(async) init()

Description:
  • Setup the park for use Call to ensure the object has been initialised before accessing data
Source:

(async, private) postUpdate()

Description:
  • Called after each successful update, handle any clean-up or extra work here
Source:

(async) removeAttractionTag(attractionID, key, type)

Description:
  • Remove a tag from a given attraction ID
Source:
Parameters:
Name Type Description
attractionID string
key string
type tagType

(async) setAttractionTag(attractionID, key, type, value) → {boolean}

Description:
  • Set an attraction tag Used for metadata on rides, such as location, thrill level, fastpass availability etc.
Source:
Parameters:
Name Type Description
attractionID string | object Attraction ID to update (or the actual object)
key string Tag key to set
type tagType Tag type to use
value * Tag value to set
Returns:
True if tag was stored successfully
Type
boolean

(async) shutdown()

Description:
  • Call this to shutdown the park object. This is an async call, so wait until it has resolved to continue.
Source:

(async) toggleAttractionTag(attractionID, type, value)

Description:
  • Set a toggle tag for an attraction. This is different from more complex tags that expect a data structure. Use this for tags that don't have any actual value, but are just present. Eg. FastPass as a feature.
Source:
Parameters:
Name Type Description
attractionID string
type tagType
value boolean

(async) update()

Description:
  • Update this park This is automatically called for you unless disableParkUpdate is set to false
Source:

(async) updateAttractionQueue(attractionID, queueValue, type)

Description:
  • Update the queue status for an attraction
Source:
Parameters:
Name Type Description
attractionID string Attraction ID to update
queueValue number | object Updated Wait Time in minutes, or null if wait time doesn't exist or isn't valid. Set waitTime to undefined to remove this queue type from the attraction. BoardingGroup and ReturnTime types expect an object containing queue details instead of a number
type queueType Type of queue to update (standup, virtual, fastpass etc.)

(async) updateAttractionState(attractionID, status)

Description:
  • Update an attraction state
Source:
Parameters:
Name Type Description
attractionID string Unique Attraction ID
status statusType New Attraction state