Interface UserRepositoryInterface<RoleType, UserType, CredentialsType>

Interface for a User Repository.

interface UserRepositoryInterface<
    RoleType extends string,
    UserType extends BaseUser<RoleType>,
    CredentialsType,
> {
    findByEmail: (mail: UserType["email"]) => Promise<UserType>;
    findById: (id: UserType["id"]) => Promise<UserType>;
    resolveCredentialsFor: (user: UserType) => Promise<CredentialsType>;
}

Type Parameters

Properties

findByEmail: (mail: UserType["email"]) => Promise<UserType>

Finds a user by the provided email.

findById: (id: UserType["id"]) => Promise<UserType>

Finds a by the provided id.

resolveCredentialsFor: (user: UserType) => Promise<CredentialsType>

Resolves the credentials for the given user.