IndexedDB

This module contains all the methods to store, update, and delete stored objects on the IndexedDB. ALL THE METHODS WILL RETURN UNDEFINED IF SOMETHING WENT WRONG.

Methods

# (inner) dropDatabase() → {void}

The method to drop all the items inside the database, & the database itself
Returns:
Type
void

# (inner) findCredential(credentialId) → {Promise.<CredentialT>}

The method to get a specific credential from the DB
Parameters:
Name Type Description
credentialId number The id of the credential
Returns:
Type
Promise.<CredentialT>

# (inner) forgetCredential(credentialId) → {number}

The method used to remove one credential from the DB
Parameters:
Name Type Description
credentialId number The ID of the credential to delete
Returns:
The id of the credential deleted.
Type
number

# (inner) getCompanies() → {Promise.<Array.<CompanyT>>}

The method to get all the options for the user to select when creating a new credential
Returns:
Type
Promise.<Array.<CompanyT>>

# (inner) getCredentials() → {Promise.<Array.<CredentialT>>}

The method to get all the credentials stored in the indexedDB
Returns:
Type
Promise.<Array.<CredentialT>>

# (inner) getRecentlySeen() → {Promise.<Array.<RecentlySeenT>>}

The method used to get the data for the "recently accessed" table. (Recently accessed credentials, basically).
Returns:
Type
Promise.<Array.<RecentlySeenT>>

# (inner) getUser() → {Promise.<UserT>}

The method to obtain all the user's data
Returns:
Type
Promise.<UserT>

# (inner) initiateDB(user, credentials) → {void}

The method used to prepare the database, and store all the info returned from the api.
Parameters:
Name Type Description
user UserT The info of the authenticated user
credentials Array.<CredentialT> All the credentials that the current user has
Returns:
Type
void

# (inner) putCompanies(companies) → {Promise.<Array.<CompanyT>>}

The method to store / update all the options for companies
Parameters:
Name Type Description
companies Array.<CompanyT> All the companies to store in the DB
Returns:
Type
Promise.<Array.<CompanyT>>

# (inner) putCredential(credential) → {Promise.<CredentialT>}

This method is used to update a single credential on the DB
Parameters:
Name Type Description
credential CredentialT The credential to update in the DB
Returns:
Type
Promise.<CredentialT>

# (inner) putCredentials(credentials) → {Promise.<Array.<CredentialT>>}

This method is used to update many credentials at once
Parameters:
Name Type Description
credentials Array.<CredentialT> The credentials to update in the DB
Returns:
Type
Promise.<Array.<CredentialT>>

# (inner) putRecentlySeen(recent) → {Promise.<Array.<RecentlySeenT>>}

The method to store the response of the api for the recently accessed credentials
Parameters:
Name Type Description
recent Array.<RecentlySeenT> The info returned from the api of the recently accessed credentials
Returns:
Type
Promise.<Array.<RecentlySeenT>>

# (inner) putUser(user) → {Promise.<UserT>}

The method to update user's info. It returns a promise of the updated user object
Parameters:
Name Type Description
user UserT The new user to store in the DB
Returns:
Type
Promise.<UserT>