Skip to content

Latest commit

 

History

History
315 lines (221 loc) · 9.08 KB

docs.md

File metadata and controls

315 lines (221 loc) · 9.08 KB

Classes

LaMetric

A class that provides utility functions for the LaMetric json-format.

Timer

A class used to fetch data from InventivetalentDevs api.

JsonConfiguration

Basic json-configuration.

TimeUtility

A class that provides comparison methods for the estimated time.

Functions

handleLegacyRequest(req, res)

Handles incoming requests.

handleRequest(req, res)

Handles requests with timer-names.

handleSummary(req, res)Promise.<{frames: {test: string, icon: string}}>

Handles requests to the getEstimations path.

logRequest(req, res, next)

Logs an incoming request.

stringifyResults(req, result, timerName)Object

"Stingifies" the results of a fetched result.

applyLeadingZeros(num, req)string | number

Applies the leadingZeros query-parameter.

LaMetric

A class that provides utility functions for the LaMetric json-format.

Kind: global class

LaMetric.generateResponse(message, icon) ⇒

Generates a response for LaMetric devices.

Kind: static method of LaMetric
Returns: object

Param Type Description
message string The message.
icon string The code of the icon that should be used.

Timer

A class used to fetch data from InventivetalentDevs api.

Kind: global class

Timer.fetchData(timerKey) ⇒ Promise.<object>

Fetches the estimated spawn time from the Magma-Boss-Timer api.

Kind: static method of Timer

Param Type Description
timerKey string The key of the the timers requestUrl item.

Timer.magmaBoss() ⇒ Promise.<object>

Get the estimation for the magma-boss.

Kind: static method of Timer

Timer.newYear() ⇒ Promise.<object>

Get the estimation for the next new-year event.

Kind: static method of Timer

Timer.darkAuction() ⇒ Promise.<object>

Get the estimation for the next dark-auction.

Kind: static method of Timer

Timer.interest() ⇒ Promise.<object>

Get the estimation for the interest timer.

Kind: static method of Timer

Timer.spooky() ⇒ Promise.<object>

Get the estimation for the spooky festival timer.

Kind: static method of Timer

Timer.winter() ⇒ Promise.<Object>

Get the estimation for the winter-event timer.

Kind: static method of Timer

Timer.zoo() ⇒ Promise.<Object>

Get the estimation for the travelling zoo timer.

Kind: static method of Timer

JsonConfiguration

Basic json-configuration.

Kind: global class

new JsonConfiguration(file)

Construction of JsonConfiguration.

Param Type Description
file string The configs filepath.

jsonConfiguration.set(key, val)

Set a configuration value.

Kind: instance method of JsonConfiguration

Param Type
key string
val string | number | object

jsonConfiguration.get(key) ⇒ string | number | object

Get a configuration value.

Kind: instance method of JsonConfiguration

Param Type
key string

jsonConfiguration.isSet(key) ⇒ boolean

True if the given key is set.

Kind: instance method of JsonConfiguration

Param Type
key string

jsonConfiguration.default(key, val)

Set a keys default value.

Kind: instance method of JsonConfiguration

Param Type
key string
val string | number | object

jsonConfiguration.defaults(obj)

Set multiple defaults based on the given object.

Kind: instance method of JsonConfiguration

Param Type
obj object

jsonConfiguration.save(file)

Saves the current configuration.

Kind: instance method of JsonConfiguration

Param Type Description
file string Optional. The file path the configuration should be saved to.

TimeUtility

A class that provides comparison methods for the estimated time.

Kind: global class

TimeUtility.diff(estimation) ⇒

Returns an object which contains the difference between present and estimation.

Kind: static method of TimeUtility
Returns: object

Param Type Description
estimation int The unix timestamp of the estimation.

handleLegacyRequest(req, res)

Handles incoming requests.

Kind: global function

Param Type
req Request
res Response

handleRequest(req, res)

Handles requests with timer-names.

Kind: global function

Param Type
req Request
res Response

handleSummary(req, res) ⇒ Promise.<{frames: {test: string, icon: string}}>

Handles requests to the getEstimations path.

Kind: global function

Param Type
req Request
res Response

logRequest(req, res, next)

Logs an incoming request.

Kind: global function

Param Type
req Request
res Response
next function

stringifyResults(req, result, timerName) ⇒ Object

"Stingifies" the results of a fetched result.

Kind: global function

Param Type
req Request
result object
timerName string

applyLeadingZeros(num, req) ⇒ string | number

Applies the leadingZeros query-parameter.

Kind: global function

Param Type
num number
req Request