Padloc Logo Docs & Resources

Class: API

api.API

Transport-agnostic interface defining communication between Client and Server instances.

Hierarchy

Constructors

constructor

new API()

Properties

handlerDefinitions

handlerDefinitions: HandlerDefinition[]

Defined in

core/src/api.ts:428

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>

Defined in

core/src/api.ts:658


completeAuthRequest

completeAuthRequest(_params): PromiseWithProgress<CompleteAuthRequestResponse>

Parameters

Name Type
_params CompleteAuthRequestParams

Returns

PromiseWithProgress<CompleteAuthRequestResponse>

Defined in

core/src/api.ts:455


completeCreateSession

completeCreateSession(_params): PromiseWithProgress<Session>

Create new Session which can be used to authenticate future request

Parameters

Name Type
_params CompleteCreateSessionParams

Returns

PromiseWithProgress<Session>

Defined in

core/src/api.ts:481


completeRegisterAuthenticator

completeRegisterAuthenticator(_params): PromiseWithProgress<CompleteRegisterMFAuthenticatorResponse>

Parameters

Name Type
_params CompleteRegisterMFAuthenticatorParams

Returns

PromiseWithProgress<CompleteRegisterMFAuthenticatorResponse>

Defined in

core/src/api.ts:438


createAccount

createAccount(_params): PromiseWithProgress<Account>

Create a new Account

Parameters

Name Type
_params CreateAccountParams

Returns

PromiseWithProgress<Account>

Defined in

core/src/api.ts:497


createAttachment

createAttachment(_attachment): PromiseWithProgress<string>

Parameters

Name Type
_attachment Attachment

Returns

PromiseWithProgress<string>

Defined in

core/src/api.ts:663


createKeyStoreEntry

createKeyStoreEntry(_params): PromiseWithProgress<KeyStoreEntry>

Parameters

Name Type
_params CreateKeyStoreEntryParams

Returns

PromiseWithProgress<KeyStoreEntry>

Defined in

core/src/api.ts:688


createOrg

createOrg(_params): PromiseWithProgress<Org>

Create a new Org

authentication_required

Parameters

Name Type
_params Org

Returns

PromiseWithProgress<Org>

Defined in

core/src/api.ts:549


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

PromiseWithProgress<Vault>

Defined in

core/src/api.ts:591


deleteAccount

deleteAccount(): PromiseWithProgress<void>

Delete current account

Returns

PromiseWithProgress<void>

Defined in

core/src/api.ts:539


deleteAttachment

deleteAttachment(_attachment): PromiseWithProgress<void>

Parameters

Name Type
_attachment DeleteAttachmentParams

Returns

PromiseWithProgress<void>

Defined in

core/src/api.ts:673


deleteAuthenticator

deleteAuthenticator(_id): PromiseWithProgress<void>

Parameters

Name Type
_id string

Returns

PromiseWithProgress<void>

Defined in

core/src/api.ts:445


deleteKeyStoreEntry

deleteKeyStoreEntry(_params): Promise<void>

Parameters

Name Type
_params string

Returns

Promise<void>

Defined in

core/src/api.ts:698


deleteLegacyAccount

deleteLegacyAccount(): PromiseWithProgress<void>

Returns

PromiseWithProgress<void>

Defined in

core/src/api.ts:683


deleteOrg

deleteOrg(_id): PromiseWithProgress<void>

Parameters

Name Type
_id string

Returns

PromiseWithProgress<void>

Defined in

core/src/api.ts:579


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>

Defined in

core/src/api.ts:633


getAccount

getAccount(): PromiseWithProgress<Account>

Get the Account associated with the current session

authentication_required

Returns

PromiseWithProgress<Account>

Defined in

core/src/api.ts:507


getAttachment

getAttachment(_attachment): PromiseWithProgress<Attachment>

Parameters

Name Type
_attachment GetAttachmentParams

Returns

PromiseWithProgress<Attachment>

Defined in

core/src/api.ts:668


getAuthInfo

getAuthInfo(): Promise<AuthInfo>

Get the AuthInfo for the current account

Returns

Promise<AuthInfo>

Defined in

core/src/api.ts:513


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

PromiseWithProgress<Invite>

Defined in

core/src/api.ts:646


getKeyStoreEntry

getKeyStoreEntry(_params): Promise<KeyStoreEntry>

Parameters

Name Type
_params GetKeyStoreEntryParams

Returns

Promise<KeyStoreEntry>

Defined in

core/src/api.ts:693


getLegacyData

getLegacyData(_params): PromiseWithProgress<PBES2Container>

Parameters

Name Type
_params GetLegacyDataParams

Returns

PromiseWithProgress<PBES2Container>

Defined in

core/src/api.ts:678


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

PromiseWithProgress<Org>

Defined in

core/src/api.ts:561


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

PromiseWithProgress<Vault>

Defined in

core/src/api.ts:605


recoverAccount

recoverAccount(_params): PromiseWithProgress<Account>

Initiate account recovery

Parameters

Name Type
_params RecoverAccountParams

Returns

PromiseWithProgress<Account>

Defined in

core/src/api.ts:531


removeTrustedDevice

removeTrustedDevice(_id): PromiseWithProgress<void>

Parameters

Name Type
_id string

Returns

PromiseWithProgress<void>

Defined in

core/src/api.ts:708


revokeSession

revokeSession(_id): PromiseWithProgress<void>

Revoke a Session, effectively logging out any client authenticated with it

Parameters

Name Type
_id string

Returns

PromiseWithProgress<void>

Defined in

core/src/api.ts:489


startAuthRequest

startAuthRequest(_params): PromiseWithProgress<StartAuthRequestResponse>

Parameters

Name Type
_params StartAuthRequestParams

Returns

PromiseWithProgress<StartAuthRequestResponse>

Defined in

core/src/api.ts:450


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>

Defined in

core/src/api.ts:464


startRegisterAuthenticator

startRegisterAuthenticator(_params): PromiseWithProgress<StartRegisterAuthenticatorResponse>

Parameters

Name Type
_params StartRegisterAuthenticatorParams

Returns

PromiseWithProgress<StartRegisterAuthenticatorResponse>

Defined in

core/src/api.ts:431


updateAccount

updateAccount(_account): PromiseWithProgress<Account>

Update the Account associated with the current session.

authentication_required

Parameters

Name Type
_account Account

Returns

PromiseWithProgress<Account>

Defined in

core/src/api.ts:523


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>

Defined in

core/src/api.ts:473


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

PromiseWithProgress<Org>

Defined in

core/src/api.ts:574


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

Returns

PromiseWithProgress<Vault>

Defined in

core/src/api.ts:620