Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
luisrudge authored Aug 8, 2018
2 parents 64f4b23 + a990594 commit af61b76
Show file tree
Hide file tree
Showing 73 changed files with 5,910 additions and 886 deletions.
39 changes: 39 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: 2
jobs:
build-and-test:
docker:
- image: circleci/node:6.14.3-browsers
environment:
LANG: en_US.UTF-8
steps:
- checkout
- run:
name: Update Yarn
command: 'sudo npm update -g yarn'
- restore-cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Install Dependencies
command: yarn install --pure-lockfile
- save-cache:
name: Save Yarn Package Cache
key: yarn-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run:
name: Check
command: yarn check
- run:
name: Tests
command: yarn test:ci
- run:
name: Generate Coverage
command: yarn test:coverage

workflows:
version: 2
build-test-report:
jobs:
- build-and-test
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Change Log

## [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)

**Added**

* Added Pagination Docs for a Client Grants, Resouce Servers and Rules [\#282](https://github.com/auth0/node-auth0/pull/282) ([cocojoe](https://github.com/cocojoe))
* Added rules config methods [\#227](https://github.com/auth0/node-auth0/pull/227) ([dctoon](https://github.com/dctoon))

**Fixed**

* Get access token before importing users [\#267](https://github.com/auth0/node-auth0/pull/267) ([Floppy](https://github.com/Floppy))

## [v2.10.0](https://github.com/auth0/node-auth0/tree/v2.10.0) (2018-05-29)

[Full Changelog](https://github.com/auth0/node-auth0/compare/v2.9.3...v2.10.0)
Expand Down
16 changes: 0 additions & 16 deletions circle.yml

This file was deleted.

4 changes: 2 additions & 2 deletions docs/RetryRestClient.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/auth_DatabaseAuthenticator.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/auth_OAuthAuthenticator.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/auth_PasswordlessAuthenticator.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/auth_TokensManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/auth_UsersManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/auth_index.js.html

Large diffs are not rendered by default.

114 changes: 107 additions & 7 deletions docs/external-RestClient.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/management_BlacklistedTokensManager.js.html

Large diffs are not rendered by default.

25 changes: 20 additions & 5 deletions docs/management_ClientGrantsManager.js.html

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/management_ClientsManager.js.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/management_ConnectionsManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/management_DeviceCredentialsManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/management_EmailProviderManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/management_EmailTemplatesManager.js.html

Large diffs are not rendered by default.

79 changes: 41 additions & 38 deletions docs/management_JobsManager.js.html

Large diffs are not rendered by default.

29 changes: 24 additions & 5 deletions docs/management_LogsManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/management_ManagementTokenProvider.js.html

Large diffs are not rendered by default.

24 changes: 19 additions & 5 deletions docs/management_ResourceServersManager.js.html

Large diffs are not rendered by default.

188 changes: 188 additions & 0 deletions docs/management_RulesConfigsManager.js.html

Large diffs are not rendered by default.

24 changes: 19 additions & 5 deletions docs/management_RulesManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/management_StatsManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/management_TenantManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/management_TicketsManager.js.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/management_UsersManager.js.html

Large diffs are not rendered by default.

229 changes: 199 additions & 30 deletions docs/management_index.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-auth.AuthenticationClient.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-auth.DatabaseAuthenticator.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-auth.OAuthAuthenticator.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-auth.PasswordlessAuthenticator.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-auth.TokensManager.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-auth.UsersManager.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-auth.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-management.BlacklistedTokensManager.html

Large diffs are not rendered by default.

319 changes: 307 additions & 12 deletions docs/module-management.ClientGrantsManager.html

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/module-management.ClientsManager.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/module-management.ConnectionsManager.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-management.DeviceCredentialsManager.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-management.EmailProviderManager.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-management.EmailTemplatesManager.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/module-management.JobsManager.html

Large diffs are not rendered by default.

337 changes: 332 additions & 5 deletions docs/module-management.LogsManager.html

Large diffs are not rendered by default.

2,702 changes: 2,168 additions & 534 deletions docs/module-management.ManagementClient.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-management.ManagementTokenProvider.html

Large diffs are not rendered by default.

161 changes: 154 additions & 7 deletions docs/module-management.ResourceServersManager.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-management.RetryRestClient.html

Large diffs are not rendered by default.

1,326 changes: 1,326 additions & 0 deletions docs/module-management.RulesConfigsManager.html

Large diffs are not rendered by default.

161 changes: 154 additions & 7 deletions docs/module-management.RulesManager.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-management.StatsManager.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-management.TenantManager.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-management.TicketsManager.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/module-management.UsersManager.html

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions docs/module-management.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module-utils.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/utils.js.html

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{
"name": "auth0",
"version": "2.10.0",
"version": "2.11.0",
"description": "SDK for Auth0 API v2",
"main": "src/index.js",
"files": [
"src"
],
"files": ["src"],
"scripts": {
"test": "mocha -R spec $(find ./test -name *.tests.js)",
"test:ci":
Expand Down Expand Up @@ -43,7 +41,7 @@
"codecov": "^2.2.0",
"husky": "^0.14.3",
"istanbul": "^0.4.0",
"jsdoc": "^3.4.0",
"jsdoc": "^3.5.5",
"json-loader": "^0.5.4",
"minami": "^1.2.3",
"mocha": "^2.2.4",
Expand Down
21 changes: 18 additions & 3 deletions src/management/ClientGrantsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,27 @@ utils.wrapPropertyMethod(ClientGrantsManager, 'create', 'resource.create');
* @method getAll
* @memberOf module:management.ClientGrantsManager.prototype
*
* @example
* management.clientGrants.getAll(function (err, grants) {
* @example <caption>
* This method takes an optional object as first argument that may be used to
* specify pagination settings. If pagination options are not present,
* the first page of a limited number of results will be returned.
* </caption>
*
* // Pagination settings.
* var params = {
* per_page: 10,
* page: 0
* };
*
*
* management.clientGrants.getAll(params, function (err, grants) {
* console.log(grants.length);
* });
*
* @param {Function} [cb] Callback function.
* @param {Object} [params] Client Grants parameters.
* @param {Number} [params.per_page] Number of results per page.
* @param {Number} [params.page] Page number, zero indexed.
* @param {Function} [cb] Callback function.
*
* @return {Promise|undefined}
*/
Expand Down
10 changes: 5 additions & 5 deletions src/management/ClientsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,16 @@ utils.wrapPropertyMethod(ClientsManager, 'create', 'resource.create');
* // Pagination settings.
* var params = {
* per_page: 10,
* page: 2
* page: 0
* };
*
* management.clients.getAll(function (err, clients) {
* management.clients.getAll(params, function (err, clients) {
* console.log(clients.length);
* });
*
* @param {Object} [params] Clients params.
* @param {Number} [params.per_page] Number of clients per page.
* @param {Number} [params.page] Page number.
* @param {Object} [params] Clients parameters.
* @param {Number} [params.per_page] Number of results per page.
* @param {Number} [params.page] Page number, zero indexed.
* @param {Function} [cb] Callback function.
*
* @return {Promise|undefined}
Expand Down
8 changes: 4 additions & 4 deletions src/management/ConnectionsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,16 @@ utils.wrapPropertyMethod(ConnectionsManager, 'create', 'resource.create');
* // Pagination settings.
* var params = {
* per_page: 10,
* page: 2
* page: 0
* };
*
* management.connections.getAll(function (err, connections) {
* management.connections.getAll(params, function (err, connections) {
* console.log(connections.length);
* });
*
* @param {Object} [params] Connections params.
* @param {Number} [params.per_page] Number of connections per page.
* @param {Number} [params.page] Page number.
* @param {Number} [params.per_page] Number of results per page.
* @param {Number} [params.page] Page number, zero indexed.
* @param {Function} [cb] Callback function.
*
* @return {Promise|undefined}
Expand Down
96 changes: 96 additions & 0 deletions src/management/GuardianManager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
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;
20 changes: 17 additions & 3 deletions src/management/ResourceServersManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,26 @@ utils.wrapPropertyMethod(ResourceServersManager, 'create', 'resource.create');
* @method getAll
* @memberOf module:management.ResourceServersManager.prototype
*
* @example
* management.resourceServers.getAll(function (err, resourceServers) {
* @example <caption>
* This method takes an optional object as first argument that may be used to
* specify pagination settings. If pagination options are not present,
* the first page of a limited number of results will be returned.
* </caption>
*
* // Pagination settings.
* var params = {
* per_page: 10,
* page: 0
* };
*
* management.resourceServers.getAll(params, function (err, resourceServers) {
* console.log(resourceServers.length);
* });
*
* @param {Function} [cb] Callback function.
* @param {Object} [params] Resource Servers parameters.
* @param {Number} [params.per_page] Number of results per page.
* @param {Number} [params.page] Page number, zero indexed.
* @param {Function} [cb] Callback function.
*
* @return {Promise|undefined}
*/
Expand Down
20 changes: 17 additions & 3 deletions src/management/RulesManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,26 @@ utils.wrapPropertyMethod(RulesManager, 'create', 'resource.create');
* @method getAll
* @memberOf module:management.RulesManager.prototype
*
* @example
* management.rules.getAll(function (err, rules) {
* @example <caption>
* This method takes an optional object as first argument that may be used to
* specify pagination settings. If pagination options are not present,
* the first page of a limited number of results will be returned.
* </caption>
*
* // Pagination settings.
* var params = {
* per_page: 10,
* page: 0
* };
*
* management.rules.getAll(params, function (err, rules) {
* console.log(rules.length);
* });
*
* @param {Function} [cb] Callback function.
* @param {Object} [params] Rules parameters.
* @param {Number} [params.per_page] Number of results per page.
* @param {Number} [params.page] Page number, zero indexed.
* @param {Function} [cb] Callback function.
*
* @return {Promise|undefined}
*/
Expand Down
Loading

0 comments on commit af61b76

Please sign in to comment.