amido-profile-service
Version:
Amido Profile Service JavaScript SDK
1,536 lines (486 loc) • 18.4 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: AmidoProfileService</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: AmidoProfileService</h1>
<section>
<header>
<h2>
AmidoProfileService
</h2>
</header>
<article>
<div class="container-overview">
<dt>
<h4 class="name" id="AmidoProfileService"><span class="type-signature"></span>new AmidoProfileService<span class="signature">(config)</span><span class="type-signature"> → {<a href="AmidoProfileService.html">AmidoProfileService</a>}</span></h4>
</dt>
<dd>
<div class="description">
Instantiate an instance of the profile service SDK
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>subscriptionKey</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
</dl>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line18">line 18</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="AmidoProfileService.html">AmidoProfileService</a></span>
</dd>
</dl>
</dd>
</div>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="createIdentityUser"><span class="type-signature"></span>createIdentityUser<span class="signature">(profile)</span><span class="type-signature"> → {Promise}</span></h4>
</dt>
<dd>
<div class="description">
Create a new user profile with their identity provider, defined by the identityProvider set in the constructor (if provided)
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>profile</code></td>
<td class="type">
</td>
<td class="description last">the profile to save</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line175">line 175</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- resolved with the profile if successful
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="createProfile"><span class="type-signature"></span>createProfile<span class="signature">(userId, realm, delegateToken, profile)</span><span class="type-signature"> → {Promise}</span></h4>
</dt>
<dd>
<div class="description">
Create a profile for an existing user within the specified realm
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>userId</code></td>
<td class="type">
</td>
<td class="description last">the user's ID</td>
</tr>
<tr>
<td class="name"><code>realm</code></td>
<td class="type">
</td>
<td class="description last">the realm to create the profile</td>
</tr>
<tr>
<td class="name"><code>delegateToken</code></td>
<td class="type">
</td>
<td class="description last">the user's access token to authorize with the API</td>
</tr>
<tr>
<td class="name"><code>profile</code></td>
<td class="type">
</td>
<td class="description last">the JSON profile to save</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line57">line 57</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- resolved with the profile if successful.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getFieldsets"><span class="type-signature"></span>getFieldsets<span class="signature">(realm, screenName)</span><span class="type-signature"> → {Promise}</span></h4>
</dt>
<dd>
<div class="description">
Get the schema for a given field set
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>realm</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>screenName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of fieldset to load</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line101">line 101</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- Resolved with the fieldset
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getNestedProfile"><span class="type-signature"></span>getNestedProfile<span class="signature">(userId, realm, delegateToken)</span><span class="type-signature"> → {Promise}</span></h4>
</dt>
<dd>
<div class="description">
Return a user's nested profile. If a user's profile has a parent profile, will also be returned.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>userId</code></td>
<td class="type">
</td>
<td class="description last">the user's ID</td>
</tr>
<tr>
<td class="name"><code>realm</code></td>
<td class="type">
</td>
<td class="description last">the realm to create the profile</td>
</tr>
<tr>
<td class="name"><code>delegateToken</code></td>
<td class="type">
</td>
<td class="description last">the user's access token to authorize with the API</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line145">line 145</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- resolved with the user's nested profile
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getProfile"><span class="type-signature"></span>getProfile<span class="signature">(userId, realm, delegateToken)</span><span class="type-signature"> → {Promise}</span></h4>
</dt>
<dd>
<div class="description">
Get a user's profile for a specific schema
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>userId</code></td>
<td class="type">
</td>
<td class="description last">the user's ID</td>
</tr>
<tr>
<td class="name"><code>realm</code></td>
<td class="type">
</td>
<td class="description last">the realm to create the profile</td>
</tr>
<tr>
<td class="name"><code>delegateToken</code></td>
<td class="type">
</td>
<td class="description last">the user's access token to authorize with the API</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line123">line 123</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- resolved with the user's profile
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="updateIdentityUser"><span class="type-signature"></span>updateIdentityUser<span class="signature">(userId, profile)</span><span class="type-signature"> → {Promise}</span></h4>
</dt>
<dd>
<div class="description">
Update a user's profile for their identity provider, defined by the identityProvider set in the constructor (if provided)
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>userId</code></td>
<td class="type">
</td>
<td class="description last">the user's ID</td>
</tr>
<tr>
<td class="name"><code>profile</code></td>
<td class="type">
</td>
<td class="description last">the profile to update</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line166">line 166</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- resolved with the profile if successful
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="updateProfile"><span class="type-signature"></span>updateProfile<span class="signature">(userId, realm, delegateToken, profile)</span><span class="type-signature"> → {Promise}</span></h4>
</dt>
<dd>
<div class="description">
Update the profile of an existing user within the specified realm
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>userId</code></td>
<td class="type">
</td>
<td class="description last">the user's ID</td>
</tr>
<tr>
<td class="name"><code>realm</code></td>
<td class="type">
</td>
<td class="description last">the realm to create the profile</td>
</tr>
<tr>
<td class="name"><code>delegateToken</code></td>
<td class="type">
</td>
<td class="description last">the user's access token to authorize with the API</td>
</tr>
<tr>
<td class="name"><code>profile</code></td>
<td class="type">
</td>
<td class="description last">the JSON profile to save</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line79">line 79</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- resolved with the profile if successful.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="AmidoProfileService.html">AmidoProfileService</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha10</a> on Tue Nov 18 2014 12:16:04 GMT+0000 (GMT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>