Class: Client
client.Client
Client-side interface for Client-Server communication. Manages serialization, authentication and some state like current session and account.
Hierarchy
-
↳
Client
Constructors
constructor
• new Client(state
, sender
, hook?
)
Parameters
Name | Type |
---|---|
state |
ClientState |
sender |
Sender |
hook? |
(req : Request , res : null | Response , err : null | Err ) => void |
Overrides
Defined in
Properties
handlerDefinitions
• handlerDefinitions: HandlerDefinition
[]
Inherited from
Defined in
online
• online: boolean
= true
Defined in
state
• state: ClientState
Accessors
session
• get
session(): null
| Session
The current session
Returns
null
| Session
Defined in
Methods
acceptInvite
▸ acceptInvite(_invite
):
PromiseWithProgress
<void
>
Accept an Invite
authentication_required
Requires the authenticated account to be the recipient of the invite.
Parameters
Name | Type |
---|---|
_invite |
Invite |
Returns
PromiseWithProgress
<void
>
Inherited from
Defined in
call
▸ call(method
, params?
, progress?
):
Promise
<Response
>
Generic method for making an RPC call
Parameters
Name | Type |
---|---|
method |
string |
params? |
any [] |
progress? |
RequestProgress |
Returns
Promise
<Response
>
Defined in
completeAuthRequest
▸ completeAuthRequest(_params
):
PromiseWithProgress
<CompleteAuthRequestResponse
>
Parameters
Name | Type |
---|---|
_params |
CompleteAuthRequestParams |
Returns
PromiseWithProgress
<CompleteAuthRequestResponse
>
Inherited from
Defined in
completeCreateSession
▸ completeCreateSession(_params
):
PromiseWithProgress
<Session
>
Create new Session which can be used to authenticate future request
Parameters
Name | Type |
---|---|
_params |
CompleteCreateSessionParams |
Returns
Inherited from
Defined in
completeRegisterAuthenticator
▸ completeRegisterAuthenticator(_params
):
PromiseWithProgress
<CompleteRegisterMFAuthenticatorResponse
>
Parameters
Name | Type |
---|---|
_params |
CompleteRegisterMFAuthenticatorParams |
Returns
PromiseWithProgress
<CompleteRegisterMFAuthenticatorResponse
>
Inherited from
API.completeRegisterAuthenticator
Defined in
createAccount
▸ createAccount(_params
):
PromiseWithProgress
<Account
>
Create a new Account
Parameters
Name | Type |
---|---|
_params |
CreateAccountParams |
Returns
Inherited from
Defined in
createAttachment
▸ createAttachment(_attachment
):
PromiseWithProgress
<string
>
Parameters
Name | Type |
---|---|
_attachment |
Attachment |
Returns
PromiseWithProgress
<string
>
Inherited from
Defined in
createKeyStoreEntry
▸ createKeyStoreEntry(_params
):
PromiseWithProgress
<KeyStoreEntry
>
Parameters
Name | Type |
---|---|
_params |
CreateKeyStoreEntryParams |
Returns
PromiseWithProgress
<KeyStoreEntry
>
Inherited from
Defined in
createOrg
▸ createOrg(_params
):
PromiseWithProgress
<Org
>
Create a new Org
authentication_required
Parameters
Name | Type |
---|---|
_params |
Org |
Returns
Inherited from
Defined in
createVault
▸ createVault(_vault
):
PromiseWithProgress
<Vault
>
Create a new vault
authentication_required
Requires the OrgRole.Admin role on the associated organization
Parameters
Name | Type |
---|---|
_vault |
Vault |
Returns
Inherited from
Defined in
deleteAccount
▸ deleteAccount():
PromiseWithProgress
<void
>
Delete current account
Returns
PromiseWithProgress
<void
>
Inherited from
Defined in
deleteAttachment
▸ deleteAttachment(_attachment
):
PromiseWithProgress
<void
>
Parameters
Name | Type |
---|---|
_attachment |
DeleteAttachmentParams |
Returns
PromiseWithProgress
<void
>
Inherited from
Defined in
deleteAuthenticator
▸ deleteAuthenticator(_id
):
PromiseWithProgress
<void
>
Parameters
Name | Type |
---|---|
_id |
string |
Returns
PromiseWithProgress
<void
>
Inherited from
Defined in
deleteKeyStoreEntry
▸ deleteKeyStoreEntry(_params
): Promise
<void
>
Parameters
Name | Type |
---|---|
_params |
string |
Returns
Promise
<void
>
Inherited from
Defined in
deleteLegacyAccount
▸ deleteLegacyAccount():
PromiseWithProgress
<void
>
Returns
PromiseWithProgress
<void
>
Inherited from
Defined in
deleteOrg
▸ deleteOrg(_id
):
PromiseWithProgress
<void
>
Parameters
Name | Type |
---|---|
_id |
string |
Returns
PromiseWithProgress
<void
>
Inherited from
Defined in
deleteVault
▸ deleteVault(_id
):
PromiseWithProgress
<void
>
Delete the Vault with the given id
authentication_required
Requires at least the OrgRole.Admin role on the organization the vault belongs to. Private vaults cannot be deleted.
Parameters
Name | Type |
---|---|
_id |
string |
Returns
PromiseWithProgress
<void
>
Inherited from
Defined in
getAccount
▸ getAccount():
PromiseWithProgress
<Account
>
Get the Account associated with the current session
authentication_required
Returns
Inherited from
Defined in
getAttachment
▸ getAttachment(_attachment
):
PromiseWithProgress
<Attachment
>
Parameters
Name | Type |
---|---|
_attachment |
GetAttachmentParams |
Returns
PromiseWithProgress
<Attachment
>
Inherited from
Defined in
getAuthInfo
▸ getAuthInfo(): Promise
<AuthInfo
>
Get the AuthInfo for the current account
Returns
Promise
<AuthInfo
>
Inherited from
Defined in
getInvite
▸ getInvite(_params
):
PromiseWithProgress
<Invite
>
Get an Invite.
authentication_required
Requires the authenticated account to either be an OrgRole.Owner of the associated organization or the recipient of the invite.
Parameters
Name | Type |
---|---|
_params |
GetInviteParams |
Returns
Inherited from
Defined in
getKeyStoreEntry
▸ getKeyStoreEntry(_params
):
Promise
<KeyStoreEntry
>
Parameters
Name | Type |
---|---|
_params |
GetKeyStoreEntryParams |
Returns
Promise
<KeyStoreEntry
>
Inherited from
Defined in
getLegacyData
▸ getLegacyData(_params
):
PromiseWithProgress
<PBES2Container
>
Parameters
Name | Type |
---|---|
_params |
GetLegacyDataParams |
Returns
PromiseWithProgress
<PBES2Container
>
Inherited from
Defined in
getOrg
▸ getOrg(_id
):
PromiseWithProgress
<Org
>
Get the Org for a given id
.
authentication_required
Requires the authenticated account to be a member of the given organization
Parameters
Name | Type |
---|---|
_id |
string |
Returns
Inherited from
Defined in
getVault
▸ getVault(_id
):
PromiseWithProgress
<Vault
>
Get the Vault with the given id
authentiation_required
If the vault belongs to an organization, the authenticated account needs to be assigned to the given vault either directly or through a Group. Otherwise, only access to the accounts private vault is allowed.
Parameters
Name | Type |
---|---|
_id |
string |
Returns
Inherited from
Defined in
recoverAccount
▸ recoverAccount(_params
):
PromiseWithProgress
<Account
>
Initiate account recovery
Parameters
Name | Type |
---|---|
_params |
RecoverAccountParams |
Returns
Inherited from
Defined in
removeTrustedDevice
▸ removeTrustedDevice(_id
):
PromiseWithProgress
<void
>
Parameters
Name | Type |
---|---|
_id |
string |
Returns
PromiseWithProgress
<void
>
Inherited from
Defined in
revokeSession
▸ revokeSession(_id
):
PromiseWithProgress
<void
>
Revoke a Session, effectively logging out any client authenticated with it
Parameters
Name | Type |
---|---|
_id |
string |
Returns
PromiseWithProgress
<void
>
Inherited from
Defined in
startAuthRequest
▸ startAuthRequest(_params
):
PromiseWithProgress
<StartAuthRequestResponse
>
Parameters
Name | Type |
---|---|
_params |
StartAuthRequestParams |
Returns
PromiseWithProgress
<StartAuthRequestResponse
>
Inherited from
Defined in
startCreateSession
▸ startCreateSession(_params
):
PromiseWithProgress
<StartCreateSessionResponse
>
Initiate the login procedure for a given account by requesting the authentication params which are required for proceeding with [[createSession]].
Parameters
Name | Type |
---|---|
_params |
StartCreateSessionParams |
Returns
PromiseWithProgress
<StartCreateSessionResponse
>
Inherited from
Defined in
startRegisterAuthenticator
▸ startRegisterAuthenticator(_params
):
PromiseWithProgress
<StartRegisterAuthenticatorResponse
>
Parameters
Name | Type |
---|---|
_params |
StartRegisterAuthenticatorParams |
Returns
PromiseWithProgress
<StartRegisterAuthenticatorResponse
>
Inherited from
API.startRegisterAuthenticator
Defined in
updateAccount
▸ updateAccount(_account
):
PromiseWithProgress
<Account
>
Update the Account associated with the current session.
authentication_required
Parameters
Name | Type |
---|---|
_account |
Account |
Returns
Inherited from
Defined in
updateAuth
▸ updateAuth(_params
):
PromiseWithProgress
<void
>
Update the authentication params stored on the server. This is usually used in case a users master password has changed.
Parameters
Name | Type |
---|---|
_params |
UpdateAuthParams |
Returns
PromiseWithProgress
<void
>
Inherited from
Defined in
updateOrg
▸ updateOrg(_org
):
PromiseWithProgress
<Org
>
Updates a given Org
authentication_required
Updating members, organization name or pubic/private keys requires the OrgRole.Owner role, while any other changes require the OrgRole.Admin role.
Parameters
Name | Type |
---|---|
_org |
Org |
Returns
Inherited from
Defined in
updateVault
▸ updateVault(_vault
):
PromiseWithProgress
<Vault
>
Update the given Vault
authentiation_required
If vault belongs to an organization, the authenticated account needs to be be assigned to the given vault either directly or through a Group and have explicit write access. Otherwise, only access to the accounts private vault is allowed.
Parameters
Name | Type |
---|---|
_vault |
Vault |