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(options) ⇒ Promise
Inserts a new Account. The Account must contain id
.
Kind: static method 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(options) ⇒ Promise
Check for the existence of an account.
Kind: static method 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(options) ⇒ Promise
Retrieves an Account.
Kind: static method 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(options) ⇒ Promise
Retrieves all Accounts matching the given query.
Kind: static method 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(options) ⇒ Promise
Updates an Account.
Kind: static method 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(options) ⇒ Promise
Sets an Account's status.
Kind: static method 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(options) ⇒ Promise
Sets the Account's ResourceRoles from the given resource roles arrays.
Kind: static method 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. |
options.sequence | number | | The sequence number that must match the current record prior to the patch. |
bedrock-account.getCapabilities(options) ⇒ Promise
Gets the capabilities for a given account.
Kind: static method 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. |
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