1.2.7 • Published 6 years ago

hiro-sdk v1.2.7

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

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

Request application state from the HIRO Desktop

Returns Promise<Object>

getSuspendedApps

Ask HIRO Desktop to give list of suspended apps.

Returns Promise<Object>

getInstalledApps

Ask HIRO Desktop to give list of installed apps.

Returns Promise<Object>

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

Returns Promise<Object>

uninstallApp

Ask HIRO Desktop to uninstall application.

Parameters

  • appId string Application id to uninstall

Returns Promise<Object>

runApp

Ask HIRO Desktop to open/run application.

Parameters

  • appId string Application id to run

Returns Promise<Object>

closeApp

Ask HIRO Desktop to close/stop application.

Parameters

  • appId string Application id to stop

Returns Promise<Object>

onClosing

Register callback for the CLOSING event

Parameters

Returns Function Function to unregister this callback

onSuspending

Register callback for the SUSPENDING event

Parameters

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

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 Servlets
    • config.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 auth
    • config.graphUrl String? Graph URL for dev auth
    • config.redirectUrl String? Graph Auth Redirect URL for dev auth
    • config.clientId String? Client ID for dev auth
    • config.forceHttp Boolean Force HTTP connection instead of websocket (optional, default true)

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
1.2.7

6 years ago

2.0.0

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.11.2

7 years ago

0.11.1

7 years ago

0.11.0

7 years ago

0.10.4

7 years ago

0.10.3

7 years ago

0.10.2

7 years ago

0.10.1

7 years ago

0.10.0

7 years ago

0.9.2

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.8.2

8 years ago

0.8.1

8 years ago

0.8.0

8 years ago

0.7.3

8 years ago

0.7.2

8 years ago

0.7.1

8 years ago

0.7.0

8 years ago

0.6.0

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago