GT2/GT2-iOS/node_modules/auth0/docs/module-management.UsersMana...

4742 lines
93 KiB
HTML
Raw Normal View History

2018-02-12 17:26:06 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>UsersManager - Documentation</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="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="module-auth.AuthenticationClient.html">AuthenticationClient</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.AuthenticationClient.html#changePassword">changePassword</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.AuthenticationClient.html#clientCredentialsGrant">clientCredentialsGrant</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.AuthenticationClient.html#getClientInfo">getClientInfo</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.AuthenticationClient.html#getDelegationToken">getDelegationToken</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.AuthenticationClient.html#getProfile">getProfile</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.AuthenticationClient.html#passwordGrant">passwordGrant</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.AuthenticationClient.html#requestChangePasswordEmail">requestChangePasswordEmail</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.AuthenticationClient.html#requestEmailCode">requestEmailCode</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.AuthenticationClient.html#requestMagicLink">requestMagicLink</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.AuthenticationClient.html#requestSMSCode">requestSMSCode</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.AuthenticationClient.html#verifySMSCode">verifySMSCode</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="module-auth.DatabaseAuthenticator.html">DatabaseAuthenticator</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.DatabaseAuthenticator.html#changePassword">changePassword</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.DatabaseAuthenticator.html#requestChangePasswordEmail">requestChangePasswordEmail</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.DatabaseAuthenticator.html#signIn">signIn</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.DatabaseAuthenticator.html#signUp">signUp</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="module-auth.OAuthAuthenticator.html">OAuthAuthenticator</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.OAuthAuthenticator.html#passwordGrant">passwordGrant</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.OAuthAuthenticator.html#signIn">signIn</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-auth.OAuthAuthenticator.html#socialSignIn">s
</nav>
<div id="main">
<h1 class="page-title">UsersManager</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="module-management.html">management</a>.</span>
UsersManager
</h2>
<div class="class-description"><p>Abstracts interaction with the users endpoint.</p></div>
</header>
<article>
<div class="container-overview">
<div class="section-method">
<h2>Constructor</h2>
<h4 class="name" id="UsersManager"><span class="type-signature"></span>new UsersManager<span class="signature">(options)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line23">line 23</a>
</li></ul></dd>
</dl>
<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>options</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="description last">
<p>The client options.</p>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>baseUrl</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>The URL of the API.</p>
</td>
</tr>
<tr>
<td class="name"><code>headers</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Headers to be included in all requests.</p>
</td>
</tr>
<tr>
<td class="name"><code>retry</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Retry Policy Config</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h3 class="subsection-title">Members</h3>
<div class="section-members">
<h4 class="name" id="~enrollmentsAuth0RestClient"><span class="type-signature">(inner) </span>enrollmentsAuth0RestClient<span class="type-signature"> :<a href="external-RestClient.html">external:RestClient</a></span></h4>
<div class="description">
<p>Provides an abstraction layer for retrieving Guardian enrollments.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line76">line 76</a>
</li></ul></dd>
</dl>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><code><a href="external-RestClient.html">external:RestClient</a></code></span>
</li>
</ul>
</div>
<div class="section-members">
<h4 class="name" id="~identitiesAuth0RestClient"><span class="type-signature">(inner) </span>identitiesAuth0RestClient<span class="type-signature"> :<a href="external-RestClient.html">external:RestClient</a></span></h4>
<div class="description">
<p>Provides a simple abstraction layer for linking user accounts.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line60">line 60</a>
</li></ul></dd>
</dl>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><code><a href="external-RestClient.html">external:RestClient</a></code></span>
</li>
</ul>
</div>
<div class="section-members">
<h4 class="name" id="~multifactorAuth0RestClient"><span class="type-signature">(inner) </span>multifactorAuth0RestClient<span class="type-signature"> :<a href="external-RestClient.html">external:RestClient</a></span></h4>
<div class="description">
<p>Provides an abstraction layer for consuming the
<a href="https://auth0.com/docs/api/v2#!/Users/delete_multifactor_by_provider">Multifactor Provider endpoint</a>.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line52">line 52</a>
</li></ul></dd>
</dl>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><code><a href="external-RestClient.html">external:RestClient</a></code></span>
</li>
</ul>
</div>
<div class="section-members">
<h4 class="name" id="~userLogsAuth0RestClient"><span class="type-signature">(inner) </span>userLogsAuth0RestClient<span class="type-signature"> :<a href="external-RestClient.html">external:RestClient</a></span></h4>
<div class="description">
<p>Provides a simple abstraction layer for user logs</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line68">line 68</a>
</li></ul></dd>
</dl>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><code><a href="external-RestClient.html">external:RestClient</a></code></span>
</li>
</ul>
</div>
<div class="section-members">
<h4 class="name" id="~usersByEmailClient"><span class="type-signature">(inner) </span>usersByEmailClient<span class="type-signature"> :<a href="external-RestClient.html">external:RestClient</a></span></h4>
<div class="description">
<p>Provides an abstraction layer for the new &quot;users-by-email&quot; API</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line84">line 84</a>
</li></ul></dd>
</dl>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><code><a href="external-RestClient.html">external:RestClient</a></code></span>
</li>
</ul>
</div>
<h3 class="subsection-title">Methods</h3>
<div class="section-method">
<h4 class="name" id="create"><span class="type-signature"></span>create<span class="signature">(data, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|undefined}</span></h4>
<div class="description">
<p>Create a new user.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line89">line 89</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>User data.</p>
</td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Callback function.</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
|
<span class="param-type"><code>undefined</code></span>
</dd>
</dl>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>management.users.create(data, function (err) {
if (err) {
// Handle error.
}
// User created.
});</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id="delete"><span class="type-signature"></span>delete<span class="signature">(params, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|undefined}</span></h4>
<div class="description">
<p>Delete a user by its id.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line309">line 309</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>The user data object..</p>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="description last">
<p>The user id.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Callback function</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
|
<span class="param-type"><code>undefined</code></span>
</dd>
</dl>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>management.users.delete({ id: USER_ID }, function (err) {
if (err) {
// Handle error.
}
// User deleted.
});</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id="deleteAll"><span class="type-signature"></span>deleteAll<span class="signature">(cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|undefined}</span></h4>
<div class="description">
<p>Delete all users.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line340">line 340</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Callback function</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
|
<span class="param-type"><code>undefined</code></span>
</dd>
</dl>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>management.users.deleteAll(function (err) {
if (err) {
// Handle error.
}
// Users deleted
});</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id="deleteMultifactorProvider"><span class="type-signature"></span>deleteMultifactorProvider<span class="signature">(params, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|undefined}</span></h4>
<div class="description">
<p>Delete a multifactor provider.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line370">line 370</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>Data object.</p>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="description last">
<p>The user id.</p>
</td>
</tr>
<tr>
<td class="name"><code>provider</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="description last">
<p>Multifactor provider.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Callback function</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
|
<span class="param-type"><code>undefined</code></span>
</dd>
</dl>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>var params = { id: USER_ID, provider: MULTIFACTOR_PROVIDER };
management.users.deleteMultifactorProvider(params, function (err, user) {
if (err) {
// Handle error.
}
// Users accounts unlinked.
});</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(data, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|undefined}</span></h4>
<div class="description">
<p>Get a user by its id.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line175">line 175</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>The user data object.</p>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="description last">
<p>The user id.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Callback function.</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
|
<span class="param-type"><code>undefined</code></span>
</dd>
</dl>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>management.users.get({ id: USER_ID }, function (err, user) {
console.log(user);
});</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id="getAll"><span class="type-signature"></span>getAll<span class="signature">(params<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|undefined}</span></h4>
<div class="description">
<p>Get all users.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line118">line 118</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Users params.</p>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>per_page</code></td>
<td class="type">
<span class="param-type"><code>Number</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Number of users per page.</p>
</td>
</tr>
<tr>
<td class="name"><code>page</code></td>
<td class="type">
<span class="param-type"><code>Number</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Page number.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Callback function.</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
|
<span class="param-type"><code>undefined</code></span>
</dd>
</dl>
</div>
<div class="section-examples">
<h5>Example</h5>
<p class="code-caption">
This method takes an optional object as first argument that may be used to
specify pagination settings and the search query.
</p>
<pre class="prettyprint"><code>// Pagination settings.
var params = {
per_page: 10,
page: 2
};
management.users.getAll(function (err, users) {
console.log(users.length);
});</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id="getByEmail"><span class="type-signature"></span>getByEmail<span class="signature">(email<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|undefined}</span></h4>
<div class="description">
<p>Get Users by an Email Address</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line150">line 150</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>email</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Email address of user(s) to find</p>
</td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Callback function.</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
|
<span class="param-type"><code>undefined</code></span>
</dd>
</dl>
</div>
<div class="section-examples">
<h5>Example</h5>
<p class="code-caption">
This method takes a first argument as the Email address to look for
users, and uses the /users-by-email API, not the search API
</p>
<pre class="prettyprint"><code>management.users.getByEmail('email@address', function (err, users) {
console.log(users);
});</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id="getGuardianEnrollments"><span class="type-signature"></span>getGuardianEnrollments<span class="signature">(data, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|undefined}</span></h4>
<div class="description">
<p>Get a list of Guardian enrollments.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line543">line 543</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>The user data object.</p>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="description last">
<p>The user id.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Callback function.</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
|
<span class="param-type"><code>undefined</code></span>
</dd>
</dl>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>management.users.getGuardianEnrollments({ id: USER_ID }, function (err, enrollments) {
console.log(enrollments);
});</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id="link"><span class="type-signature"></span>link<span class="signature">(userId, params, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|undefined}</span></h4>
<div class="description">
<p>Link the user with another account.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line413">line 413</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>userId</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>ID of the primary user.</p>
</td>
</tr>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>Secondary user data.</p>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>user_id</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="description last">
<p>ID of the user to be linked.</p>
</td>
</tr>
<tr>
<td class="name"><code>connection_id</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="description last">
<p>ID of the connection to be used.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Callback function.</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
|
<span class="param-type"><code>undefined</code></span>
</dd>
</dl>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>var params = { id: USER_ID };
var data = {
user_id: 'OTHER_USER_ID',
connection_id: 'CONNECTION_ID'
};
management.users.link(params, data, function (err, user) {
if (err) {
// Handle error.
}
// Users linked.
});</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id="logs"><span class="type-signature"></span>logs<span class="signature">(params, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|undefined}</span></h4>
<div class="description">
<p>Get user's log events.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line506">line 506</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>Get logs data.</p>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="description last">
<p>User id.</p>
</td>
</tr>
<tr>
<td class="name"><code>per_page</code></td>
<td class="type">
<span class="param-type"><code>Number</code></span>
</td>
<td class="description last">
<p>Number of logs per page.</p>
</td>
</tr>
<tr>
<td class="name"><code>page</code></td>
<td class="type">
<span class="param-type"><code>Number</code></span>
</td>
<td class="description last">
<p>Page number.</p>
</td>
</tr>
<tr>
<td class="name"><code>sort</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="description last">
<p>The field to use for sorting. Use field:order where order is 1 for ascending and -1 for descending. For example date:-1.</p>
</td>
</tr>
<tr>
<td class="name"><code>include_totals</code></td>
<td class="type">
<span class="param-type"><code>Boolean</code></span>
</td>
<td class="description last">
<p>true if a query summary must be included in the result, false otherwise. Default false;</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Callback function.</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
|
<span class="param-type"><code>undefined</code></span>
</dd>
</dl>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>var params = { id: USER_ID, page: 0, per_page: 50, sort: 'date:-1', include_totals: true };
management.users.logs(params, function (err, logs) {
if (err) {
// Handle error.
}
console.log(logs);
});</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id="unlink"><span class="type-signature"></span>unlink<span class="signature">(params, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|undefined}</span></h4>
<div class="description">
<p>Unlink the given accounts.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line459">line 459</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>Linked users data.</p>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="description last">
<p>Primary user ID.</p>
</td>
</tr>
<tr>
<td class="name"><code>provider</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="description last">
<p>Identity provider in use.</p>
</td>
</tr>
<tr>
<td class="name"><code>user_id</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="description last">
<p>Secondary user ID.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Callback function.</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
|
<span class="param-type"><code>undefined</code></span>
</dd>
</dl>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>var params = { id: USER_ID, provider: 'auht0', user_id: OTHER_USER_ID };
management.users.unlink(params, function (err, user) {
if (err) {
// Handle error.
}
// Users accounts unlinked.
});</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id="update"><span class="type-signature"></span>update<span class="signature">(params, data, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|undefined}</span></h4>
<div class="description">
<p>Update a user by its id.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line197">line 197</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>The user parameters.</p>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="description last">
<p>The user id.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>New user data.</p>
</td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Callback function</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
|
<span class="param-type"><code>undefined</code></span>
</dd>
</dl>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>var params = { id: USER_ID };
management.users.update(params, data, function (err, user) {
if (err) {
// Handle error.
}
// Updated user.
console.log(user);
});</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id="updateAppMetadata"><span class="type-signature"></span>updateAppMetadata<span class="signature">(params, metadata, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|undefined}</span></h4>
<div class="description">
<p>Update the app metadata.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line268">line 268</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>The user data object..</p>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="description last">
<p>The user id.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>metadata</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>New app metadata.</p>
</td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Callback function</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
|
<span class="param-type"><code>undefined</code></span>
</dd>
</dl>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>var params = { id: USER_ID };
var metadata = {
foo: 'bar'
};
management.users.updateAppMetadata(params, metadata, function (err, user) {
if (err) {
// Handle error.
}
// Updated user.
console.log(user);
});</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id="updateUserMetadata"><span class="type-signature"></span>updateUserMetadata<span class="signature">(params, metadata, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|undefined}</span></h4>
<div class="description">
<p>Update the user metadata.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="management_UsersManager.js.html">management/UsersManager.js</a>, <a href="management_UsersManager.js.html#line227">line 227</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>The user data object..</p>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type"><code>String</code></span>
</td>
<td class="description last">
<p>The user id.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>metadata</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="attributes">
</td>
<td class="description last">
<p>New user metadata.</p>
</td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Callback function</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
|
<span class="param-type"><code>undefined</code></span>
</dd>
</dl>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>var params = { id: USER_ID };
var metadata = {
address: '123th Node.js Street'
};
management.users.updateUserMetadata(params, metadata, function (err, user) {
if (err) {
// Handle error.
}
// Updated user.
console.log(user);
});</code></pre>
</div>
</div>
</article>
</section>
</div>
<br class="clear">
<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Fri Dec 08 2017 10:01:22 GMT-0300 (-03) using the Minami theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>