Constructors

  • Creates a new Key instance.

    Parameters

    • name: string

      The name of the key.

    • OptionalisAdmin: boolean

      Whether the key has admin privileges.

    • OptionalhasAccessToAllServers: boolean

      Whether the key has access to all servers.

    Returns Key

Properties

customServerPermissions?: Record<string, Record<ServerPermissions, boolean>>
hasAccessToAllServers?: boolean
isAdmin?: boolean
name: string

Methods

  • Adds custom server permissions for a specific server.

    Parameters

    • serverId: string

      The ID of the server.

    • permissions: Record<ServerPermissions, boolean>

      The permissions to set for the server.

    Returns Key

    The current Key instance for method chaining.

  • Removes custom server permissions for a specific server.

    Parameters

    • serverId: string

      The ID of the server.

    Returns Key

    The current Key instance for method chaining.

  • Sets whether the key has access to all servers.

    Parameters

    • hasAccessToAllServers: boolean

      Whether the key has access to all servers.

    Returns Key

    The current Key instance for method chaining.

  • Sets whether the key has admin privileges.

    Parameters

    • isAdmin: boolean

      Whether the key has admin privileges.

    Returns Key

    The current Key instance for method chaining.

  • Sets the name of the key.

    Parameters

    • name: string

      The new name for the key.

    Returns Key

    The current Key instance for method chaining.

  • Converts the Key instance to a JSON object.

    Returns Record<string, any>

    The JSON representation of the Key instance.