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
state
Object Application state to save
installApp
Ask HIRO Desktop to install application.
Parameters
appId
string Application id to install
uninstallApp
Ask HIRO Desktop to uninstall application.
Parameters
appId
string Application id to uninstall
runApp
Ask HIRO Desktop to open/run application.
Parameters
appId
string Application id to run
closeApp
Ask HIRO Desktop to close/stop application.
Parameters
appId
string Application id to stop
onClosing
Register callback for the CLOSING event
Parameters
cb
Function CLOSING event listener
Returns Function Function to unregister this callback
onSuspending
Register callback for the SUSPENDING event
Parameters
cb
Function SUSPENDING event listener
Returns Function Function to unregister this callback
onEnvironmentChanged
Register callback for the ENVIRONMENT_CHANGED event
Parameters
cb
Function 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
config
Object SDK configuration (optional, default{}
)config.mappings
Array? ORM mappings There are some mappings provided by default.config.servlets
Object? ORM Servletsconfig.createToken
Function? Factory to create token. Default implementation is require('hiro-graph-client').Token But you may want use ReduxToken from the 'hiro-graph-redux'config.authUrl
String? Graph Auth URL for dev authconfig.graphUrl
String? Graph URL for dev authconfig.redirectUrl
String? Graph Auth Redirect URL for dev authconfig.clientId
String? Client ID for dev authconfig.forceHttp
Boolean 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
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 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
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