hiro-sdk v1.2.7
HIRO SDK
SDK for HIRO applications.
ctx is instance of HiroGraphOrm.
Documentation can be found at hiro-graph-orm docs.
API
Table of Contents
- getState
- getSuspendedApps
- getInstalledApps
- saveState
- installApp
- uninstallApp
- runApp
- closeApp
- onClosing
- onSuspending
- onEnvironmentChanged
- initSdk
getState
Request application state from the HIRO Desktop
getSuspendedApps
Ask HIRO Desktop to give list of suspended apps.
getInstalledApps
Ask HIRO Desktop to give list of installed apps.
saveState
Ask HIRO Desktop to save application state for later usage. Usually, this method is invoke during suspend process.
Parameters
stateObject Application state to save
installApp
Ask HIRO Desktop to install application.
Parameters
appIdstring Application id to install
uninstallApp
Ask HIRO Desktop to uninstall application.
Parameters
appIdstring Application id to uninstall
runApp
Ask HIRO Desktop to open/run application.
Parameters
appIdstring Application id to run
closeApp
Ask HIRO Desktop to close/stop application.
Parameters
appIdstring Application id to stop
onClosing
Register callback for the CLOSING event
Parameters
cbFunction CLOSING event listener
Returns Function Function to unregister this callback
onSuspending
Register callback for the SUSPENDING event
Parameters
cbFunction SUSPENDING event listener
Returns Function Function to unregister this callback
onEnvironmentChanged
Register callback for the ENVIRONMENT_CHANGED event
Parameters
cbFunction ENVIRONMENT_CHANGED event listener
Returns Function Function to unregister this callback
initSdk
- See: https://www.npmjs.com/package/hiro-graph-orm-mappings
- See: https://github.com/arago/hiro-graph-js/tree/v0.2.8/packages/hiro-graph-client#servlets
Initialize HIRO SDK
Parameters
configObject SDK configuration (optional, default{})config.mappingsArray? ORM mappings There are some mappings provided by default.config.servletsObject? ORM Servletsconfig.createTokenFunction? Factory to create token. Default implementation is require('hiro-graph-client').Token But you may want use ReduxToken from the 'hiro-graph-redux'config.authUrlString? Graph Auth URL for dev authconfig.graphUrlString? Graph URL for dev authconfig.redirectUrlString? Graph Auth Redirect URL for dev authconfig.clientIdString? Client ID for dev authconfig.forceHttpBoolean Force HTTP connection instead of websocket (optional, defaulttrue)
Returns Promise<{ready: Function, orm: Context, config: Object, state: Object}> Promise will be resolved with next values:- ready: callback for HIRO Desktop, tells about ready status
- orm: configured ORM
- config: { graphUrl, token, user, org } from the HIRO Desktop
- state: saved application state in case app was suspended
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago