Global

Members


<constant> sqlite3

Caching module using sqlite

Methods


ClearCache()

Clear out expired entries from our cache

GetGlobal(key)

Get a globally cached value This is identical to Get, but the requested key will be in scope of the entire library, not just the park that requests the data
Parameters:
Name Type Description
key String Key to request associated data for
Returns:
Returns Promise with data (or null if not cached)
Type
Promise.<Object>

SetGlobal(key, data [, ttl])

Set a cached value library-wide Idential to Set, but cached at a library level instead of for the owning park
Parameters:
Name Type Argument Description
key String Key to set data for
data Object Data to store in cache
ttl Number | function <optional>
Time this data should be cached for (in seconds)
Returns:
Returns Promise resolving if cached data was successfully set
Type
Promise

SetupDB()

Setup database tables

UpgradeDB()

Upgrade our cache database

Type Definitions


RideData

Type:
  • Object
Properties:
Name Type Description
id String Unique Ride ID
name String The ride's name
active Bool Is this ride currently operating?
wait_time Number Ride's current queue time
last_update Number Last time this Ride has a wait time change (in milliseconds)

ScheduleData

Type:
  • Object
Properties:
Name Type Description
date Moment Date this schedule data applies to
openingTime Moment Opening time for this date
closingTime Moment Closing time for this date
type String Whether this schedule data refers to an "Operating", "Closed" or "Refurbishment" status
special Array.<SpecialScheduleData> Won't exist if no special times exist for this date

SpecialScheduleData

Type:
  • Object
Properties:
Name Type Description
openingTime Moment Opening time for this special schedule data
closingTime Moment Closing time for this special schedule data
type String Type of special schedule this is (eg. "Extra Magic Hours")