Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Properties

apikeys: APIKey[]

The identifiers of API keys associated with the account.

client: PteroClient
email: string

The email of the user.

firstname: string

The firstname of the user.

id: number

The internal ID of the account.

isAdmin: boolean

Whether the account has administrative permissions.

language: string

The language set for the user.

lastname: string

The lastname of the user.

tokens: string[]

The two-factor authentication tokens for the account.

username: string

The username of the user.

Accessors

  • get panelURL(): string

Methods

  • _patch(data: any): void
  • createKey(description: string, allowedIps?: string[]): Promise<APIKey>
  • Creates an API key associated with the account.

    Parameters

    • description: string

      The description (or memo) for the key.

    • allowedIps: string[] = []

      A list of IP addresses that can use this key.

    Returns Promise<APIKey>

    The new API key.

  • createSSHKey(name: string, publicKey: string): Promise<SSHKey>
  • Creates an SSH key associated with the account.

    Parameters

    • name: string

      The name of the key.

    • publicKey: string

      The public key to authorize.

    Returns Promise<SSHKey>

    The new SSH key.

  • deleteKey(id: string): Promise<void>
  • Deletes an API key from the account.

    Parameters

    • id: string

      The identifier of the key.

    Returns Promise<void>

  • disable2FA(password: string): Promise<void>
  • Disables 2FA on the account and removes existing authentication tokens.

    Parameters

    • password: string

      The account password.

    Returns Promise<void>

  • enable2FA(code: string): Promise<string[]>
  • Enables 2FA for the account.

    Parameters

    • code: string

      The 2FA code.

    Returns Promise<string[]>

    A list of 2FA codes.

  • fetchKeys(): Promise<APIKey[]>
  • fetchSSHKeys(): Promise<SSHKey[]>
  • get2FACode(): Promise<string>
  • removeSSHKey(fingerprint: string): Promise<void>
  • Removes an SSH key from the account.

    Parameters

    • fingerprint: string

      The fingerprint of the SSH key.

    Returns Promise<void>

  • toJSON(): object
  • toString(): string
  • updateEmail(email: string, password: string): Promise<Account>
  • Updates the email for the account.

    Parameters

    • email: string

      The new email.

    • password: string

      The password for the account.

    Returns Promise<Account>

    The updated account instance.

  • updatePassword(oldPass: string, newPass: string): Promise<Account>
  • Updates the password for the account. Note: the password is not stored in the account instance.

    Parameters

    • oldPass: string

      The account's current password.

    • newPass: string

      The new password for the account.

    Returns Promise<Account>

    The updated account instance (no change).

Generated using TypeDoc