bedrock-account
User accounts for Bedrock Applications
API Reference
Modules
- bedrock-account
Typedefs
- Actor :
Object
| null
| undefined
An Actor may be an Object, undefined or null.
bedrock-account
bedrock-account.insert ⇒ Promise
Inserts a new Account. The Account must contain id
.
Kind: static property of bedrock-account
Returns: Promise
- Resolves to the database account record.
Param | Type | Description |
---|
options | Object | The options to use. |
options.actor | Actor | The actor or capabilities for performing the action. |
options.account | Object | The account containing at least the minimum required data. |
[options.meta] | Object | The meta information to include. |
bedrock-account.exists ⇒ Promise
Check for the existence of an account.
Kind: static property of bedrock-account
Returns: Promise
- Resolves to a boolean indicating account existence.
Param | Type | Default | Description |
---|
options | Object | | The options to use. |
options.actor | Actor | | The actor or capabilities for performing the action. |
[options.id] | string | | The ID of the account to check. |
[options.email] | string | | The email address for the account. |
[options.status] | string | "active" | The status to check for (options: 'active', deleted'). |
bedrock-account.get ⇒ Promise
Retrieves an Account.
Kind: static property of bedrock-account
Returns: Promise
- Resolves to {account, meta}
.
Param | Type | Description |
---|
options | Object | The options to use. |
options.actor | Actor | The actor or capabilities for performing the action. |
options.id | string | The ID of the Account to retrieve. |
bedrock-account.getAll ⇒ Promise
Retrieves all Accounts matching the given query.
Kind: static property of bedrock-account
Returns: Promise
- Resolves to the records that matched the query.
Param | Type | Default | Description |
---|
options | Object | | The options to use. |
options.actor | Actor | | The actor or capabilities for performing the action. |
[options.query] | Object | {} | The query to use. |
[options.fields] | Object | {} | The fields to include or exclude. |
[options.options] | Object | {} | The options (eg: 'sort', 'limit'). |
bedrock-account.update ⇒ Promise
Updates an Account.
Kind: static property of bedrock-account
Returns: Promise
- Resolves once the operation completes.
Param | Type | Description |
---|
options | Object | The options to use. |
options.actor | Actor | The actor or capabilities to perform the action. |
options.id | string | The ID of the account to update. |
options.patch | Array | A JSON patch for performing the update. |
options.sequence | number | The sequence number that must match the current record prior to the patch. |
bedrock-account.setStatus ⇒ Promise
Sets an Account's status.
Kind: static property of bedrock-account
Returns: Promise
- Resolves once the operation completes.
Param | Type | Description |
---|
options | Object | The options to use. |
options.actor | Actor | The actor or capabilities to perform the action. |
options.id | string | The Account ID. |
options.status | string | The status. |
bedrock-account.updateRoles ⇒ Promise
Sets the Account's ResourceRoles from the given resource roles arrays.
Kind: static property of bedrock-account
Returns: Promise
- Resolves once the operation completes.
Param | Type | Default | Description |
---|
options | Object | | The options to use. |
options.actor | Actor | | The actor or capabilities to perform the action. |
options.id | string | | The ID of the Account that is to be updated. |
[options.add] | Array | [] | The resourceRoles to add. |
[options.remove] | Array | [] | The resourceRoles to remove. |
bedrock-account.getCapabilities ⇒ Promise
Gets the capabilities for a given account.
Kind: static property of bedrock-account
Returns: Promise
- Resolves to an actor
once the operation completes.
Param | Type | Description |
---|
options | Object | The options to use. |
options.id | string | The ID of the Account to get the capabilities for. |
[options.identities] | Array | A set of identity IDs to restrict capabitilies to; if unspecified, all identity capabilities will be included. |
bedrock-account.manageIdentity ⇒ Promise
Assumes management over the given identity.
Note This method requires the capability to update the identity. This
means that the actor must have authenticated as that identity (i.e. actor
must include the capability to update the identity).
Kind: static property of bedrock-account
Returns: Promise
- Resolves once the operation completes.
Param | Type | Description |
---|
options | Object | The options to use. |
options.actor | Actor | The actor or capabilities to perform the action. |
options.accountId | string | The ID of the account to make the manager of an identity. |
options.identityId | string | The ID of the identity to manage. |
bedrock-account.getManagerId ⇒ Promise
Retrieves the ID of the Account that manages the given identity or null
if there is no managing account set.
Kind: static property of bedrock-account
Returns: Promise
- Resolves to the account ID or null
.
Param | Type | Description |
---|
options | Object | The options to use. |
options.actor | Actor | The actor or capabilities for performing the action. |
options.identity | string | The ID of the identity to get the managing Account for. |
bedrock-account.generateResource(options) ⇒ Object
Inserts a specified ID into a role's resource restriction array. The given
role is copied and the given ID is inserted into the new role's resource
restriction array.
Kind: static method of bedrock-account
Returns: Object
- The transformed role.
Param | Type | Description |
---|
options | Object | The options to use. |
options.role | Object | The role to transform. |
options.id | string | The ID to insert into the resource array. |
Actor : Object
| null
| undefined
An Actor may be an Object, undefined or null.
Kind: global typedef