Interface Users

Interface for user management functionality

interface Users {
    all: Map<number, User>;
    add(user: Partial<User>, options?: AddUserOptions): Promise<void>;
    get(uid: number): undefined | User;
    load(): Promise<void>;
    login(
        username: string,
        password: string,
    ): Promise<{ cred: { gid: number; uid: number } }>;
    password(oldPassword: string, newPassword: string): Promise<void>;
    remove(uid: number): Promise<void>;
    update(uid: number, updates: Partial<User>): Promise<void>;
}

Properties

all: Map<number, User>

Get all users

Methods

  • Login with credentials

    Parameters

    • username: string

      Username

    • password: string

      Password

    Returns Promise<{ cred: { gid: number; uid: number } }>

  • Change a user's password

    Parameters

    • oldPassword: string

      Current password

    • newPassword: string

      New password

    Returns Promise<void>