diff --git a/CHANGELOG.md b/CHANGELOG.md index 3533c1e73..d383384a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## [v2.12.0](https://github.com/auth0/node-auth0/tree/v2.12.0) (2018-08-09) + +[Full Changelog](https://github.com/auth0/node-auth0/compare/v2.11.0...v2.12.0) + +**Added** + +* Added authorizationCodeGrant method to OAuthAuthenticator [\#290](https://github.com/auth0/node-auth0/pull/290) ([cwurtz](https://github.com/cwurtz)) +* Add Guardian Enrollments endpoints [\#278](https://github.com/auth0/node-auth0/pull/278) ([fmedinac](https://github.com/fmedinac)) + ## [v2.11.0](https://github.com/auth0/node-auth0/tree/v2.11.0) (2018-07-25) [Full Changelog](https://github.com/auth0/node-auth0/compare/v2.10.0...v2.11.0) diff --git a/docs/RetryRestClient.js.html b/docs/RetryRestClient.js.html index 9b05faa95..d21a69aa3 100644 --- a/docs/RetryRestClient.js.html +++ b/docs/RetryRestClient.js.html @@ -24,7 +24,7 @@
@@ -207,7 +207,7 @@

RetryRestClient.js


diff --git a/docs/auth_DatabaseAuthenticator.js.html b/docs/auth_DatabaseAuthenticator.js.html index 064142b98..8ffa6d405 100644 --- a/docs/auth_DatabaseAuthenticator.js.html +++ b/docs/auth_DatabaseAuthenticator.js.html @@ -24,7 +24,7 @@
@@ -345,7 +345,7 @@

auth/DatabaseAuthenticator.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/auth_OAuthAuthenticator.js.html b/docs/auth_OAuthAuthenticator.js.html index 8a5c76c46..6d31afcb0 100644 --- a/docs/auth_OAuthAuthenticator.js.html +++ b/docs/auth_OAuthAuthenticator.js.html @@ -24,7 +24,7 @@
@@ -47,7 +47,7 @@

auth/OAuthAuthenticator.js

/** * @class * Abstracts the sign-in, sign-up and change-password processes for Database & - * Active Directory auhtentication services. + * Active Directory authentication services. * @constructor * @memberOf module:auth * @@ -97,7 +97,7 @@

auth/OAuthAuthenticator.js

* var data = { * client_id: '{CLIENT_ID}', // Optional field. * username: '{USERNAME}', - * password: '{PASSWORD} + * password: '{PASSWORD}', * connection: '{CONNECTION_NAME}', * scope: 'openid' // Optional field. * }; @@ -162,7 +162,7 @@

auth/OAuthAuthenticator.js

* var data = { * client_id: '{CLIENT_ID}', // Optional field. * username: '{USERNAME}', - * password: '{PASSWORD}' + * password: '{PASSWORD}', * realm: '{CONNECTION_NAME}', // Optional field. * scope: 'openid' // Optional field. * }; @@ -284,6 +284,75 @@

auth/OAuthAuthenticator.js

return this.oauth.create(params, data); }; +/** + * Sign in using an authorization code + * + * @method authorizationCodeGrant + * @memberOf module:auth.OAuthAuthenticator.prototype + * + * @example <caption> + * Given the code returned in the URL params after the redirect + * from successful authentication, exchange the code for auth0 + * credentials. It will return JSON with the access_token and id_token. + * More information in the + * <a href="https://auth0.com/docs/api/authentication#authorization-code-grant"> + * API Docs + * </a>. + * </caption> + * + * var data = { + * code: '{CODE}', + * redirect_uri: '{REDIRECT_URI}', + * client_id: '{CLIENT_ID}', // Optional field. + * client_secret: '{CLIENT_SECRET}', // Optional field. + * }; + * + * auth0.oauth.authorizationCodeGrant(data, function (err, userData) { + * if (err) { + * // Handle error. + * } + * + * console.log(userData); + * }); + * + * @param {Object} data Authorization code payload + * @param {String} userData.code Code in URL returned after authentication + * @param {String} userData.redirect_uri The URL to which Auth0 will redirect the browser after authorization has been granted by the user. + * + * @return {Promise|undefined} + */ +OAuthAuthenticator.prototype.authorizationCodeGrant = function(options, cb) { + var params = { + type: 'token' + }; + + var defaultFields = { + grant_type: 'authorization_code', + client_id: this.clientId, + client_secret: this.clientSecret + }; + + var data = extend(defaultFields, options); + + if (!options || typeof options !== 'object') { + throw new ArgumentError('Missing options object'); + } + + if (!data.code || data.code.trim().length === 0) { + throw new ArgumentError('code field is required'); + } + + if (!data.redirect_uri || data.redirect_uri.trim().length === 0) { + throw new ArgumentError('redirect_uri field is required'); + } + + if (cb && cb instanceof Function) { + return this.oauth.create(params, data, cb); + } + + return this.oauth.create(params, data); +}; + module.exports = OAuthAuthenticator; @@ -297,7 +366,7 @@

auth/OAuthAuthenticator.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/auth_PasswordlessAuthenticator.js.html b/docs/auth_PasswordlessAuthenticator.js.html index a8f8616f5..e7e07bbfa 100644 --- a/docs/auth_PasswordlessAuthenticator.js.html +++ b/docs/auth_PasswordlessAuthenticator.js.html @@ -24,7 +24,7 @@
@@ -286,7 +286,7 @@

auth/PasswordlessAuthenticator.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/auth_TokensManager.js.html b/docs/auth_TokensManager.js.html index 59e81544d..3add59586 100644 --- a/docs/auth_TokensManager.js.html +++ b/docs/auth_TokensManager.js.html @@ -24,7 +24,7 @@
@@ -226,7 +226,7 @@

auth/TokensManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/auth_UsersManager.js.html b/docs/auth_UsersManager.js.html index abf412ba1..4db3f3b5b 100644 --- a/docs/auth_UsersManager.js.html +++ b/docs/auth_UsersManager.js.html @@ -24,7 +24,7 @@
@@ -224,7 +224,7 @@

auth/UsersManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/auth_index.js.html b/docs/auth_index.js.html index 40651f13b..e93b915f9 100644 --- a/docs/auth_index.js.html +++ b/docs/auth_index.js.html @@ -24,7 +24,7 @@
@@ -596,7 +596,7 @@

auth/index.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/external-RestClient.html b/docs/external-RestClient.html index ca5167408..4a50e24a3 100644 --- a/docs/external-RestClient.html +++ b/docs/external-RestClient.html @@ -24,7 +24,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +

+ RestClient +

+ + +
+ +
+
+ + +

Simple facade for consuming a REST API endpoint.

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -1039,7 +1139,7 @@


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/index.html b/docs/index.html index cc157863c..1a1d18f36 100644 --- a/docs/index.html +++ b/docs/index.html @@ -24,7 +24,7 @@
@@ -151,7 +151,7 @@

License

This project is licensed under the MIT license. See the

diff --git a/docs/index.js.html b/docs/index.js.html index 731420497..4868fba4f 100644 --- a/docs/index.js.html +++ b/docs/index.js.html @@ -24,7 +24,7 @@
@@ -61,7 +61,7 @@

index.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_BlacklistedTokensManager.js.html b/docs/management_BlacklistedTokensManager.js.html index 5a90b95e8..2366b8bd6 100644 --- a/docs/management_BlacklistedTokensManager.js.html +++ b/docs/management_BlacklistedTokensManager.js.html @@ -24,7 +24,7 @@
@@ -153,7 +153,7 @@

management/BlacklistedTokensManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_ClientGrantsManager.js.html b/docs/management_ClientGrantsManager.js.html index 83db47ad5..d325a9a3b 100644 --- a/docs/management_ClientGrantsManager.js.html +++ b/docs/management_ClientGrantsManager.js.html @@ -24,7 +24,7 @@
@@ -216,7 +216,7 @@

management/ClientGrantsManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_ClientsManager.js.html b/docs/management_ClientsManager.js.html index 74727a0ca..f4858aabd 100644 --- a/docs/management_ClientsManager.js.html +++ b/docs/management_ClientsManager.js.html @@ -24,7 +24,7 @@
@@ -238,7 +238,7 @@

management/ClientsManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_ConnectionsManager.js.html b/docs/management_ConnectionsManager.js.html index 7060b64c5..7083a0719 100644 --- a/docs/management_ConnectionsManager.js.html +++ b/docs/management_ConnectionsManager.js.html @@ -24,7 +24,7 @@
@@ -232,7 +232,7 @@

management/ConnectionsManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_DeviceCredentialsManager.js.html b/docs/management_DeviceCredentialsManager.js.html index 212f98329..63f4b8d1f 100644 --- a/docs/management_DeviceCredentialsManager.js.html +++ b/docs/management_DeviceCredentialsManager.js.html @@ -24,7 +24,7 @@
@@ -177,7 +177,7 @@

management/DeviceCredentialsManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_EmailProviderManager.js.html b/docs/management_EmailProviderManager.js.html index ea866799e..ff94dab39 100644 --- a/docs/management_EmailProviderManager.js.html +++ b/docs/management_EmailProviderManager.js.html @@ -24,7 +24,7 @@
@@ -195,7 +195,7 @@

management/EmailProviderManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_EmailTemplatesManager.js.html b/docs/management_EmailTemplatesManager.js.html index 1a5e04e97..d0d6b260d 100644 --- a/docs/management_EmailTemplatesManager.js.html +++ b/docs/management_EmailTemplatesManager.js.html @@ -24,7 +24,7 @@
@@ -180,7 +180,7 @@

management/EmailTemplatesManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_GuardianManager.js.html b/docs/management_GuardianManager.js.html new file mode 100644 index 000000000..ce9ea2881 --- /dev/null +++ b/docs/management_GuardianManager.js.html @@ -0,0 +1,156 @@ + + + + + + management/GuardianManager.js - Documentation + + + + + + + + + + + + + + + + + +
+ +

management/GuardianManager.js

+ + + + + + + +
+
+
var ArgumentError = require('rest-facade').ArgumentError;
+var Auth0RestClient = require('../Auth0RestClient');
+var RetryRestClient = require('../RetryRestClient');
+
+/**
+ * Simple facade for consuming a REST API endpoint.
+ * @external RestClient
+ * @see https://github.com/ngonzalvez/rest-facade
+ */
+
+/**
+ * @class
+ * Abstracts interaction with the Guardian endpoint.
+ * @constructor
+ * @memberOf module:management
+ *
+ * @param {Object} options            The client options.
+ * @param {String} options.baseUrl    The URL of the API.
+ * @param {Object} [options.headers]  Headers to be included in all requests.
+ * @param {Object} [options.retry]    Retry Policy Config
+ */
+var GuardianManager = function(options) {
+  if (options === null || typeof options !== 'object') {
+    throw new ArgumentError('Must provide manager options');
+  }
+
+  if (options.baseUrl === null || options.baseUrl === undefined) {
+    throw new ArgumentError('Must provide a base URL for the API');
+  }
+
+  if ('string' !== typeof options.baseUrl || options.baseUrl.length === 0) {
+    throw new ArgumentError('The provided base URL is invalid');
+  }
+
+  var clientOptions = {
+    errorFormatter: { message: 'message', name: 'error' },
+    headers: options.headers,
+    query: { repeatParams: false }
+  };
+
+  /**
+   * Provides an abstraction layer for retrieving Guardian enrollments.
+   *
+   * @type {external:RestClient}
+   */
+  var guardianEnrollmentsAuth0RestClient = new Auth0RestClient(
+    options.baseUrl + '/guardian/enrollments/:id',
+    clientOptions,
+    options.tokenProvider
+  );
+  this.enrollments = new RetryRestClient(guardianEnrollmentsAuth0RestClient, options.retry);
+};
+
+/**
+ * Get a single Guardian enrollment.
+ *
+ * @method    getGuardianEnrollment
+ * @memberOf  module:management.GuardianManager.prototype
+ *
+ * @example
+ * management.users.getGuardianEnrollment({ id: ENROLLMENT_ID }, function (err, enrollment) {
+ *   console.log(enrollment);
+ * });
+ *
+ * @param   {Object}    data      The user data object.
+ * @param   {String}    data.id   The user id.
+ * @param   {Function}  [cb]      Callback function.
+ *
+ * @return  {Promise|undefined}
+ */
+GuardianManager.prototype.getGuardianEnrollment = function(params, cb) {
+  return this.enrollments.get(params, cb);
+};
+
+/**
+ * Delete a Guardian enrollment.
+ *
+ * @method    deleteGuardianEnrollment
+ * @memberOf  module:management.GuardianManager.prototype
+ *
+ * @example
+ * management.users.deleteGuardianEnrollment({ id: ENROLLMENT_ID }, function (err, enrollments) {
+ *   console.log(enrollments);
+ * });
+ *
+ * @param   {Object}    data      The user data object.
+ * @param   {String}    data.id   The user id.
+ * @param   {Function}  [cb]      Callback function.
+ *
+ * @return  {Promise|undefined}
+ */
+GuardianManager.prototype.deleteGuardianEnrollment = function(params, cb) {
+  return this.enrollments.delete(params, cb);
+};
+
+module.exports = GuardianManager;
+
+
+
+ + + + +
+ +
+ +
+ Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme. +
+ + + + + diff --git a/docs/management_JobsManager.js.html b/docs/management_JobsManager.js.html index c8ff2eeb7..898fa2dcd 100644 --- a/docs/management_JobsManager.js.html +++ b/docs/management_JobsManager.js.html @@ -24,7 +24,7 @@
@@ -276,7 +276,7 @@

management/JobsManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_LogsManager.js.html b/docs/management_LogsManager.js.html index 8234b55fe..68b59b55a 100644 --- a/docs/management_LogsManager.js.html +++ b/docs/management_LogsManager.js.html @@ -24,7 +24,7 @@
@@ -165,7 +165,7 @@

management/LogsManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_ManagementTokenProvider.js.html b/docs/management_ManagementTokenProvider.js.html index 3f4b6b57b..7fdc26e39 100644 --- a/docs/management_ManagementTokenProvider.js.html +++ b/docs/management_ManagementTokenProvider.js.html @@ -24,7 +24,7 @@
@@ -189,7 +189,7 @@

management/ManagementTokenProvider.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_ResourceServersManager.js.html b/docs/management_ResourceServersManager.js.html index a87f20eb8..618dcba9a 100644 --- a/docs/management_ResourceServersManager.js.html +++ b/docs/management_ResourceServersManager.js.html @@ -24,7 +24,7 @@
@@ -238,7 +238,7 @@

management/ResourceServersManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_RulesConfigsManager.js.html b/docs/management_RulesConfigsManager.js.html index e92906ae3..1ce85ebbb 100644 --- a/docs/management_RulesConfigsManager.js.html +++ b/docs/management_RulesConfigsManager.js.html @@ -24,7 +24,7 @@
@@ -179,7 +179,7 @@

management/RulesConfigsManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_RulesManager.js.html b/docs/management_RulesManager.js.html index 4609238a5..1f3a7b95f 100644 --- a/docs/management_RulesManager.js.html +++ b/docs/management_RulesManager.js.html @@ -24,7 +24,7 @@
@@ -248,7 +248,7 @@

management/RulesManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_StatsManager.js.html b/docs/management_StatsManager.js.html index ae40ac457..d1bb6a9ea 100644 --- a/docs/management_StatsManager.js.html +++ b/docs/management_StatsManager.js.html @@ -24,7 +24,7 @@
@@ -174,7 +174,7 @@

management/StatsManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_TenantManager.js.html b/docs/management_TenantManager.js.html index a04bc4efe..967982106 100644 --- a/docs/management_TenantManager.js.html +++ b/docs/management_TenantManager.js.html @@ -24,7 +24,7 @@
@@ -161,7 +161,7 @@

management/TenantManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_TicketsManager.js.html b/docs/management_TicketsManager.js.html index 08b49f382..5fe9f4398 100644 --- a/docs/management_TicketsManager.js.html +++ b/docs/management_TicketsManager.js.html @@ -24,7 +24,7 @@
@@ -166,7 +166,7 @@

management/TicketsManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_UsersManager.js.html b/docs/management_UsersManager.js.html index 055304cbf..793e9479d 100644 --- a/docs/management_UsersManager.js.html +++ b/docs/management_UsersManager.js.html @@ -24,7 +24,7 @@
@@ -147,6 +147,21 @@

management/UsersManager.js

options.tokenProvider ); this.usersByEmail = new RetryRestClient(usersByEmailClient, options.retry); + + /** + * Provides an abstraction layer for regenerating Guardian recovery codes. + * + * @type {external:RestClient} + */ + var recoveryCodeRegenerationAuth0RestClients = new Auth0RestClient( + options.baseUrl + '/users/:id/recovery-code-regeneration', + clientOptions, + options.tokenProvider + ); + this.recoveryCodeRegenerations = new RetryRestClient( + recoveryCodeRegenerationAuth0RestClients, + options.retry + ); }; /** @@ -618,6 +633,35 @@

management/UsersManager.js

return this.enrollments.get.apply(this.enrollments, arguments); }; +/** + * Generate new Guardian recovery code. + * + * @method regenerateRecoveryCode + * @memberOf module:management.UsersManager.prototype + * + * @example + * management.users.regenerateRecoveryCode("USER_ID", function (err, result) { + * console.log(result.recovery_code); + * }); + * + * @param {Object} params Get logs data. + * @param {String} params.id User id. + * @param {Function} [cb] Callback function. + * + * @return {Promise|undefined} + */ +UsersManager.prototype.regenerateRecoveryCode = function(params, cb) { + if (!params || !params.id) { + throw new ArgumentError('The userId cannot be null or undefined'); + } + + if (cb && cb instanceof Function) { + return this.recoveryCodeRegenerations.create(params, {}, cb); + } + + return this.recoveryCodeRegenerations.create(params, {}); +}; + module.exports = UsersManager;

@@ -631,7 +675,7 @@

management/UsersManager.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/management_index.js.html b/docs/management_index.js.html index 95a6cc229..67296f73d 100644 --- a/docs/management_index.js.html +++ b/docs/management_index.js.html @@ -24,7 +24,7 @@
@@ -67,6 +67,7 @@

management/index.js

var ManagementTokenProvider = require('./ManagementTokenProvider'); var RulesConfigsManager = require('./RulesConfigsManager'); var EmailTemplatesManager = require('./EmailTemplatesManager'); +var GuardianManager = require('./GuardianManager'); var BASE_URL_FORMAT = 'https://%s/api/v2'; var MANAGEMENT_API_AUD_FORMAT = 'https://%s/api/v2/'; @@ -196,6 +197,14 @@

management/index.js

*/ this.users = new UsersManager(managerOptions); + /** + * Simple abstraction for performing CRUD operations on the + * guardian endpoint. + * + * @type {GuardianManager} + */ + this.guardian = new GuardianManager(managerOptions); + /** * Simple abstraction for performing CRUD operations on the * connections endpoint. @@ -1277,6 +1286,79 @@

management/index.js

'users.getGuardianEnrollments' ); +/** + * Generate new Guardian recovery code. + * + * @method regenerateRecoveryCode + * @memberOf module:management.ManagementClient.prototype + * + * @example + * management.regenerateRecoveryCode({ id: USER_ID }, function (err, newRecoveryCode) { + * console.log(newRecoveryCode); + * }); + * + * @param {Object} data The user data object. + * @param {String} data.id The user id. + * @param {Function} [cb] Callback function. + * + * @return {Promise|undefined} + */ +utils.wrapPropertyMethod( + ManagementClient, + 'regenerateRecoveryCode', + 'users.regenerateRecoveryCode' +); + +/** + * Get a single Guardian enrollment. + * + * @method getGuardianEnrollment + * @memberOf module:management.ManagementClient.prototype + * + * @example + * management.getGuardianEnrollment({ id: ENROLLMENT_ID }, function (err, enrollment) { + * console.log(enrollment); + * }); + * + * @param {Object} data The Guardian enrollment data object. + * @param {String} data.id The Guardian enrollment id. + * @param {Function} [cb] Callback function. + * + * @return {Promise|undefined} + */ +utils.wrapPropertyMethod( + ManagementClient, + 'getGuardianEnrollment', + 'guardian.getGuardianEnrollment' +); + +/** + * Delete a user's Guardian enrollment. + * + * @method deleteGuardianEnrollment + * @memberOf module:management.ManagementClient.prototype + * + * @example + * management.deleteGuardianEnrollment({ id: ENROLLMENT_ID }, function (err) { + * if (err) { + * // Handle error. + * } + * + * // Email provider deleted. + * }); + * + * @param {Object} data The Guardian enrollment data object. + * @param {String} data.id The Guardian enrollment id. + * @param {Function} [cb] Callback function. + * + * @return {Promise|undefined} + */ +utils.wrapPropertyMethod( + ManagementClient, + 'deleteGuardianEnrollment', + 'guardian.deleteGuardianEnrollment' +); + /** * Get all blacklisted tokens. * @@ -1898,7 +1980,7 @@

management/index.js


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-auth.AuthenticationClient.html b/docs/module-auth.AuthenticationClient.html index 767a42097..df8515ef9 100644 --- a/docs/module-auth.AuthenticationClient.html +++ b/docs/module-auth.AuthenticationClient.html @@ -24,7 +24,7 @@
@@ -3622,7 +3622,7 @@
Examples

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-auth.DatabaseAuthenticator.html b/docs/module-auth.DatabaseAuthenticator.html index f73820dca..5c87ad275 100644 --- a/docs/module-auth.DatabaseAuthenticator.html +++ b/docs/module-auth.DatabaseAuthenticator.html @@ -24,7 +24,7 @@
@@ -1738,7 +1738,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-auth.OAuthAuthenticator.html b/docs/module-auth.OAuthAuthenticator.html index e0e65f98b..32efbf6ee 100644 --- a/docs/module-auth.OAuthAuthenticator.html +++ b/docs/module-auth.OAuthAuthenticator.html @@ -24,7 +24,7 @@
@@ -48,7 +48,7 @@

Abstracts the sign-in, sign-up and change-password processes for Database & -Active Directory auhtentication services.

+Active Directory authentication services.

@@ -419,6 +419,247 @@

Methods

+
+ + + +

authorizationCodeGrant(data) → {Promise|undefined}

+ + + + + +
+

Sign in using an authorization code

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +Object + + + + +

Authorization code payload

+ +
userData.code + + +String + + + + +

Code in URL returned after authentication

+ +
userData.redirect_uri + + +String + + + + +

The URL to which Auth0 will redirect the browser after authorization has been granted by the user.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise +| + +undefined + + +
+
+ + + +
+ + + +
+
Example
+ +

+ Given the code returned in the URL params after the redirect + from successful authentication, exchange the code for auth0 + credentials. It will return JSON with the access_token and id_token. + More information in the + + API Docs + . +

+ +
var data = {
+  code: '{CODE}',
+  redirect_uri: '{REDIRECT_URI}',
+  client_id: '{CLIENT_ID}',  // Optional field.
+  client_secret: '{CLIENT_SECRET}',  // Optional field.
+};
+
+auth0.oauth.authorizationCodeGrant(data, function (err, userData) {
+  if (err) {
+    // Handle error.
+  }
+
+  console.log(userData);
+});
+ +
+ +
+ +
@@ -722,7 +963,7 @@
Example
var data = {
   client_id: '{CLIENT_ID}',  // Optional field.
   username: '{USERNAME}',
-  password: '{PASSWORD}'
+  password: '{PASSWORD}',
   realm: '{CONNECTION_NAME}', // Optional field.
   scope: 'openid'  // Optional field.
 };
@@ -1014,7 +1255,7 @@ 
Example
var data = {
   client_id: '{CLIENT_ID}',  // Optional field.
   username: '{USERNAME}',
-  password: '{PASSWORD}
+  password: '{PASSWORD}',
   connection: '{CONNECTION_NAME}',
   scope: 'openid'  // Optional field.
 };
@@ -1284,7 +1525,7 @@ 
Returns:

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-auth.PasswordlessAuthenticator.html b/docs/module-auth.PasswordlessAuthenticator.html index a21bd9114..5cd5d2913 100644 --- a/docs/module-auth.PasswordlessAuthenticator.html +++ b/docs/module-auth.PasswordlessAuthenticator.html @@ -24,7 +24,7 @@
@@ -1492,7 +1492,7 @@
Examples

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-auth.TokensManager.html b/docs/module-auth.TokensManager.html index 8befa00d1..36c3e083a 100644 --- a/docs/module-auth.TokensManager.html +++ b/docs/module-auth.TokensManager.html @@ -24,7 +24,7 @@
@@ -352,7 +352,7 @@
Parameters:

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-auth.UsersManager.html b/docs/module-auth.UsersManager.html index 263aa0379..a344885d1 100644 --- a/docs/module-auth.UsersManager.html +++ b/docs/module-auth.UsersManager.html @@ -24,7 +24,7 @@
@@ -1009,7 +1009,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-auth.html b/docs/module-auth.html index 5c148a786..2e3a81a80 100644 --- a/docs/module-auth.html +++ b/docs/module-auth.html @@ -24,7 +24,7 @@
@@ -105,7 +105,7 @@

Classes


- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.BlacklistedTokensManager.html b/docs/module-management.BlacklistedTokensManager.html index b8eadce77..b53d34806 100644 --- a/docs/module-management.BlacklistedTokensManager.html +++ b/docs/module-management.BlacklistedTokensManager.html @@ -24,7 +24,7 @@
@@ -991,7 +991,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.ClientGrantsManager.html b/docs/module-management.ClientGrantsManager.html index 2c1b70877..5da6642fb 100644 --- a/docs/module-management.ClientGrantsManager.html +++ b/docs/module-management.ClientGrantsManager.html @@ -24,7 +24,7 @@
@@ -542,7 +542,7 @@

createSource:
@@ -978,7 +978,7 @@

deleteSource:
@@ -1247,7 +1247,7 @@

deleteSource:
@@ -1516,7 +1516,7 @@

getAllSource:
@@ -2171,7 +2171,7 @@

updateSource:
@@ -2481,7 +2481,7 @@

updateSource:
@@ -2760,7 +2760,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.ClientsManager.html b/docs/module-management.ClientsManager.html index 6660e333f..288df07c3 100644 --- a/docs/module-management.ClientsManager.html +++ b/docs/module-management.ClientsManager.html @@ -24,7 +24,7 @@
@@ -1904,7 +1904,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.ConnectionsManager.html b/docs/module-management.ConnectionsManager.html index ba59d39d8..a609a2047 100644 --- a/docs/module-management.ConnectionsManager.html +++ b/docs/module-management.ConnectionsManager.html @@ -24,7 +24,7 @@
@@ -1899,7 +1899,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.DeviceCredentialsManager.html b/docs/module-management.DeviceCredentialsManager.html index 694636a5e..d0f9b4ffc 100644 --- a/docs/module-management.DeviceCredentialsManager.html +++ b/docs/module-management.DeviceCredentialsManager.html @@ -24,7 +24,7 @@
@@ -1179,7 +1179,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.EmailProviderManager.html b/docs/module-management.EmailProviderManager.html index ef80c4764..af9dacf13 100644 --- a/docs/module-management.EmailProviderManager.html +++ b/docs/module-management.EmailProviderManager.html @@ -24,7 +24,7 @@
@@ -1345,7 +1345,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.EmailTemplatesManager.html b/docs/module-management.EmailTemplatesManager.html index b9d4bb269..3c4e9b491 100644 --- a/docs/module-management.EmailTemplatesManager.html +++ b/docs/module-management.EmailTemplatesManager.html @@ -24,7 +24,7 @@
@@ -1304,7 +1304,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.GuardianManager.html b/docs/module-management.GuardianManager.html new file mode 100644 index 000000000..08dfc8532 --- /dev/null +++ b/docs/module-management.GuardianManager.html @@ -0,0 +1,973 @@ + + + + + + GuardianManager - Documentation + + + + + + + + + + + + + + + + + +
+ +

GuardianManager

+ + + + + + + +
+ +
+ +

+ management. + + GuardianManager +

+ +

Abstracts interaction with the Guardian endpoint.

+ + +
+ +
+
+ + +
+ + +

Constructor

+ + +

new GuardianManager(options)

+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + +

The client options.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
baseUrl + + +String + + + + + + + + + + +

The URL of the API.

+ +
headers + + +Object + + + + + + <optional>
+ + + + + +
+

Headers to be included in all requests.

+ +
retry + + +Object + + + + + + <optional>
+ + + + + +
+

Retry Policy Config

+ +
+ + +
+ + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + +

Members

+ + + +
+

(inner) guardianEnrollmentsAuth0RestClient :external:RestClient

+ + + + +
+

Provides an abstraction layer for retrieving Guardian enrollments.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + +
Type:
+ + + + + + +
+ + + + + +

Methods

+ + + +
+ + + +

deleteGuardianEnrollment(data, cbopt) → {Promise|undefined}

+ + + + + +
+

Delete a Guardian enrollment.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
data + + +Object + + + + + + + + + + +

The user data object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +String + + + + +

The user id.

+ +
+ + +
cb + + +function + + + + + + <optional>
+ + + + + +
+

Callback function.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise +| + +undefined + + +
+
+ + + +
+ + + +
+
Example
+ +
management.users.deleteGuardianEnrollment({ id: ENROLLMENT_ID }, function (err, enrollments) {
+  console.log(enrollments);
+});
+ +
+ +
+ + +
+ + + +

getGuardianEnrollment(data, cbopt) → {Promise|undefined}

+ + + + + +
+

Get a single Guardian enrollment.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
data + + +Object + + + + + + + + + + +

The user data object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +String + + + + +

The user id.

+ +
+ + +
cb + + +function + + + + + + <optional>
+ + + + + +
+

Callback function.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise +| + +undefined + + +
+
+ + + +
+ + + +
+
Example
+ +
management.users.getGuardianEnrollment({ id: ENROLLMENT_ID }, function (err, enrollment) {
+  console.log(enrollment);
+});
+ +
+ +
+ + + + + + +
+ +
+ + + + +
+ +
+ +
+ Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme. +
+ + + + + \ No newline at end of file diff --git a/docs/module-management.JobsManager.html b/docs/module-management.JobsManager.html index 86062089a..d217ba6ff 100644 --- a/docs/module-management.JobsManager.html +++ b/docs/module-management.JobsManager.html @@ -24,7 +24,7 @@
@@ -1306,7 +1306,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.LogsManager.html b/docs/module-management.LogsManager.html index 90bb3156b..1ab6b3f19 100644 --- a/docs/module-management.LogsManager.html +++ b/docs/module-management.LogsManager.html @@ -24,7 +24,7 @@
@@ -1286,7 +1286,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.ManagementClient.html b/docs/module-management.ManagementClient.html index 9092609a0..381045a07 100644 --- a/docs/module-management.ManagementClient.html +++ b/docs/module-management.ManagementClient.html @@ -24,7 +24,7 @@
@@ -106,7 +106,7 @@

new M
Source:
@@ -723,7 +723,7 @@

blac
Source:
@@ -798,7 +798,7 @@

clientGra
Source:
@@ -873,7 +873,7 @@

clientsSource:
@@ -948,7 +948,7 @@

connection
Source:
@@ -1023,7 +1023,7 @@

devi
Source:
@@ -1098,7 +1098,7 @@

emailPro
Source:
@@ -1173,7 +1173,7 @@

emailTe
Source:
@@ -1200,6 +1200,81 @@

Type:
+

+ + + +
+

guardian :GuardianManager

+ + + + +
+

Simple abstraction for performing CRUD operations on the +guardian endpoint.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + +
Type:
+
    +
  • + +GuardianManager + + +
  • +
+ + + + +
@@ -1247,7 +1322,7 @@

jobsSource:
@@ -1321,7 +1396,7 @@

logsSource:
@@ -1396,7 +1471,7 @@

resour
Source:
@@ -1471,7 +1546,7 @@

rulesSource:
@@ -1545,7 +1620,7 @@

rulesConf
Source:
@@ -1619,7 +1694,7 @@

statsSource:
@@ -1693,7 +1768,7 @@

tenantSource:
@@ -1767,7 +1842,7 @@

ticketsSource:
@@ -1842,7 +1917,7 @@

usersSource:
@@ -1926,7 +2001,7 @@

blackli
Source:
@@ -2226,7 +2301,7 @@

Source:
@@ -2444,7 +2519,7 @@

createCli
Source:
@@ -2662,7 +2737,7 @@

creat
Source:
@@ -2880,7 +2955,7 @@

Source:
@@ -3098,7 +3173,7 @@

Source:
@@ -3282,7 +3357,7 @@

Source:
@@ -3468,7 +3543,7 @@

c
Source:
@@ -3686,7 +3761,7 @@

createRule<
Source:
@@ -3904,7 +3979,7 @@

createUser<
Source:
@@ -4122,7 +4197,7 @@

deleteA
Source:
@@ -4306,7 +4381,7 @@

deleteCli
Source:
@@ -4575,7 +4650,7 @@

delet
Source:
@@ -4844,7 +4919,7 @@

Source:
@@ -5115,7 +5190,7 @@

de
Source:
@@ -5256,14 +5331,14 @@

Example
-

deleteResourceServer(params, cbopt) → {Promise|undefined}

+

deleteGuardianEnrollment(data, cbopt) → {Promise|undefined}

-

Delete an existing resource server.

+

Delete a user's Guardian enrollment.

@@ -5299,7 +5374,7 @@

d
Source:
@@ -5345,7 +5420,7 @@

Parameters:
- params + data @@ -5370,7 +5445,7 @@
Parameters:
-

Resource Server parameters.

+

The Guardian enrollment data object.

@@ -5413,7 +5488,7 @@
Parameters:
-

Resource Server ID.

+

The Guardian enrollment id.

@@ -5508,12 +5583,12 @@
Returns:
Example
-
management.deleteResourceServer({ id: RESOURCE_SERVER_ID }, function (err) {
+    
management.deleteGuardianEnrollment({ id: ENROLLMENT_ID }, function (err) {
   if (err) {
     // Handle error.
   }
 
-  // Resource Server deleted.
+  // Email provider deleted.
 });
@@ -5525,14 +5600,14 @@
Example
-

deleteRule(params, cbopt) → {Promise|undefined}

+

deleteResourceServer(params, cbopt) → {Promise|undefined}

-

Delete an existing rule.

+

Delete an existing resource server.

@@ -5568,7 +5643,7 @@

deleteRule<
Source:
@@ -5639,7 +5714,7 @@

Parameters:
-

Rule parameters.

+

Resource Server parameters.

@@ -5682,7 +5757,7 @@
Parameters:
-

Rule ID.

+

Resource Server ID.

@@ -5777,12 +5852,12 @@
Returns:
Example
-
auth0.deleteRule({ id: RULE_ID }, function (err) {
+    
management.deleteResourceServer({ id: RESOURCE_SERVER_ID }, function (err) {
   if (err) {
     // Handle error.
   }
 
-  // Rule deleted.
+  // Resource Server deleted.
 });
@@ -5794,14 +5869,14 @@
Example
-

deleteRulesConfig(params, cbopt) → {Promise|undefined}

+

deleteRule(params, cbopt) → {Promise|undefined}

-

Delete rules config.

+

Delete an existing rule.

@@ -5837,7 +5912,7 @@

dele
Source:
@@ -5908,7 +5983,7 @@

Parameters:
-

Rule Configs parameters.

+

Rule parameters.

@@ -5934,7 +6009,7 @@
Parameters:
- key + id @@ -5951,7 +6026,7 @@
Parameters:
-

Rule Configs key.

+

Rule ID.

@@ -6046,12 +6121,12 @@
Returns:
Example
-
management.deleteRulesConfig({ key: RULE_CONFIG_KEY }, function (err) {
+    
auth0.deleteRule({ id: RULE_ID }, function (err) {
   if (err) {
     // Handle error.
   }
 
-  // Rules Config deleted.
+  // Rule deleted.
 });
@@ -6063,14 +6138,14 @@
Example
-

deleteUser(params, cbopt) → {Promise|undefined}

+

deleteRulesConfig(params, cbopt) → {Promise|undefined}

-

Delete a user by its id.

+

Delete rules config.

@@ -6106,7 +6181,7 @@

deleteUser<
Source:
@@ -6177,7 +6252,7 @@

Parameters:
-

The user data object..

+

Rule Configs parameters.

@@ -6203,7 +6278,7 @@
Parameters:
- id + key @@ -6220,7 +6295,7 @@
Parameters:
-

The user id.

+

Rule Configs key.

@@ -6264,7 +6339,7 @@
Parameters:
-

Callback function

+

Callback function.

@@ -6315,12 +6390,12 @@
Returns:
Example
-
management.deleteUser({ id: USER_ID }, function (err) {
+    
management.deleteRulesConfig({ key: RULE_CONFIG_KEY }, function (err) {
   if (err) {
     // Handle error.
   }
 
-  // User deleted.
+  // Rules Config deleted.
 });
@@ -6332,14 +6407,14 @@
Example
-

deleteUserMultifactor(params, cbopt) → {Promise|undefined}

+

deleteUser(params, cbopt) → {Promise|undefined}

-

Delete a multifactor provider for a user.

+

Delete a user by its id.

@@ -6375,7 +6450,7 @@

Source:
@@ -6446,7 +6521,7 @@

Parameters:
-

Data object.

+

The user data object..

@@ -6495,32 +6570,6 @@
Parameters:
- - - - provider - - - - - -String - - - - - - - - - - -

Multifactor provider.

- - - - - @@ -6610,14 +6659,12 @@
Returns:
Example
-
var params = { id: USER_ID, provider: MULTIFACTOR_PROVIDER };
-
-management.deleteUserMultifactor(params, function (err, user) {
+    
management.deleteUser({ id: USER_ID }, function (err) {
   if (err) {
     // Handle error.
   }
 
-  // Users accounts unlinked.
+  // User deleted.
 });
@@ -6629,7 +6676,7 @@
Example
-

deleteUserMultifcator(params, cbopt) → {Promise|undefined}

+

deleteUserMultifactor(params, cbopt) → {Promise|undefined}

@@ -6660,10 +6707,6 @@

-
Deprecated:
  • The function name has a typo. -We're shipping this so it doesn't break compatibility. -Use deleteUserMultifactor instead.
- @@ -6676,7 +6719,7 @@

Source:
@@ -6913,7 +6956,7 @@

Example
var params = { id: USER_ID, provider: MULTIFACTOR_PROVIDER };
 
-management.deleteUserMultifcator(params, function (err, user) {
+management.deleteUserMultifactor(params, function (err, user) {
   if (err) {
     // Handle error.
   }
@@ -6930,14 +6973,14 @@ 
Example
-

getActiveUsersCount(cbopt) → {Promise|undefined}

+

deleteUserMultifcator(params, cbopt) → {Promise|undefined}

-

Get a the active users count.

+

Delete a multifactor provider for a user.

@@ -6961,6 +7004,10 @@

ge +
Deprecated:
  • The function name has a typo. +We're shipping this so it doesn't break compatibility. +Use deleteUserMultifactor instead.
+ @@ -6973,7 +7020,7 @@

ge
Source:
@@ -7019,13 +7066,13 @@

Parameters:
- cb + params -function +Object @@ -7034,8 +7081,6 @@
Parameters:
- <optional>
- @@ -7046,51 +7091,350 @@
Parameters:
-

Callback function.

+

Data object.

- - + - - - + + + + + + + + + + + + + + + + + + + + + + + + -
-
Returns:
+
+ + + - + + - - + + + - + +
NameTypeDescription
id + + +String + + +

The user id.

+ +
provider + + +String -
-
- Type: -
-
- -Promise -| -undefined + +
+

Multifactor provider.

+ +
+ + + + + + + + + + cb + + + + + +function + + + + + + + + + <optional>
+ + + + + + + + + + + +

Callback function

+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise +| + +undefined + + +
+
+ + + +
+ + + +
+
Example
+ +
var params = { id: USER_ID, provider: MULTIFACTOR_PROVIDER };
+
+management.deleteUserMultifcator(params, function (err, user) {
+  if (err) {
+    // Handle error.
+  }
+
+  // Users accounts unlinked.
+});
+ +
+ +

+ + +
+ + + +

getActiveUsersCount(cbopt) → {Promise|undefined}

+ + + + + +
+

Get a the active users count.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
cb + + +function + + + + + + <optional>
+ + + + + +
+

Callback function.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise +| + +undefined + + +
+
+ + + +
@@ -7157,7 +7501,7 @@

g
Source:
@@ -7337,7 +7681,7 @@

getClientSource:
@@ -7606,7 +7950,7 @@

getClien
Source:
@@ -7714,7 +8058,7 @@

getClients<
Source:
@@ -8041,7 +8385,7 @@

getConne
Source:
@@ -8310,7 +8654,7 @@

getConn
Source:
@@ -8637,7 +8981,7 @@

getDaily
Source:
@@ -8937,7 +9281,7 @@

g
Source:
@@ -9117,7 +9461,187 @@

getEm
Source:
+ + + + + + + + + + + + + + + + + +

Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
cb + + +function + + + + + + <optional>
+ + + + + +
+

Callback function.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise +| + +undefined + + +
+
+ + + +
+ + + +
+
Example
+ +
management.getEmailProvider(function (err, provider) {
+  console.log(provider.length);
+});
+ +
+ +

+ + +
+ + + +

getGuardianEnrollment(data, cbopt) → {Promise|undefined}

+ + + + + +
+

Get a single Guardian enrollment.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -9136,8 +9660,61 @@

getEm -

Parameters:
- +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -9241,8 +9850,8 @@
Returns:
Example
-
management.getEmailProvider(function (err, provider) {
-  console.log(provider.length);
+    
management.getGuardianEnrollment({ id: ENROLLMENT_ID }, function (err, enrollment) {
+  console.log(enrollment);
 });
@@ -9297,7 +9906,7 @@

Source:
@@ -9562,7 +10171,7 @@

getJobSource:
@@ -9836,7 +10445,7 @@

getLogSource:
@@ -10105,7 +10714,7 @@

getLogsSource:
@@ -10612,7 +11221,7 @@

getR
Source:
@@ -10881,7 +11490,7 @@

get
Source:
@@ -11208,7 +11817,7 @@

getRuleSource:
@@ -11477,7 +12086,7 @@

getRulesSource:
@@ -11804,7 +12413,7 @@

getRul
Source:
@@ -11924,7 +12533,7 @@

getT
Source:
@@ -12108,7 +12717,7 @@

getUserSource:
@@ -12373,7 +12982,7 @@

getUserLog
Source:
@@ -12748,7 +13357,7 @@

getUsersSource:
@@ -13032,14 +13641,236 @@
Example
-

getUsersByEmail(emailopt, cbopt) → {Promise|undefined}

+

getUsersByEmail(emailopt, cbopt) → {Promise|undefined}

+ + + + + +
+

Get users for a given email address

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + +

NameTypeAttributesDescription
data + + +Object + + + + + + + + + + +

The Guardian enrollment data object.

+ + @@ -9149,8 +9726,6 @@
Parameters:
- - @@ -9161,6 +9736,40 @@
Parameters:
+ + + + + + + + + + + + + + + + +
TypeAttributes
id + + +String + + + + +

The Guardian enrollment id.

+ +
+ + +
cb
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
email + + +String + + + + + + <optional>
+ + + + + +
+

Email Address of users to locate

+ +
cb + + +function + + + + + + <optional>
+ + + + + +
+

Callback function.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise +| + +undefined + + +
+
+ + + +
+ + + +
+
Example
+ +

+ This method takes an email address as the first argument, + and returns all users with that email address +

+ +
auth0.getUsersByEmail(email, function (err, users) {
+  console.log(users);
+});
+ +
+ +
+ + +
+ + + +

importUsers(data, cbopt) → {Promise|undefined}

-

Get users for a given email address

+

Given a path to a file and a connection id, create a new job that imports the +users contained in the file and associate them with the given connection.

@@ -13075,7 +13906,7 @@

getUse
Source:
@@ -13121,13 +13952,13 @@

Parameters:
- email + data -String +Object @@ -13136,8 +13967,6 @@
Parameters:
- <optional>
- @@ -13148,7 +13977,84 @@
Parameters:
-

Email Address of users to locate

+

Users import data.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
connectionId + + +String + + + + +

Connection for the users insertion.

+ +
users + + +String + + + + +

Path to the users data file.

+ +
+ @@ -13235,13 +14141,15 @@
Returns:
Example
-

- This method takes an email address as the first argument, - and returns all users with that email address -

- -
auth0.getUsersByEmail(email, function (err, users) {
-  console.log(users);
+    
var params = {
+  connection_id: '{CONNECTION_ID}',
+  users: '{PATH_TO_USERS_FILE}'
+};
+
+management.get(params, function (err) {
+  if (err) {
+    // Handle error.
+  }
 });
@@ -13253,15 +14161,14 @@
Example
-

importUsers(data, cbopt) → {Promise|undefined}

+

linkUsers(userId, params, cbopt) → {Promise|undefined}

-

Given a path to a file and a connection id, create a new job that imports the -users contained in the file and associate them with the given connection.

+

Link the user with another account.

@@ -13297,7 +14204,7 @@

importUser
Source:
@@ -13343,7 +14250,41 @@

Parameters:
- data + userId + + + + + +String + + + + + + + + + + + + + + + + + + +

ID of the primary user.

+ + + + + + + + + params @@ -13368,7 +14309,7 @@
Parameters:
-

Users import data.

+

Secondary user data.

@@ -13394,7 +14335,7 @@
Parameters:
- connectionId + user_id @@ -13411,7 +14352,7 @@
Parameters:
-

Connection for the users insertion.

+

ID of the user to be linked.

@@ -13420,7 +14361,7 @@
Parameters:
- users + connection_id @@ -13437,7 +14378,7 @@
Parameters:
-

Path to the users data file.

+

ID of the connection to be used.

@@ -13532,15 +14473,18 @@
Returns:
Example
-
var params = {
-  connection_id: '{CONNECTION_ID}',
-  users: '{PATH_TO_USERS_FILE}'
+    
var userId = 'USER_ID';
+var params = {
+  user_id: 'OTHER_USER_ID',
+  connection_id: 'CONNECTION_ID'
 };
 
-management.get(params, function (err) {
+management.linkUsers(userId, params, function (err, user) {
   if (err) {
     // Handle error.
   }
+
+  // Users linked.
 });
@@ -13552,14 +14496,14 @@
Example
-

linkUsers(userId, params, cbopt) → {Promise|undefined}

+

regenerateRecoveryCode(data, cbopt) → {Promise|undefined}

-

Link the user with another account.

+

Generate new Guardian recovery code.

@@ -13595,7 +14539,7 @@

linkUsersSource:
@@ -13641,41 +14585,7 @@
Parameters:
- userId - - - - - -String - - - - - - - - - - - - - - - - - - -

ID of the primary user.

- - - - - - - - - params + data @@ -13700,7 +14610,7 @@
Parameters:
-

Secondary user data.

+

The user data object.

@@ -13726,33 +14636,7 @@
Parameters:
- user_id - - - - - -String - - - - - - - - - - -

ID of the user to be linked.

- - - - - - - - - connection_id + id @@ -13769,7 +14653,7 @@
Parameters:
-

ID of the connection to be used.

+

The user id.

@@ -13864,18 +14748,8 @@
Returns:
Example
-
var userId = 'USER_ID';
-var params = {
-  user_id: 'OTHER_USER_ID',
-  connection_id: 'CONNECTION_ID'
-};
-
-management.linkUsers(userId, params, function (err, user) {
-  if (err) {
-    // Handle error.
-  }
-
-  // Users linked.
+    
management.regenerateRecoveryCode({ id: USER_ID }, function (err, newRecoveryCode) {
+  console.log(newRecoveryCode);
 });
@@ -13930,7 +14804,7 @@

Source:
@@ -14201,7 +15075,7 @@

setRule
Source:
@@ -14558,7 +15432,7 @@

unlinkUser
Source:
@@ -14881,7 +15755,7 @@

upda
Source:
@@ -15190,7 +16064,7 @@

updateCli
Source:
@@ -15496,7 +16370,7 @@

updat
Source:
@@ -15802,7 +16676,7 @@

up
Source:
@@ -16055,7 +16929,7 @@

u
Source:
@@ -16361,7 +17235,7 @@

updateRule<
Source:
@@ -16666,7 +17540,7 @@

u
Source:
@@ -16882,7 +17756,7 @@

updateUser<
Source:
@@ -17188,7 +18062,7 @@

upd
Source:
@@ -17466,7 +18340,7 @@

Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.ManagementTokenProvider.html b/docs/module-management.ManagementTokenProvider.html index 550fb0649..b8a4fe1f9 100644 --- a/docs/module-management.ManagementTokenProvider.html +++ b/docs/module-management.ManagementTokenProvider.html @@ -24,7 +24,7 @@
@@ -633,7 +633,7 @@
Returns:

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.ResourceServersManager.html b/docs/module-management.ResourceServersManager.html index 7c507c01e..cdba34475 100644 --- a/docs/module-management.ResourceServersManager.html +++ b/docs/module-management.ResourceServersManager.html @@ -24,7 +24,7 @@
@@ -1904,7 +1904,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.RetryRestClient.html b/docs/module-management.RetryRestClient.html index 3eec1b0be..1e510c1c5 100644 --- a/docs/module-management.RetryRestClient.html +++ b/docs/module-management.RetryRestClient.html @@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@
Parameters:

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.RulesConfigsManager.html b/docs/module-management.RulesConfigsManager.html index befe42be7..e98a4e8a7 100644 --- a/docs/module-management.RulesConfigsManager.html +++ b/docs/module-management.RulesConfigsManager.html @@ -24,7 +24,7 @@
@@ -1317,7 +1317,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.RulesManager.html b/docs/module-management.RulesManager.html index ec01820be..f6f3c3936 100644 --- a/docs/module-management.RulesManager.html +++ b/docs/module-management.RulesManager.html @@ -24,7 +24,7 @@
@@ -1910,7 +1910,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.StatsManager.html b/docs/module-management.StatsManager.html index 3352f9484..1c38a85e4 100644 --- a/docs/module-management.StatsManager.html +++ b/docs/module-management.StatsManager.html @@ -24,7 +24,7 @@
@@ -919,7 +919,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.TenantManager.html b/docs/module-management.TenantManager.html index 366cdfc78..c0e6fbfad 100644 --- a/docs/module-management.TenantManager.html +++ b/docs/module-management.TenantManager.html @@ -24,7 +24,7 @@
@@ -835,7 +835,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.TicketsManager.html b/docs/module-management.TicketsManager.html index 9a8dbf3df..1929bae6b 100644 --- a/docs/module-management.TicketsManager.html +++ b/docs/module-management.TicketsManager.html @@ -24,7 +24,7 @@
@@ -805,7 +805,7 @@
Example

- Generated by JSDoc 3.5.5 on Wed Jul 25 2018 11:56:07 GMT-0300 (-03) using the Minami theme. + Generated by JSDoc 3.5.5 on Thu Aug 09 2018 13:41:30 GMT-0300 (-03) using the Minami theme.
diff --git a/docs/module-management.UsersManager.html b/docs/module-management.UsersManager.html index 8b54ed544..c28b03f38 100644 --- a/docs/module-management.UsersManager.html +++ b/docs/module-management.UsersManager.html @@ -24,7 +24,7 @@
@@ -539,6 +539,80 @@

( + + + + +
Type:
+ + + + + + +

+ + + +
+

(inner) recoveryCodeRegenerationAuth0RestClients :external:RestClient

+ + + + +
+

Provides an abstraction layer for regenerating Guardian recovery codes.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
@@ -762,7 +836,7 @@

createSource:
@@ -980,7 +1054,7 @@

deleteSource:
@@ -1249,7 +1323,7 @@

deleteAllSource:
@@ -1433,7 +1507,7 @@

Source:
@@ -1730,7 +1804,7 @@

getSource:
@@ -1995,7 +2069,7 @@

getAllSource:
@@ -2322,7 +2396,7 @@

getByEmail<
Source:
@@ -2543,7 +2617,7 @@

Source:
@@ -2808,7 +2882,7 @@

+
+ + + +

regenerateRecoveryCode(params, cbopt) → {Promise|undefined}

+ + + + + +
+

Generate new Guardian recovery code.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
params + + +Object + + + + + + + + + + +

Get logs data.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +String + + + + +

User id.

+ +
+ + +
cb + + +function + + + + + + <optional>
+ + + + + +
+

Callback function.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise +| + +undefined + + +
+
+ + + +
+ + + +
+
Example
+ +
management.users.regenerateRecoveryCode("USER_ID", function (err, result) {
+  console.log(result.recovery_code);
+});
+ +
+ +
+ +
@@ -3518,7 +3857,7 @@