120 lines
2.9 KiB
JavaScript
120 lines
2.9 KiB
JavaScript
/**
|
|
* Singleton instance of CommandLibrary.
|
|
* @type {CommandLibrary}
|
|
* @readOnly
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* CommandLibrary constructor
|
|
* @param {any} jibo Instance of jibo runtime
|
|
* @param {boolean} [validate = true] Flag deteremining if CommandLibrary shoudl validate protocol, `false` used for testing
|
|
*/
|
|
|
|
/**
|
|
* Gets singleton instance of CommandLibrary.
|
|
*/
|
|
|
|
/**
|
|
* Destroy CommandLibrary and nullify its singleton
|
|
*/
|
|
|
|
/**
|
|
* Create a CommandConnector.
|
|
* If there is alreayd a CommandConnector registered with taht id it will return that CommandConnector.
|
|
*/
|
|
|
|
/**
|
|
* Remove reference to CommandConnector.
|
|
* If the given CommandConnector is the active it will be disconnected.
|
|
*/
|
|
|
|
/**
|
|
* Remove reference to CommandConnector by id.
|
|
* If the given CommandConnector is the active it will be disconnected.
|
|
*/
|
|
|
|
/**
|
|
* Connect delegate to command library
|
|
* private - only called by via CommandConnector.connect()
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Returns a Promise that resolves on completion of entity engine update.
|
|
* Convenience method for testing purposes
|
|
* @return {Promise<void>} - Promise resolving on completion of entity engine update
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Returns a entity Engine
|
|
* Convenience method for testing purposes
|
|
* @return {Engine} - entity engine of current command session
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Method to pass commands.
|
|
* @method CommandManager#onMessage
|
|
* @param {Command} data
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Handler for responses that could not be deliver, returned via a CommandConnector
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Start a session.
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Called by CommandConnector when a connection is lost, but a reconnect is desired.
|
|
* Would get called in the case of connection disruption.
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Called to disconnect current connection.
|
|
* Sends disconnect request to currently active CommandConnector
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* End the current session and nullify active connection and connection proxy
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Converts ACO into a Permissions object for use by the CommandLibrary
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Create protocol validators for supported protocol versions
|
|
* Will need to add validators for each supported protocol
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Checks if data fits the protocol format of the current connection.
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Checks if version matches active version, if not send appropriate response code
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Checks if version string is incluced in set of supported protocols
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Helper method to send acknowledgements
|
|
* @private
|
|
*/ |