Comparing version 0.5.4 to 0.5.5
@@ -93,3 +93,3 @@ ## Classes | ||
* [new Elarian(config)](#new_Elarian_new) | ||
* [.fetchAppState()](#Elarian+fetchAppState) ⇒ <code>AppState</code> | ||
* [.fetchAppState(appIds)](#Elarian+fetchAppState) ⇒ <code>AppState</code> \| <code>Array.<AppState></code> | ||
* [.updateAppState(data)](#Elarian+updateAppState) ⇒ <code>AppState</code> | ||
@@ -114,6 +114,11 @@ * [.connect()](#Client+connect) ⇒ [<code>Elarian</code>](#Elarian) | ||
### elarian.fetchAppState() ⇒ <code>AppState</code> | ||
<p>Lease app state</p> | ||
### elarian.fetchAppState(appIds) ⇒ <code>AppState</code> \| <code>Array.<AppState></code> | ||
<p>Fetch your app state</p> | ||
**Kind**: instance method of [<code>Elarian</code>](#Elarian) | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| appIds | <code>Array.<String></code> | <p>Other apps whose state you want to get. This trigger a consent notification to the user</p> | | ||
<a name="Elarian+updateAppState"></a> | ||
@@ -120,0 +125,0 @@ |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable max-len */ | ||
/* eslint-disable no-underscore-dangle */ | ||
@@ -25,7 +26,8 @@ const Client = require('./client'); | ||
/** | ||
* Lease app state | ||
* @returns {AppState} | ||
* Fetch your app state | ||
* @param {String[]} appIds Other apps whose state you want to get. This trigger a consent notification to the user | ||
* @returns {AppState|AppState[]} | ||
* @memberof Elarian | ||
*/ | ||
Elarian.prototype.fetchAppState = function fetchAppState() { | ||
Elarian.prototype.fetchAppState = function fetchAppState(appIds = []) { | ||
const { appId, token } = this.config; | ||
@@ -37,2 +39,3 @@ const service = this._getAppStateService(); | ||
token, | ||
appIds, | ||
}; | ||
@@ -42,4 +45,6 @@ service.GetAppState(params, (error, result) => { | ||
reject(error); | ||
} else if (appIds && appIds.length) { | ||
resolve(result.states); | ||
} else { | ||
resolve(result); | ||
resolve(result.states[0]); | ||
} | ||
@@ -46,0 +51,0 @@ }); |
{ | ||
"name": "elarian", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"description": "Elarian JavaScript SDK", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1100111
56
967