Comparing version
{ | ||
"name": "auth0", | ||
"version": "2.35.0", | ||
"version": "2.35.1", | ||
"description": "SDK for Auth0 API v2", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -121,2 +121,4 @@ # node-auth0 | ||
``` | ||
## Typescript | ||
The types for this library are currently maintained by the community at [Definitely Typed](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/auth0). The team is planning taking ownership of this library as discussed in https://github.com/auth0/node-auth0/issues/572. After the team has taken ownership we will remove this net from the Readme. | ||
@@ -123,0 +125,0 @@ ## What is Auth0? |
@@ -56,3 +56,3 @@ var ArgumentError = require('rest-facade').ArgumentError; | ||
var auth0RestClient = new Auth0RestClient( | ||
options.baseUrl + '/actions/actions/:action_id', | ||
options.baseUrl + '/actions/actions/:id', | ||
clientOptions, | ||
@@ -64,3 +64,3 @@ options.tokenProvider | ||
var actionsDeployRestClient = new Auth0RestClient( | ||
options.baseUrl + '/actions/actions/:action_id/deploy', | ||
options.baseUrl + '/actions/actions/:id/deploy', | ||
clientOptions, | ||
@@ -72,3 +72,3 @@ options.tokenProvider | ||
var actionsTestRestClient = new Auth0RestClient( | ||
options.baseUrl + '/actions/actions/:action_id/test', | ||
options.baseUrl + '/actions/actions/:id/test', | ||
clientOptions, | ||
@@ -108,3 +108,3 @@ options.tokenProvider | ||
var actionVersionRestClient = new Auth0RestClient( | ||
options.baseUrl + '/actions/actions/:action_id/versions/:version_id', | ||
options.baseUrl + '/actions/actions/:id/versions/:version_id', | ||
clientOptions, | ||
@@ -116,3 +116,3 @@ options.tokenProvider | ||
var deployActionVersionRestClient = new Auth0RestClient( | ||
options.baseUrl + '/actions/actions/:action_id/versions/:version_id/deploy', | ||
options.baseUrl + '/actions/actions/:id/versions/:version_id/deploy', | ||
clientOptions, | ||
@@ -328,3 +328,3 @@ options.tokenProvider | ||
* @example | ||
* management.actions.get({ action_id: ACTION_ID }, function (err, action) { | ||
* management.actions.get({ id: ACTION_ID }, function (err, action) { | ||
* if (err) { | ||
@@ -338,3 +338,3 @@ * // Handle error. | ||
* @param {Object} params Action parameters. | ||
* @param {String} params.action_id Action ID. | ||
* @param {String} params.id Action ID. | ||
* @param {Function} [cb] Callback function. | ||
@@ -344,4 +344,17 @@ * | ||
*/ | ||
utils.wrapPropertyMethod(ActionsManager, 'get', 'resource.get'); | ||
ActionsManager.prototype.get = function(params, cb) { | ||
params = params || {}; | ||
if (params.action_id) { | ||
params.id = params.action_id; | ||
delete params.action_id; | ||
} | ||
if (cb && cb instanceof Function) { | ||
return this.resource.get(params, cb); | ||
} | ||
return this.resource.get(params); | ||
}; | ||
/** | ||
@@ -355,3 +368,3 @@ * Update an existing action. | ||
* var data = { name: 'new-name' }; | ||
* var params = { action_id: ACTION_ID }; | ||
* var params = { id: ACTION_ID }; | ||
* | ||
@@ -377,3 +390,3 @@ * // Using auth0 instance. | ||
* @param {Object} params Action parameters. | ||
* @param {String} params.action_id Action ID. | ||
* @param {String} params.id Action ID. | ||
* @param {Object} data Updated action data. | ||
@@ -384,4 +397,17 @@ * @param {Function} [cb] Callback function. | ||
*/ | ||
utils.wrapPropertyMethod(ActionsManager, 'update', 'resource.patch'); | ||
ActionsManager.prototype.update = function(params, data, cb) { | ||
params = params || {}; | ||
if (params.action_id) { | ||
params.id = params.action_id; | ||
delete params.action_id; | ||
} | ||
if (cb && cb instanceof Function) { | ||
return this.resource.patch(params, data, cb); | ||
} | ||
return this.resource.patch(params, data); | ||
}; | ||
/** | ||
@@ -394,3 +420,3 @@ * Delete an existing action. Deleting an Action deletes all the action's versions | ||
* @example | ||
* management.actions.delete({ action_id: ACTION_ID }, function (err) { | ||
* management.actions.delete({ id: ACTION_ID }, function (err) { | ||
* if (err) { | ||
@@ -404,3 +430,3 @@ * // Handle error. | ||
* @param {Object} params Action parameters. | ||
* @param {String} params.action_id Action ID. | ||
* @param {String} params.id Action ID. | ||
* @param {Function} [cb] Callback function. | ||
@@ -410,4 +436,17 @@ * | ||
*/ | ||
utils.wrapPropertyMethod(ActionsManager, 'delete', 'resource.delete'); | ||
ActionsManager.prototype.delete = function(params, cb) { | ||
params = params || {}; | ||
if (params.action_id) { | ||
params.id = params.action_id; | ||
delete params.action_id; | ||
} | ||
if (cb && cb instanceof Function) { | ||
return this.resource.delete(params, cb); | ||
} | ||
return this.resource.delete(params); | ||
}; | ||
/** | ||
@@ -420,3 +459,3 @@ * test an Action. | ||
* @example | ||
* var params = { action_id: ACTION_ID}; | ||
* var params = { id: ACTION_ID}; | ||
* management.actions.testAction(params, payload, function (err) { | ||
@@ -430,3 +469,3 @@ * if (err) { | ||
* @param {Object} params Action parameters. | ||
* @param {String} params.action_id Action ID. | ||
* @param {String} params.id Action ID. | ||
* @param {Object} payload Payload represents the entire structure necessary to test a particular trigger | ||
@@ -441,2 +480,7 @@ * @param {Function} [cb] Callback function. | ||
if (params.action_id) { | ||
params.id = params.action_id; | ||
delete params.action_id; | ||
} | ||
if (cb && cb instanceof Function) { | ||
@@ -457,3 +501,3 @@ return this.actionsTest.create(params, payload, cb); | ||
* @example | ||
* var params = { action_id: ACTION_ID}; | ||
* var params = { id: ACTION_ID}; | ||
* mangement.actions.deploy(params, function (err, actionVersion) { | ||
@@ -467,3 +511,3 @@ * if (err) { | ||
* @param {Object} params Action parameters. | ||
* @param {String} params.action_id Action ID. | ||
* @param {String} params.id Action ID. | ||
* @param {Function} [cb] Callback function. | ||
@@ -476,2 +520,7 @@ * | ||
if (params.action_id) { | ||
params.id = params.action_id; | ||
delete params.action_id; | ||
} | ||
if (cb && cb instanceof Function) { | ||
@@ -501,3 +550,3 @@ return this.actionsDeploy.create(params, {}, cb); | ||
* | ||
* management.actions.getVersions({ action_id: ACTION_ID }, function (err, actionVersions) { | ||
* management.actions.getVersions({ id: ACTION_ID }, function (err, actionVersions) { | ||
* console.log(actionVersions.length); | ||
@@ -509,3 +558,3 @@ * }); | ||
* @param {Number} [params.page] Page number, zero indexed. | ||
* @param {String} [params.action_id] Action ID. | ||
* @param {String} [params.id] Action ID. | ||
* @param {Function} [cb] Callback function. | ||
@@ -518,2 +567,7 @@ * | ||
if (params.action_id) { | ||
params.id = params.action_id; | ||
delete params.action_id; | ||
} | ||
if (cb && cb instanceof Function) { | ||
@@ -533,3 +587,3 @@ return this.actionVersions.getAll(params, cb); | ||
* @example | ||
* var params = { action_id: ACTION_ID, version_id: VERSION_ID }; | ||
* var params = { id: ACTION_ID, version_id: VERSION_ID }; | ||
* management.actions.getVersion(params, function (err, actionVersion) { | ||
@@ -543,3 +597,3 @@ * if (err) { | ||
* @param {Object} params Action parameters. | ||
* @param {String} params.action_id Action ID. | ||
* @param {String} params.id Action ID. | ||
* @param {String} params.version_id ActionVersion ID. | ||
@@ -553,2 +607,7 @@ * @param {Function} [cb] Callback function. | ||
if (params.action_id) { | ||
params.id = params.action_id; | ||
delete params.action_id; | ||
} | ||
if (cb && cb instanceof Function) { | ||
@@ -571,3 +630,3 @@ return this.actionVersions.get(params, cb); | ||
* @example | ||
* var params = { action_id: ACTION_ID }; | ||
* var params = { id: ACTION_ID }; | ||
* management.actions.createActionVersion(params, data, function (err, actionVersion) { | ||
@@ -580,3 +639,3 @@ * if (err) { | ||
* @param {Object} params Action parameters. | ||
* @param {String} params.action_id Action ID. | ||
* @param {String} params.id Action ID. | ||
* @param {Object} data ActionVersion parameters. | ||
@@ -590,2 +649,7 @@ * @param {Function} [cb] Callback function. | ||
if (params.action_id) { | ||
params.id = params.action_id; | ||
delete params.action_id; | ||
} | ||
if (cb && cb instanceof Function) { | ||
@@ -605,3 +669,3 @@ return this.actionVersions.create(params, data, cb); | ||
* @example | ||
* var params = { action_id: ACTION_ID, version_id: VERSION_ID }; | ||
* var params = { id: ACTION_ID, version_id: VERSION_ID }; | ||
* management.actions.deployVersion(params, function (err, actionVersion) { | ||
@@ -615,3 +679,3 @@ * if (err) { | ||
* @param {Object} params Action parameters. | ||
* @param {String} params.action_id Action ID. | ||
* @param {String} params.id Action ID. | ||
* @param {String} params.version_id Action ID. | ||
@@ -625,2 +689,7 @@ * @param {Function} [cb] Callback function. | ||
if (params.action_id) { | ||
params.id = params.action_id; | ||
delete params.action_id; | ||
} | ||
if (cb && cb instanceof Function) { | ||
@@ -649,3 +718,3 @@ return this.actionVersionDeploy.create(params, {}, cb); | ||
* @param {Object} params Action Execution parameters. | ||
* @param {String} params.execution_id Action Execution ID. | ||
* @param {String} params.id Action Execution ID. | ||
* @param {Function} [cb] Callback function. | ||
@@ -652,0 +721,0 @@ * |
@@ -76,3 +76,3 @@ var ArgumentError = require('rest-facade').ArgumentError; | ||
* @example | ||
* management.branding.updateSettings(data, function (err, branding) { | ||
* management.branding.updateSettings(params, data, function (err, branding) { | ||
* if (err) { | ||
@@ -86,3 +86,3 @@ * // Handle error. | ||
* | ||
* @param {Object} params Branding parameters. | ||
* @param {Object} params Branding parameters (leavy empty). | ||
* @param {Object} data Updated branding data. | ||
@@ -150,3 +150,3 @@ * @param {Function} [cb] Callback function. | ||
* @example | ||
* management.branding.setUniversalLoginTemplate({ template: "a template" }, function (err) { | ||
* management.branding.setUniversalLoginTemplate(params, data, function (err) { | ||
* if (err) { | ||
@@ -153,0 +153,0 @@ * // Handle error. |
@@ -80,3 +80,3 @@ var ArgumentError = require('rest-facade').ArgumentError; | ||
* @example | ||
* management.prompts.updateSettings(data, function (err, prompts) { | ||
* management.prompts.updateSettings(params, data, function (err, prompts) { | ||
* if (err) { | ||
@@ -83,0 +83,0 @@ * // Handle error. |
448072
6%47
2.17%13098
0.41%167
1.21%