Methods
(async) activate(user, activationCode) → {Promise.<void>}
Activates the PCUser with provided activation code. Should be called immediately after
PCUsersManager#importUser if PCUser#isActivated returns false.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
PCUser | Target PCUser object |
activationCode |
string | Activation code |
Throws:
PCError
Returns:
- Type
- Promise.<void>
(async) delete(user, password) → {Promise.<void>}
Removes PCUser from the storage.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
PCUser | Target PCUser object |
password |
string | Rutoken password |
Throws:
PCError
Returns:
- Type
- Promise.<void>
(async) getById(userId) → {Promise.<PCUser>}
Returns PCUser from storage by it's id
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | ID of user |
Throws:
PCError
Returns:
PCUser object
- Type
- Promise.<PCUser>
(async) importUser(source, deviceId) → {Promise.<PCUser>}
Create PCUser by input source (Deep Link value, QR-code value) and deviceId
Parameters:
| Name | Type | Description |
|---|---|---|
source |
string | User data |
deviceId |
number | Device id |
Throws:
PCError
|
PCNetError
Returns:
- Type
- Promise.<PCUser>
(async) listStorage() → {Promise.<Array.<PCUser>>}
List of PCUser in the storage
Throws:
PCError
Returns:
array of PCUser objects
- Type
- Promise.<Array.<PCUser>>
(async) register(user, password) → {Promise.<string>}
Register PCUser on PCSDK Server
Parameters:
| Name | Type | Description |
|---|---|---|
user |
PCUser | Target PCUser object |
password |
string | Rutoken password |
Throws:
PCError
|
PCNetError
Returns:
- Type
- Promise.<string>
(async) store(user, keyName, password)
Stores a new PCUser an existing object in storage.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
PCUser | Target PCUser object |
keyName |
string | Key name |
password |
string | Rutoken password |
Throws:
PCError