Global

Members

(constant) HTTP

Description:
  • HTTP helper with injection
Source:
HTTP helper with injection

(constant) activeFunctions

Description:
  • Module that wraps re-using the same Promise multiple times. This allows a function to be called multiple times before returning, but only return once. Useful for latent network requests, such as requesting a document from multiple sources, but only making one HTTP request.
Source:
Module that wraps re-using the same Promise multiple times. This allows a function to be called multiple times before returning, but only return once. Useful for latent network requests, such as requesting a document from multiple sources, but only making one HTTP request.

(constant) attractionType

Description:
  • All known attraction types (ride, show, etc.)
Source:
All known attraction types (ride, show, etc.)

(constant) boardingGroupState

Description:
  • Possible types for boarding groups
Source:
Possible types for boarding groups

(constant) entityType

Description:
  • Entity types
Source:
Entity types

(constant) metaCommands

Description:
  • Meta-programming commands Functions can declare tags to add extra functionality to their behaviour. This is a replacement for decorators until they actually exist.
Source:
Meta-programming commands Functions can declare tags to add extra functionality to their behaviour. This is a replacement for decorators until they actually exist.

(constant) queueType

Description:
  • Possible types of queue
Source:
Possible types of queue

(constant) returnTimeState

Description:
  • Possible types of state for a return time queue
Source:
Possible types of state for a return time queue

(constant) scheduleType

Description:
  • All possible schedule types
Source:
All possible schedule types

(constant) simpleTags

Description:
  • Simple tags that don't have a value entry. Instead, these tags are either present or not.
Source:
Simple tags that don't have a value entry. Instead, these tags are either present or not.

(constant) statusType

Description:
  • Status an attraction can be in (Operating, Down, etc.)
Source:
Status an attraction can be in (Operating, Down, etc.)

(constant) tagType

Description:
  • All possible Tag types for attractions
Source:
All possible Tag types for attractions

(constant) validators

Description:
  • Each tag type must have a validator function to confirm the incoming tag value is correct
Source:
Each tag type must have a validator function to confirm the incoming tag value is correct

Methods

Sieve(conf) → {function}

Description:
  • Build a mongo-style filter function
Source:
Parameters:
Name Type Description
conf object
Returns:
Type
function

(async, abstract, private) _del(key)

Description:
  • Internal operation to delete a key
Source:
Parameters:
Name Type Description
key string Key name to delete

(async) _del()

Source:

(async) _del()

Source:

(async) _del()

Source:

(async, abstract, private) _get(key) → {Object|undefined}

Description:
  • Internal implementation of Get()
Source:
Parameters:
Name Type Description
key string Unique key name for this cache entry
Returns:
Returns the object in the cache, or undefined if not present
Type
Object | undefined

(async) _get()

Source:

(async) _get()

Source:

(async) _get()

Source:

(async, abstract, private) _getKeys(prefix)

Description:
  • Internal implementation of getKeys()
Source:
Parameters:
Name Type Description
prefix string

(async) _getKeys()

Source:

(async) _getKeys()

Source:

(async) _getKeys()

Source:

(private) _reusePromise(useResultForever, self, fn, …args) → {Promise}

Description:
  • Internal call to run a Promise once time (and optionally keep result forever)
Source:
Parameters:
Name Type Attributes Description
useResultForever boolean
self *
fn function
args any <repeatable>
Returns:
Type
Promise

(async, abstract, private) _set(key, object)

Description:
  • Internal implementation of Set()
Source:
Parameters:
Name Type Description
key string Unique key name for this cache entry
object Object Data to be set

(async) _set()

Source:

(async) _set()

Source:

(async) _set()

Source:

addGlobalInjections(param0)

Description:
  • Add global injections to HTTP object to support general proxies etc.
Source:
Parameters:
Name Type Description
param0 *

(async) blockOnPendingTransactions() → {Promise}

Description:
  • Block if we have any pending transactions
Source:
Returns:
Type
Promise

(async) createCacheInstance()

Description:
  • Create a new Cache Instance. This function should only be called once for the lifetime of the module.
Source:

extractName(name) → {String}

Description:
  • Helper to extract name from a variable
Source:
Parameters:
Name Type Description
name String | Object
Returns:
Type
String

(private) findActiveFunctionIndex(self, fn, argsSerialised) → {number}

Description:
  • Find the active function with these arguments
Source:
Parameters:
Name Type Description
self *
fn function
argsSerialised string
Returns:
Type
number

generateRandomAndroidUseragent() → {string}

Description:
  • Generate a random Android user agent for making network requests
Source:
Returns:
Type
string

(async) get(key, getFullObjectopt, forceopt) → {Object|undefined}

Description:
  • Get a cached object
Source:
Parameters:
Name Type Attributes Default Description
key string Unique key name for this cache entry
getFullObject boolean <optional>
false Get the full cache entry, including expiry time, even if expired
force boolean <optional>
false Force set, bypassing transaction blocks
Returns:
Returns the object in the cache, or undefined if not present
Type
Object | undefined

getCache()

Description:
  • Get the configured Cache implementation
Source:

getDatabase() → {IndexedWDWDB}

Description:
  • Get a reference to the WDW database
Source:
Returns:
Type
IndexedWDWDB

getEntityID(doc) → {string}

Description:
  • Given a document, return it's entity ID for the WDW database
Source:
Parameters:
Name Type Description
doc object | string CouchDB document or a document ID
Returns:
Type
string

(async) getKeys(prefixopt) → {array.<string>}

Description:
  • Get an array of all the cached keys matching the supplied prefix
Source:
Parameters:
Name Type Attributes Default Description
prefix string <optional>
''
Returns:
Type
array.<string>

getLiveDataErrors(liveData) → {Array.<string>}

Description:
  • Given an entity doc, and a live data object - validate the live data
Source:
Parameters:
Name Type Description
liveData object
Returns:
Array of errors, of null if passes validation
Type
Array.<string>

getMethods(obj) → {Array.<string>}

Description:
  • Return functions available on the supplied object as an array of strings
Source:
Parameters:
Name Type Description
obj object
Returns:
array of function names
Type
Array.<string>

getValidTagObject(key, type, value) → {object}

Description:
  • Given a tag key, type, and value - parse, validate, and return the full expected tag object
Source:
Parameters:
Name Type Description
key string Tag name - some tags must have a valid name
type tagType The type for this tag entry
value * The tag data to validate matches this tag format's data structure
Returns:
The tag object to use, or undefined if it isn't valid
Type
object

injectBasicProxy(param0)

Description:
  • Inject basic proxy into HTTP object
Source:
Parameters:
Name Type Description
param0 *

injectCrawlBase(param0)

Description:
  • Inject CrawlBase proxy into HTTP object
Source:
Parameters:
Name Type Description
param0 *

injectScrapfly(param0)

Description:
  • Inject Scrapfly proxy into HTTP object
Source:
Parameters:
Name Type Description
param0 *

isSimpleTagType(type) → {boolean}

Description:
  • Is the given type a "simple tag" (one with no actual value)
Source:
Parameters:
Name Type Description
type tagType
Returns:
Type
boolean

isValidTag(key, type, value) → {boolean}

Description:
  • Validate a tag value based on its type
Source:
Parameters:
Name Type Description
key string Tag name - some tags must have a valid name
type tagType The type for this tag entry
value * The tag data to validate matches this tag format's data structure
Returns:
Type
boolean

isValidTagType(type) → {boolean}

Description:
  • Is the supplied tag type supported?
Source:
Parameters:
Name Type Description
type tagType
Returns:
Type
boolean

parseConfig(options) → {object}

Description:
  • Combine given options with environment variables
Source:
Parameters:
Name Type Description
options object Incoming options
Returns:
Processed configuration options
Type
object

reusePromise(self, fn, …args) → {Promise}

Description:
  • Reuse a function until it resolves
Source:
Parameters:
Name Type Attributes Description
self *
fn function
args any <repeatable>
Arguments to pass to the function
Returns:
Type
Promise

reusePromiseForever(self, fn, …args) → {Promise}

Description:
  • Reuse a function, returning it's result forever
Source:
Parameters:
Name Type Attributes Description
self *
fn function
args any <repeatable>
Arguments to pass to the function
Returns:
Type
Promise

riderHeightValidate(key, data) → {boolean}

Description:
  • Validate a rider height tag. Used for min/max heights
Source:
Parameters:
Name Type Description
key string
data *
Returns:
Type
boolean

(async) runTransaction(func, keyModifierFuncopt)

Description:
  • Run a transaction. All other queries are halted while this is running
Source:
Parameters:
Name Type Attributes Default Description
func function
keyModifierFunc function <optional>
null Optional function that translates incoming keys

(async) set(key, value, ttlopt, forceopt)

Description:
  • Set a key in our cache
Source:
Parameters:
Name Type Attributes Default Description
key string Unique key name for this cache entry
value Object
ttl function | number <optional>
3600000 How long the cache entry should last in milliseconds
force boolean <optional>
false Force set, bypassing transaction blocks Can be a number or a function that will return a number Default 1 hour

setOverrideFunction(fn)

Description:
  • Set an override function to use for HTTP requests Accepts (method, URL, data, options)
Source:
Parameters:
Name Type Description
fn function

validateEntitySchedule(scheduleData) → {array.<string>}

Description:
  • Validate a schedula data object. Containing _id and a schedule array of schedules
Source:
Parameters:
Name Type Description
scheduleData object
Returns:
Array of errors, or null if successful
Type
array.<string>

validateObjectContainsOnlyGivenKeys(data, keys) → {boolean}

Description:
  • Given an object, validate that it only contains the given keys Will return false if the object is missing any keys, or has additional keys not listed
Source:
Parameters:
Name Type Description
data object
keys array.<string>
Returns:
Type
boolean

(async) wrap(key, fn, ttlopt)

Description:
  • A helper "wrap" function that will return a cached value if present This will call the supplied function to fetch it if the value isn't present in the cache
Source:
Parameters:
Name Type Attributes Description
key string Unique key name for this cache entry
fn function Fetch function that will be called if the cache entry is not present
ttl function | number <optional>
How long the cache entry should last in milliseconds Can be a number or a function that will return a number

(async, private) writeToHAR(method, url, data, options, resp, startTime, timeTaken)

Description:
  • Write a HTTP response to HAR file for debugging
Source:
Parameters:
Name Type Description
method *
url *
data *
options *
resp *
startTime *
timeTaken *