Extension qnx.user

qnx.user

Manage the system user information

Methods

addProfile

Create a new profile
Parameters:
Name Type Description
args Object The object defining the details of a profile
Returns:
ID of the last row entered in the profiles table
Type
  • Number

deleteProfile

Delete a profile
Parameters:
Name Type Description
profileId Number The ID of the profile

getActive

Return the current user information
Returns:
The requested user object
Type
  • Object
Example
{
    id: {Number},
    fullName: {String},
    avatar: {String},
}

getAllProfiles

Return all profiles
Returns:
all profiles
Type
  • Array

getProfileDetails

Return a single profile
Parameters:
Name Type Description
profileId Number The ID of the profile
Returns:
A single profile with all the details
Type
  • Object

getSettings

Return all settings for a given profile
Parameters:
Name Type Description
profileId Number The ID of the profile to get the settings for
Returns:
DB query result
Type
  • Array

resetProfilePreferredDevice

Reset the device IDs for all profiles that have the unpaired device as their preferred device
Parameters:
Name Type Description
deviceId String The MAC address of the Bluetooth device

setActive

Set the current user information
Parameters:
Name Type Description
user Object The new user object

setSettings

Insert or update setting(s) for a specific profile
Parameters:
Name Type Description
profileId Number The ID of the profile to get the settings for
settings Object Data specifying the name of the key, its value, and the profile ID

updateProfile

Update the value of a key/value pair of a profile
Parameters:
Name Type Description
profileId Number The ID of the profile
attributes Object The key/value pair(s)