Constructor
new ConnectionsManager(options)
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The client options.
|
Members
(inner) auth0RestClient :external:RestClient
Provides an abstraction layer for performing CRUD operations on Auth0 Connections.
- Source:
Type:
(inner) clientOptions :Object
Options object for the Rest Client instance.
- Source:
Type:
-
Object
Methods
create(data, cbopt) → {Promise|undefined}
Create a new connection.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Object
|
Connection data object. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.connections.create(data, function (err) {
if (err) {
// Handle error.
}
// Conection created.
});
delete(params, cbopt) → {Promise|undefined}
Delete an existing connection.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
Object
|
Connection parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.connections.delete({ id: CONNECTION_ID }, function (err) {
if (err) {
// Handle error.
}
// Conection deleted.
});
get(params, cbopt) → {Promise|undefined}
Get an Auth0 connection.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
Object
|
Connection parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.connections.get({ id: CONNECTION_ID }, function (err, connection) {
if (err) {
// Handle error.
}
console.log(connection);
});
getAll(cbopt) → {Promise|undefined}
Get all connections.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.connections.getAll(function (err, connections) {
console.log(connections.length);
});
update(params, data, cbopt) → {Promise|undefined}
Update an existing connection.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
Object
|
Conneciton parameters.
|
|||||||
data |
Object
|
Updated connection data. |
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var data = { name: 'newConnectionName' };
var params = { id: CONNECTION_ID };
management.connections.update(params, data, function (err, connection) {
if (err) {
// Handle error.
}
console.log(connection.name); // 'newConnectionName'
});