account
Stored account management.
A number of account records can be stored into a platform-specific storage. One of them can be marked as current, which will cause it to be used as a default account for methods that need one.
In Node.js, you can manage stored accounts using the Dasha CLI.
Table of contents
Interfaces
Functions
deleteAccount
▸ deleteAccount(name
: string, options?
: { quiet?
: boolean }): Promise<void>
Delete a stored account.
Parameters:
Name | Type | Description |
---|---|---|
name | string | - |
options? | object | - |
options.quiet? | boolean | if true, does not throw if no account was found |
Returns: Promise<void>
getAccount
▸ getAccount(name
: string): Promise<Account>
Get an account by its name. Throws if no account was found.
Parameters:
Name | Type |
---|---|
name | string |
Returns: Promise<Account>
getCurrentAccountName
▸ getCurrentAccountName(): Promise<string | undefined>
Get the name of a stored account that is marked as current, or undefined
if no one is.
Returns: Promise<string | undefined>
listAccounts
▸ listAccounts(): Promise<{ [name: string]: Account; }>
List all stored accounts.
Returns: Promise<{ [name: string]: Account; }>
a dictionary object storing accounts by their name
renameAccount
▸ renameAccount(oldName
: string, newName
: string, options?
: { overwrite?
: boolean }): Promise<void>
Rename a stored account.
Parameters:
Name | Type | Description |
---|---|---|
oldName | string | - |
newName | string | - |
options? | object | - |
options.overwrite? | boolean | if true, does not throw if the new name is taken. |
Returns: Promise<void>
setAccount
▸ setAccount(name
: string, account
: Account, options?
: { overwrite?
: boolean }): Promise<void>
Store an account under a name.
Parameters:
Name | Type | Description |
---|---|---|
name | string | - |
account | Account | - |
options? | object | - |
options.overwrite? | boolean | if true, does not throw if the name is taken |
Returns: Promise<void>
setCurrentAccountName
▸ setCurrentAccountName(name
: string | undefined): Promise<void>
Mark a stored account as current. Pass undefined
to unset a current account altogether.
Parameters:
Name | Type |
---|---|
name | string | undefined |
Returns: Promise<void>