2.1.0 • Published 2 years ago

bedrock-web-account v2.1.0

Weekly downloads
29
License
-
Repository
github
Last release
2 years ago

bedrock-web-account

User account APIs for Bedrock Web Apps

API Reference

Classes

Typedefs

AccountService

This service is used to encapsulate all account based activity for a project.

Kind: global class

new exports.AccountService(config)

ParamTypeDefault
configObject{urls: {base: '/accounts'}}
config.urlsObject{}
config.urls.basestring"/accounts"

accountService.exists(options) ⇒ Boolean

On 200 exists returns true on error if it is a NotFoundError we return false in all other cases we forward the error to the project.

Kind: instance method of AccountService
Returns: Boolean - exists

ParamTypeDefault
optionsObject
options.baseUrlstring"/accounts"
options.emailstring

accountService.create(options) ⇒ Object

Takes a url and an email then creates an account for a user.

Kind: instance method of AccountService

ParamTypeDefault
optionsObject
options.urlstring"/accounts"
options.emailstring

accountService.get(options) ⇒ Object

Takes a url and an id and finds a single account.

Kind: instance method of AccountService
Returns: Object - an account

ParamTypeDefault
optionsObject
options.baseUrlstring"/accounts"
options.idstring

accountService.getAll(options) ⇒ Array

Returns all accounts that match the given query parameters.

Kind: instance method of AccountService
Returns: Array - data

ParamTypeDefaultDescription
optionsObject
options.baseUrlstring"/accounts"The base baseUrl.
options.emailstringThe user's email.
options.afterstringnullAn account's ID.
options.limitnumber10How many accounts to return.

accountService.update(options) ⇒ Void

Updates an account via a series of json patches patches need to be in the:

json patch format we use fast-json for handling json patches.

Kind: instance method of AccountService

ParamTypeDefaultDescription
optionsObject
options.baseUrlstring"/accounts"
options.idstringAn account's id.
options.sequencenumberAn account's sequence number.
config.patchArray.<Object>A JSON patch per RFC6902.

accountService.setStatus(options) ⇒ Void

Takes an id and a status string then changes an account's status.

Kind: instance method of AccountService

ParamTypeDefaultDescription
optionsObject
options.baseUrlstring"/accounts"
options.idstringAn account id.
options.statusStatusTypeone of 3 status types

accountService.getRoles(options) ⇒ Array.<Object>

Takes an account's id and returns all sysRoles for it.

Kind: instance method of AccountService

ParamTypeDefaultDescription
optionsObject
options.baseUrlstring"/accounts"
options.idstringAn account id.

RegisterController

Encapsulates the registration methods.

Kind: global class

new exports.RegisterController(options)

ParamTypeDefault
optionsObject
options.debounceExistsnumber500
options.accountServiceConfigObject{}

registerController.exists()

Exists is a debounced method used to check if an email already exists during registration.

Kind: instance method of RegisterController

registerController.register()

Registers a user then sets registering to false.

Kind: instance method of RegisterController

StatusType : "active" | "disabled" | "deleted"

Kind: global typedef


Copyright (c) 2018-2019 Digital Bazaar, Inc. All rights reserved.

2.1.0

2 years ago

2.0.0

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

5 years ago